/* Tim Hortons dynasty - HTML prototype */
:root {
  --th-red: #c8102e;
  --th-red-dark: #9b0c24;
  --th-cream: #f5f0e8;
  --th-ink: #1a1a1a;
  --th-muted: #5c5c5c;
  --th-border: #ddd5c8;
  --th-card: #ffffff;
  --th-positive: #1b7f4a;
  --th-negative: #c8102e;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--th-red);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--th-red);
  color: white;
  padding: 0.75rem 1rem;
}

.header-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 0;
}

.site-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: white;
  cursor: pointer;
}

.site-nav-toggle:hover,
.site-nav-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.site-nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.2rem;
}

.site-nav-toggle-box span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav-toggle.is-open .site-nav-toggle-box span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-nav-toggle.is-open .site-nav-toggle-box span:nth-child(2) {
  opacity: 0;
}

.site-nav-toggle.is-open .site-nav-toggle-box span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 999;
}

.site-nav-backdrop.is-open {
  opacity: 1;
}

.site-nav-flyout {
  position: fixed;
  top: 0;
  left: 0;
  width: min(18rem, 88vw);
  height: 100vh;
  background: var(--th-card);
  color: var(--th-ink);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 1000;
  overflow-y: auto;
}

.site-nav-flyout.is-open {
  transform: translateX(0);
}

.site-nav-flyout-header {
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--th-border);
  background: var(--th-red);
  color: white;
}

.site-nav-flyout-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.site-nav.site-nav-flyout-nav {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0.85rem 0 1.25rem;
}

.site-nav-flyout-nav .nav-link {
  display: block;
  padding: 0.55rem 1.1rem;
  color: var(--th-ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.site-nav-flyout-nav .nav-link:hover,
.site-nav-flyout-nav .nav-link:focus-visible {
  background: #f3eee6;
  text-decoration: none;
}

.site-nav-flyout-nav .nav-link.active {
  background: #ede4d8;
  border-left-color: var(--th-red);
  color: var(--th-red-dark);
}

body.site-nav-open {
  overflow: hidden;
}

.nav-flyout-group {
  padding: 0.35rem 0;
}

.nav-flyout-group-label {
  padding: 0.65rem 1.1rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-muted);
}

.nav-flyout-group-collapsible .nav-flyout-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 1.1rem 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.nav-flyout-group-collapsible .nav-flyout-group-toggle:hover,
.nav-flyout-group-collapsible .nav-flyout-group-toggle:focus-visible {
  background: #f3eee6;
  outline: none;
}

.nav-flyout-group-collapsible .nav-flyout-group-label {
  padding: 0;
}

.nav-flyout-group-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--th-muted);
  border-bottom: 2px solid var(--th-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.nav-flyout-group-collapsible:not(.is-collapsed) .nav-flyout-group-chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.nav-flyout-group-collapsible.is-collapsed .nav-flyout-links {
  display: none;
}

.nav-flyout-links {
  display: flex;
  flex-direction: column;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.site-nav-scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.nav-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.nav-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  opacity: 0.75;
  margin-right: 0.15rem;
  white-space: nowrap;
}

.nav-link {
  color: white;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.35);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--th-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--th-red-dark);
  border-bottom: 2px solid var(--th-border);
  padding-bottom: 0.5rem;
}

.hero {
  text-align: center;
  padding: 2rem 1rem;
}

.hero p {
  color: var(--th-muted);
  max-width: 540px;
  margin: 0.5rem auto 1.5rem;
}

.btn-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  background: var(--th-red);
  color: white !important;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none !important;
}

.btn:hover {
  background: var(--th-red-dark);
}

.btn-secondary {
  background: var(--th-ink);
}

.field-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

label {
  font-weight: 600;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--th-border);
  border-radius: 6px;
  font-size: 1rem;
}

.player-picker-toolbar {
  display: block;
}

.picker-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.75rem 1rem;
  align-items: end;
}

.player-picker-toolbar.is-compare .picker-grid {
  grid-template-columns: minmax(14rem, 1fr) minmax(14rem, 1fr) auto;
}

.picker-grid > .picker-item:first-child {
  grid-column: 1;
  grid-row: 1;
}

.picker-grid > .picker-item:nth-child(4) {
  grid-column: 1;
  grid-row: 2;
}

.picker-grid > .picker-compare-field[for="compare-search"] {
  grid-column: 2;
  grid-row: 1;
}

.picker-grid > .picker-compare-field[for="compare-select"] {
  grid-column: 2;
  grid-row: 2;
}

.picker-grid > .picker-toggle {
  grid-column: 2;
  grid-row: 1;
}

.player-picker-toolbar.is-compare .picker-grid > .picker-toggle {
  grid-column: 3;
}

.picker-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.picker-compare-field[hidden] {
  display: none !important;
}

.picker-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--th-muted);
}

.player-search-wrap {
  position: relative;
}

.player-search-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 16rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  overflow-y: auto;
  background: #e4e4e4;
  border: 1px solid #bdbdbd;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.player-search-option {
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--th-ink);
  background: #e4e4e4;
  cursor: pointer;
}

.player-search-option:hover,
.player-search-option.is-active {
  background: #cfcfcf;
}

.picker-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  padding-bottom: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.picker-toggle input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--th-red);
  cursor: pointer;
}

.player-compare-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.player-compare-grid.is-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.player-compare-grid.is-compare > .player-card-panel[data-panel="primary"] {
  grid-column: 1;
}

.player-compare-grid.is-compare > .player-card-panel[data-panel="compare"] {
  grid-column: 2;
}

.player-card-panel {
  min-width: 0;
}

.player-card-panel .panel-empty {
  margin: 0;
}

.player-meta {
  margin-bottom: 0.75rem;
}

.player-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-areas:
    "player team position bash value"
    ". owner upside certainty .";
  column-gap: 2rem;
  row-gap: 0.65rem;
  align-items: start;
  width: 100%;
}

.meta-slot-player {
  grid-area: player;
}

.meta-slot-team {
  grid-area: team;
}

.meta-slot-owner {
  grid-area: owner;
}

.meta-slot-position {
  grid-area: position;
}

.meta-slot-upside {
  grid-area: upside;
}

.meta-slot-avg-bash {
  grid-area: bash;
}

.meta-slot-certainty {
  grid-area: certainty;
}

.meta-slot-team,
.meta-slot-owner,
.meta-slot-position,
.meta-slot-upside {
  text-align: center;
  align-items: center;
}

.meta-slot-avg-value {
  grid-area: value;
  grid-row: 1 / 3;
  align-items: center;
  text-align: center;
}

.meta-avg-value-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.meta-avg-value-stack strong,
.meta-avg-value-stack .player-avg-value,
.meta-avg-value-stack .player-avg-display,
.meta-avg-value-stack .meta-slot-prospect-link {
  text-align: center;
}

.meta-avg-value-stack .player-avg-display {
  justify-content: center;
  align-self: center;
}

.meta-avg-value-stack .meta-slot-prospect-link {
  margin-top: auto;
  padding-top: 0.65rem;
  width: 100%;
}

.meta-avg-value-stack .player-dobber-link a {
  white-space: normal;
}

.meta-slot-avg-bash,
.meta-slot-certainty {
  align-items: center;
  text-align: center;
}

.meta-avg-bash-stack,
.meta-certainty-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.meta-avg-bash-stack strong,
.meta-certainty-stack strong,
.meta-certainty-stack .player-nhl-certainty {
  text-align: center;
}

.meta-avg-bash-stack .player-avg-bash,
.meta-avg-bash-stack .player-avg-display {
  justify-content: center;
  align-self: center;
}

.player-dobber-link {
  text-align: right;
}

