:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #5d6878;
  --line: #d7dde8;
  --paper: #fffdf8;
  --surface: #f5f8fb;
  --green: #1d6f5f;
  --blue: #2357a6;
  --gold: #d4932f;
  --red: #c74438;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.site-header {
  min-height: 240px;
  display: flex;
  align-items: center;
  background: #173d37;
  color: white;
}

.compact-header {
  min-height: 210px;
}

.header-copy {
  padding: clamp(28px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 18px;
}

.site-nav a {
  color: white;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--gold);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f0b34e;
  outline-offset: 3px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 3.4rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.generated-at {
  margin: 0;
  color: #d8efe9;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.next-session {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--line);
}

.member-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 20px;
  align-items: center;
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--line);
}

.member-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.primary-action {
  min-width: 172px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  text-decoration: none;
  font-weight: 700;
  text-align: center;
}

.primary-action[aria-disabled="true"] {
  pointer-events: none;
  background: #8792a1;
}

.muted {
  color: var(--muted);
}

.text-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 32px 0 16px;
}

.data-health {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: #fff7e9;
  color: #6f4513;
  font-weight: 700;
}

.data-health span {
  display: block;
}

.data-health span + span {
  margin-top: 6px;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 16px;
}

.session-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.session-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.session-card.is-next {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.session-date-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.session-date-item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-weight: 700;
}

.reservation-details {
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.session-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.session-date {
  font-weight: 800;
  font-size: 1.05rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e7f4ef;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
}

.status.cancelled {
  background: #fdecea;
  color: var(--red);
}

.counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.count {
  background: var(--surface);
  border-radius: 6px;
  padding: 8px;
  min-height: 64px;
}

.count strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.1;
}

.count span {
  color: var(--muted);
  font-size: 0.78rem;
}

.key-pickup-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid #8792a1;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.86rem;
}

.key-pickup-status span {
  color: var(--muted);
}

.key-pickup-status strong {
  text-align: right;
}

.key-pickup-confirmed {
  border-left-color: var(--green);
  background: #e7f4ef;
  color: var(--green);
}

.key-pickup-pending {
  border-left-color: var(--gold);
  background: #fff7e9;
  color: #6f4513;
}

.key-pickup-unassigned {
  border-left-color: var(--red);
  background: #fdecea;
  color: var(--red);
}

.response-state,
.session-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.session-note {
  border-left: 3px solid var(--gold);
  background: #fff7e9;
}

.session-form-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.map-section {
  margin-top: 36px;
  padding-top: 8px;
}

.map-frame {
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.practice-photo-section {
  padding: 28px 0 8px;
}

.practice-figure {
  margin: 0;
}

.practice-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.practice-caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.policy-section {
  margin-top: 40px;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}

.policy-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.policy-content ul {
  margin: 0;
  padding-left: 20px;
}

.workflow-section {
  padding: 28px 0 8px;
  border-bottom: 1px solid var(--line);
}

.flow-diagram {
  list-style: none;
  margin: 0;
  padding: 0 0 0 28px;
  display: grid;
  gap: 14px;
  max-width: 920px;
  position: relative;
}

.flow-diagram::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 6px;
  width: 2px;
  background: var(--line);
}

.flow-step {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  grid-template-areas:
    "time title"
    "time body";
  gap: 8px 18px;
}

.flow-step::after {
  content: "";
  position: absolute;
  top: 24px;
  left: -28px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--gold);
}

.flow-step:last-child::after {
  display: block;
}

