:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #666666;
  --line: #d9d9d9;
  --panel: #ffffff;
  --page: #f2f2f2;
  --accent: #c1121f;
  --accent-2: #161616;
  --navy: #0b0b0b;
  --navy-2: #242424;
  --steel: #eeeeee;
  --soft: #f7f7f7;
  --success: #0f766e;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 24px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, #0b0b0b 0 178px, var(--page) 178px);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--navy);
}

.login-panel {
  display: grid;
  gap: 16px;
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 0;
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-panel input {
  min-height: 44px;
  border: 1px solid var(--line);
  padding: 9px 11px;
  color: var(--ink);
}

.login-panel button {
  min-height: 44px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.brand-header {
  display: block;
  width: min(760px, 100%);
  max-height: 178px;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.login-brand {
  justify-self: center;
  width: min(260px, 72vw);
  max-height: 230px;
  margin-bottom: 0;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #b91c1c;
  font-weight: 700;
}

.app-shell {
  display: none;
  min-height: 0;
  padding: 18px;
}

.is-authenticated .app-shell {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  border: 1px solid var(--line);
  background: #fafafa;
  box-shadow: var(--shadow);
}

.sidebar {
  display: grid;
  grid-template-columns: minmax(500px, 780px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 8px 22px 10px;
  border-bottom: 4px solid var(--accent);
  background: #fff;
  color: var(--ink);
}

.brand-block {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.brand-block .intro {
  max-width: 760px;
}

.sidebar-note {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.note-block {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: #fafafa;
  padding: 10px 12px;
}

.note-block strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.note-block span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.75rem;
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.sidebar .intro {
  color: var(--muted);
  max-width: 760px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.upload-drop {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 190px;
  padding: 22px;
  border: 2px dashed #9fb2c2;
  background: var(--soft);
  text-align: center;
}

.upload-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
}

.upload-title {
  font-weight: 800;
}

.upload-copy {
  color: var(--muted);
  font-size: 0.92rem;
}

.source-list {
  min-height: 0;
}

.archive-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.archive-actions button,
.archive-actions label {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.archive-actions input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.paste-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.paste-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.paste-panel input,
.paste-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--ink);
}

.paste-panel textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.35;
}

.paste-panel > button {
  min-height: 40px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.paste-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 800;
}

.panel-title button,
#exportBtn,
#exportGameLogBtn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 11px;
}

#fileList {
  display: grid;
  gap: 8px;
  max-height: 34vh;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

#fileList li {
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 22px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -18px -22px 0;
  padding: 13px 22px;
  border-bottom: 1px solid #d4d4d4;
  background: #fff;
}

.icon-command {
  min-height: 34px;
  border: 1px solid #d4d4d4;
  background: #f7f7f7;
  padding: 8px 11px;
  color: #333333;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-status-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d4d4d4;
  background: #f7f7f7;
  color: #333333;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-status-chip.clear {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.data-status-chip.notice {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.data-status-chip.warning {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.global-season-control {
  display: flex;
  align-items: center;
}

.global-season-control select {
  min-height: 34px;
  min-width: 218px;
  max-width: 250px;
  border: 1px solid #d4d4d4;
  background: #fff;
  padding: 7px 30px 7px 9px;
  color: var(--ink);
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-command:disabled {
  cursor: wait;
  opacity: 0.7;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 96px));
  border: 1px solid var(--line);
  background: #f7f7f7;
}

.summary-strip div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-left: 1px solid var(--line);
}

.summary-strip div:first-child {
  border-left: 0;
}

.summary-strip span {
  color: var(--accent-2);
  font-size: 1.15rem;
  font-weight: 900;
}

.summary-strip small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 -22px 16px;
  border-bottom: 1px solid #d4d4d4;
  background: #242424;
}

.tab {
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 10px 14px;
  color: #eeeeee;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tab.active {
  border-bottom-color: var(--accent);
  background: #000000;
  color: #fff;
}

.sub-tabs {
  display: none;
  gap: 6px;
  margin: -4px 0 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.sub-tabs .tab {
  border-right: 0;
  padding: 9px 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
}

.sub-tabs .tab.active {
  color: var(--accent-2);
  background: transparent;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.toolbar .toolbar-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #333333;
}

.toolbar .toolbar-check input {
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}

.toolbar input,
.toolbar select {
  min-height: 36px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

#searchInput {
  min-width: min(320px, 70vw);
}

#exportBtn,
#exportGameLogBtn {
  min-height: 36px;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 800;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 360px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  padding: 32px;
}

.empty-state p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state.loading-state {
  gap: 12px;
  min-height: 420px;
  border-top: 4px solid var(--accent);
}

.loading-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
}

.loading-mark span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  animation: loadingPulse 0.9s ease-in-out infinite;
}

.loading-mark span:nth-child(2) {
  animation-delay: 0.12s;
}

.loading-mark span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

.dashboard-panel {
  display: none;
  gap: 12px;
}

.games-panel {
  display: none;
}

.games-page {
  display: grid;
  gap: 12px;
}

.games-page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent-2);
  background: #fff;
  padding: 14px 16px;
}

.games-page-header h2,
.games-page-header p {
  margin: 0;
}

.games-page-header label {
  display: grid;
  gap: 5px;
  min-width: 190px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.games-page-header select {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
  text-transform: none;
}

.games-page-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.games-calendar {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.games-calendar-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.games-calendar-header button {
  min-height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
}

.games-calendar-header button:disabled {
  opacity: 0.35;
}

.games-calendar-header strong {
  font-size: 0.86rem;
}

.games-calendar-weekdays,
.games-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.games-calendar-weekdays span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.games-calendar-grid button,
.games-calendar-grid .calendar-empty {
  min-height: 38px;
}

.games-calendar-grid button {
  display: grid;
  place-items: center;
  gap: 1px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 3px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
}

.games-calendar-grid button:not(:disabled) {
  border-color: #fecaca;
  background: #fff1f2;
}

.games-calendar-grid button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.games-calendar-grid button:disabled {
  color: #c4c4c4;
  background: #f7f7f7;
}

.games-calendar-grid small {
  font-size: 0.54rem;
  font-weight: 900;
}

.scoreboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 320px));
  justify-content: start;
  gap: 10px;
  align-items: start;
}

.scoreboard-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-top: 3px solid var(--accent-2);
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.scoreboard-card:hover {
  border-color: var(--accent);
  background: #fff1f2;
}

.scoreboard-date {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scoreboard-card small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.scoreboard-open {
  justify-self: start;
  min-height: 30px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 5px 9px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scorebook-print-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.line-score-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.scoreboard-card .line-score-table {
  min-width: 0;
}

.line-score-table th,
.line-score-table td {
  border-bottom: 1px solid var(--line);
  padding: 5px 6px;
  font-size: 0.76rem;
  text-align: right;
}

.line-score-table th:first-child,
.line-score-table td:first-child {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-score-table th:not(:first-child),
.line-score-table td:not(:first-child) {
  width: 34px;
  font-weight: 900;
}

.line-score-table.compact th:first-child,
.line-score-table.compact td:first-child {
  width: calc(100% - 78px);
}

.line-score-table.compact th:not(:first-child),
.line-score-table.compact td:not(:first-child) {
  width: 26px;
  padding-inline: 3px;
}

.games-detail {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.game-detail-modal {
  display: grid;
  gap: 14px;
}

.game-detail-modal > .line-score-table {
  max-width: 620px;
}

.dashboard-loading-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 18px;
  min-height: 160px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.dashboard-loading-panel h2,
.dashboard-loading-panel p {
  margin: 0;
}

.dashboard-loading-panel h2 {
  font-size: 1rem;
}

.dashboard-loading-panel p {
  color: var(--muted);
  font-size: 0.82rem;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.table-pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-pagination strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.table-view-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.table-view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-manager-button {
  min-height: 30px;
  padding: 5px 10px;
}

#statsTable [data-column-width="compact"] {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
}

#statsTable [data-column-width="wide"] {
  width: 168px;
  min-width: 168px;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--panel);
}

.segmented-control button {
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active {
  background: var(--accent);
  color: #fff;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.dashboard-kpi {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  align-content: start;
  gap: 2px 10px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-2);
  background: #fff;
  padding: 10px 12px;
}

.dashboard-kpi span,
.dashboard-kpi small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-kpi span {
  grid-column: 1 / -1;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.dashboard-kpi strong {
  color: var(--accent-2);
  font-size: 1.35rem;
  line-height: 1;
}

.dashboard-kpi small {
  justify-self: end;
  text-align: right;
  font-size: 0.78rem;
}

.game-kpi {
  grid-template-columns: 1fr auto;
}

.game-kpi small {
  grid-column: 1 / -1;
}

.kpi-mini-donut {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 56%, transparent 57%),
    conic-gradient(var(--accent) calc(var(--pct) * 1%), #dedede 0);
  cursor: help;
}

.kpi-mini-donut i {
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
}

.dashboard-visuals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.dashboard-card,
.import-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent-2);
  background: #fff;
  padding: 12px;
}

.dashboard-card-wide {
  grid-column: span 2;
}

.dashboard-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--steel);
}

.dashboard-card-title h3 {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.92rem;
  text-transform: uppercase;
}