.player-dobber-link a {
  display: inline-block;
  font-size: 0.95rem;
  line-height: 1.2;
  color: #0432ff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.player-dobber-link a:hover,
.player-dobber-link a:focus-visible {
  text-decoration: underline;
}

.player-dobber-metric {
  min-width: 0;
}

.player-owner-metric {
  min-width: 0;
  text-align: center;
}

.player-nhl-certainty-metric {
  min-width: 0;
}

.meta-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-item-avg {
  text-align: right;
}

.meta-item-avg-bash strong {
  color: maroon;
}

.player-avg-display {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.player-avg-number {
  font-size: 1rem;
  font-weight: 400;
}

.player-avg-trend {
  font-size: 0.75rem;
  line-height: 1;
}

.player-avg-trend-up {
  color: var(--th-positive);
}

.player-avg-trend-down {
  color: var(--th-negative);
}

.meta-item-avg span:not(.player-avg-display) {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.meta-item-avg .player-avg-display {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
  padding: 0.15rem 0.45rem;
}

.meta-item strong {
  display: block;
  font-size: 0.8rem;
  color: var(--th-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-item span {
  font-size: 1rem;
  font-weight: 400;
}

.meta-item .player-name {
  font-size: 1.2rem;
  font-weight: 700;
}

body.page-player-card.is-compare-mode main {
  max-width: 1480px;
}

body.page-player-card .player-summary-table {
  table-layout: fixed;
}

body.page-player-card .player-summary-table th:first-child,
body.page-player-card .player-summary-table td:first-child {
  width: 38%;
  white-space: normal;
  line-height: 1.25;
  padding-right: 0.45rem;
}

body.page-player-card .player-summary-table thead th:not(:first-child) {
  width: calc(62% / 4);
}

body.page-player-card .player-summary-table td.contract-expired-year {
  color: var(--th-negative);
  font-weight: 700;
}

body.page-player-card .player-summary-table td.contract-expired-ltc {
  color: #000;
  font-weight: 700;
}

.player-compare-grid.is-compare .player-summary-table {
  font-size: 0.82rem;
}

.player-compare-grid.is-compare .player-summary-table th,
.player-compare-grid.is-compare .player-summary-table td {
  padding: 0.4rem 0.3rem;
}

.player-compare-grid.is-compare .player-summary-table th:first-child,
.player-compare-grid.is-compare .player-summary-table td:first-child {
  width: 34%;
  font-size: 0.74rem;
  line-height: 1.2;
}

.player-compare-grid.is-compare .player-summary-table thead th:not(:first-child) {
  width: calc(66% / 4);
  font-size: 0.72rem;
  letter-spacing: 0;
  white-space: nowrap;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.player-compare-grid.is-compare .player-meta-grid {
  column-gap: 0.65rem;
  row-gap: 0.4rem;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 0.75fr)) repeat(2, minmax(0, 0.95fr));
  grid-template-areas:
    "player team position bash value"
    ". owner upside certainty .";
}

.player-compare-grid.is-compare .meta-slot-upside strong,
.player-compare-grid.is-compare .meta-slot-certainty strong,
.player-compare-grid.is-compare .meta-slot-owner strong {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.player-compare-grid.is-compare .meta-item-avg .player-avg-display {
  gap: 0.2rem;
  padding: 0.1rem 0.15rem;
  max-width: 100%;
}

.player-compare-grid.is-compare .player-avg-number {
  font-size: 0.9rem;
}

.player-compare-grid.is-compare .meta-item-avg strong {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.player-compare-grid.is-compare .meta-avg-value-stack .meta-slot-prospect-link {
  padding-top: 0.4rem;
}

.player-compare-grid.is-compare .player-dobber-link a {
  white-space: normal;
  font-size: 0.85rem;
  max-width: 100%;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.data-table th,
table.data-table td {
  padding: 0.55rem 0.65rem;
  text-align: right;
  border-bottom: 1px solid var(--th-border);
}

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

table.data-table thead th {
  background: #faf7f2;
  color: var(--th-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

table.data-table thead th.stat-col-bash {
  color: maroon;
}

.val-pos {
  color: var(--th-positive);
}

.val-neg {
  color: var(--th-negative);
}

.diff-strong-pos {
  background-color: #b8dbab;
  color: #3a7d22;
  font-weight: 700;
}

.diff-mild-pos {
  color: #3a7d22;
  font-weight: 700;
}

.diff-mild-neg {
  color: #ff0000;
  font-weight: 700;
}

.diff-strong-neg {
  background-color: #fae2d5;
  color: #ff0000;
  font-weight: 700;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.stats-scroll {
  overflow-x: auto;
}

.status {
  padding: 1rem;
  color: var(--th-muted);
  text-align: center;
}

.error {
  color: var(--th-negative);
  background: #fff0f2;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--th-muted);
  font-size: 0.85rem;
}

/* Filterable season tables */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.row-count {
  color: var(--th-muted);
  font-size: 0.9rem;
}

.row-count-note {
  font-weight: 400;
}

.btn-clear-filters {
  background: none;
  border: 1px solid var(--th-border);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-clear-filters:hover {
  background: #faf7f2;
}

.table-scroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--th-border);
  border-radius: 8px;
}

/* Season skater/goalie sheets: fit ~15 visible body rows (labels + filter row + data). */
.table-scroll.season-sheet-view {
  --season-sheet-header: 5.25rem;
  --season-sheet-row: 2.375rem;
  max-height: calc(var(--season-sheet-header) + var(--season-sheet-row) * 15);
}

.filter-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
}

.filter-table .header-labels th:not([style*="background-color"]) {
  background: #faf7f2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 4;
}

.filter-table.salary-analysis {
  table-layout: fixed;
  width: 100%;
}

.table-scroll.has-section-nav .salary-section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.45rem 0.65rem 0.55rem;
  background: var(--th-card);
  position: sticky;
  top: 0;
  z-index: 5;
}

.table-scroll.has-section-nav .salary-section-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  align-items: center;
  flex: 1 1 auto;
}

.table-scroll.has-section-nav .salary-owner-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.table-scroll.has-section-nav .salary-owner-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--th-muted, #666);
}

.table-scroll.has-section-nav .salary-owner-select {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--th-border, #ccc);
  border-radius: 4px;
  background: var(--th-bg, #fff);
  color: inherit;
  max-width: 12rem;
}

.table-scroll.has-section-nav .salary-section-link {
  color: #0432ff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.table-scroll.has-section-nav .salary-section-link:hover,
.table-scroll.has-section-nav .salary-section-link:focus-visible {
  color: #0326c0;
  text-decoration: underline;
}

/* Keep nav + header as one sticky stack; avoid thead/th fighting at different tops */
.table-scroll.has-section-nav .filter-table.salary-analysis thead {
  position: static;
}

.table-scroll.has-section-nav .filter-table.salary-analysis .header-labels th {
  position: sticky;
  top: var(--salary-nav-offset, 2.35rem);
  z-index: 4;
}

.table-scroll.has-section-nav .filter-table.salary-analysis .header-labels th.sorted {
  color: #ffffff !important;
}

.filter-table.salary-analysis td.salary-section-anchor {
  scroll-margin-top: 5rem;
  text-align: center;
}

.filter-table.salary-analysis th,
.filter-table.salary-analysis td {
  padding: 0.45rem 0.4rem;
}

.filter-table.salary-analysis .header-labels th.col-bucket {
  min-width: 0;
  width: 18%;
}

.filter-table.salary-analysis .header-labels th {
  background-color: #7a7a7a !important;
  color: #ffffff !important;
}

.filter-table.salary-analysis .header-labels th.sorted {
  color: #ffffff !important;
}

.filter-table.salary-analysis th.col-range,
.filter-table.salary-analysis td.col-range {
  min-width: 0;
  width: 7.25rem;
  max-width: 7.25rem;
  white-space: nowrap;
  font-size: 0.85rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.filter-table.salary-analysis td.col-bucket {
  font-weight: 600;
}

.filter-table.salary-analysis td.num,
.filter-table.salary-analysis th.num {
  width: 4.5rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.filter-table.salary-analysis tbody td[style*="background-color"] {
  border-color: rgba(0, 0, 0, 0.06);
}

.filter-table.salary-analysis .salary-count-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #0432ff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.filter-table.salary-analysis .salary-count-link:hover,
.filter-table.salary-analysis .salary-count-link:focus-visible {
  color: #0326c0;
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  overflow-y: auto;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-dialog {
  width: min(100%, 42rem);
  background: var(--th-card, #fff);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--th-border, #ddd);
}

.modal-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.modal-close {
  appearance: none;
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0.15rem 0.35rem;
}

.modal-body {
  padding: 0.75rem 1.1rem 1.1rem;
  max-height: min(70vh, 32rem);
  overflow: auto;
}

.salary-players-table {
  width: 100%;
}

.salary-players-table th,
.salary-players-table td {
  padding: 0.45rem 0.5rem;
}

.salary-players-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.03);
}

.salary-players-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.salary-players-table th.sortable:hover,
.salary-players-table th.sortable:focus-visible {
  color: var(--th-red-dark);
}

.salary-players-table th.sortable.sorted {
  color: var(--th-red-dark);
}

.filter-table .header-labels th.sorted {
  color: var(--th-red-dark);
}

/* When Excel supplies dark header backgrounds, keep filter inputs readable */
.filter-table .header-labels th[style*="background"] {
  color: inherit;
}

.filter-table .header-filters th {
  background: white;
  padding: 0.35rem;
  top: 2.1rem;
  position: sticky;
  z-index: 4;
}

.filter-table .col-filter {
  width: 100%;
  min-width: 4rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.8rem;
  border: 1px solid var(--th-border);
  border-radius: 4px;
}

.filter-table select.col-filter-owner {
  min-width: 5.75rem;
  font-weight: 600;
}

.projection-value-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.projection-value-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--th-border);
  border-radius: 8px;
  background: #faf7f2;
}

.projection-value-card-primary {
  border-color: var(--th-red);
  background: #fff8f9;
}

.projection-value-summary-single .projection-value-card {
  grid-column: 2;
}

.projection-value-summary-actual-only {
  grid-template-columns: 1fr;
  max-width: 24rem;
}

.projection-value-summary-goalie {
  grid-template-columns: 1fr 1fr;
}

.projection-value-summary-goalie .projection-value-card {
  grid-column: 1;
}

.projection-value-label {
  display: block;
  font-size: 0.8rem;
  color: var(--th-muted);
  margin-bottom: 0.35rem;
}

.projection-value-num {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.projection-block {
  margin-bottom: 2rem;
}

.projection-block-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--th-red-dark);
  border-bottom: 2px solid var(--th-border);
  padding-bottom: 0.35rem;
}

.projection-block-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.75rem;
  border-bottom: 2px solid var(--th-border);
  padding-bottom: 0.35rem;
}

.projection-block-heading .projection-block-title {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.projection-return-player {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.9rem;
}

.projection-skater-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.75rem;
}

.projection-full-season {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--th-ink);
  cursor: pointer;
  user-select: none;
}

.projection-full-season input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--th-red);
}

.projection-hint {
  color: var(--th-muted);
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.projection-warn {
  color: var(--th-muted);
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.projection-table {
  table-layout: fixed;
  width: 100%;
  font-size: 0.82rem;
}

.projection-table th,
.projection-table td {
  padding: 0.35rem 0.2rem;
}

.projection-table thead th:first-child,
.projection-table tbody th {
  width: 4.25rem;
}

.projection-block .table-scroll {
  overflow-x: visible;
}

.projection-table tbody th {
  font-weight: 600;
  text-align: left;
}

.projection-table .cell-edit {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.2rem 0.15rem;
  border: 1px solid var(--th-border);
  border-radius: 4px;
  font-size: 0.78rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.projection-table .cell-edit::-webkit-outer-spin-button,
.projection-table .cell-edit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.projection-table .cell-edit:focus {
  outline: none;
  border-color: var(--th-red);
  box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.15);
}

.projection-table .projection-readonly {
  background: #f5f0e8;
  color: var(--th-muted);
  font-weight: 600;
}

.projection-table .projection-factor {
  color: var(--th-muted);
  font-style: italic;
}

.filter-table.has-zebra-rows tbody tr.row-alt > td:not(.diff-strong-pos):not(.diff-strong-neg) {
  background-color: #f3f3f3;
}

.filter-table.has-zebra-rows tbody tr.row-alt > td.diff-strong-pos {
  background-color: #b8dbab;
}

.filter-table.has-zebra-rows tbody tr.row-alt > td.diff-strong-neg {
  background-color: #fae2d5;
}

.filter-table.has-zebra-rows tbody tr:hover > td:not(.diff-strong-pos):not(.diff-strong-neg) {
  background-color: #ebe6de;
}

.filter-table.has-zebra-rows tbody tr:hover > td.diff-strong-pos {
  background-color: #a8d09b;
}

.filter-table.has-zebra-rows tbody tr:hover > td.diff-strong-neg {
  background-color: #f0d2c5;
}

.filter-table.has-zebra-rows td.col-contract {
  color: #000 !important;
}

.filter-table.has-zebra-rows .header-labels th.col-contract,
.filter-table.has-zebra-rows .header-filters th.col-contract {
  color: #fff !important;
}

.filter-table td.num {
  font-variant-numeric: tabular-nums;
}

.filter-table th.col-row-num,
.filter-table td.col-row-num {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  text-align: center !important;
  color: var(--th-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.filter-table.has-row-numbers td.col-row-num {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.filter-table.has-row-numbers .header-labels th.col-row-num {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #faf7f2;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.filter-table.has-row-numbers .header-filters th.col-row-num {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #ffffff;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.filter-table.has-row-numbers td.col-player {
  left: 2.75rem;
}

.filter-table.has-row-numbers .header-labels th.col-player {
  left: 2.75rem;
  z-index: 5;
}

.filter-table.has-row-numbers .header-filters th.col-player {
  left: 2.75rem;
  z-index: 5;
}

.filter-table th.col-range,
.filter-table td.col-range {
  min-width: 9.5rem;
  white-space: nowrap;
}

.filter-table th.col-section {
  min-width: 10rem;
  white-space: nowrap;
}

.filter-table th.col-player,
.filter-table td.col-player {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 12rem;
  white-space: nowrap;
  background: #ffffff;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.filter-table .header-labels th.col-player {
  z-index: 4;
  background: #faf7f2;
}

.filter-table .header-filters th.col-player {
  z-index: 4;
  background: #ffffff;
}

.filter-table th.col-team,
.filter-table td.col-team,
table.data-table th.col-team,
table.data-table td.col-team {
  width: 4.5rem;
  max-width: 5rem;
  white-space: nowrap;
}

.filter-table th.col-position,
.filter-table td.col-position {
  min-width: 4.75rem;
  white-space: nowrap;
  text-align: right !important;
}

.filter-table th.col-owner,
.filter-table td.col-owner {
  min-width: 5.75rem;
  white-space: nowrap;
}

.player-link {
  color: #0432ff;
  text-decoration: none;
}

.player-link:hover,
.player-link:focus-visible {
  color: #0326c0;
  text-decoration: none;
}

.player-owner-link {
  color: #0432ff;
  text-decoration: none;
  font-weight: inherit;
}

.player-team-link {
  color: #0432ff;
  text-decoration: none;
  font-weight: inherit;
}

.player-team-link:hover,
.player-team-link:focus-visible {
  color: #0326c0;
  text-decoration: underline;
}

.player-owner-link:hover,
.player-owner-link:focus-visible {
  color: #0326c0;
  text-decoration: underline;
}

.player-owner-fa {
  color: var(--th-muted);
  cursor: default;
}

.sheet-desc {
  color: var(--th-muted);
  margin-top: 0;
  font-size: 0.9rem;
}

.minor-draft-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.minor-draft-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 10rem;
}

.minor-draft-filter-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
}

.minor-draft-filter select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--th-border, #ddd);
  border-radius: var(--radius);
  background: var(--th-surface, #fff);
  font: inherit;
}

.minor-draft-desc {
  color: var(--th-muted);
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.filter-table.minor-draft {
  width: 100%;
  table-layout: fixed;
}

.filter-table.minor-draft th,
.filter-table.minor-draft td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-table.minor-draft th.col-draft-overall,
.filter-table.minor-draft td.col-draft-overall {
  width: 3.35rem;
  min-width: 3.35rem;
  max-width: 3.35rem;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  text-align: center !important;
  font-size: 0.85rem;
}

.filter-table.minor-draft th.col-draft-num,
.filter-table.minor-draft td.col-draft-num {
  width: 2.5rem;
  min-width: 2.5rem;
  max-width: 2.5rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center !important;
  font-size: 0.85rem;
}

.filter-table.minor-draft th.col-pick-value,
.filter-table.minor-draft td.col-pick-value {
  width: 4.75rem;
  min-width: 4.75rem;
  max-width: 4.75rem;
  text-align: right !important;
}

.filter-table.minor-draft th.col-draft-owner,
.filter-table.minor-draft td.col-draft-owner {
  width: 10%;
}

.filter-table.minor-draft td.col-draft-original-owner {
  color: #9a9a9a;
}

.filter-table.minor-draft tbody tr:hover td.col-draft-original-owner {
  color: #9a9a9a;
}

.filter-table.minor-draft th.col-selection,
.filter-table.minor-draft td.col-selection {
  width: auto;
  min-width: 0;
  text-align: left !important;
}

.filter-table.minor-draft th.col-extension,
.filter-table.minor-draft td.col-extension {
  width: 7.5rem;
  min-width: 7.5rem;
  max-width: 7.5rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-align: center !important;
  font-size: 0.85rem;
}

.filter-table.minor-draft .header-labels th.col-extension {
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.filter-table.minor-draft .header-labels th.col-draft-overall,
.filter-table.minor-draft .header-labels th.col-draft-num {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}

.filter-table.minor-draft .header-filters th.col-draft-overall,
.filter-table.minor-draft .header-filters th.col-draft-num,
.filter-table.minor-draft .header-filters th.col-extension,
.filter-table.minor-draft .header-filters th.col-pick-value {
  padding: 0.2rem;
}

.filter-table.minor-draft .header-filters th.col-draft-overall .col-filter,
.filter-table.minor-draft .header-filters th.col-draft-num .col-filter,
.filter-table.minor-draft .header-filters th.col-extension .col-filter,
.filter-table.minor-draft .header-filters th.col-pick-value .col-filter {
  min-width: 0;
  padding: 0.2rem 0.25rem;
  font-size: 0.72rem;
}

.filter-table.minor-draft .header-labels th.col-selection,
.filter-table.minor-draft .header-filters th.col-selection {
  text-align: left !important;
}

.filter-table.minor-draft .header-filters th input.col-filter,
.filter-table.minor-draft .header-filters th select.col-filter {
  min-width: 0;
}

.page-minor-draft .table-scroll {
  overflow-x: hidden;
}

.filter-hint {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--th-ink);
  color: white;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.78rem;
  max-width: 280px;
  opacity: 0.92;
  box-shadow: var(--shadow);
}

.filter-hint code {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
}

.live-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  background: var(--th-red);
  color: white;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.live-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.sheet-card {
  display: block;
  background: #faf7f2;
  border: 1px solid var(--th-border);
  border-radius: 8px;
  padding: 1rem;
  color: var(--th-ink);
  text-decoration: none !important;
}

.sheet-card:hover {
  border-color: var(--th-red);
  background: white;
}

.sheet-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.sheet-card span {
  font-size: 0.85rem;
  color: var(--th-muted);
}

/* Performance roster table */
body.page-performance main {
  max-width: 1520px;
}

body.page-performance .stats-scroll {
  overflow-x: visible;
}

.performance-roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  border-bottom: 2px solid var(--th-border);
  padding-bottom: 0.5rem;
}

.card h2.performance-roster-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--th-red-dark);
  text-align: right;
  border-bottom: none;
  padding-bottom: 0;
}

.performance-roster-hint {
  color: var(--th-muted);
  margin-top: 0;
}

.performance-prospects-hint {
  color: var(--th-muted);
  margin-top: 0;
}

.performance-prospects-table th,
.performance-prospects-table td {
  white-space: nowrap;
}

.performance-prospects-table .col-player {
  white-space: normal;
  min-width: 10rem;
}

.performance-prospects-table th.col-prospect-salary,
.performance-prospects-table td.col-prospect-salary {
  text-align: center;
}

.performance-prospects-table th.col-prospect-score,
.performance-prospects-table th.col-fantasy-upside,
.performance-prospects-table th.col-nhl-certainty,
.performance-prospects-table td.col-prospect-score,
.performance-prospects-table td.col-fantasy-upside,
.performance-prospects-table td.col-nhl-certainty,
.filter-table.performance-prospects-table th.col-prospect-score,
.filter-table.performance-prospects-table th.col-fantasy-upside,
.filter-table.performance-prospects-table th.col-nhl-certainty,
.filter-table.performance-prospects-table td.col-prospect-score,
.filter-table.performance-prospects-table td.col-fantasy-upside,
.filter-table.performance-prospects-table td.col-nhl-certainty {
  text-align: center;
}

.performance-prospects-table th.col-fantasy-upside,
.performance-prospects-table th.col-nhl-certainty {
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.performance-prospects-table td.col-fantasy-upside,
.performance-prospects-table td.col-nhl-certainty {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.performance-prospects-table th.performance-prospect-profile-col,
.performance-prospects-table td.performance-dobber-link {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
}

.filter-table.performance-prospects-table .performance-dobber-link a {
  color: #0432ff;
  font-weight: normal;
  text-decoration: none;
}

.filter-table.performance-prospects-table .performance-dobber-link a:hover,
.filter-table.performance-prospects-table .performance-dobber-link a:focus-visible {
  text-decoration: underline;
}

.performance-prospects-table .performance-dobber-link a {
  color: #0432ff;
  font-weight: normal;
  text-decoration: none;
}

.performance-prospects-table .performance-dobber-link a:hover,
.performance-prospects-table .performance-dobber-link a:focus-visible {
  text-decoration: underline;
}

.filter-table.performance-prospects-table td.col-team a {
  color: #0432ff;
  font-weight: normal;
  text-decoration: none;
}

.filter-table.performance-prospects-table td.col-team a:hover,
.filter-table.performance-prospects-table td.col-team a:focus-visible {
  text-decoration: underline;
}

.performance-prospects-table.has-zebra-rows tbody tr.row-alt > td {
  background-color: #f3f3f3;
}

.performance-prospects-table.has-zebra-rows tbody tr:hover > td {
  background: #faf7f2;
}

.performance-prospects-empty {
  color: var(--th-muted);
  text-align: center;
  font-style: italic;
  padding: 1rem;
}

.performance-owner-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.performance-owner-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--th-muted);
}

.performance-owner-select {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--th-border);
  border-radius: 4px;
  background: var(--th-bg, #fff);
  color: inherit;
  max-width: 12rem;
}

/* Cap Worksheet */
body.page-cap-worksheet main {
  max-width: 1520px;
}

body.page-cap-worksheet .stats-scroll {
  overflow-x: auto;
}

.cap-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  border-bottom: 2px solid var(--th-border);
  padding-bottom: 0.5rem;
}

.cap-worksheet-summary .cap-summary-header h2 {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.cap-summary-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cap-retention-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
}

.cap-pdf-export-host {
  position: fixed;
  left: -10000px;
  top: 0;
  box-sizing: border-box;
  background: #fff;
  color: #1a1a1a;
  padding: 0;
  z-index: -1;
}

.cap-pdf-page {
  width: 100%;
  box-sizing: border-box;
  --cap-pdf-scale: 1;
}

.cap-pdf-page .card {
  width: 100%;
  box-sizing: border-box;
  box-shadow: none;
  border: 1px solid var(--th-border);
  margin-bottom: calc(12px * var(--cap-pdf-scale));
  padding: calc(10px * var(--cap-pdf-scale)) calc(12px * var(--cap-pdf-scale));
}

.cap-pdf-page .card:last-child {
  margin-bottom: 0;
}

.cap-pdf-page .card h2 {
  font-size: calc(14px * var(--cap-pdf-scale));
  margin-bottom: calc(8px * var(--cap-pdf-scale));
}

.cap-pdf-page .stats-scroll {
  overflow: visible;
  width: 100%;
  max-width: 100%;
}

.cap-pdf-page .cap-summary-grid,
.cap-pdf-page .cap-summary-metrics-row,
.cap-pdf-page .cap-summary-categories-row {
  width: 100%;
  max-width: 100%;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  font-size: calc(9px * var(--cap-pdf-scale));
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table th,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td {
  padding: calc(5.5px * var(--cap-pdf-scale)) calc(4px * var(--cap-pdf-scale));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  font-size: inherit;
  font-weight: normal;
  vertical-align: middle;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-value.val-pos {
  color: var(--th-positive);
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-value.val-neg {
  color: var(--th-negative);
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table th.stat-col-bash {
  color: maroon;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table th.col-salary,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-salary {
  text-align: center;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table th.col-player,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-player {
  width: 20%;
  min-width: calc(110px * var(--cap-pdf-scale));
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table th.col-position,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-position,
.cap-pdf-export-host .cap-pdf-page .player-stats-table th.col-contract,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-contract,
.cap-pdf-export-host .cap-pdf-page .player-stats-table th.col-retain,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-retain {
  min-width: 0;
  max-width: none;
  width: auto;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table th.col-contract,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-contract,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.cap-contract-cell,
.cap-pdf-export-host .cap-pdf-page .player-stats-table .cap-contract-readonly,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-contract .cap-pdf-static-value {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  text-align: center;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table td.contract-expired-year,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.contract-expired-ltc,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.contract-topper {
  font-weight: inherit;
  color: inherit;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table td.contract-buyout,
.cap-pdf-export-host .cap-pdf-page .player-stats-table td.contract-buyout .cap-pdf-static-value {
  background-color: #000;
  color: #fff;
  font-weight: 700;
}

.cap-pdf-page .cap-summary-grid {
  font-size: calc(10px * var(--cap-pdf-scale));
}

.cap-pdf-export-host .cap-pdf-page .cap-summary-row dt,
.cap-pdf-export-host .cap-pdf-page .cap-summary-row dd,
.cap-pdf-export-host .cap-pdf-page .cap-summary-category-heading,
.cap-pdf-export-host .cap-pdf-page .cap-summary-stat dt,
.cap-pdf-export-host .cap-pdf-page .cap-summary-stat dd {
  font-size: inherit;
}

.cap-pdf-export-host .cap-pdf-page .cap-summary-stat dt {
  font-weight: 700;
  color: var(--th-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cap-pdf-export-host .cap-pdf-page .cap-summary-stat dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--th-text, #222);
}

.cap-pdf-export-host .cap-pdf-page .cap-summary-pos-stat dt,
.cap-pdf-export-host .cap-pdf-page .cap-summary-pos-stat dd {
  font-size: inherit;
}

.cap-pdf-export-host .cap-pdf-page .cap-summary-value-blue {
  color: #0432ff;
}

.cap-pdf-export-host .cap-pdf-page .cap-summary-skater-stat-bash dt {
  color: maroon;
}

.cap-pdf-page .cap-summary-header {
  border-bottom-width: 1px;
  padding-bottom: calc(6px * var(--cap-pdf-scale));
  margin-bottom: calc(8px * var(--cap-pdf-scale));
}

.cap-pdf-page .cap-pdf-static-value {
  display: inline-block;
  min-width: 1.5em;
}

.cap-pdf-export-host .cap-pdf-page .player-stats-table td.col-contract .cap-pdf-static-value {
  display: inline-block;
  width: 100%;
  text-align: center;
  min-width: 0;
}

.cap-pdf-export-host .cap-pdf-page .cap-worksheet-minors .player-stats-table th.col-contract,
.cap-pdf-export-host .cap-pdf-page .cap-worksheet-minors .player-stats-table td.col-contract {
  min-width: calc(6.25rem * var(--cap-pdf-scale));
  max-width: none;
  width: auto;
  padding-left: calc(6px * var(--cap-pdf-scale));
  padding-right: calc(6px * var(--cap-pdf-scale));
}

.cap-pdf-export-host .cap-pdf-page .cap-worksheet-minors .player-stats-table td.col-contract .cap-pdf-static-value {
  min-width: calc(5.5rem * var(--cap-pdf-scale));
}

.cap-pdf-page .cap-pdf-owner-label {
  font-size: calc(12px * var(--cap-pdf-scale));
  font-weight: 600;
  color: var(--th-red-dark);
}

.cap-pdf-page .performance-prospects-hint {
  font-size: calc(9px * var(--cap-pdf-scale));
  margin-bottom: calc(8px * var(--cap-pdf-scale));
}

.cap-worksheet-summary .cap-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0.75rem 0 0;
}

.cap-summary-metrics-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: start;
  width: 100%;
}

.cap-summary-metrics-row .cap-summary-stats:nth-child(1) {
  grid-column: 1;
  justify-self: start;
}

.cap-summary-metrics-row .cap-summary-stats:nth-child(2) {
  grid-column: 3;
  justify-self: end;
}

.cap-summary-metrics-row .cap-summary-stats:nth-child(3) {
  grid-column: 5;
  justify-self: center;
}

.cap-summary-metrics-row .cap-summary-stats:nth-child(4) {
  grid-column: 7;
  justify-self: end;
}

.cap-worksheet-summary .cap-summary-metrics-row .cap-summary-stats {
  gap: 0.25rem;
  font-size: 0.875em;
}

.cap-summary-positions {
  gap: 0.25rem;
  min-width: 8.5rem;
}

.cap-summary-pos-grid {
  display: grid;
  grid-template-columns: 1fr max-content 1fr max-content;
  column-gap: 0.35rem;
  row-gap: 0.2rem;
  align-items: baseline;
}

.cap-summary-pos-row-c,
.cap-summary-pos-row-pair {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: baseline;
}

.cap-summary-pos-row-c .cap-summary-pos-stat,
.cap-summary-pos-row-pair .cap-summary-pos-stat {
  display: contents;
}

.cap-summary-pos-row-c .cap-summary-pos-stat dd {
  grid-column: 2 / -1;
}

.cap-summary-pos-row-pair .cap-summary-pos-stat:nth-child(2) dt {
  margin-left: 0.9rem;
}

.cap-summary-pos-spacer {
  visibility: hidden;
}

.cap-summary-pos-stat dt {
  margin: 0;
  font-weight: 600;
  color: var(--th-text, #222);
  white-space: nowrap;
  justify-self: start;
  text-align: left;
}

.cap-summary-pos-stat dt::after {
  content: ":";
}

.cap-summary-pos-only {
  font-size: 0.72em;
  font-weight: 600;
  color: #9a9a9a;
}

.cap-summary-pos-row-c .cap-summary-pos-stat dd,
.cap-summary-pos-row-pair .cap-summary-pos-stat dd {
  margin: 0;
  min-width: 1.25rem;
  justify-self: stretch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.cap-worksheet-summary .cap-summary-stats {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.cap-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 22rem;
}

.cap-summary-row dt {
  margin: 0;
  font-weight: 600;
  color: var(--th-text, #222);
}

.cap-summary-row dt::after {
  content: ":";
}

.cap-summary-row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cap-worksheet-summary .cap-summary-value-blue {
  color: #0432ff;
}

body.page-cap-worksheet .cap-summary-row dd.diff-strong-pos,
body.page-cap-worksheet .cap-summary-row dd.diff-strong-neg,
body.page-cap-worksheet .cap-summary-row dd.diff-mild-pos,
body.page-cap-worksheet .cap-summary-row dd.diff-mild-neg {
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
}

.cap-summary-categories-row {
  --cap-categories-gap: 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem var(--cap-categories-gap);
  width: 100%;
  position: relative;
  align-items: end;
}

.cap-summary-rank-mode {
  position: absolute;
  left: calc((100% - var(--cap-categories-gap)) * 27 / 44 + var(--cap-categories-gap) / 2);
  bottom: 0.05rem;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1;
}

.cap-summary-rank-mode-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
}

.cap-summary-rank-mode-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a9a9a;
}

.cap-summary-rank-mode-select {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--th-text, #222);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  min-width: 6.25rem;
}

.cap-summary-skaters,
.cap-summary-goalies {
  min-width: 0;
}

.cap-summary-categories-row .cap-summary-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}

.cap-summary-categories-row .cap-summary-skaters {
  display: grid;
  grid-template-columns: repeat(11, minmax(2rem, 1fr));
  column-gap: 0.5rem;
  row-gap: 0.25rem;
  align-items: start;
  width: 100%;
}

.cap-summary-categories-row .cap-summary-skaters > .cap-summary-category-heading,
.cap-summary-categories-row .cap-summary-skaters > .cap-summary-rank-label {
  grid-column: 1 / -1;
}

.cap-summary-categories-row .cap-summary-skaters > .cap-summary-skater-grid {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  margin: 0;
  gap: 0;
}

.cap-summary-categories-row .cap-summary-goalies {
  align-items: flex-end;
}

.cap-summary-goalies-inner {
  display: grid;
  grid-template-columns: repeat(6, minmax(2rem, 1fr));
  column-gap: 0.5rem;
  row-gap: 0.25rem;
  width: calc(100% * 6 / 11);
  max-width: calc(100% * 6 / 11);
}

.cap-summary-goalies-inner > .cap-summary-category-heading,
.cap-summary-goalies-inner > .cap-summary-rank-label {
  grid-column: 1 / -1;
}

.cap-summary-goalies-inner > .cap-summary-goalie-grid {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  margin: 0;
  gap: 0;
}

.cap-summary-category-heading {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--th-text, #222);
}

.cap-summary-stat-grid {
  margin: 0;
}

.cap-summary-skater-grid,
.cap-summary-goalie-grid {
  display: grid;
  gap: 0.45rem 0.5rem;
}

.cap-summary-skater-grid {
  grid-template-columns: repeat(11, minmax(2rem, 1fr));
}

.cap-summary-goalie-grid {
  grid-template-columns: repeat(6, minmax(2rem, 1fr));
  width: 100%;
}

.cap-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.cap-summary-stat dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--th-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cap-summary-stat dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--th-text, #222);
  min-width: 0;
  max-width: 100%;
}

.cap-summary-rank-label {
  margin: 0.85rem 0 0.05rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a9a9a;
}

.cap-summary-rank-grid {
  margin-top: 0;
}

.cap-summary-rank-stat dd {
  font-size: 0.76rem;
  font-weight: 600;
  color: #ababab;
}

.cap-summary-skater-stat-bash dt {
  color: maroon;
  cursor: help;
}

.cap-roster-separator {
  height: 0.75rem;
}

.cap-worksheet-auction-targets .cap-roster-separator {
  height: 0;
  margin: 0.65rem 0;
  border-top: 1px solid var(--th-border);
}

.cap-roster-empty {
  color: var(--th-muted);
  text-align: center;
  font-style: italic;
  padding: 1rem;
}

body.page-cap-worksheet .player-stats-table th[title] {
  cursor: help;
}

body.page-cap-worksheet .cap-readonly-cell {
  background: var(--row-alt, #f8f8f8);
  color: var(--text-muted, #555);
}

body.page-cap-worksheet .player-stats-table {
  font-size: 0.82rem;
}

body.page-cap-worksheet .player-stats-table th,
body.page-cap-worksheet .player-stats-table td {
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

body.page-cap-worksheet .player-stats-table th.col-position,
body.page-cap-worksheet .player-stats-table td.col-position {
  min-width: 2.75rem;
  text-align: center;
}

body.page-cap-worksheet .player-stats-table th.col-salary,
body.page-cap-worksheet .player-stats-table td.col-salary {
  text-align: center;
}

body.page-cap-worksheet .player-stats-table th.col-rating,
body.page-cap-worksheet .player-stats-table td.col-rating {
  text-align: center;
}

body.page-cap-worksheet .player-stats-table .col-player {
  white-space: normal;
  min-width: 10rem;
}

body.page-cap-worksheet .player-stats-table th.col-retain,
body.page-cap-worksheet .player-stats-table td.col-retain {
  width: 1%;
  min-width: 3.25rem;
  max-width: 3.25rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-align: center;
  vertical-align: middle;
}

body.page-cap-worksheet .cap-retain-checkbox {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
  accent-color: #0432ff;
}

body.page-cap-worksheet .cap-retain-checkbox.cap-mandatory-retention {
  accent-color: var(--th-positive);
}

body.page-cap-worksheet .cap-retain-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

body.page-cap-worksheet .cap-retain-checkbox.cap-mandatory-retention:disabled {
  opacity: 1;
}

.cap-stats-table.has-zebra-rows tbody tr.row-alt > td {
  background-color: #f3f3f3;
}

.cap-stats-table.has-zebra-rows tbody tr:hover > td {
  background: #faf7f2;
}

body.page-cap-worksheet .cap-stats-table td.contract-expired-year {
  color: var(--th-negative);
  font-weight: 700;
}

body.page-cap-worksheet .cap-stats-table td.contract-expired-ltc {
  color: #000;
  font-weight: 700;
}

body.page-cap-worksheet .player-stats-table th.col-contract,
body.page-cap-worksheet .player-stats-table td.col-contract {
  width: 1%;
  max-width: 6.25rem;
  min-width: 6.25rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-align: center;
}

body.page-cap-worksheet .cap-worksheet-minors .player-stats-table th.col-contract,
body.page-cap-worksheet .cap-worksheet-minors .player-stats-table td.col-contract {
  width: 1%;
  max-width: 3.35rem;
  min-width: 3.35rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

body.page-cap-worksheet .cap-contract-select {
  font: inherit;
  font-size: 0.82rem;
  font-weight: inherit;
  width: 100%;
  box-sizing: border-box;
  padding: 0.12rem 0.2rem;
  border: 1px solid var(--th-border);
  border-radius: 4px;
  background: var(--th-bg, #fff);
  color: inherit;
  text-align: center;
  text-align-last: center;
}

body.page-cap-worksheet .cap-contract-cell {
  text-align: center;
}

body.page-cap-worksheet .cap-contract-readonly {
  font-size: 0.82rem;
}

body.page-cap-worksheet .cap-stats-table td.contract-expired-year .cap-contract-select,
body.page-cap-worksheet .cap-stats-table td.contract-expired-ltc .cap-contract-select {
  font-weight: 700;
}

body.page-cap-worksheet .cap-stats-table td.contract-expired-year .cap-contract-select {
  color: var(--th-negative);
}

body.page-cap-worksheet .cap-stats-table td.contract-expired-ltc .cap-contract-select {
  color: #000;
}

body.page-cap-worksheet .cap-stats-table td.contract-topper,
body.page-cap-worksheet .cap-stats-table td.contract-topper .cap-contract-select {
  color: #0432ff;
  font-weight: 700;
}

body.page-cap-worksheet .cap-stats-table td.contract-buyout,
body.page-cap-worksheet .cap-stats-table td.contract-buyout .cap-contract-select {
  background-color: #000;
  color: #fff;
  font-weight: 700;
  border-color: #000;
}

body.page-cap-worksheet .cap-contract-select option.cap-contract-topper-option {
  color: #0432ff;
  font-weight: 700;
}

body.page-cap-worksheet .cap-contract-select option.cap-contract-buyout-option {
  background-color: #000;
  color: #fff;
  font-weight: 700;
}

body.page-cap-worksheet .cap-roster-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#cap-topper-limit-modal-message {
  text-align: center;
}

#cap-topper-limit-modal-ok {
  display: block;
  margin: 0.75rem auto 0;
}

#cap-minors-retain-limit-modal-message {
  text-align: center;
}

#cap-minors-retain-limit-modal-ok {
  display: block;
  margin: 0.75rem auto 0;
}

#cap-allocate-cap-modal-message {
  text-align: center;
}

#cap-allocate-cap-modal-ok {
  display: block;
  margin: 0.75rem auto 0;
}

#cap-buyout-modal-message {
  text-align: center;
}

#cap-reset-roster-modal-message {
  text-align: center;
}

.cap-reset-roster-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

body.page-cap-worksheet #cap-reset-roster-modal-confirm {
  background: var(--th-positive);
  color: #fff;
}

body.page-cap-worksheet #cap-reset-roster-modal-confirm:hover {
  background: #155a34;
}

body.page-cap-worksheet #cap-reset-roster-modal-cancel {
  background: var(--th-negative);
  color: #fff;
}

body.page-cap-worksheet #cap-reset-roster-modal-cancel:hover {
  background: #a00d24;
}

.cap-buyout-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

body.page-cap-worksheet #cap-buyout-modal-accept {
  background: var(--th-positive);
  color: #fff;
}

body.page-cap-worksheet #cap-buyout-modal-accept:hover {
  background: #155a34;
}

body.page-cap-worksheet #cap-buyout-modal-reject {
  background: var(--th-negative);
  color: #fff;
}

