:root {
  color-scheme: light;
  --paper: #f5f4f1;
  --card: #fff;
  --ink: #232625;
  --muted: #555b57;
  --line: #dcddd7;
  --shadow: 0 1px 2px rgba(35, 38, 37, .035);
  --dark: #343d38;
  --danger: #8a3329;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

input, select { font: inherit; }

:focus-visible {
  outline: 3px solid #626e65;
  outline-offset: 3px;
}

.container {
  width: min(100% - 3rem, 68rem);
  margin-inline: auto;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.masthead {
  display: flex;
  align-items: center;
  min-height: 5.125rem;
  gap: 1rem;
}

.brand {
  position: relative;
  flex: 0 0 auto;
  width: 11.75rem;
  height: 2.75rem;
  overflow: hidden;
}

.brand img {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
}

.program-name {
  padding-inline-start: 1rem;
  border-inline-start: 1px solid var(--line);
  color: var(--dark);
  font-weight: 650;
  line-height: 1.25;
}

main.container { padding-bottom: 3.5rem; }
.intro { padding-block: clamp(2.25rem, 6vw, 4.125rem) 1.85rem; }

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.065em;
  font-weight: 720;
  text-wrap: balance;
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: .75rem;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: -.028em;
}

.surface {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .875rem;
  box-shadow: var(--shadow);
}

.message { padding: 1rem 1.25rem; }

.access {
  max-width: 49rem;
  padding: clamp(1.3rem, 6vw, 2.25rem);
}

.access h2 { margin-block: .1rem .55rem; }
.access p { color: var(--muted); }

label {
  display: block;
  margin-bottom: .35rem;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 620;
}

input:not([type="radio"]), select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  border: 1px solid #bfc3bb;
  border-radius: .5rem;
  padding: .55rem .75rem;
  background: var(--card);
  color: var(--ink);
}

input::placeholder { color: #656b66; }

.overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 0 0 1.45rem;
}

.metric {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: .25rem;
  padding: .95rem 1.2rem;
}

.metric dd {
  margin: 0;
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  font-weight: 680;
  line-height: 1.1;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}

.metric dt {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 610;
}

.connection { margin-bottom: 1rem; }

.roster-header { padding: 1.35rem 1.3rem .85rem; }

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 12rem);
  gap: .65rem;
  margin-top: 1rem;
}

.search-field, .select-field { position: relative; }
.search-field input { padding-inline-start: 2.35rem; }

.search-field::before, .search-field::after, .select-field::after {
  position: absolute;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.search-field::before {
  left: .85rem;
  top: .82rem;
  width: .8rem;
  height: .8rem;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

.search-field::after {
  left: 1.5rem;
  top: 1.48rem;
  width: .36rem;
  height: 1.5px;
  transform: rotate(45deg);
  transform-origin: left;
  background: var(--muted);
}

.select-field select {
  appearance: none;
  padding-inline-end: 2rem;
}

.select-field::after {
  right: .92rem;
  top: 1.05rem;
  width: .55rem;
  height: .55rem;
  transform: rotate(45deg);
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
}

.result-count {
  color: var(--muted);
  margin-top: .75rem;
  font-size: .875rem;
}

.notice {
  color: var(--muted);
  font-size: .9rem;
}

.notice:not(:empty) {
  margin-top: .65rem;
  padding: .6rem .75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .45rem;
}

.notice.is-error { color: var(--danger); }

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  border-block: 1px solid var(--line);
  color: var(--muted);
  background: #f7f7f5;
}

th, td { padding: .6rem 1.3rem; }
thead th { font-size: .875rem; font-weight: 650; }
tbody th { font-weight: 600; overflow-wrap: anywhere; }
tbody tr + tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: #fbfbfa; }
.choice-cell {
  width: 9rem;
  padding-inline: .7rem;
  text-align: center;
  white-space: nowrap;
}

td.choice-cell { padding-block: .35rem; }

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  margin: 0;
  padding: .35rem .5rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  cursor: pointer;
  touch-action: manipulation;
}

.choice input[type="radio"] {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--dark);
  cursor: inherit;
}

.choice:hover { background: #f4f4f1; }
.choice:has(input:checked) { background: #efeee9; border-color: #d6d5cd; }
.choice-cell:nth-child(2) .choice:has(input:checked) { background: #ecf1eb; border-color: #cbd5cb; }
.choice:has(input[aria-disabled="true"]) { cursor: progress; opacity: .65; }
.choice:has(input:focus-visible) { outline: 3px solid #626e65; outline-offset: 2px; }
.choice:has(input:focus-visible) input:focus-visible { outline: none; }
.choice-caption { display: none; }
.empty { padding: 1.6rem 1.3rem; color: var(--muted); }

@media (max-width: 42rem) {
  .container { width: calc(100% - 2rem); }
  .masthead { min-height: 4.25rem; gap: .75rem; }
  .brand { width: 10.5rem; height: 2.35rem; }
  .program-name { padding-inline-start: .75rem; font-size: .9rem; }
  .overview { gap: .45rem; }
  .metric { padding: .72rem .58rem; }
  .roster-header { padding-inline: .85rem; }
  th, td { padding-inline: .65rem; }
}

@media (max-width: 31rem) {
  .controls { grid-template-columns: minmax(0, 1fr); }
  .roster table, .roster tbody { display: block; }

  .roster thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .roster tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    padding: .55rem .85rem;
    column-gap: .5rem;
    border-top: 1px solid var(--line);
  }

  .roster tbody th { grid-column: 1 / -1; }
  .roster tbody th { padding: .15rem 0 .35rem; }
  td.choice-cell { width: auto; padding: .15rem 0; }
  .choice { border-color: var(--line); }
  .choice-caption { display: inline; }
}