.step-time {
  grid-area: time;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e7f4ef;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.flow-step h3 {
  grid-area: title;
  margin: 0;
  font-size: 1rem;
}

.flow-step p {
  grid-area: body;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.join-option h3 {
  margin: 0;
  font-size: 1rem;
}

.join-option p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.operation-details {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.operation-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.operation-note h3 {
  margin: 0;
  font-size: 1rem;
}

.operation-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.note-band {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  background: #fff7e9;
  border-radius: 6px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.officer-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.officer-table th,
.officer-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.officer-table th {
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
}

.officer-table tr:last-child td {
  border-bottom: 0;
}

.officer-table td {
  color: var(--muted);
}

.trend-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(420px, 0.75fr);
  gap: 28px;
  align-items: end;
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--line);
}

.trend-intro > div > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.trend-summary div {
  min-height: 88px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
}

.trend-summary dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.trend-summary dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
}

.trend-panel {
  margin-top: 32px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

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

.trend-panel-heading p {
  margin-bottom: 0;
}

.attendance-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  min-width: 100px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attendance-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.attendance-legend-line {
  display: inline-block;
  width: 28px;
  height: 4px;
  border-radius: 999px;
}

.attendance-figure {
  margin: 18px 0 0;
}

.attendance-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 470px;
  overflow: hidden;
}

.attendance-chart-wrap canvas {
  display: block;
  max-width: 100%;
  touch-action: pan-y;
}

.attendance-tooltip {
  position: absolute;
  z-index: 2;
  width: 216px;
  padding: 10px 12px;
  transform: translate(-50%, -100%);
  border: 1px solid #c8d1dd;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 8px 24px rgba(24, 33, 47, 0.16);
  color: var(--ink);
  font-size: 0.8rem;
  pointer-events: none;
}

.attendance-tooltip strong,
.attendance-tooltip span {
  display: block;
}

.attendance-tooltip span {
  margin-top: 3px;
  color: var(--muted);
}

.attendance-figure figcaption {
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.attendance-empty {
  margin: 18px 0 0;
  padding: 24px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.attendance-records {
  margin-top: 30px;
}

.download-action {
  min-width: 210px;
}

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

.attendance-table th,
.attendance-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.attendance-table thead th {
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
}

.attendance-table th:first-child,
.attendance-table td:first-child {
  text-align: left;
}

.attendance-table tbody th {
  color: var(--muted);
  font-weight: 600;
}

.attendance-table tr:last-child th,
.attendance-table tr:last-child td {
  border-bottom: 0;
}

.join-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.join-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.join-request-section {
  padding: 28px 0 8px;
}

.join-request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 20px;
  align-items: start;
}

.request-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.request-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.request-form input,
.request-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  background: white;
}

.request-form textarea {
  resize: vertical;
}

.checkbox-label {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  color: var(--muted);
  font-weight: 500;
}

.checkbox-label input {
  width: auto;
  margin-top: 4px;
}

.website-field,
.hidden-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--green);
  font-weight: 700;
}

.join-request-notes {
  border-left: 4px solid var(--green);
  background: #edf7f3;
  border-radius: 6px;
  padding: 16px;
}

.join-request-notes h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.join-request-notes p {
  margin-bottom: 10px;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--line);
  padding: 20px 16px 30px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .next-session,
  .member-stats,
  .trend-intro,
  .policy-content,
  .join-grid,
  .operation-details,
  .join-request-layout {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .heading-actions {
    justify-content: flex-start;
  }

  .primary-action {
    width: 100%;
  }

  .counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-diagram {
    padding-left: 22px;
  }

  .flow-diagram::before {
    left: 5px;
  }

  .flow-step {
    grid-template-columns: 1fr;
    grid-template-areas:
      "time"
      "title"
      "body";
    gap: 8px;
  }

  .flow-step::after {
    left: -23px;
  }

  .member-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-counts .count:first-child {
    grid-column: 1 / -1;
  }

  .map-frame {
    aspect-ratio: 1 / 1;
    min-height: 280px;
  }

  .trend-summary {
    grid-template-columns: 1fr;
  }

  .trend-summary div {
    min-height: 0;
  }

  .trend-panel {
    padding: 16px 10px 12px;
  }

  .trend-panel-heading {
    flex-direction: column;
    gap: 12px;
  }

  .attendance-legend {
    justify-content: flex-start;
  }

  .attendance-chart-wrap {
    min-height: 390px;
  }

  .attendance-table {
    min-width: 620px;
  }
}