body.page-cap-worksheet #cap-buyout-modal-reject:hover {
  background: #a00d24;
}

body.page-cap-worksheet .cap-allocate-input {
  width: 4.5rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--th-border);
  border-radius: 4px;
  font: inherit;
  font-size: 0.82rem;
  text-align: right;
  background: #fff;
}

body.page-cap-worksheet .cap-allocate-cell {
  text-align: right;
}

/* Player Card season statistics */
body.page-player-card .player-stats-table {
  font-size: 0.82rem;
}

body.page-player-card .player-stats-table th,
body.page-player-card .player-stats-table td {
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

body.page-player-card .player-stats-table th.col-position,
body.page-player-card .player-stats-table td.col-position {
  min-width: 2.75rem;
  text-align: center;
}

body.page-player-card .player-stats-table td:first-child,
body.page-player-card .player-stats-table th:first-child {
  min-width: 5.5rem;
}

body.page-player-card .player-stats-table th.col-proj,
body.page-player-card .player-stats-table td.col-proj {
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  width: 3.5rem;
}

body.page-player-card.is-compare-mode .player-stats-table th.col-team,
body.page-player-card.is-compare-mode .player-stats-table td.col-team,
body.page-player-card.is-compare-mode .player-stats-table th.col-position,
body.page-player-card.is-compare-mode .player-stats-table td.col-position {
  display: none;
}

.btn-proj {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--th-border);
  border-radius: 4px;
  background: #fff;
  color: var(--th-red-dark);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.btn-proj:hover {
  background: #fff5f5;
  border-color: var(--th-red);
}

.roster-table {
  font-size: 0.82rem;
}

.roster-table th,
.roster-table td {
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.roster-table td.col-player,
.roster-table .sub-head th:first-child {
  padding-left: 0.65rem;
  min-width: 9.5rem;
}

.roster-table td:nth-child(2),
.roster-table .sub-head th:nth-child(2) {
  min-width: 3.25rem;
}

.roster-table.has-zebra-rows tbody tr.row-alt > td:not(.diff-strong-pos):not(.diff-strong-neg) {
  background-color: #f3f3f3;
}

.roster-table.has-zebra-rows tbody tr.row-alt > td.diff-strong-pos {
  background-color: #b8dbab;
}

.roster-table.has-zebra-rows tbody tr.row-alt > td.diff-strong-neg {
  background-color: #fae2d5;
}

.roster-table.has-zebra-rows tbody tr:hover > td:not(.diff-strong-pos):not(.diff-strong-neg) {
  background: #faf7f2;
}

.roster-table.has-zebra-rows tbody tr:hover > td.diff-strong-pos {
  background-color: #b8dbab;
}

.roster-table.has-zebra-rows tbody tr:hover > td.diff-strong-neg {
  background-color: #fae2d5;
}

.roster-table tbody tr.roster-separator:hover > td {
  background: transparent;
}

.roster-separator td {
  height: 1.25rem;
  padding: 0;
  border-left: none;
  border-right: none;
  background: transparent;
  cursor: default;
}

.performance-roster-manage-desc {
  margin: 0 0 1rem;
  color: var(--th-muted);
  font-size: 0.9rem;
}

.performance-roster-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.performance-roster-control label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--th-ink);
}

