/* Contextual tools stay inside existing rows. */
.competition-links-panel:not(:popover-open) { display: none; }
.show-all-leagues > :not(.all-leagues-view) { display: none !important; }
.schedule-dates { display: flex; align-items: center; gap: 6px; order: 1; flex: none; }
.compact-ui #schedule-date { flex: none; width: 137px; min-width: 0; min-height: 30px; padding: 4px 6px; font-size: 11px; border: 1px solid var(--accent); border-radius: 4px; background: var(--panel); color: var(--text); }
.compact-ui .ranking-toolbar { flex-wrap: wrap; gap: 8px; }
.compact-ui #ranking-sort, .compact-ui #ranking-minimum { flex: none; width: auto; min-height: 30px; padding: 4px 21px 4px 8px; border-radius: 4px; font-size: 10px; }
.csv-export { min-height: 30px; padding: 4px 5px; font-size: 10px; white-space: nowrap; }
.standings-toolbar .csv-export { margin-left: auto; }
#back-to-top { position: fixed; bottom: 20px; right: 18px; width: 37px; height: 37px; padding: 0; z-index: 4; border: 1px solid var(--stroke); border-radius: 6px; background: var(--panel-raised); color: var(--accent); font-size: 23px; box-shadow: 0 3px 16px #0003; }
.protocol-score strong { display: inline-block; margin-right: 8px; vertical-align: baseline; color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.protocol-score small { display: inline; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.protocol-table > span, .protocol-state > span { display: none; }
.match-browse { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.match-browse button { width: 28px; min-height: 28px; padding: 0; border: 1px solid var(--stroke); background: var(--panel-raised); color: var(--accent); border-radius: 4px; font-size: 21px; box-shadow: none; }
.match-browse span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .compact-ui .match-filter-bar:has(#schedule-date:not([hidden])) { flex-wrap: wrap; }
  .schedule-dates:has(#schedule-date:not([hidden])) { flex-basis: 100%; }
  .schedule-dates #schedule-date { flex: 1; }
  .compact-ui #ranking-sort, .compact-ui #ranking-minimum { width: calc(50% - 4px); font-size: 10px; }
  .compact-ui #ranking-count { flex-basis: 100%; }
  .compact-ui .ranking-toolbar .csv-export { margin-right: auto; }
  .compact-ui .standings-toolbar { gap: 7px; flex-wrap: wrap; }
  #back-to-top { bottom: 13px; right: 12px; width: 32px; height: 32px; }
  .match-summary-body .match-modal-games { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .match-summary-body #match-modal-games-table { width: 540px; min-width: 100%; table-layout: fixed; }
  .compact-ui #match-modal-games-table th, .compact-ui #match-modal-games-table td { width: auto; min-width: 0; max-width: none; padding: 6px 7px; font-size: 11px; white-space: nowrap; word-break: normal; }
  .compact-ui #match-modal-games-table th { font-size: 9px; }
  #match-modal-games-table :is(th, td):nth-child(1), #match-modal-games-table :is(th, td):nth-child(2), #match-modal-games-table :is(th, td):nth-child(6) { display: none; }
  .compact-ui #match-modal-games-table :is(th, td):nth-child(3), .compact-ui #match-modal-games-table :is(th, td):nth-child(4) { width: 80px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
  #match-modal-games-table .protocol-number, #match-modal-games-table .protocol-table, #match-modal-games-table .protocol-state { color: var(--muted); }
  .compact-ui #match-modal-games-table .protocol-score { white-space: nowrap; text-align: left; }
  #match-modal-games-table .protocol-score strong { margin-right: 6px; font-size: 14px; }
  #match-modal-games-table .protocol-score small { font-size: 10px; }
  #match-modal-games-table .player-line { display: inline; font-size: 11px; line-height: 1.5; white-space: nowrap; }
  #match-modal-games-table .player-line + .player-line::before { content: " / "; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 340px) {
  .compact-ui .brand-mark { display: none; }
  .compact-ui .topbar-inner { gap: 6px; }
}
