:root {
  --ink: #222428;
  --muted: #616870;
  --rule: #dedfe1;
  --red: #c72b3f;
  --safe-fill: #e7f2ee;
  --danger-fill: #fbefd2;
  --down-fill: #e9ecf0;
  --safe-line: #568579;
  --down-line: #69747f;
  --safe-ink: #306456;
  --danger-ink: #795715;
  --down-ink: #485460;
  --body: 'DM Sans', Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: white; font: 14px/1.45 var(--body); }
a, button { color: inherit; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .32; cursor: default; }
:focus-visible { outline: 2px solid #337bc0; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(1220px, 94%); margin-inline: auto; }
header { border-bottom: 1px solid var(--rule); }
.mast, .brand, .chart-head, .toggle, .focus-title, .arrows, .forms, .scorebox, .row { display: flex; align-items: center; }
.mast { min-height: 49px; gap: 32px; }
.brand { gap: 8px; font-size: 15px; font-weight: 700; letter-spacing: -.45px; text-decoration: none; }
.brand img { object-fit: contain; }

.season { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.stats { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px clamp(12px, 2vw, 30px); padding: 13px 0; border-bottom: 1px solid var(--rule); }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 21px; font-weight: 600; letter-spacing: -.6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat:first-child strong { color: var(--red); }
.stat small { font-size: 12px; color: var(--muted); font-weight: 400; }
.cohort-stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 6px; }
.cohort-stat small { line-height: 1.25; }
.forms { align-self: center; gap: 3px; }
.recent { border: 0; padding: 0; }
#form-tip {
  position: fixed; z-index: 5; pointer-events: none; width: max-content;
  max-width: calc(100vw - 12px); padding: 6px 9px; border-radius: 4px;
  background: var(--ink); color: white; font-size: 12px;
}
#form-tip small { display: block; color: #e1e2e4; font-size: 10px; }
.form { display: inline-grid; place-items: center; width: 17px; height: 18px; font-size: 10px; font-weight: 700; border-radius: 2px; }
.L { background: #f7e3e6; color: #942c3d; }
.W { background: #ddefe5; color: #287155; }
.D { background: #edeef0; color: #52585f; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 27%); align-items: start; gap: 24px; padding-top: 17px; }
.card { min-width: 0; }
.chart-head, .focus-title, .row { justify-content: space-between; gap: 8px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.6px; }
h1, h2 { font-size: 20px; }
h3 { font-size: 16px; }
.intro, .game-date, .chart-tip { color: var(--muted); font-size: 12px; }
.intro { margin: 2px 0 12px; }
.chart-summary { font-size: 15px; line-height: 1.4; margin: 6px 0 12px; text-wrap: pretty; }
.chart-summary strong { font-weight: 700; white-space: nowrap; }
.united-points { color: var(--red); }
.toggle { gap: 2px; }
.toggle button, .arrows button { background: transparent; border: 0; border-radius: 3px; }
.toggle button { display: flex; align-items: center; gap: 5px; padding: 5px 7px; font-size: 11px; color: var(--muted); }
.toggle button[aria-pressed=true], .toggle button:hover, .arrows button:hover { color: var(--ink); background: #f0f1f2; }
.toggle svg { display: block; width: 13px; height: 13px; }
.axis-title, .axis-x { font-size: 9px; color: var(--muted); letter-spacing: .6px; }
.axis-x { text-align: center; }
#plot { height: clamp(232px, 27vw, 308px); cursor: crosshair; touch-action: pan-y; }
#plot svg { display: block; width: 100%; height: 100%; }
.series-label { paint-order: stroke; stroke: white; stroke-width: 3px; stroke-linejoin: round; }
.chart-tip { margin: 7px 0 0; font-size: 11px; }
.focus { border-left: 1px solid var(--rule); padding-left: 18px; }
.focus h2 { font-size: 17px; }
.arrows button { width: 27px; height: 27px; font: 20px/1 Arial; }
.game-date { margin: 3px 0 6px; }
.scorebox { min-height: 45px; gap: 10px; justify-content: space-between; border-bottom: 1px solid var(--rule); padding-bottom: 7px; }
.club { padding: 3px 5px; border-radius: 3px; background: #f0f1f2; font-size: 11px; font-weight: 600; text-decoration: none; }
.score { font-size: 19px; font-weight: 700; white-space: nowrap; text-align: center; }
.score small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .5px; }
.match-standing { margin: 4px 0; }
.row { padding: 3px 0; color: var(--muted); font-size: 12px; }
.row b { color: var(--ink); font-weight: 600; }
.zone-badge { white-space: nowrap; color: var(--danger-ink); font-weight: 600; }
.zone-badge.safe { color: var(--safe-ink); }
.zone-badge.down { color: var(--down-ink); }
.insight, .focus details { font-size: 12px; }
.insight { border-top: 1px solid var(--rule); padding-top: 9px; }
.insight p { margin: 3px 0; color: #474d53; }
.cohort-note { font-size: 13px; margin: 9px 0 0; }
.focus details { margin-top: 7px; }
.focus summary { color: var(--muted); cursor: pointer; }
.focus ul { padding-left: 18px; max-height: 170px; overflow: auto; }
.secondary { padding-top: 17px; }
.method { max-width: 76ch; }
.method h3 { margin-top: 16px; }
.method p, .method dl { margin: 7px 0; color: #484e55; }
.method dt { font-weight: 600; color: var(--ink); }
.method dd { margin: 1px 0 7px; }
.method a { color: #8d3440; }
.tablewrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
td, th { padding: 6px 8px; border-bottom: 1px solid #e8e9ea; text-align: left; }
th { font-weight: 600; background: #f7f8f8; color: var(--muted); }
td button { border: 0; background: none; color: #9d2939; text-decoration: underline; padding: 3px; }
.result-cell { white-space: nowrap; }
.chartcard .tablewrap { max-height: 330px; }
.chartcard thead { position: sticky; top: 0; }
.chartcard tr.chosen { background: #fff1f2; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin: 14px 0; padding-top: 8px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 10px; }
.site-credit a { text-underline-offset: 2px; }
#freshness:before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #969ba1; }
#freshness.live:before { background: #429378; }
@media (max-width: 720px) {
  .dashboard { grid-template-columns: 1fr; gap: 14px; }
  .focus { border-left: 0; border-top: 1px solid var(--rule); padding: 10px 0 0; }
  .scorebox { justify-content: start; gap: 15px; }
  .stats { display: grid; grid-template-columns: auto auto auto auto minmax(0, 1fr); gap: clamp(5px, 2vw, 15px); align-items: start; }
  .stat { flex-direction: column; align-items: start; gap: 3px; }
  .stat-label { font-size: 11px; line-height: 1.15; }
  .forms { align-self: start; }
  .stat:last-child .stat-label { max-width: 10ch; }
  #plot { height: 235px; }
}
@media (max-width: 540px) {
  .mast { gap: 10px; min-height: 44px; }
  .brand { font-size: 14px; }

  .stats { padding: 9px 0; }
  .forms { gap: 2px; }
  .recent { width: 16px; height: 20px; }
  .stat strong { font-size: 18px; }
  .dashboard { padding-top: 12px; }
  h1 { font-size: 18px; }
}