.performance-roster-control-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.performance-roster-control-row input,
.performance-roster-control-row select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--th-border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}

.performance-roster-control-row .player-search-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.performance-roster-control-row .player-search-wrap input {
  width: 100%;
  box-sizing: border-box;
}

.performance-roster-control-row .btn-proj {
  flex: 0 0 auto;
  white-space: nowrap;
}

.performance-roster-error {
  margin: 0.45rem 0 0;
  color: var(--th-red-dark);
  font-size: 0.82rem;
}

.group-head th {
  background: var(--th-red) !important;
  color: white;
  text-align: center !important;
  font-weight: 700;
}

.roster-head-spacer {
  background: transparent;
  border-bottom: none;
}

.roster-table .sub-head th {
  vertical-align: bottom;
}

/* Empty filter result */
.filter-table .empty-row td {
  text-align: center;
  color: var(--th-muted);
  padding: 1.25rem;
  font-style: italic;
}

/* Keyboard focus indicators (accessibility) */
.filter-table th.sortable:focus-visible,
.player-link:focus-visible,
.sheet-card:focus-visible {
  outline: 2px solid var(--th-red);
  outline-offset: -2px;
}

@media (max-width: 900px) {
  body.page-performance main {
    max-width: 1100px;
  }

  body.page-performance .stats-scroll {
    overflow-x: auto;
  }

  body.page-cap-worksheet main {
    max-width: 1100px;
  }

  .performance-roster-controls {
    grid-template-columns: 1fr;
  }

  .player-compare-grid.is-compare {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* Admin page */
.admin-main {
  max-width: 720px;
  margin: 0 auto;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-end;
  margin-bottom: 0;
}

.admin-tab {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border: 1px solid var(--th-border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--th-surface-alt, #f8f8f8);
  color: var(--th-muted);
  cursor: pointer;
}

.admin-tab:hover,
.admin-tab:focus-visible {
  color: var(--th-ink);
  background: #ffffff;
}

.admin-tab.is-active {
  background: var(--th-card);
  color: var(--th-red-dark);
  position: relative;
  z-index: 2;
  padding-bottom: calc(0.55rem + 1px);
  margin-bottom: -1px;
}

.admin-tab-panel {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.admin-main:has(#admin-tab-fantrax.is-active) .admin-tab-panel:not([hidden]) {
  border-top-left-radius: 0;
}

.admin-main:has(#admin-tab-dobber.is-active) .admin-tab-panel:not([hidden]) {
  border-top-right-radius: 0;
}

.admin-main:has(#admin-tab-site-logs.is-active) .admin-tab-panel:not([hidden]) {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.admin-site-logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.admin-site-logs-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 12rem;
}

.admin-site-logs-filter-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
}

.admin-site-logs-filter select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--th-border, #ddd);
  border-radius: var(--radius);
  background: var(--th-surface, #fff);
  font: inherit;
}

.admin-site-logs-meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--th-muted);
}

.admin-site-logs-table-wrap {
  overflow: auto;
  max-height: min(70vh, 720px);
  border: 1px solid var(--th-border, #e0e0e0);
  border-radius: var(--radius);
  background: #fff;
  color: #1a1a1a;
}

.admin-site-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-site-logs-table th,
.admin-site-logs-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--th-border, #eee);
}

.admin-site-logs-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f8f8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
}