.dashboard-card-title small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.visual-card {
  align-content: start;
}

.donut-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.donut {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 55%, transparent 56%),
    conic-gradient(var(--accent) calc(var(--pct) * 1%), #dedede 0);
}

.donut span {
  font-size: 1.35rem;
  font-weight: 900;
}

.donut-wrap p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.bar-chart {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.95fr) minmax(90px, 1.35fr) minmax(44px, auto);
  align-items: center;
  gap: 8px;
  min-height: 25px;
  font-size: 0.8rem;
}

.bar-row span {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row strong {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f5;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mini-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.74rem;
  table-layout: auto;
}

.mini-table th,
.mini-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
  white-space: normal;
}

.mini-table th:first-child,
.mini-table td:first-child {
  text-align: left;
  width: 46%;
}

.mini-table tbody tr:nth-child(even) {
  background: #f4f7fa;
}

.mini-table .mini-table-section td {
  background: #eeeeee;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.mini-table td small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.recent-game-list {
  display: grid;
  gap: 8px;
}

.recent-game-row {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.recent-game-row strong {
  overflow-wrap: anywhere;
}

.recent-game-row small {
  color: var(--muted);
  font-weight: 800;
}

.import-panel {
  display: none;
  gap: 16px;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 12px;
}

.admin-panel {
  display: none;
  gap: 18px;
}

.admin-sub-tabs {
  display: flex;
  margin-bottom: 0;
}

.admin-return-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
  border-right: 1px solid #454545;
}

.admin-view .summary-strip {
  display: none;
}

.column-manager-modal .modal-panel {
  width: min(620px, 100%);
}

.column-manager-heading,
.column-manager-row,
.column-order-actions {
  display: flex;
  align-items: center;
}

.column-manager-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.column-manager-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.column-manager-list {
  display: grid;
  border: 1px solid var(--line);
}

.column-manager-row {
  grid-template-columns: minmax(140px, 1fr) 110px auto;
  gap: 10px;
  min-height: 42px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}

.column-manager-row:last-child {
  border-bottom: 0;
}

.column-manager-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.column-manager-row select {
  min-height: 30px;
  padding: 4px 24px 4px 7px;
  font-size: 0.76rem;
}

.column-order-actions {
  gap: 4px;
}

.column-order-actions button {
  width: 30px;
  min-height: 30px;
  padding: 0;
}

@media (max-width: 640px) {
  .column-manager-modal {
    align-items: flex-start;
    padding: max(10px, env(safe-area-inset-top)) 10px 10px;
  }

  .column-manager-modal .modal-panel {
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)));
  }

  .column-manager-row {
    grid-template-columns: minmax(108px, 1fr) 92px auto;
    gap: 6px;
    padding-inline: 6px;
  }

  .column-manager-row select {
    width: 92px;
  }
}

.admin-section {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent-2);
  background: #fff;
  padding: 18px;
}

.admin-subsection {
  border: 1px solid var(--line);
  background: #f7f7f7;
  padding: 12px;
}

.admin-subsection h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.admin-help-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.standalone-profile-section {
  gap: 8px;
  border: 0;
  border-top: 0;
  background: transparent;
  padding: 0;
}

.standalone-profile-section > div:first-child {
  display: none;
}

.admin-team-list,
.admin-import-list {
  display: grid;
  gap: 10px;
}

.visibility-transfer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.visibility-column {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr);
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.visibility-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.visibility-column-header small {
  color: var(--muted);
  font-weight: 800;
}

.visibility-column select {
  width: 100%;
  min-height: 260px;
  border: 0;
  padding: 6px;
  background: #fff;
  color: var(--ink);
}

.visibility-column option {
  padding: 7px 8px;
}

.visibility-actions {
  display: grid;
  align-content: center;
  gap: 8px;
}

.visibility-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.visibility-actions button {
  min-width: 44px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.admin-team-row,
.admin-import-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.admin-import-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-import-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f8fafb;
}

.admin-import-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 220px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-import-toolbar select {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
}

.admin-import-toolbar button {
  min-height: 34px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 7px 10px;
  font-weight: 900;
}

.admin-import-toolbar small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
}

.admin-processing-status {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(320px, 2fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
}

.admin-processing-status.warning {
  border-left: 4px solid #b91c1c;
}

.admin-processing-status.notice {
  border-left: 4px solid #d97706;
}

.admin-processing-status.clear {
  border-left: 4px solid #16a34a;
}

.admin-processing-status strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
}

.admin-processing-status small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
}

