:root {
  color-scheme: light;
  --ink: #18312b;
  --muted: #52645e;
  --green: #176b49;
  --line: #d6e1da;
  --paper: #fff;
  --wash: #f3f7f4;
  --magenta: #a91367;
  --teal: #086a67;
  --orange: #934506;
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html { scroll-padding-top: 70px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
main { max-width: 1120px; margin: 0 auto; padding: 28px 32px 64px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.2; font-weight: 720; margin-top: 5px; }
h2 { font-size: 24px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.4; margin-bottom: 14px; }
a { color: var(--green); text-underline-offset: 4px; }
button, select, input { font: inherit; }
button, select { min-height: 44px; border: 1px solid #a6bbb0; border-radius: 5px; color: var(--ink); background: white; }
button { padding: 8px 14px; cursor: pointer; }
button:hover { background: var(--wash); }
button:disabled { cursor: default; color: #65746c; opacity: .6; }
select { width: 100%; padding: 7px 28px 7px 10px; }
:focus-visible { outline: 3px solid #c24581; outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { display: block; padding: 12px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 22px; }
.eyebrow, .muted, .section-heading p, .count { color: var(--muted); font-size: 14px; }
.eyebrow { overflow-wrap: anywhere; }
.clips-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14px; white-space: nowrap; }
.provenance { border-left: 4px solid var(--orange); padding: 10px 14px; background: #fff5e8; font-size: 14px; color: #653805; margin-bottom: 14px; }
.section-nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 30px; background: white; border-bottom: 1px solid var(--line); }
.section-nav a { min-height: 50px; display: grid; align-items: center; font-weight: 650; text-decoration: none; border-bottom: 3px solid transparent; }
.section-nav a:hover, .section-nav a:focus-visible { border-bottom-color: var(--green); }
#filters { padding: 20px 0 10px; }
#filter-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 0; border: 0; margin: 0; }
#filter-fields label { font-size: 13px; font-weight: 600; display: grid; gap: 6px; min-width: 0; }
.text-button { background: transparent; border: none; color: var(--green); text-decoration: underline; text-underline-offset: 4px; padding: 8px 0; }
.status-line { display: flex; align-items: center; gap: 16px; margin: 8px 0; font-size: 14px; color: var(--muted); }
#status { flex: 1; }
#status[data-error="true"] { color: #a52735; }
section { padding: 28px 0 32px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 24px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 24px; }
.metric { min-width: 0; }
.metric dt { font-size: 14px; color: var(--muted); }
.metric dd { margin: 0; }
.metric .metric-value { font-size: 28px; font-weight: 680; line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric .metric-note { font-size: 13px; color: var(--muted); margin-top: 3px; }
.metric .unavailable { font-size: 20px; padding: 6px 0 5px; }
dl.metric { margin: 0; }
.availability { margin: 24px 0 10px; font-size: 14px; }
.availability summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--green); }
.availability ul { padding-left: 20px; margin: 4px 0 12px; columns: 2; column-gap: 30px; }
.availability li { break-inside: avoid; margin-bottom: 8px; }
.notice { background: var(--wash); padding: 14px; margin-top: 20px; }
.layers { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.layers label { min-height: 44px; display: flex; align-items: center; gap: 7px; font-size: 14px; }
.layers input { width: 19px; height: 19px; accent-color: var(--green); }
.legend { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 18px; gap: 8px 22px; font-size: 13px; }
.legend span { font-size: 18px; margin-right: 5px; }
.forehand { color: var(--magenta); }
.backhand { color: var(--teal); }
.serve { color: var(--orange); }
.unknown { color: #485658; }
.diagram-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr); gap: 36px; }
.court-figure { margin: 0; min-width: 0; }
#court-map { width: 100%; height: 470px; display: block; background: var(--wash); border-radius: 4px; }
.court-lines { stroke: white; stroke-width: .055; fill: none; }
.court-surface { fill: #267249; }
.court-lines .net { stroke: #162d24; stroke-width: .12; }
.shot-point { cursor: pointer; outline: none; --shot-color: #e4e8e7; }
.shot-point.forehand { --shot-color: #ff79be; }
.shot-point.backhand { --shot-color: #72e5de; }
.shot-point.serve { --shot-color: #ffbd68; }
.shot-mark { fill: var(--shot-color); stroke: #142c25; stroke-width: .05; }
.hit-mark { fill: none; stroke: var(--shot-color); stroke-width: .11; }
.direction-mark { stroke: var(--shot-color); stroke-width: .065; opacity: .65; }
.selection-ring { fill: none; stroke: white; stroke-width: .11; visibility: hidden; }
.shot-point[aria-pressed="true"] .selection-ring, .shot-point:focus .selection-ring { visibility: visible; }
.shot-point:focus .selection-ring { stroke: #fff200; }
#map-coverage { color: var(--muted); font-size: 13px; padding-top: 10px; }
#map-notice { margin-top: 6px; }
.shot-detail { border-top: 2px solid var(--green); padding-top: 16px; min-width: 0; }
#shot-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
#shot-details dt { color: var(--muted); }
#shot-details dd { margin: 0; overflow-wrap: anywhere; }
.ledger-link { display: inline-flex; gap: 12px; align-items: center; min-height: 44px; font-size: 14px; margin-top: 12px; }
#selected-rally { display: block; margin-top: 8px; }
.stroke-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 32px; }
.stroke-metrics .metric-value { font-size: 24px; }
.rally-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 16px; }
.rally-summary .metric-value { font-size: 24px; }
.rally-bins { display: grid; gap: 12px; }
.rally-bin { display: grid; grid-template-columns: 100px 1fr 60px; gap: 10px; align-items: center; font-size: 14px; }
.rally-bin meter { width: 100%; height: 18px; accent-color: var(--green); }
.rally-bin small { grid-column: 2 / -1; color: var(--muted); }
.ledger { margin-top: 32px; min-width: 0; }
.count { font-weight: 400; margin-left: 8px; }
.table-scroll { overflow-x: auto; max-width: 100%; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; }
th { background: var(--wash); font-weight: 600; color: var(--muted); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { min-width: 90px; }
td { white-space: nowrap; }
td button { min-width: 94px; text-align: left; }
tr[aria-selected="true"] { background: #eaf4ed; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-top: 12px; }
.pagination p { color: var(--muted); font-size: 13px; min-width: 108px; text-align: center; }
.pagination button { width: 44px; padding: 4px; font-size: 21px; }
#definition-note { margin-top: 28px; }
@media (max-width: 760px) {
  main { padding: 20px 20px 44px; }
  h1 { font-size: 27px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 6px; }
  #filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #filter-fields label:first-of-type { grid-column: 1 / -1; }
  .section-nav { justify-content: space-between; gap: 0; }
  .section-nav a { justify-content: center; flex: 1; }
  .section-heading { flex-direction: column; gap: 4px; margin-bottom: 20px; }
  .metrics, .stroke-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .metric .metric-value { font-size: 25px; }
  .metric .unavailable { font-size: 18px; }
  .availability ul { columns: 1; }
  .diagram-layout, .rally-summary { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  #court-map { height: 440px; }
  .layers { gap: 0 16px; }
  .legend { gap: 7px 16px; }
  .shot-detail { padding-top: 14px; }
  .rally-summary .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rally-summary .metric-value { font-size: 23px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
