/* Rafters Pace — app styles. Everything is scoped under .rp-app and uses the site's tokens (css/styles.css). */
.rp-app { padding-bottom: 48px; }
.rp-app:focus { outline: none; }
.rp-app .page-head { padding-bottom: 0; }
.rp-app .rp-asof { margin: 14px 0 0; font-size: .9375rem; color: var(--muted); }
.rp-app h2, .rp-app h3 { text-wrap: balance; }

/* sub-navigation of the app */
.rp-tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 22px 0 0; padding: 0 0 6px; border-bottom: 1px solid var(--rule); }
.rp-tabs a { display: inline-block; padding: 6px 0; font-weight: 600; text-decoration: none; color: var(--ink); }
.rp-tabs a:hover { color: var(--orange-text); }
.rp-tabs a[aria-current] { box-shadow: inset 0 -3px 0 var(--orange); }

/* player search */
.rp-search { position: relative; max-width: 30rem; margin: 22px 0 6px; }
.rp-search__box { position: relative; }
.rp-search label { display: block; margin-bottom: 4px; font-weight: 600; font-size: .9375rem; }
.rp-search input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--wash); border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; -webkit-appearance: none; appearance: none;
}
.rp-search input:disabled { opacity: .6; }
.rp-search__help { margin: 4px 0 0; font-size: .8125rem; color: var(--muted); }
.rp-search__list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin: 0; padding: 0; list-style: none;
  max-height: 22rem; overflow: auto; background: var(--ground); border: 2px solid var(--ink);
}
.rp-search__list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--rule); cursor: pointer; }
.rp-search__list li:first-child { border-top: 0; }
.rp-search__list li[aria-selected="true"], .rp-search__list li[role="option"]:hover { background: var(--wash); box-shadow: inset 4px 0 0 var(--orange); }
.rp-search__name { font-weight: 600; }
.rp-search__meta { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.rp-search__empty { padding: 10px 12px; color: var(--muted); }

/* states */
.rp-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; padding: 12px 14px; background: var(--wash); }
.rp-state--error { border-left: 4px solid var(--orange-text); }
.rp-spinner { width: 16px; height: 16px; border: 2px solid var(--rule); border-top-color: var(--orange); border-radius: 50%; animation: rp-spin .8s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rp-spinner { animation: none; } }
.rp-btn {
  padding: 7px 14px; font: inherit; font-size: .9375rem; font-weight: 600; color: var(--ground); background: var(--ink);
  border: 0; border-radius: 0; cursor: pointer;
}
.rp-btn:hover { background: var(--orange-text); }