.status-kicker {
  display: block;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-processing-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-recent-imports {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.admin-recent-imports-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.admin-recent-imports-heading strong { color: var(--ink); font-size: 0.8rem; }
.admin-recent-imports-heading small { color: var(--muted); font-weight: 700; }
.admin-recent-imports-scroll { overflow-x: auto; }
.admin-recent-imports-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.admin-recent-imports-table th,
.admin-recent-imports-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.admin-recent-imports-table th { color: var(--muted); font-size: 0.66rem; text-transform: uppercase; }
.admin-recent-imports-table td:last-child { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.admin-import-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-import-state { display: inline-block; padding: 2px 5px; border: 1px solid currentColor; font-weight: 900; }
.admin-import-state.done { color: #166534; background: #f0fdf4; }
.admin-import-state.pending { color: #92400e; background: #fffbeb; }
.admin-import-state.issue { color: #991b1b; background: #fef2f2; }

.admin-processing-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.admin-processing-metric b {
  color: var(--ink);
  font-size: 0.86rem;
}

.admin-processing-metric.has-issue {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.admin-processing-metric.clear {
  color: #166534;
}

.admin-duplicate-games {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.admin-duplicate-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-duplicate-header strong,
.admin-duplicate-group header strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.admin-duplicate-header small,
.admin-duplicate-group header small,
.muted-note {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.admin-duplicate-group {
  border: 1px solid var(--line);
  margin-top: 8px;
  background: #fff;
}

.admin-duplicate-group header,
.admin-duplicate-group footer {
  padding: 8px;
  background: #f8fafc;
}

.admin-duplicate-table-wrap {
  overflow-x: auto;
}

.admin-duplicate-table {
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.admin-duplicate-table th,
.admin-duplicate-table td {
  border-top: 1px solid var(--line);
  padding: 6px 7px;
  text-align: left;
  vertical-align: top;
}

.admin-duplicate-table th {
  background: #e5e7eb;
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-duplicate-table td:first-child,
.admin-duplicate-table th:first-child {
  width: 82px;
}

.admin-duplicate-table td:nth-child(2),
.admin-duplicate-table th:nth-child(2) {
  width: 30%;
}

.admin-duplicate-table .is-hidden-game {
  background: #f9fafb;
  color: #6b7280;
}

.selected-button {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

.admin-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-inline-actions button,
.admin-inline-actions .button-link {
  min-height: 38px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-inline-actions .button-link.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.admin-inline-actions button:disabled {
  opacity: 0.65;
}

.appearance-linker {
  display: grid;
  gap: 10px;
}

.appearance-linker-header,
.appearance-linker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.appearance-linker-header {
  justify-content: space-between;
}

.appearance-linker-header > div:first-child {
  min-width: min(100%, 360px);
}

.appearance-linker-modes {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid var(--ink);
}

.appearance-linker-modes button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.appearance-linker-modes button:last-child {
  border-right: 0;
}

.appearance-linker-modes button[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
}

.appearance-linker-actions button {
  min-height: 38px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  font-weight: 900;
}

.appearance-linker-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.appearance-linker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.appearance-linker-toggle input {
  margin: 0;
}

.appearance-selection-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #f8fafb;
  padding: 6px;
}

.appearance-selection-empty {
  align-self: center;
  color: var(--muted);
  padding: 3px 5px;
  font-size: 0.74rem;
  font-weight: 700;
}

.appearance-selection-item {
  display: flex;
  align-items: stretch;
  border: 1px solid #aeb5bc;
  background: #fff;
}

.appearance-selection-item label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  cursor: pointer;
}

.appearance-selection-item label > span,
.appearance-selection-item strong,
.appearance-selection-item small {
  display: block;
}

.appearance-selection-item small {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appearance-selection-item > button {
  width: 30px;
  border: 0;
  border-left: 1px solid #aeb5bc;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
}

.appearance-suggestion-list {
  display: grid;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.appearance-suggestion-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.6fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.appearance-suggestion-row:last-child {
  border-bottom: 0;
}

.appearance-suggestion-summary strong,
.appearance-suggestion-summary span,
.appearance-suggestion-summary small,
.appearance-suggestion-members strong,
.appearance-suggestion-members small {
  display: block;
}

.appearance-suggestion-summary > strong {
  color: var(--accent);
  font-size: 0.82rem;
}

.appearance-suggestion-summary small,
.appearance-suggestion-members small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.appearance-suggestion-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 12px;
}

.appearance-suggestion-members > span {
  min-width: 0;
  border-left: 3px solid #c8d0d7;
  padding-left: 7px;
}

.appearance-suggestion-row > button,
.appearance-linker-pager button {
  min-height: 34px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.appearance-suggestion-row > button:hover,
.appearance-suggestion-row > button:focus-visible,
.appearance-linker-pager button:hover,
.appearance-linker-pager button:focus-visible {
  background: var(--ink);
  color: #fff;
}

.appearance-linker-pager {
  display: flex;
  align-items: center;
  gap: 7px;
}

.appearance-linker-pager label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.appearance-linker-pager select {
  min-height: 34px;
}

.appearance-linker-list {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.appearance-linker-list-head,
.appearance-link-row {
  display: grid;
  grid-template-columns: 46px 62px minmax(160px, 1.3fr) minmax(180px, 1.45fr) 78px 52px 52px minmax(150px, 0.9fr);
  align-items: center;
  min-width: 940px;
}

.appearance-linker-list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
  background: #e5e7eb;
  color: var(--ink);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.appearance-linker-list-head span,
.appearance-link-cell {
  padding: 7px 8px;
  min-width: 0;
}

.appearance-link-row {
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.appearance-link-row:last-child {
  border-bottom: 0;
}

.appearance-link-row:hover {
  background: #f9fafb;
}

.appearance-link-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appearance-link-cell.compact,
.appearance-link-cell.select-column {
  text-align: center;
}

.appearance-link-cell.player-cell strong,
.appearance-link-cell.status-cell small,
.appearance-link-cell.player-cell small {
  display: block;
}

.appearance-link-cell.player-cell small,
.appearance-link-cell.status-cell small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.linked-appearance-row {
  background: #f8fafb;
}

.appearance-linker-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .appearance-suggestion-row {
    grid-template-columns: 1fr;
  }

  .appearance-suggestion-row > button {
    justify-self: start;
  }
}

.inline-text-button {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 2px 0;
  font-size: 0.68rem;
  font-weight: 900;
  text-decoration: underline;
  text-transform: uppercase;
}

.inline-text-button:hover,
.inline-text-button:focus-visible {
  color: #a80f1d;
}

.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 3px solid var(--accent);
  background: #1f1f1f;
}

.admin-subtab {
  min-height: 38px;
  border: 0;
  border-right: 1px solid #3a3a3a;
  background: #1f1f1f;
  color: #fff;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-subtab.active {
  background: var(--accent);
}

.admin-alias-pane[hidden] {
  display: none;
}

.admin-compact-filter {
  display: inline-grid;
  gap: 3px;
  min-width: 220px;
}

.admin-compact-filter.small {
  min-width: 90px;
}

.admin-compact-filter span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-compact-filter input,
.admin-compact-filter select {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
  font-size: 0.78rem;
}

.statcast-action-link {
  min-height: 38px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.statcast-action-link:hover,
.statcast-action-link:focus-visible {
  background: #a80f1d;
  border-color: #a80f1d;
  color: #fff;
}

.statcast-action-link-secondary {
  border-color: var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(17, 24, 39, 0.1);
}

.statcast-action-link-secondary:hover,
.statcast-action-link-secondary:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.extension-install-card {
  gap: 14px;
}

.install-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.65;
}

.admin-import-table {
  min-width: 1180px;
  table-layout: fixed;
}

.admin-record-table {
  min-width: 760px;
}

.user-admin-table {
  min-width: 760px;
}

.feature-permission-fields {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 10px;
  margin: 0;
}

.feature-permission-fields legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-threshold-table {
  min-width: 1120px;
}

.trend-threshold-table th,
.trend-threshold-table td {
  vertical-align: top;
}

.admin-profile-toolbar {
  display: grid;
  grid-template-columns: 120px repeat(auto-fit, minmax(130px, max-content));
  gap: 10px;
  align-items: end;
}

.versus-finder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
  background: #fff;
  padding: 10px;
}

.versus-finder-toolbar > * {
  flex: 0 0 auto;
}

.admin-profile-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-benchmark-card {
  display: grid;
  gap: 2px;
  min-height: 54px;
  border: 1px solid var(--line);
  background: #f8fafb;
  padding: 7px 9px;
  align-content: center;
}

.versus-finder-toolbar .profile-benchmark-card {
  border-color: #d7d7d7;
  background: #f4f4f4;
}

.profile-benchmark-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-benchmark-card strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1;
}

.profile-benchmark-card small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.15;
}

.profile-reset-actions {
  display: grid;
  gap: 5px;
  align-content: start;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-reset-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  font: inherit;
  font-weight: 900;
}

.profile-reset-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-profile-toolbar select,
.admin-profile-toolbar input[type="search"] {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  padding: 6px 8px;
  font: inherit;
  text-transform: none;
}

.profile-recalculate-control {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-recalculate-control button {
  min-height: 34px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  font: inherit;
  font-weight: 900;
}

.profile-recalculate-control button:hover {
  background: #a80f1c;
}

.versus-finder-toolbar .profile-reset-actions button,
.versus-finder-toolbar .profile-recalculate-control button,
.versus-finder-toolbar select {
  min-height: 36px;
  min-width: 126px;
  white-space: nowrap;
}

.versus-finder-toolbar .profile-recalculate-control button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.profile-selection-strip {
  display: grid;
  grid-template-columns: repeat(var(--profile-select-cols), minmax(150px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.profile-select-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 112px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  align-content: start;
  text-align: center;
}

.profile-select-card.searching {
  text-align: left;
}

.profile-select-card.add-only {
  place-items: center;
  align-content: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-select-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-select-card > strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.15;
}

.profile-select-card > small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.66rem;
  font-weight: 800;
}

.profile-select-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #b91c1c;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.profile-add-slot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.profile-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: auto;
  z-index: 30;
  display: grid;
  gap: 5px;
  width: max-content;
  min-width: 280px;
  max-width: min(560px, calc(100vw - 72px));
  max-height: 156px;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.profile-search-results button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid #e5e7eb;
  background: #f8fafb;
  color: var(--ink);
  padding: 6px 8px;
  text-align: left;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  min-width: 270px;
}

.profile-search-results button small {
  grid-column: 1;
  color: var(--muted);
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-size: 0.64rem;
  font-weight: 700;
}

.profile-search-results button strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
}

.profile-search-results button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.profile-comparison-tool {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.profile-comparison-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 10px;
}

.profile-comparison-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.versus-results-card .profile-comparison-header h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1;
}

.versus-detail-page .profile-grid {
  max-width: 100%;
}

.versus-finder-idle {
  max-width: 100%;
}

.versus-selection-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 12px;
  min-width: 0;
  align-items: flex-start;
}

.versus-add-player {
  flex: 0 0 280px;
  padding: 12px 8px;
  text-align: center;
}

.versus-add-player .profile-add-slot {
  margin: 0 auto 8px;
}

.versus-add-player .profile-search-field {
  text-align: left;
}

.versus-add-player .profile-search-results {
  position: static;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 4px;
}

.versus-add-player .profile-search-results button {
  min-width: 0;
}

.versus-add-player .profile-search-results button small {
  white-space: normal;
  overflow-wrap: anywhere;
}

.versus-selection-list:empty {
  display: none;
}

.versus-selected-player {
  position: relative;
  flex: 0 0 200px;
  box-sizing: border-box;
  padding: 12px 24px;
  text-align: center;
}

.versus-selected-player .profile-avatar {
  margin: 0 auto 8px;
}

.versus-selected-player strong,
.versus-selected-player small {
  display: block;
  overflow-wrap: anywhere;
}

.versus-selected-player small {
  margin-top: 4px;
  line-height: 1.4;
}

.versus-start-search {
  width: min(320px, 100%);
}

.versus-results-scroll {
  min-width: 0;
  overflow-x: auto;
}

.versus-results-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: max-content;
}

.versus-results-row .versus-stat-table {
  width: auto;
  min-width: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
}

.versus-stat-table th,
.versus-stat-table td {
  text-align: center;
  padding: 0;
  border-right: 1px solid var(--line);
  white-space: normal;
}

.versus-stat-table thead th {
  position: static;
  background: #fff;
  width: 200px;
  min-width: 200px;
  vertical-align: top;
}

.versus-stat-table thead .versus-stat-label {
  width: 88px;
  min-width: 88px;
  vertical-align: bottom;
  padding: 8px;
}

.versus-stat-table .profile-player-card {
  position: relative;
  height: auto;
  min-height: 160px;
  padding: 16px 12px 12px;
  text-transform: none;
}

.versus-stat-table .profile-player-card span,
.versus-stat-table .profile-player-card small {
  max-width: 176px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.versus-stat-table tbody th {
  padding: 5px 8px;
  background: #f5f5f5;
}

.versus-stat-table .profile-raw-stat {
  min-height: 26px;
  height: auto;
  border: 0;
  padding: 5px 8px;
}

.versus-start-search input {
  min-height: 38px;
  border: 1px solid var(--line);
  padding: 7px 9px;
}

.profile-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-legend span {
  border: 1px solid var(--line);
  padding: 5px 8px;
}

.profile-legend-red {
  color: #b91c1c;
  background: #fee2e2;
}

.profile-legend-blue {
  color: #1d4ed8;
  background: #dbeafe;
}

.profile-grid {
  display: grid;
  grid-template-columns: 108px repeat(var(--profile-cols), 180px);
  justify-content: start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 6px;
}

.profile-grid:has(.profile-search-results) {
  padding-bottom: 120px;
}

.profile-label-column,
.profile-player-column {
  display: grid;
  grid-template-rows: 108px;
  grid-auto-rows: 26px;
  gap: 5px;
  min-width: 0;
}

.profile-player-spacer,
.profile-player-card {
  min-height: 108px;
}

.profile-player-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  text-align: center;
}

.profile-player-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #b91c1c;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.profile-add-card {
  place-items: center;
  align-content: center;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-add-card.searching {
  justify-items: stretch;
  align-content: start;
  text-align: left;
}

.profile-search-field {
  position: relative;
  display: grid;
  gap: 5px;
  width: 180px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-empty-bar {
  opacity: 0.25;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #d7f1f1;
  border: 2px solid #a7dada;
  color: var(--ink);
  font-weight: 1000;
}

.profile-avatar.small {
  width: 42px;
  height: 42px;
  margin: 0 auto 4px;
  font-size: 0.86rem;
}

.profile-player-card strong {
  font-size: 0.9rem;
  line-height: 1.05;
}

.profile-player-card span {
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
}

.profile-player-card small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.1;
}

.profile-metric-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 850;
  padding-right: 4px;
  white-space: nowrap;
}

.profile-bar-row {
  display: flex;
  align-items: center;
}

.profile-bar-track {
  position: relative;
  width: 100%;
  height: 22px;
  background: #d7dcdf;
  overflow: visible;
}

.profile-midline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(0, 0, 0, 0.28);
  z-index: 2;
}

.profile-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 2px;
  background: var(--profile-fill-color, #aeb7bb);
}

.profile-bar-row.above .profile-bar-fill {
  background: var(--profile-fill-color, #df1428);
}

.profile-bar-row.below .profile-bar-fill {
  background: var(--profile-fill-color, #2f6db2);
}

.profile-bar-row.average .profile-bar-fill {
  background: var(--profile-fill-color, #aeb7bb);
}

.profile-bar-row.missing .profile-bar-track {
  background: repeating-linear-gradient(135deg, #e5e7eb, #e5e7eb 4px, #f8fafc 4px, #f8fafc 8px);
}

.profile-bar-row.missing .profile-bar-fill {
  background: transparent;
}

.profile-score {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #aeb7bb;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 1000;
  line-height: 1;
  z-index: 3;
}

.profile-bar-row.above .profile-score {
  background: #d7192e;
}

.profile-bar-row.below .profile-score {
  background: #2f6db2;
}

.raw-profile-comparison .profile-comparison-header {
  align-items: start;
}

.profile-raw-grid .profile-label-column,
.profile-raw-grid .profile-player-column {
  grid-auto-rows: 28px;
}

.profile-raw-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.profile-raw-stat.best {
  background: #e6f3e8;
  box-shadow: inset 4px 0 0 #a8d9b3;
}

.threshold-input {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 74px;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.threshold-input input {
  min-height: 28px;
  width: 74px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 4px 5px;
  text-align: right;
}

.admin-import-table th,
.admin-import-table td,
.admin-record-table th,
.admin-record-table td {
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
}

.admin-record-table .select-column {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-inline: 6px;
  text-align: center;
}

.admin-record-table .select-column input {
  width: 16px;
  height: 16px;
}

.admin-record-table tbody tr:nth-child(even) {
  background: #f8fafb;
}

.admin-record-table td:nth-child(2),
.admin-record-table td:nth-child(3) {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.admin-table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 4px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-table-pager > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-table-pager button {
  min-height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 5px 9px;
  color: var(--ink);
  font-weight: 900;
}

.record-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 9px;
  font-weight: 900;
}

.record-actions button:last-child {
  border-color: #fecaca;
  color: #b91c1c;
}

.admin-import-table td:nth-child(4),
.admin-import-table td:nth-child(5) {
  text-align: left;
  white-space: nowrap;
}

.admin-import-table th:nth-child(1),
.admin-import-table td:nth-child(1) {
  width: 320px;
}

.admin-import-table th:nth-child(2),
.admin-import-table td:nth-child(2) {
  width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-import-table th:nth-child(3),
.admin-import-table td:nth-child(3) {
  width: 90px;
  white-space: nowrap;
}

.admin-import-table th:nth-child(4),
.admin-import-table td:nth-child(4) {
  width: 110px;
}

.admin-import-table th:nth-child(5),
.admin-import-table td:nth-child(5) {
  width: 150px;
}

.admin-import-table th:nth-child(6),
.admin-import-table td:nth-child(6),
.admin-import-table th:nth-child(7),
.admin-import-table td:nth-child(7) {
  width: 90px;
  white-space: nowrap;
}

.admin-import-table th:nth-child(8),
.admin-import-table td:nth-child(8) {
  width: 150px;
  white-space: nowrap;
}

.admin-import-table td:last-child,
.admin-import-table th:last-child {
  width: 74px;
  text-align: center;
}

.admin-import-table strong {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-sort-header {
  width: 100%;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: 900;
  text-align: left;
}

.admin-import-actions {
  display: flex;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.admin-import-modal-body {
  display: grid;
  gap: 12px;
}

.admin-modal-upload {
  min-height: 128px;
}

.admin-modal-paste textarea {
  min-height: 180px;
}

.play-import-cell,
.import-count-cell {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.import-count-cell {
  grid-template-columns: auto auto;
}

.play-import-cell span,
.import-count-cell span {
  font-weight: 800;
  white-space: nowrap;
}

.play-import-cell .warning-text {
  grid-column: 1 / -1;
}

.raw-import-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.raw-import-status.saved {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: var(--success);
}

.raw-import-status.legacy {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.raw-import-status.missing {
  border-color: #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
}

.warning-text {
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 800;
}

.trash-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  font-size: 1rem;
  line-height: 1;
}

.trash-button:hover {
  background: #fef2f2;
}

.trash-button.small {
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
}

.reprocess-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #fecdd3;
  background: #fff;
  color: var(--accent);
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 900;
}

.reprocess-button:hover {
  background: rgba(190, 18, 60, 0.08);
}

.reprocess-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.reprocess-button.small {
  width: 28px;
  height: 28px;
}

.admin-team-row input {
  width: 18px;
  height: 18px;
}

.admin-team-row span,
.admin-import-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-team-row strong,
.admin-import-row strong {
  overflow-wrap: anywhere;
}

.admin-team-row small,
.admin-import-row small {
  color: var(--muted);
  font-weight: 700;
}

.inline-admin-field {
  display: grid;
  gap: 4px;
  max-width: 360px;
}

.inline-admin-field input {
  min-height: 36px;
  border: 1px solid var(--line);
  padding: 7px 9px;
}

.inline-admin-field select {
  min-height: 130px;
  border: 1px solid var(--line);
  padding: 6px;
}

.user-profile-row {
  align-items: start;
}

.admin-team-row em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-import-row button,
.admin-form button {
  min-height: 38px;
  border: 1px solid #b91c1c;
  background: #fff;
  color: #b91c1c;
  padding: 8px 11px;
  font-weight: 900;
}

.admin-form {
  display: grid;
  gap: 12px;
  max-width: 460px;
}

.admin-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-form input:not([type="checkbox"]),
.admin-form select {
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.admin-form select[multiple] {
  min-height: 168px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: none;
}

.admin-form.wide {
  max-width: 720px;
}

.setting-row {
  max-width: 720px;
}

.compact-setting {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ink);
  text-transform: none;
}

.compact-setting input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin-top: 2px;
}

.compact-setting strong {
  display: block;
  font-size: 0.9rem;
}

.compact-setting small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.table-wrap {
  display: none;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.25;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  background: #e5e5e5;
  color: #161616;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
  z-index: 1;
}

#statsTable .sticky-id {
  position: sticky;
  left: var(--sticky-left, 0);
  width: var(--sticky-width, auto);
  min-width: var(--sticky-width, auto);
  max-width: var(--sticky-width, auto);
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--line), 7px 0 10px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#statsTable thead .sticky-id {
  top: 0;
  z-index: 4;
  background: #e5e5e5;
}

#statsTable tbody tr:nth-child(even) .sticky-id {
  background: #f8fafb;
}

#statsTable tbody tr:hover .sticky-id,
#statsTable tbody tr:nth-child(even):hover .sticky-id {
  background: #f3f4f6;
}

.sort-header {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  text-transform: inherit;
  white-space: nowrap;
}

.team-link,
.table-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  padding: 0;
  font: inherit;
  font-weight: 900;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  vertical-align: bottom;
}

.table-link {
  font-weight: 800;
}

.player-name-link {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 4px;
}

.player-identity-cell {
  display: inline-grid;
  min-width: 0;
  max-width: 100%;
  gap: 2px;
  vertical-align: middle;
}

.player-identity-cell > span:first-child {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 4px;
}

.mobile-player-team {
  display: none;
}

.trend-badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1;
  vertical-align: middle;
}

.trend-badge.hot {
  border-color: rgb(193 18 31 / 0.45);
}

.trend-badge.cold {
  border-color: rgb(126 136 255 / 0.55);
}

.mobile-tooltip {
  position: fixed;
  z-index: 100;
  max-width: min(300px, calc(100vw - 20px));
  border: 1px solid #2b2b2b;
  background: #111;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
  padding: 8px 10px;
  pointer-events: none;
  text-align: left;
}

.mobile-tooltip::after {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: #111;
  border-right: 1px solid #2b2b2b;
  border-bottom: 1px solid #2b2b2b;
  content: "";
}

.mobile-tooltip.below::after {
  top: -6px;
  bottom: auto;
  border: 0;
  border-left: 1px solid #2b2b2b;
  border-top: 1px solid #2b2b2b;
}

td.stat-heat {
  background-clip: padding-box;
}

td.stat-heat.hot {
  background-color: rgb(193 18 31 / var(--heat-alpha));
  color: #111111;
}

td.stat-heat.cold {
  background-color: rgb(126 136 255 / var(--heat-alpha));
  color: #111111;
}

tbody tr:nth-child(even) td.stat-heat.hot {
  background-color: rgb(193 18 31 / var(--heat-alpha));
}

tbody tr:nth-child(even) td.stat-heat.cold {
  background-color: rgb(126 136 255 / var(--heat-alpha));
}

tbody tr:hover {
  background: #f1f1f1;
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

tbody tr:nth-child(even):hover {
  background: #f1f1f1;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 20, 38, 0.62);
  z-index: 1000;
}

.modal-backdrop[aria-hidden="false"] {
  display: flex;
}

.modal-panel {
  display: flex;
  flex-direction: column;
  width: min(1060px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.alias-edit-panel {
  width: min(720px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 10px;
  border-bottom: 4px solid var(--accent);
  background: var(--navy);
  color: #fff;
}

.modal-header .eyebrow {
  color: #bdbdbd;
}

.modal-tabs {
  margin: 0;
  padding-inline: 16px;
  background: #242424;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px 24px 24px;
}

.alias-edit-form {
  max-width: none;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-actions button {
  min-height: 38px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  font-weight: 900;
}

.modal-actions button[type="button"] {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.modal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-summary span {
  border: 1px solid var(--line);
  background: #fafafa;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.baseball-card {
  border: 2px solid var(--ink);
  background: linear-gradient(135deg, #fff 0%, #f4f4f4 58%, #fff 100%);
  padding: 16px;
  display: grid;
  gap: 14px;
  max-width: 860px;
}

.baseball-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 4px solid var(--red);
  padding-bottom: 12px;
}

.baseball-card-header h3 {
  margin: 2px 0 0;
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.baseball-card-header h3 small {
  font-size: 0.9rem;
  color: var(--red);
}

.baseball-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.baseball-card-link-action {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  padding: 6px 9px;
  text-transform: uppercase;
}

.baseball-card-header > strong {
  border: 2px solid var(--ink);
  color: var(--red);
  background: #fff;
  padding: 7px 9px;
  font-size: 1.1rem;
}

.baseball-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

.baseball-card-grid article {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.baseball-card-grid span,
.baseball-card-footer strong {
  display: block;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.baseball-card-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.baseball-card-trends,
.player-detail-trends {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

.trend-pill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.trend-pill.hot {
  border-left: 4px solid var(--red);
}

.trend-pill.cold {
  border-left: 4px solid #4f7fc3;
}

.trend-pill span {
  grid-row: span 2;
  font-size: 1rem;
}

.trend-pill strong {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.trend-pill small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.baseball-card-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.baseball-card-footer div {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.baseball-card-team-list {
  display: grid;
  gap: 2px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.baseball-card-team-list span {
  display: block;
}

.baseball-card-career {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  overflow-x: auto;
}

.baseball-card-career .panel-title {
  margin-bottom: 6px;
}

.baseball-card-subtitle {
  margin-top: 12px;
}

.compact-season-table {
  min-width: 860px;
  font-size: 0.76rem;
}

.compact-season-table th,
.compact-season-table td {
  padding: 5px 7px;
  white-space: nowrap;
}

.compact-season-table th:first-child,
.compact-season-table td:first-child {
  text-align: left;
  min-width: 78px;
}

.compact-season-table th:nth-child(2),
.compact-season-table td:nth-child(2) {
  text-align: left;
  min-width: 150px;
  max-width: 210px;
  white-space: normal;
  line-height: 1.15;
}

.compact-season-table th:nth-child(3),
.compact-season-table td:nth-child(3) {
  min-width: 44px;
}

.compact-season-table .season-combined-row td {
  background: #fff3f3;
  border-top: 1px solid #e2b8b8;
  color: #4b1d1d;
  font-weight: 500;
}

.admin-season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-season-card {
  border: 1px solid var(--line);
  background: #fafafa;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.admin-season-card small {
  color: var(--muted);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.analytics-grid h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.usage-table {
  min-width: 0;
  border: 1px solid var(--line);
}

.usage-heatmap-wrap {
  overflow: auto;
  max-width: 100%;
}

.usage-heatmap {
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.usage-heatmap th,
.usage-heatmap td {
  padding: 7px 9px;
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
}

.usage-heatmap thead th:first-child,
.usage-heatmap tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel);
  text-align: left;
}

.usage-heatmap thead th:first-child {
  z-index: 2;
}

.usage-heatmap tbody th {
  min-width: 180px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.pitching-share-table {
  min-width: 620px;
}

.pitching-share-table tfoot th,
.pitching-share-table tfoot td {
  border-top: 2px solid var(--ink);
  background: #f2f3f4;
  font-weight: 800;
}

.pitching-share-table tfoot th {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
}

.heat-cell {
  background: color-mix(in srgb, var(--accent) var(--heat, 0%), #fff);
  color: color-mix(in srgb, var(--ink) 82%, #fff);
  font-weight: 600;
}

.heat-cell:empty {
  background: #fff;
}

.game-log-wrap {
  overflow: auto;
}

.game-log-wrap .usage-table {
  min-width: 1120px;
}

.game-log-table {
   width: 100%;
   border-collapse: collapse;
   table-layout: fixed;
}

.game-log-table th,
.game-log-table td {
  box-sizing: border-box;
  white-space: nowrap;
  vertical-align: middle;
}

.game-log-table thead th {
   padding: 7px 9px;
   text-align: center;
}

.game-log-table th:first-child,
.game-log-table td:first-child {
   width: 92px;
}

.game-log-table th:nth-child(2),
.game-log-table td:nth-child(2),
.game-log-table th:nth-child(3),
.game-log-table td:nth-child(3) {
   width: 150px;
   text-align: left;
}

.game-log-table th:not(:first-child):not(:nth-child(2)):not(:nth-child(3)),
.game-log-table td:not(:first-child):not(:nth-child(2)):not(:nth-child(3)) {
   text-align: center;
}

.game-log-table thead .sort-header {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: inherit;
}

.contact-panel {
  display: grid;
  gap: 14px;
}

.contact-field {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 2 / 3;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.contact-field-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.contact-grass {
  fill: #eef4f7;
  stroke: #667c8c;
  stroke-width: 1.2;
}

.contact-foul,
.contact-arc,
.contact-infield,
.contact-mound {
  fill: none;
  stroke: #667c8c;
  stroke-width: 1.2;
}

.contact-foul {
  stroke-dasharray: 4 4;
  opacity: 0.72;
}

.contact-infield {
  fill: rgba(157, 178, 196, 0.18);
}

.contact-mound,
.contact-base {
  fill: #9db2c4;
  stroke: #667c8c;
  stroke-width: 0.8;
}

.contact-zone {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 66px;
  min-height: 50px;
  border: 1px solid color-mix(in srgb, var(--accent) calc(var(--zone, 8) * 0.9%), var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) calc(var(--zone, 8) * 0.5%), rgba(255, 255, 255, 0.94));
  color: var(--ink);
  text-align: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  padding: 6px 8px;
}

.contact-zone strong {
  font-size: 0.72rem;
  font-weight: 950;
}

.contact-zone span {
  font-size: 1.05rem;
  font-weight: 950;
}

.contact-zone small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
}

.usage-table tfoot td {
  position: sticky;
  bottom: 0;
  border-top: 2px solid var(--line);
  background: #fafafa;
  color: var(--ink);
  font-weight: 800;
}

.activity-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent-2);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  cursor: help;
}

.team-source-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 55%, #fff);
  border-radius: 999px;
  padding: 0 5px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
  box-shadow: 0 1px 0 rgba(154, 52, 18, 0.08);
}

.jersey-number-inline {
  color: var(--accent-2);
  font-size: 0.82em;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.usage-table th,
.usage-table td {
  text-align: left;
}

.usage-heatmap th,
.usage-heatmap td {
  text-align: center;
}

.usage-heatmap thead th:first-child,
.usage-heatmap tbody th {
  text-align: left;
}

.usage-heatmap .sort-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
}

.game-picker {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.game-picker label {
  display: grid;
  gap: 6px;
  max-width: 560px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.game-picker select {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  text-transform: none;
}

.game-picker p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.play-filter-tabs {
  display: flex;
  margin: 0 0 12px;
}

.play-feed .modal-summary {
  margin-bottom: 12px;
}

.pitch-sequence-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.pitch-sequence-legend strong,
.pitch-sequence-legend b {
  color: var(--ink);
  font-weight: 950;
}

.box-score-grid {
  display: grid;
  gap: 22px;
}

.box-score-team {
  display: grid;
  gap: 10px;
}

.box-score-team h3,
.box-score-team h4 {
  margin: 0;
}

.box-score-team h3 {
  font-size: 1.05rem;
}

.box-score-team h4 {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.box-score-table-wrap {
  overflow: auto;
}

.box-score-table {
  min-width: 1040px;
}

.empty-note {
  margin: 0;
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
}

.empty-note.compact {
  padding: 12px;
  font-size: 0.9rem;
}

.report-panel {
  display: none;
  gap: 12px;
}

.report-controls {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.report-control-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  gap: 10px;
}

.report-control-options {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 6px 14px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.report-controls [hidden] {
  display: none !important;
}

.report-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-controls .inline-toggle {
  display: flex;
  align-items: center;
  min-height: 28px;
  gap: 7px;
  font-size: 0.68rem;
}

.report-controls .inline-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.report-controls select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 9px;
}

.report-controls select:disabled {
  background: #f3f4f6;
  color: var(--muted);
}

#reportLineupAvailableSelect {
  min-height: 132px;
  font-size: 0.82rem;
}

#reportLineupAvailableLabel {
  grid-column: 1 / -1;
}

#generateReportBtn,
#printReportBtn {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  padding: 0 14px;
}

#generateReportBtn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.print-report,
.report-page,
.report-section {
  display: grid;
  gap: 12px;
}

.report-page {
  border: 1px solid var(--line);
  background: #fff;
  padding: 18px;
}

.report-header {
  display: grid;
  grid-template-columns: minmax(260px, 440px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border-bottom: 4px solid var(--accent);
  padding-bottom: 10px;
}

.report-header img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.report-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.report-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.report-stat-card {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  padding: 10px;
}

.report-stat-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-stat-card strong {
  color: var(--accent-2);
  font-size: 1.3rem;
  line-height: 1;
}

.report-stat-card small {
  color: var(--muted);
  font-weight: 700;
}

.report-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.report-two-col > .report-section {
  align-content: start;
  align-self: start;
}

.report-section h2 {
  margin: 0;
  border-bottom: 2px solid #111;
  padding-bottom: 4px;
  font-size: 1rem;
  text-transform: uppercase;
}

.report-matchup-notes {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  background: #f8fafb;
  padding: 10px 12px;
}

.report-matchup-notes p {
  margin: 0;
  color: #111;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.report-matchup-section {
  break-before: page;
  page-break-before: always;
}

.report-h2h-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.report-h2h-card {
  display: grid;
  gap: 6px;
  align-content: start;
}

.report-h2h-card h3 {
  margin: 0;
  border-bottom: 1px solid #111;
  padding-bottom: 3px;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.report-spray-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: start;
  gap: 8px;
}

.report-spray-group {
  display: grid;
  gap: 8px;
}

.report-spray-group h3 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.report-spray-card {
  display: grid;
  gap: 5px;
  align-content: start;
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px;
}

.report-spray-card h4 {
  margin: 0;
  border-bottom: 1px solid #111;
  padding-bottom: 2px;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.report-spray-card .contact-field {
  width: min(100%, 150px);
}

.report-spray-card .contact-zone {
  min-width: 28px;
  min-height: 24px;
  padding: 2px 3px;
}

.report-spray-card .contact-zone strong {
  font-size: 0.45rem;
}

.report-spray-card .contact-zone span {
  font-size: 0.62rem;
}

.report-spray-card .contact-zone small {
  display: none;
}

.report-spray-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.report-heading-note {
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 800;
  text-transform: none;
}

.report-mini-table,
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.report-mini-table th,
.report-mini-table td,
.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 5px 6px;
  text-align: right;
  vertical-align: top;
}

.report-mini-table th:first-child,
.report-mini-table td:first-child,
.report-mini-table th:nth-child(2),
.report-mini-table td:nth-child(2),
.report-table th:first-child,
.report-table td:first-child {
  text-align: left;
}

.report-leader-list {
  display: grid;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

.report-leader-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 72px;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 5px 6px;
}

.report-leader-head {
  background: #f3f4f6;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-leader-row span:nth-child(2) {
  min-width: 0;
  overflow-wrap: break-word;
}

.report-leader-row strong {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.report-table.compact {
  font-size: 0.8rem;
}

.cohort-matrix-wrap {
  width: 100%;
  overflow-x: auto;
}

.cohort-matrix-table {
  width: auto;
  min-width: 0;
  table-layout: fixed;
}

.cohort-matrix-table th,
.cohort-matrix-table td {
  padding: 3px 4px;
  text-align: left;
  vertical-align: middle;
}

.cohort-matrix-table th:first-child,
.cohort-matrix-table td:first-child {
  width: 145px;
  min-width: 145px;
}

.cohort-matrix-table th:not(:first-child),
.cohort-matrix-table td:not(:first-child) {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  text-align: center;
}

.cohort-sort-button {
  display: grid;
  gap: 1px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.cohort-matrix-table th:not(:first-child) .cohort-sort-button {
  justify-items: center;
  text-align: center;
  font-size: 0.62rem;
  line-height: 1.05;
}

.cohort-sort-button small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: none;
}

.cohort-sort-button.active {
  color: var(--accent);
}

.cohort-season-cell {
  min-width: 88px;
  white-space: normal;
}

.cohort-season-cell small {
  display: inline;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.cohort-play-icon {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  vertical-align: middle;
}

.cohort-play-icon.yes {
  color: var(--muted);
}

.cohort-play-icon.no {
  color: var(--muted);
}

.cohort-team-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  vertical-align: middle;
}

.cohort-team-badge {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  vertical-align: middle;
}

.cohort-team-badge.color-black { background: #111; border-color: #111; }
.cohort-team-badge.color-red { background: #dc2626; border-color: #991b1b; }
.cohort-team-badge.color-white { background: #fff; border-color: #9ca3af; }
.cohort-team-badge.color-grey { background: #9ca3af; border-color: #6b7280; }
.cohort-team-badge.color-blue { background: #2563eb; border-color: #1e3a8a; }
.cohort-team-badge.color-green { background: #16a34a; border-color: #14532d; }
.cohort-team-badge.color-gold { background: #f59e0b; border-color: #92400e; }
.cohort-team-badge.color-orange { background: #ea580c; border-color: #9a3412; }
.cohort-team-badge.color-navy { background: #1e3a8a; border-color: #172554; }
.cohort-team-badge.color-other { background: #cbd5e1; border-color: #94a3b8; }
.cohort-team-badge.color-star {
  background: #fff7cc;
  border-color: #d97706;
  color: #92400e;
}

.cohort-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cohort-matrix-legend span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.cohort-team-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 14px;
  padding: 0 3px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
  vertical-align: middle;
}

.lineup-recommendation-table th:first-child,
.lineup-recommendation-table td:first-child {
  width: 48px;
  text-align: center;
}

.lineup-slot-matrix {
  font-size: 0.72rem;
}

.lineup-slot-matrix th,
.lineup-slot-matrix td {
  text-align: center;
}

.lineup-slot-matrix th:first-child,
.lineup-slot-matrix td:first-child {
  min-width: 150px;
  text-align: left;
}

.lineup-slot-matrix small {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.report-jersey-number {
  color: var(--accent-2);
  font-size: 0.86em;
  font-weight: 950;
  white-space: nowrap;
}

.report-trend-table th,
.report-trend-table td {
  text-align: left;
}

.report-notes {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.report-trend {
  display: inline-block;
  min-width: 42px;
  border: 1px solid var(--line);
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.report-trend.hot {
  border-color: #f3a2a8;
  background: #ffe5e7;
  color: #9f0712;
}

.report-trend.cold {
  border-color: #b9c4ff;
  background: #e8ecff;
  color: #263a9b;
}

.trend-scope {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--line);
  padding: 2px 6px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.trend-scope.on-team {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.trend-scope.other-team {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.report-player-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.report-player-chip {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: #fff;
  padding: 8px 9px;
}

.report-player-chip strong {
  font-size: 0.86rem;
}

.report-player-chip span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-player-chip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: 0;
    border: 0;
  }

  .sidebar {
    grid-template-columns: 1fr;
    border-right: 0;
    border-bottom: 4px solid var(--accent);
  }

  .sidebar-note {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    margin: -14px -14px 0;
    padding: 12px 14px;
  }

  .tabs {
    margin-inline: -14px;
  }

  .summary-strip {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .games-page-header,
  .games-page-layout {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .games-calendar {
    max-height: 260px;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
  }

  .contact-field {
    width: min(100%, 390px);
  }

  .contact-zone {
    min-width: 54px;
    min-height: 44px;
    padding: 5px 6px;
  }

  .contact-zone span {
    font-size: 0.92rem;
  }

  .contact-zone small {
    font-size: 0.56rem;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpis,
  .dashboard-visuals,
  .dashboard-grid,
  .import-grid,
  .report-controls,
  .report-header,
  .report-summary-grid,
  .report-two-col,
  .report-spray-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card-wide {
    grid-column: span 1;
  }

  .admin-processing-status {
    grid-template-columns: 1fr;
  }

  .admin-processing-metrics {
    justify-content: flex-start;
  }

  .admin-profile-toolbar {
    grid-template-columns: 1fr;
  }

  .profile-selection-strip {
    grid-template-columns: 1fr;
  }

  .profile-comparison-header {
    align-items: start;
    flex-direction: column;
  }

  .profile-grid {
    grid-template-columns: 100px repeat(var(--profile-cols), minmax(140px, 1fr));
  }

  .profile-search-results {
    max-width: calc(100vw - 48px);
  }

  .profile-metric-label {
    font-size: 0.72rem;
  }

  .visibility-transfer {
    grid-template-columns: 1fr;
  }

  .visibility-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 0;
    background: var(--page);
  }

  .login-view {
    align-items: start;
    padding: 14px;
  }

  .login-panel {
    width: 100%;
    min-width: 0;
    margin-top: 18px;
    padding: 18px;
  }

  .sidebar {
    padding: 8px 12px;
    gap: 6px;
  }

  .brand-header {
    width: min(360px, 96vw);
    max-height: 92px;
  }

  .login-brand {
    width: min(220px, 76vw);
    max-width: 100%;
  }

  .sidebar .intro {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .content {
    padding: 10px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -10px -10px 0;
    padding: 10px;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  }

  .topbar > div:first-child {
    display: grid;
    gap: 2px;
  }

  .topbar .eyebrow {
    margin-bottom: 0;
    font-size: 0.58rem;
  }

  h2,
  .topbar h2 {
    font-size: 1.15rem;
    line-height: 1.1;
  }

  .summary-strip div {
    padding: 6px 7px;
  }

  .summary-strip span {
    font-size: 0.98rem;
  }

  .summary-strip small {
    font-size: 0.56rem;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: stretch;
    gap: 6px;
  }

  .global-season-control {
    min-width: 0;
  }

  .global-season-control select {
    width: 100%;
    min-width: 0;
    max-width: none;
    font-size: 0.78rem;
  }

  .data-status-chip {
    grid-column: 1 / -1;
    min-height: 28px;
    justify-content: center;
    padding: 5px 8px;
    font-size: 0.62rem;
  }

  #rebuildCacheBtn {
    display: none;
  }

  .icon-command {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.72rem;
  }

  .tabs {
    flex-wrap: nowrap;
    margin: 0 -10px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.72rem;
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .toolbar label,
  .toolbar .toolbar-check {
    min-width: 0;
    font-size: 0.66rem;
  }

  .toolbar input,
  .toolbar select,
  #exportBtn,
  #exportGameLogBtn {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    font-size: 0.82rem;
  }

  #searchInput,
  .toolbar label:has(#searchInput),
  .toolbar label:has(#teamFilterInput) {
    grid-column: 1 / -1;
  }

  .toolbar .toolbar-check {
    justify-content: start;
    padding: 0 8px;
  }

  .table-view-controls,
  .table-pagination {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .table-view-controls > div,
  .table-pagination > div {
    flex-wrap: wrap;
  }

  .table-wrap {
    margin-inline: -10px;
    border-left: 0;
    border-right: 0;
  }

  table {
    min-width: 620px;
  }

  th,
  td {
    padding: 6px 7px;
    font-size: 0.72rem;
  }

  thead th {
    font-size: 0.58rem;
  }

  #statsTable .sticky-id {
    max-width: var(--sticky-width, 176px);
  }

  .team-link,
  .table-link,
  .player-name-link {
    max-width: 100%;
  }

  #statsTable.mobile-combined-identity th:nth-child(2),
  #statsTable.mobile-combined-identity td:nth-child(2) {
    display: none;
  }

  .player-identity-cell {
    width: 100%;
  }

  .player-identity-cell > span:first-child {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 3px;
  }

  .mobile-player-team {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
  }

  .dashboard-panel {
    gap: 10px;
  }

  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .dashboard-kpi {
    padding: 9px;
  }

  .dashboard-kpi strong {
    font-size: 1.1rem;
  }

  .dashboard-kpi small {
    font-size: 0.66rem;
  }

  .dashboard-visuals,
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dashboard-card,
  .import-card {
    padding: 10px;
  }

  .dashboard-card-title {
    display: grid;
    gap: 2px;
  }

  .dashboard-card-title h3 {
    font-size: 0.82rem;
  }

  .dashboard-card-title small {
    font-size: 0.68rem;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .games-page-header {
    padding: 10px;
  }

  .games-calendar {
    max-height: none;
  }

  .scoreboard-grid {
    grid-template-columns: 1fr;
  }

  .game-score-card {
    min-height: 0;
  }

  .modal-backdrop {
    align-items: stretch;
    padding:
      env(safe-area-inset-top, 0)
      0
      env(safe-area-inset-bottom, 0);
    overflow: hidden;
  }

  .modal-panel,
  .alias-edit-panel {
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    min-height: calc(100dvh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    border: 0;
  }

  .modal-header {
    padding: 12px 14px 8px;
  }

  .modal-header h2 {
    font-size: 1.08rem;
  }

  .modal-tabs {
    flex-wrap: nowrap;
    padding-inline: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }

  .modal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .baseball-card {
    padding: 10px;
  }

  .baseball-card-header {
    display: grid;
    gap: 8px;
  }

  .profile-grid {
    grid-template-columns: 78px repeat(var(--profile-cols), minmax(126px, 1fr));
    overflow-x: auto;
  }

  .profile-metric-label {
    font-size: 0.66rem;
  }

  .profile-player-card strong {
    font-size: 0.78rem;
  }

  .profile-player-card span,
  .profile-player-card small {
    font-size: 0.58rem;
  }

  .admin-import-toolbar,
  .admin-inline-actions,
  .report-control-main,
  .report-control-options {
    grid-template-columns: 1fr;
  }

  .report-panel,
  .admin-panel,
  .import-panel {
    min-width: 0;
  }
}

@media print {
  body {
    background: #fff;
    padding: 0;
  }

  .login-view,
  .sidebar,
  .topbar,
  .tabs,
  .toolbar,
  #teamStatsTabs,
  .report-controls,
  .dashboard-panel,
  .import-panel,
  .admin-panel,
  .table-wrap,
  .empty-state,
  .mobile-tooltip {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .content,
  .report-panel {
    display: block !important;
    min-height: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
    padding: 0;
  }

  .print-report {
    display: block;
  }

  .report-page {
    display: block;
    border: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  .report-header {
    grid-template-columns: 220px 1fr;
    gap: 10px;
  }

  .report-header img {
    max-height: 68px;
  }

  .report-header h1 {
    font-size: 20pt;
  }

  .report-header p {
    font-size: 10.5pt;
  }

  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .report-stat-card {
    break-inside: avoid;
    padding: 8px;
  }

  .report-stat-card span {
    font-size: 8.5pt;
  }

  .report-stat-card strong {
    font-size: 15pt;
  }

  .report-stat-card small {
    font-size: 9.5pt;
  }

  .report-section {
    display: block;
    break-inside: avoid-page;
    margin-bottom: 10px;
    page-break-inside: avoid;
  }

  .report-section > h2,
  .report-h2h-card > h3 {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .report-section > h2 + *,
  .report-h2h-card > h3 + * {
    break-before: avoid-page;
    page-break-before: avoid;
  }

  .report-stat-table-section {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .report-matchup-section {
    break-before: page;
    break-inside: auto;
    page-break-before: always;
    page-break-inside: auto;
  }

  .report-matchup-section .report-section {
    break-inside: auto;
    page-break-inside: auto;
  }

  .report-matchup-section .report-two-col > .report-section {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .report-matchup-section .report-two-col {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .report-matchup-section .report-table {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .report-matchup-section .report-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-matchup-section .report-table:not(.compact) {
    font-size: 7.6pt;
    table-layout: auto;
  }

  .report-matchup-section .report-table:not(.compact) th,
  .report-matchup-section .report-table:not(.compact) td {
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .report-matchup-section .report-table:not(.compact) th:first-child,
  .report-matchup-section .report-table:not(.compact) td:first-child {
    max-width: 1.5in;
    white-space: normal;
  }

  .report-h2h-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    break-before: avoid-page;
    page-break-before: avoid;
  }

  .report-h2h-card {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .report-h2h-card:first-child {
    break-before: avoid-page;
    page-break-before: avoid;
  }

  .report-h2h-card h3 {
    font-size: 10pt;
  }

  .report-spray-section {
    break-before: page;
    break-inside: auto;
    page-break-before: always;
    page-break-inside: auto;
  }

  .report-spray-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 6px;
  }

  .report-spray-card {
    break-inside: avoid-page;
    page-break-inside: avoid;
    padding: 4px;
  }

  .report-spray-group h3 {
    font-size: 10pt;
  }

  .report-spray-card h4 {
    font-size: 7pt;
  }

  .report-spray-card .contact-field {
    width: 1.18in;
  }

  .report-spray-card .contact-zone {
    min-width: 0.22in;
    min-height: 0.18in;
    padding: 1px 2px;
  }

  .report-spray-card .contact-zone strong {
    font-size: 4.5pt;
  }

  .report-spray-card .contact-zone span {
    font-size: 6pt;
  }

  .report-spray-card .contact-zone small {
    display: none;
  }

  .report-spray-card p {
    font-size: 6pt;
  }

  .report-section h2 {
    font-size: 12pt;
  }

  .report-heading-note {
    font-size: 8.5pt;
   }

  .report-table,
  .report-mini-table {
    font-size: 10pt;
    width: 100%;
  }

  .report-mini-table th,
  .report-mini-table td,
  .report-table th,
  .report-table td {
    line-height: 1.22;
    overflow-wrap: break-word;
    padding: 5px 6px;
    word-break: normal;
  }

  .report-mini-table,
  .report-table.compact,
  .report-trend-table {
    table-layout: auto;
  }

  .report-mini-table {
    table-layout: fixed;
  }

  .report-leader-list {
    font-size: 10pt;
  }

  .report-leader-row {
    grid-template-columns: 0.72in minmax(0, 1fr) 0.65in;
    gap: 8px;
    padding: 4px 5px;
  }

  .report-leader-head {
    font-size: 8pt;
  }

  .report-table.compact {
    font-size: 10pt;
  }

  .report-table:not(.compact) {
    font-size: 7.6pt;
    table-layout: auto;
  }

  .lineup-report-page .report-table:not(.compact) {
    font-size: 8.5pt;
  }

  .lineup-slot-matrix:not(.compact) {
    font-size: 7.2pt;
    table-layout: fixed;
  }

  .lineup-slot-matrix th,
  .lineup-slot-matrix td {
    padding: 3px 2px;
  }

  .lineup-slot-matrix small {
    font-size: 5.8pt;
  }

  .lineup-recommendation-table {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .report-table:not(.compact) th,
  .report-table:not(.compact) td {
    overflow-wrap: normal;
    padding: 3px 3px;
    white-space: nowrap;
  }

  .report-stat-table-section .report-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-stat-table-section .report-table th:first-child,
  .report-stat-table-section .report-table td:first-child {
    max-width: 1.5in;
    white-space: normal;
  }

  .report-notes {
    font-size: 10.5pt;
  }

  .report-trend {
    min-width: 48px;
    font-size: 8.5pt;
  }

  .report-player-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-player-chip {
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 6px 7px;
  }

  .report-player-chip strong {
    font-size: 9.5pt;
  }

  .report-player-chip span {
    font-size: 7.5pt;
  }

  .report-player-chip p {
    font-size: 8.3pt;
  }

  @page {
    size: letter landscape;
    margin: 0.35in;
  }
}
/* Dedicated player detail page */
.detail-page-shell {
  background: var(--page-bg);
  align-items: flex-start;
}

.player-detail-page {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.detail-brand {
  width: min(360px, 56vw);
  height: auto;
  object-fit: contain;
}

.player-detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--ink);
  padding: 18px;
}

.player-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 14px;
}

.player-detail-hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.player-detail-hero h1 span {
  font-size: 0.55em;
}

.player-detail-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.player-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-detail-hero > strong {
  border: 2px solid var(--ink);
  padding: 8px 10px;
  font-size: 1.25rem;
}

.player-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.player-detail-trends {
  margin: -4px 0 16px;
}

.player-detail-stat {
  border: 1px solid var(--border);
  padding: 10px;
  min-height: 72px;
}

.player-detail-stat span,
.player-detail-stat small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.player-detail-stat strong {
  display: block;
  margin-top: 7px;
  font-size: 1.25rem;
}

.player-detail-section {
  margin-top: 18px;
}

.player-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
}

.player-detail-table {
  min-width: 820px;
}

.player-detail-table th,
.player-detail-table td {
  white-space: nowrap;
}

.career-total-row th,
.career-total-row td {
  border-top: 2px solid var(--border-strong);
  background: #f4f4f4;
  font-weight: 900;
}

.season-total-row th,
.season-total-row td {
  background: #f7fbf8;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

@media (max-width: 640px) {
  .player-detail-page {
    width: 100%;
    padding: 8px 12px 28px;
  }

  .detail-topbar {
    align-items: flex-start;
  }

  .detail-brand {
    width: 190px;
  }

  .player-detail-card {
    padding: 12px;
  }

  .player-detail-hero {
    gap: 10px;
  }

  .player-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.player-link-id {
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
}
#gamechangerPanel { min-width:0;grid-template-columns:minmax(0,1fr); }
#gamechangerPanel > *,#gcSourceDetail { min-width:0; }
.gc-connection-heading { display:flex;align-items:center;justify-content:space-between;gap:16px; }
.gc-connection-heading h3 { margin:4px 0; }
#gcConnectionStatus { font-size:13px;font-weight:700;color:#2d6462; }
.gc-connection-form { display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:16px 0;border-bottom:1px solid var(--line); }
.gc-connection-form label { display:grid;gap:6px;flex:0 1 330px;min-width:0; }
.gc-connection-form label[hidden], .gc-connection-form button[hidden] { display:none; }
.gc-connection-form label span { font-size:12px;font-weight:700; }
.gc-connection-form input { width:100%;min-width:0;height:38px;padding:7px 9px;border:1px solid var(--line);font:inherit; }
.gc-connection-form button { min-height:38px;padding:8px 14px;border:1px solid #c8102e;background:#c8102e;color:#fff;font:inherit;font-size:12px;font-weight:800;cursor:pointer; }
.gc-connection-form button.secondary { border-color:#172232;background:#fff;color:#172232; }
.gc-connection-form button:disabled { opacity:0.5;cursor:default; }
.gc-table-scroll { overflow:auto; }
.gc-table-scroll table { min-width:540px;width:100%; }
.gc-table-scroll th,.gc-table-scroll td { text-align:left;white-space:normal;overflow-wrap:anywhere; }
.gc-sources { margin-top:20px;border-top:1px solid var(--line);padding-top:16px;min-width:0; }
.gc-sources[hidden] { display:none; }
.gc-source-form { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:end; }
.gc-source-form label,.gc-source-picker label { display:grid;gap:6px;min-width:0;font-size:12px;font-weight:700; }
.gc-sources input,.gc-sources select { width:100%;min-width:0;height:38px;border:1px solid var(--line);padding:7px 9px;font:inherit;background:#fff; }
.gc-sources button { min-height:38px;padding:8px 14px;border:1px solid #c8102e;background:#c8102e;color:#fff;font:inherit;font-size:12px;font-weight:800;cursor:pointer; }
.gc-sources button.secondary { background:#fff;color:#172232;border-color:#172232; }
.gc-sources button:disabled { opacity:0.5;cursor:default; }
.gc-source-picker { display:flex;gap:12px;align-items:end;margin:24px 0 16px; }
.gc-source-picker label { flex:1; }
.gc-source-heading { display:flex;gap:12px;align-items:baseline;flex-wrap:wrap; }
.gc-access-list { display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px; }
.gc-access { padding:6px 8px;background:#fff0ed;color:#8b2630;font-size:12px;overflow-wrap:anywhere; }
.gc-access.is-ok { background:#e6f2e9;color:#205c35; }
.gc-sources small { display:block;font-size:11px;max-width:360px; }
.gc-preview-controls { display:flex;align-items:center;flex-wrap:wrap;gap:10px; }
.gc-preview-controls[hidden] { display:none; }
.gc-preview-controls button { min-height:36px;padding:7px 12px;border:1px solid var(--accent);background:var(--accent);color:#fff;font:inherit;font-size:12px;font-weight:800; }
.gc-preview-controls button.secondary { border-color:var(--ink);background:#fff;color:var(--ink); }
.gc-preview-controls button:disabled { opacity:0.5;cursor:default; }
.gc-preview-result { min-width:0;border-top:1px solid var(--line);padding-top:16px;margin-top:12px; }
.gc-preview-result details { margin-top:14px; }
.gc-preview-result summary { cursor:pointer;font-size:12px;font-weight:700; }
.gc-preview-result pre { max-height:320px;overflow:auto;padding:12px;background:var(--soft);font-size:12px; }
.gc-player-link { padding:0;border:0;background:transparent;color:#075785;font:inherit;font-weight:700;text-align:left;text-decoration:underline; }
.gc-player-link:disabled { opacity:0.6;cursor:default; }
.gc-player-preview { min-width:0;margin:18px 0;padding:14px 0;border-top:2px solid var(--ink);border-bottom:1px solid var(--line);scroll-margin-top:160px; }
.gc-player-preview .gc-source-heading { justify-content:space-between; }
.gc-close-preview { width:30px;height:30px;border:1px solid var(--line);background:#fff;color:var(--ink);font-size:22px;line-height:1; }
.gc-player-stat-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px; }
.gc-player-stat-grid > section { min-width:0; }
.gc-game-selector { display:grid;gap:6px;max-width:760px;margin:12px 0;font-size:12px;font-weight:700; }
.gc-game-selector select { width:100%;min-width:0;min-height:38px;padding:7px;border:1px solid var(--line);background:#fff;color:var(--ink); }
.gc-game-preview { min-width:0;margin-bottom:18px; }
.gc-json-actions { display:flex;gap:10px;flex-wrap:wrap;margin:12px 0; }
.gc-json-actions button { padding:8px 12px;border:1px solid var(--accent);background:var(--accent);color:#fff;font:inherit;font-size:12px;font-weight:700; }
.gc-json-actions button.secondary { background:#fff;color:var(--ink);border-color:var(--ink); }
@media(max-width:700px) { .gc-player-stat-grid { grid-template-columns:minmax(0,1fr); } }
@media(max-width:700px) { .gc-source-form { grid-template-columns:minmax(0,1fr); } .gc-source-picker { flex-wrap:wrap; } .gc-source-picker label { flex-basis:100%; } }