.admin-site-logs-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-site-logs-empty {
  text-align: center;
  color: var(--th-muted);
  padding: 1.5rem !important;
}

.admin-site-logs-details {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.admin-site-logs-table .site-logs-level-error {
  color: #9b1c1c;
  font-weight: 600;
}

.admin-site-logs-table .site-logs-level-warning {
  color: #7a5b00;
  font-weight: 600;
}

.admin-site-logs-table .site-logs-status-error {
  color: #9b1c1c;
  font-weight: 600;
}

.admin-site-logs-table .site-logs-status-warning {
  color: #7a5b00;
  font-weight: 600;
}

.admin-tab-panel[hidden] {
  display: none !important;
}

.admin-card h2 {
  margin-top: 0;
}

.admin-lead {
  color: var(--th-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.admin-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.5rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--th-surface-alt, #f8f8f8);
  border-radius: var(--radius);
}

.admin-meta dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
  margin-bottom: 0.25rem;
}

.admin-meta dd {
  margin: 0;
  font-weight: 600;
}

.admin-season-field {
  display: block;
  margin-bottom: 1.25rem;
}

.admin-season-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.admin-season-field select {
  width: 100%;
  max-width: 320px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--th-border);
  border-radius: 6px;
  font-size: 1rem;
  background: white;
  color: var(--th-ink, #1a1a1a);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.admin-drop-both {
  margin-bottom: 1.25rem;
  padding: 1.5rem 1.25rem;
  border: 2px dashed var(--th-border);
  border-radius: var(--radius);
  text-align: center;
  background: var(--th-surface-alt, #fafafa);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-drop-both strong {
  display: block;
  margin-bottom: 0.35rem;
}

.admin-drop-icon {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  color: var(--th-muted);
}

.admin-drop-hint {
  display: block;
  font-size: 0.9rem;
  color: var(--th-muted);
}

.admin-drop-both.is-dragover,
.admin-drop-zone.is-dragover {
  border-color: var(--th-red);
  background: #fff5f5;
}

.admin-drop-both.has-files {
  border-color: #2e7d32;
  background: #f4fbf5;
}

.admin-drop-both.has-files .admin-drop-hint {
  color: var(--th-ink, #1a1a1a);
  font-weight: 500;
}

.admin-file-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .admin-file-grid {
    grid-template-columns: 1fr;
  }
}

.admin-file-field {
  position: relative;
  display: block;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--th-border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-file-field.has-file {
  border-color: #2e7d32;
  background: #f4fbf5;
}

.admin-file-field:hover {
  border-color: var(--th-red);
}

.admin-file-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.admin-drop-zone-text {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--th-muted);
}

.admin-browse-link {
  color: var(--th-red);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.admin-file-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-file-name {
  display: block;
  font-size: 0.9rem;
  color: var(--th-ink);
  font-weight: 500;
  word-break: break-all;
}

.admin-storage-path {
  font-size: 0.85rem;
  font-weight: 500;
  word-break: break-all;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-status {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
}

.admin-status-pending {
  background: #fff8e6;
  color: #7a5b00;
}

.admin-status-success {
  background: #e8f7ec;
  color: #1f6b34;
}

.admin-status-error {
  background: #fdecea;
  color: #9b1c1c;
}

.admin-log {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #1e1e1e;
  color: #f0f0f0;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.admin-dobber-meta {
  display: grid;
  grid-template-columns: minmax(7.5rem, max-content) 1fr auto;
  align-items: start;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.admin-dobber-meta-season {
  justify-self: start;
  min-width: 7.5rem;
}

.admin-dobber-meta-season dd {
  white-space: nowrap;
}

.admin-dobber-meta > div:nth-child(2) {
  justify-self: center;
  text-align: left;
}

.admin-dobber-criteria-list {
  margin: 0;
  padding-left: 1.1rem;
  font-weight: 600;
  line-height: 1.45;
}

.admin-dobber-criteria-list li + li {
  margin-top: 0.35rem;
}

.admin-dobber-meta-prospects {
  justify-self: end;
  align-self: start;
  text-align: right;
}
}

.admin-progress {
  margin-top: 1.25rem;
}

.admin-progress-bar {
  height: 0.85rem;
  background: var(--th-border, #ddd);
  border-radius: 999px;
  overflow: hidden;
}

.admin-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--th-red, #c8102e), var(--th-red-dark, #8b0000));
  transition: width 0.2s ease;
}

.admin-progress-label {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: var(--th-muted);
}

.admin-dobber-field {
  display: block;
}

.admin-dobber-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.admin-dobber-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.admin-dobber-control-row input[type="text"] {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--th-border);
  border-radius: 6px;
}

.admin-dobber-results {
  margin: 1.25rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--th-surface-alt, #f8f8f8);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 0.65rem 1rem;
}

.admin-dobber-results dt {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
}

.admin-dobber-results dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.admin-dobber-results dd a {
  color: #0432ff;
  text-decoration: none;
  font-weight: 600;
}

.admin-dobber-results dd a:hover,
.admin-dobber-results dd a:focus-visible {
  text-decoration: underline;
}

/* Login page */
body.page-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-header-top {
  grid-template-columns: 1fr;
  justify-items: center;
}

.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 28rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.login-card {
  width: 100%;
  margin-bottom: 1rem;
}

.login-card h2 {
  text-align: center;
}

.login-lead {
  color: var(--th-muted);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--th-border);
  border-radius: 6px;
  font-size: 1rem;
  background: white;
}

.login-form input:focus-visible {
  outline: 2px solid rgba(200, 16, 46, 0.35);
  outline-offset: 1px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}

.login-remember input {
  width: auto;
  margin: 0;
}

.login-submit {
  width: 100%;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-switch {
  margin: 1.25rem 0 0;
  text-align: center;
}

.login-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--th-red);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.login-link-btn:hover,
.login-link-btn:focus-visible {
  color: var(--th-red-dark);
}

.login-alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.login-alert.is-success {
  color: var(--th-positive);
  background: #edf7f1;
}

.login-alert.is-error {
  color: var(--th-negative);
  background: #fff0f2;
}

.login-privacy {
  text-align: center;
  color: var(--th-muted);
  font-size: 0.85rem;
  margin: 0;
}

.site-auth-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.site-auth-label {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-auth-logout {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-auth-logout:hover {
  background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 640px) {
  .site-auth-label {
    display: none;
  }
}

.cap-commissioner-access-desc,
.performance-commissioner-access-desc {
  color: var(--th-muted);
  margin: 0 0 1rem;
}

.cap-commissioner-access-toggle,
.performance-commissioner-access-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0 0 0.5rem;
  border: none;
  border-bottom: 2px solid var(--th-border);
  background: none;
  cursor: pointer;
  text-align: left;
}

.cap-commissioner-access-toggle:hover,
.cap-commissioner-access-toggle:focus-visible,
.performance-commissioner-access-toggle:hover,
.performance-commissioner-access-toggle:focus-visible {
  outline: none;
}

.cap-commissioner-access-toggle:focus-visible,
.performance-commissioner-access-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.25);
  border-radius: 4px;
}

.cap-commissioner-access-title,
.performance-commissioner-access-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--th-red-dark);
}

.cap-commissioner-access-chevron,
.performance-commissioner-access-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--th-red-dark);
  border-bottom: 2px solid var(--th-red-dark);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.cap-commissioner-access:not(.is-collapsed) .cap-commissioner-access-chevron,
.performance-commissioner-access:not(.is-collapsed) .performance-commissioner-access-chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.cap-commissioner-access.is-collapsed .cap-commissioner-access-body,
.performance-commissioner-access.is-collapsed .performance-commissioner-access-body {
  display: none;
}

.cap-commissioner-access.is-collapsed .cap-commissioner-access-toggle,
.performance-commissioner-access.is-collapsed .performance-commissioner-access-toggle {
  margin-bottom: 0;
}

.cap-commissioner-grant-options,
.performance-commissioner-grant-options {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2rem;
  margin-bottom: 1rem;
}

.cap-commissioner-grant-option,
.performance-commissioner-grant-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.cap-grants-message,
.performance-grants-message {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.cap-grants-message.is-success,
.performance-grants-message.is-success {
  color: var(--th-positive);
}

.cap-grants-message.is-error,
.performance-grants-message.is-error {
  color: var(--th-negative);
}