/* cards */
.rp-card { margin: 30px 0 0; padding-top: 14px; border-top: var(--heavy) solid var(--ink); }
.rp-card__head { margin-bottom: 12px; }
.rp-card__title, .rp-view-title {
  margin: 0; font-family: var(--font-display); font-weight: 900; text-transform: uppercase; line-height: .95;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.rp-view-title { margin-top: 28px; }
.rp-card__sub { margin: 8px 0 0; max-width: 70ch; font-size: .9375rem; line-height: 1.5; color: var(--muted); }
.rp-note { margin: 10px 0 0; max-width: 72ch; font-size: .875rem; line-height: 1.5; color: var(--muted); }
.rp-count { margin: 0; font-weight: 600; }

/* controls */
.rp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 6px 0 14px; }
.rp-field { display: flex; align-items: center; gap: 8px; }
.rp-field label { font-weight: 600; font-size: .9375rem; }
.rp-field--check label { font-weight: 500; }
.rp-field--check input { width: 18px; height: 18px; accent-color: var(--orange-text); }
.rp-select { padding: 6px 8px; font: inherit; font-size: .9375rem; color: var(--ink); background: var(--wash); border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; max-width: 100%; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.rp-chip {
  min-width: 44px; padding: 6px 12px; font: inherit; font-size: .875rem; font-weight: 600; color: var(--ink);
  background: var(--ground); border: 2px solid var(--ink); border-radius: 0; cursor: pointer;
}
.rp-chip:hover { border-color: var(--orange-text); color: var(--orange-text); }
.rp-chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.rp-chip[aria-pressed="true"]::before { content: "✓ "; }

/* tables */
.rp-scroll { position: relative; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.rp-scroll:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: .9063rem; line-height: 1.35; font-variant-numeric: tabular-nums lining-nums; }
.rp-table th, .rp-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; white-space: nowrap; }
.rp-table thead th { font-size: .8125rem; font-weight: 600; vertical-align: bottom; border-bottom: 2px solid var(--ink); }
.rp-table tbody th { font-weight: 500; }
.rp-table .num { text-align: right; }
.rp-table .rp-strong, .rp-strong { font-weight: 700; }
.rp-sticky { position: sticky; left: 0; z-index: 1; background: var(--ground); }
.rp-table thead .rp-sticky { z-index: 2; }
.rp-row--subject > * { background: #FFF1E8; }
.rp-row--subject .rp-sticky { background: #FFF1E8; box-shadow: inset 4px 0 0 var(--orange); }
.rp-row--avg > * { background: var(--wash); font-weight: 600; }
.rp-row--avg .rp-sticky { background: var(--wash); }
.rp-rank { display: inline-block; min-width: 1.8em; color: var(--muted); }
.rp-seasons { color: var(--muted); font-size: .8125rem; white-space: normal; min-width: 9rem; }
.rp-flag { display: block; color: var(--orange-text); font-weight: 600; }
.rp-sortbtn { padding: 0; font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
th[aria-sort] .rp-sortbtn::after { content: " ▼"; }
th[aria-sort="ascending"] .rp-sortbtn::after { content: " ▲"; }
.rp-mark { font-size: .75rem; }
.rp-mark--up { color: #1F6B3A; }
.rp-mark--down { color: var(--orange-text); }
.rp-name { font-weight: 600; text-decoration-color: var(--orange); }

/* verdicts (text + icon, never colour alone) */
.rp-verdict { display: inline-flex; gap: 6px; align-items: baseline; font-weight: 600; }
.rp-verdict__icon { font-size: .75em; }
.rp-verdict--ahead, .rp-verdict--on { color: #1F6B3A; }
.rp-verdict--near { color: var(--navy); }
.rp-verdict--behind { color: var(--muted); }

/* comparison header */
.rp-hero__name { margin: 0; font-family: var(--font-display); font-weight: 900; text-transform: uppercase; line-height: .9; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.rp-hero__name:focus { outline: none; }
.rp-hero__meta { margin: 8px 0 0; color: var(--muted); }
.rp-hero__links { margin: 6px 0 12px; }
.rp-score { margin: 16px 0 0; }
.rp-score__year { margin: 0; font-weight: 600; color: var(--navy); }
.rp-score__num { margin: 2px 0 4px; display: flex; align-items: baseline; gap: 10px; }
.rp-score__value { font-family: var(--font-display); font-weight: 900; font-size: clamp(3.5rem, 9vw, 5.5rem); line-height: .9; color: var(--orange-text); }
.rp-score__label { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .8125rem; }
.rp-facts { margin: 12px 0 0; padding-left: 1.1em; }
.rp-facts li { margin: 2px 0; }
.rp-poslist { margin: 0; padding-left: 1.1em; }
.rp-poslist li { margin: 4px 0; }

/* rank badges */
.rp-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.rp-badge { padding: 8px 10px; background: var(--wash); }
.rp-badge__label { display: block; font-size: .8125rem; color: var(--muted); }
.rp-badge__value { font-weight: 700; }

/* charts */
.rp-chart-wrap { margin: 8px 0; }
.rp-chart { display: block; width: 100%; height: auto; max-width: 860px; }
.rp-chart__grid { stroke: var(--rule); stroke-width: 1; }
.rp-chart__tick { font-size: 12px; fill: var(--muted); font-family: var(--font-text); }
.rp-chart__axis { font-size: 13px; fill: var(--ink); font-family: var(--font-text); font-weight: 600; }
.rp-chart__marker { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; }
.rp-bar { fill: var(--navy); }
.rp-bar--partial { fill: var(--orange); }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; }
.rp-legend__item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; font: inherit; font-size: .8125rem; color: var(--ink); background: none; border: 1px solid var(--rule); cursor: pointer; }
.rp-legend__item[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
.rp-legend__item--subject { border: 0; cursor: default; font-weight: 600; }
.rp-swatch { display: inline-block; width: 14px; height: 4px; }
.rp-legend__item--subject .rp-swatch { height: 6px; }

/* static summary + how it works */
.rp-static h2, .rp-how h2 {
  margin: 34px 0 10px; font-family: var(--font-display); font-weight: 900; text-transform: uppercase; line-height: .95;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.rp-legends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 28px; }
.rp-legends-grid h3 { margin: 10px 0 6px; font-size: 1.0625rem; }
.rp-legends-grid ol { margin: 0; padding-left: 1.6em; font-size: .9375rem; }
.rp-how { margin-top: 40px; padding-top: 14px; border-top: var(--heavy) solid var(--ink); }
.rp-how > * { max-width: var(--measure); }
.rp-how h2 { margin-top: 0; }
.rp-how h3 { margin: 22px 0 6px; font-size: 1.125rem; }
.rp-how p, .rp-how li { line-height: 1.6; }
.rp-how ul { padding-left: 1.2em; }
.rp-credit { margin: 28px 0 0; font-size: .875rem; color: var(--muted); }

@media (max-width: 480px) {
  .rp-table th, .rp-table td { padding: 5px 6px; }
  .rp-search__meta { display: none; }
}
