/* Phase 17 workflow structure. The retired route palette and timing-tower layer are gone;
   presentation comes from frozen tokens and ds-components.css. Kept here are only structures shared
   by auth/admin, Director Steps 0-10, the 96-track record and the public report document. */
@layer legacy, tokens, base, components;
@layer components {
.tt-auth {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--ds-container-max);
  margin-inline: auto;
  padding-inline: var(--ds-gutter-phone);
  padding-block: var(--ds-space-2xl) var(--ds-space-5xl);
}

.tt-auth > h1 {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 3rem);
  text-align: center;
}

.tt-auth__status {
  min-height: 1.5em;
  margin: 0.75rem auto 1.5rem;
  color: var(--ds-text-secondary);
  font-weight: 700;
  text-align: center;
}

.tt-auth__content {
  display: grid;
  gap: var(--ds-space-lg);
}

/* Mounted product views add a neutral wrapper element. Grid items default to
   min-width:auto, which lets a padded child enlarge the whole mobile page.
   Keep every mounted view inside the shared page column. */
.tt-auth__content > * {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.tt-auth__button {
  justify-self: center;
  min-height: 3rem;
  padding: var(--ds-space-md) var(--ds-space-lg);
  border: 1px solid var(--ds-border-control);
  border-radius: 0.5rem;
  color: var(--ds-text-primary);
  background: var(--ds-surface-control);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tt-auth__button--primary {
  border-color: var(--ds-action-primary);
  color: var(--ds-surface-app);
  background: var(--ds-action-primary);
}

.tt-auth__button:focus-visible{
  outline: 3px solid var(--ds-action-primary);
  outline-offset: 3px;
}

.tt-auth__button:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

.tt-auth__link {
  justify-self: start;
  color: var(--ds-text-primary);
  font-weight: 700;
  text-decoration: none;
}

.tt-auth__link:hover {
  text-decoration: underline;
}

.subnav {
  display: flex;
  gap: var(--ds-space-xs);
  flex-wrap: wrap;
  padding: var(--ds-space-xs);
  border: 1px solid var(--ds-border-strong);
  border-radius: 0.7rem;
  background: var(--ds-surface-raised);
  width: fit-content;
}

.subnav__tab {
  padding: var(--ds-space-sm) var(--ds-space-lg);
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ds-text-secondary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.subnav__tab:hover {
  background: var(--ds-surface-control);
  color: var(--ds-status-warning);
}

.subnav__tab[aria-current="page"] {
  background: var(--ds-engine-150);
  color: var(--ds-engine-on-fill);
}

.subnav__tab:focus-visible {
  outline: 3px solid var(--ds-action-primary);
  outline-offset: 2px;
}
.mastery-badge { display: inline-flex; align-items: center; width: fit-content; padding: .16rem .48rem; border: 1px solid var(--ds-live-on); border-radius: 999px; background: var(--mastery-color); color: var(--ds-live-on); font-size: .76rem; font-weight: 900; line-height: 1.2; text-shadow: 0 1px 2px var(--ds-scrim); }
.delta-badge { color: var(--delta-color); font-weight: 900; font-variant-numeric: tabular-nums; }
.tt-standing__track-label { display: inline-flex; align-items: center; gap: .55rem; white-space:normal; }
.tt-standing__track-cup { width: 2rem; height: 2rem; object-fit: contain; }
.tt-standing__track-copy { display:grid; gap:.18rem; width:fit-content; padding:.25rem .4rem; border-radius:.35rem; background:var(--ds-surface-raised); color:var(--ds-text-primary); border:1px solid var(--ds-border-subtle); }
.tt-standing__track-copy small { color:var(--ds-text-secondary); opacity:1; }


.activity-list__thumb {
  position: relative;
  display: block;
  overflow: hidden;
}

.activity-list__art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--ds-radius-none);
}

.activity-list__cup {
  position: absolute;
  top: var(--ds-space-xs);
  left: var(--ds-space-xs);
  z-index: 1;
  width: 1.4rem;
  height: 1.4rem;
}

.activity-list__track-label {
  position: absolute;
  left: var(--ds-space-xs);
  right: var(--ds-space-xs);
  bottom: var(--ds-space-xs);
  align-items: flex-end;
}

.activity-list__track-copy {
  min-width: 0;
  background: color-mix(in srgb, var(--ds-surface-app) 84%, transparent);
}

.activity-list__track-copy strong,
.activity-list__track-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-list__thumb > .activity__mode {
  position: absolute;
  top: var(--ds-space-xs);
  right: var(--ds-space-xs);
  min-width: 2.5rem;
  padding: 2px 6px;
  background: var(--ds-engine-150);
  color: var(--ds-engine-on-fill);
  font-size: var(--ds-type-micro-size);
  font-weight: 800;
  text-align: center;
}

.activity-list__thumb > .activity__mode--200 { background: var(--ds-engine-200); }

.profile-controls {
  display: flex;
  gap: var(--ds-space-sm);
  flex-wrap: wrap;
  margin: var(--ds-space-sm) 0;
}

.profile-controls__button[aria-pressed="true"] {
  border-color: var(--ds-action-primary);
  color: var(--ds-status-warning);
}

.platform-mark {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
}

.platform-mark svg { width: 100%; height: 100%; }
.platform-mark--android { color: var(--ds-status-success); }
.platform-mark--windows { color: var(--ds-status-info); }
.platform-mark--web { color: var(--ds-status-info); }
.platform-mark--ios, .platform-mark--macos { color: var(--ds-text-secondary); }
.platform-mark--linux { color: var(--ds-status-warning); }

.tournament-op { display: grid; gap: var(--ds-space-lg); }
.tournament-op__mobile-header,
.tournament-op__step-help,
.tournament-op__switch-legend,
.tournament-op__step-tip { display: none; }
/* The console answers every action here, and the button that asked may be a
   long way down the page, so the answer travels with the operator. */
.tournament-op__status {
  min-height: 1.5em; position: sticky; top: 0; z-index: 5;
  margin: 0; padding: var(--ds-space-sm) var(--ds-space-md); border-radius: var(--ds-radius-none);
  background: var(--rc-panel, var(--ds-surface-raised)); border: 1px solid var(--border, var(--ds-border-subtle));
  box-shadow: 0 6px 18px var(--ds-scrim); overflow-wrap: anywhere;
}
.tournament-op__status:empty { display: none; }
.tournament-op__content { display: grid; gap: var(--ds-space-2xl); min-width: 0; }
.tournament-op__toolbar { display: flex; gap: var(--ds-space-lg); align-items: center; flex-wrap: wrap; }
.tournament-op__stage { color: var(--ds-text-secondary); }
.tournament-op__steps {
  list-style: none; margin: 0; padding: 0 0 var(--ds-space-xs); display: flex;
  flex-wrap: nowrap; gap: var(--ds-space-sm); overflow-x: auto; overscroll-behavior-inline: contain;
}
.tournament-op__step {
  padding: var(--ds-space-xs) var(--ds-space-md); border-radius: 999px; border: 1px solid var(--ds-border-subtle);
  color: var(--ds-text-secondary); font-size: 0.85rem; flex: 0 0 auto;
}
.tournament-op__step--done { border-color: var(--ds-status-success); color: var(--ds-status-success); }
.tournament-op__checkpoint { display: flex; gap: var(--ds-space-md); justify-content: flex-end; flex-wrap: wrap; }
.tournament-op__helpers > summary { cursor: pointer; font-weight: 700; }
.tournament-op__helpers[open] { display: grid; gap: var(--ds-space-lg); }
.tournament-op__panel {
  padding: var(--ds-space-lg); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none);
  background: var(--ds-surface-raised); display: grid; gap: var(--ds-space-md); min-width: 0; max-width: 100%; box-sizing: border-box;
}
.tournament-op__panel h3, .tournament-op__panel h4, .tournament-op__panel h5 { margin: 0; }
.tournament-op__section { display: grid; gap: var(--ds-space-md); min-width: 0; }
.tournament-op__score-guide {
  padding: var(--ds-space-lg);
  border: 1px solid color-mix(in srgb, var(--ds-mode-race-direction) 55%, var(--ds-border-subtle));
  border-inline-start: .35rem solid var(--ds-mode-race-direction);
  border-radius: var(--ds-radius-none);
  background: color-mix(in srgb, var(--ds-mode-race-direction) 9%, var(--ds-surface-raised));
}
.tournament-op__score-guide > h3,
.tournament-op__score-guide > h4,
.tournament-op__score-guide > p { margin: 0; }
.tournament-op__score-guide > h4 { color: var(--ds-mode-race-direction); }
.tournament-op__incoming-card {
  padding: var(--ds-space-lg); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none);
  background: var(--ds-surface-raised); display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--ds-space-md); align-items: end; min-width: 0;
}
.tournament-op__incoming-card > h4,
.tournament-op__incoming-card > p,
.tournament-op__incoming-card > .tournament-op__toolbar { grid-column: 1 / -1; margin: 0; }
.tournament-op__incoming-card > label { display: grid; gap: var(--ds-space-xs); min-width: 0; }
.tournament-op__incoming-card > label > span { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.tournament-op__incoming-card > label > input,
.tournament-op__incoming-card > label > select { width: 100%; box-sizing: border-box; }
.tournament-op__create, .tournament-op__race-form, .tournament-op__manual-form, .tournament-op__guest-form,
.tournament-op__search, .tournament-op__move { display: grid; gap: var(--ds-space-md); }
.tournament-op__recent-roster { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); margin-block: .65rem; }
.tournament-op__recent-roster .tournament-op__hint { margin: 0; }
.tournament-op__recent-roster .tournament-op__hint { flex-basis: 100%; }
.tournament-op__exceptional-roster {
  padding: var(--ds-space-md); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none); background: var(--ds-surface-control);
}
.tournament-op__exceptional-roster > summary { cursor: pointer; font-weight: 700; }
.tournament-op__roster-summary { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); }
.tournament-op__roster-count {
  min-width: 7.5rem; padding: var(--ds-space-sm) var(--ds-space-md); border: 1px solid var(--ds-border-subtle);
  border-radius: 999px; background: var(--ds-surface-control); text-align: center; font-size: .85rem;
}
.tournament-op__roster-count--present { border-color: color-mix(in srgb, var(--ds-status-success) 65%, var(--ds-border-subtle)); color: var(--ds-status-success); }
.tournament-op__roster-count--waiting { border-color: color-mix(in srgb, var(--ds-status-warning) 65%, var(--ds-border-subtle)); color: var(--ds-status-warning); }
.tournament-op__roster-count--absent { border-color: color-mix(in srgb, var(--ds-status-error) 65%, var(--ds-border-subtle)); color: var(--ds-status-error); }
.tournament-op__inactive-filter { display: flex; align-items: center; gap: var(--ds-space-sm); width: fit-content; font-weight: 700; }
.tournament-op__roster-filter { width: min(100%, 30rem); }
.tournament-op__search, .tournament-op__move, .tournament-op__guest-form { grid-template-columns: 1fr auto; align-items: end; }
.tournament-op__guest-form { grid-template-columns: 1fr 1fr auto; }
.tournament-op__field { display: grid; gap: var(--ds-space-xs); font-weight: 600; }
.tournament-op input[type="text"], .tournament-op input[type="search"], .tournament-op input[type="number"],
.tournament-op input[type="date"], .tournament-op input:not([type]), .tournament-op select, .tournament-op textarea {
  padding: var(--ds-space-sm) var(--ds-space-md); border-radius: var(--ds-radius-none); border: 1px solid var(--ds-border-strong);
  background: var(--ds-surface-control); color: var(--ds-text-primary); font: inherit; min-height: 2.5rem; max-width: 100%;
}
.tournament-op__intro, .tournament-op__hint { color: var(--ds-text-secondary); margin: 0; }
.tournament-op__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-sm); }
.tournament-op__list-link { font-weight: 600; }
.tournament-op__list-meta { color: var(--ds-text-secondary); }
.tournament-op__results { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); max-height: 18rem; overflow-y: auto; align-content: start; }
/* ADR-0218: the Players a typed name may mean, each with its context. */
.tournament-roster-choices { display: grid; gap: var(--ds-space-sm); min-width: 0; }
.tournament-roster-choices__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-sm); max-height: 22rem; overflow-y: auto; }
.tournament-roster-choices__item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-sm);
  padding: var(--ds-space-sm); border: 1px solid var(--ds-border-subtle); border-radius: 10px; min-width: 0;
}
.tournament-roster-choices__warning { color: var(--ds-status-warning); font-weight: 600; }
.tournament-roster-candidate { display: flex; align-items: center; gap: var(--ds-space-sm); min-width: 0; flex: 1 1 14rem; }
.tournament-roster-candidate__icon { width: 28px; height: 28px; flex: none; object-fit: contain; }
.tournament-roster-candidate__words { display: grid; min-width: 0; }
.tournament-roster-candidate__context { color: var(--ds-text-secondary); overflow-wrap: anywhere; }
.tournament-roster-review { display: grid; gap: var(--ds-space-sm); min-width: 0; }
.tournament-roster-review__scroll { max-width: 100%; overflow-x: auto; }
.tournament-roster-review__table { width: 100%; border-collapse: collapse; }
.tournament-roster-review__table th, .tournament-roster-review__table td { padding: 4px 6px; text-align: left; vertical-align: top; }
.tournament-roster-review__pick { width: 100%; max-width: 28rem; min-width: 10rem; }
.tournament-op__attendance-board {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-md); align-items: start;
}

/* Step 2 follows the original Manager: a fixed, scrollable desktop status
   board and a separate, unambiguous compact row per player on small screens. */
.tournament-op__status-board {
  min-height: 22.5rem; max-height: 58vh; overflow: auto; border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-none); background: var(--ds-surface-control);
}
.tournament-op__status-board-head,
.tournament-op__status-board-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-sm); min-width: 42rem;
}
.tournament-op__status-board-head {
  position: sticky; top: 0; z-index: 1; padding: var(--ds-space-md); border-bottom: 1px solid var(--ds-border-subtle);
  background: var(--ds-surface-control);
}
.tournament-op__status-board-title { display: grid; gap: 2px; text-align: center; font-weight: 850; }
.tournament-op__status-board-title small { display: flex; justify-content: center; gap: var(--ds-space-sm); color: var(--ds-text-secondary); font-size: .72rem; }
.tournament-op__status-board-title small span { display: inline-flex; align-items: center; gap: 2px; }
.tournament-op__status-board-title small img { display: block; width: 14px; height: 14px; object-fit: contain; }
.tournament-op__status-board-title--present { color: var(--ds-status-success); }
.tournament-op__status-board-title--waiting { color: var(--ds-status-warning); }
.tournament-op__status-board-title--absent { color: var(--ds-status-error); }
.tournament-op__status-board-body { display: grid; gap: var(--ds-space-sm); padding: var(--ds-space-sm); min-width: 42rem; }
.tournament-op__status-board-row { min-height: 4.5rem; }
.tournament-op__status-board-cell {
  min-width: 0; min-height: 4.5rem; display: flex; align-items: center; justify-content: center;
  padding: var(--ds-space-sm); border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-none);
  background: color-mix(in srgb, var(--ds-surface-raised) 72%, transparent); color: var(--ds-text-secondary);
  font: inherit; text-align: center; transition: border-color 140ms ease, background-color 140ms ease;
}
.tournament-op__status-board-cell[role="button"] { cursor: pointer; }
.tournament-op__status-board-cell[role="button"]:hover,
.tournament-op__status-board-cell[role="button"]:focus-visible {
  border-color: var(--ds-mode-race-direction); outline: none; background: color-mix(in srgb, var(--ds-mode-race-direction) 13%, var(--ds-surface-raised)); color: var(--ds-text-primary);
}
.tournament-op__status-board-cell--filled { padding: 2px; border-style: solid; cursor: default; }
.tournament-op__status-board-cell--present.tournament-op__status-board-cell--filled { border-color: color-mix(in srgb, var(--ds-status-success) 60%, var(--ds-border-subtle)); }
.tournament-op__status-board-cell--waiting.tournament-op__status-board-cell--filled { border-color: color-mix(in srgb, var(--ds-status-warning) 60%, var(--ds-border-subtle)); }
.tournament-op__status-board-cell--absent.tournament-op__status-board-cell--filled { border-color: color-mix(in srgb, var(--ds-status-error) 60%, var(--ds-border-subtle)); }
.tournament-op__status-board-cell--filled .tournament-op__participant-card--row { width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
.tournament-op__layout-export { display: grid; gap: var(--ds-space-md); }
.tournament-layout-step__panel {
  min-width: 0; padding: 11px; border: 1px solid var(--ds-border-subtle); border-radius: 10px;
  background: var(--ds-surface-raised); box-sizing: border-box;
}
.tournament-layout-step__export-panel { display: grid; gap: 8px; }
.tournament-layout-step__title { margin: 0; font-size: .9rem; line-height: 1.3; }
.tournament-layout-step__body { display: grid; gap: 8px; min-width: 0; }
.tournament-op__layout-export-preview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--ds-space-md);
  padding: var(--ds-space-md); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-none); background: var(--ds-surface-control);
}
.tournament-op__layout-export-group {
  display: grid; gap: var(--ds-space-sm); padding: var(--ds-space-md); border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius-none); background: var(--ds-surface-selected); color: var(--ds-text-primary);
}
.tournament-op__layout-export-group h4 { margin: 0; color: var(--ds-status-info); }
.tournament-op__layout-export-group p { margin: 0; font-size: .84rem; line-height: 1.4; }
.tournament-op__layout-export-unplaced { color: var(--ds-status-warning); }
.tournament-op__layout-export-audit { padding: var(--ds-space-md); border-left: 3px solid var(--ds-mode-race-direction); background: var(--ds-surface-control); }
.tournament-op__layout-export-audit h4 { margin: 0 0 var(--ds-space-sm); }
.tournament-op__layout-export-audit p { margin: 0; color: var(--ds-text-secondary); }
.tournament-op__layout-export-audit ul { margin: var(--ds-space-sm) 0 0; padding-left: 1.25rem; display: grid; gap: var(--ds-space-sm); }
.tournament-op__roster-rows { display: grid; gap: var(--ds-space-sm); }
.tournament-op__roster-rows--mobile { display: none; }
.tournament-op__roster-mobile-head { display: flex; justify-content: space-between; gap: var(--ds-space-sm); padding: var(--ds-space-sm) 0; font-size: .75rem; }
.tournament-op__roster-mobile-count--present { color: var(--ds-status-success); }
.tournament-op__roster-mobile-count--waiting { color: var(--ds-status-warning); }
.tournament-op__roster-mobile-count--absent { color: var(--ds-status-error); }
.tournament-op__roster-mobile-row { min-width: 0; }
.tournament-op__participant-card--row {
  grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; padding-left: calc(var(--ds-space-sm) + 4px);
}
.tournament-op__participant-card--row .tournament-op__attendance-toggle { min-width: 8.5rem; }
.tournament-op__participant-name-row { display: flex; align-items: center; gap: var(--ds-space-sm); min-width: 0; flex-wrap: wrap; }
.tournament-op__roster-badge {
  padding: 1px var(--ds-space-sm); border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap;
}
.tournament-op__roster-badge--new { background: var(--ds-mode-race-direction); color: var(--ds-action-on-primary); }
.tournament-op__roster-badge--inactive { background: var(--ds-group-talent); color: var(--ds-action-on-primary); }
.tournament-op__roster-badge--rank { background: var(--ds-surface-control); color: var(--ds-text-secondary); }
.tournament-op__gate--ready { background: var(--ds-status-success); border-color: var(--ds-status-success); }
/* Step 3/7 group board: the source Manager's effective basai-brand look. */
.tournament-board { display: grid; grid-template-columns: repeat(var(--group-cols, 1), minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1099px) { .tournament-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }}
@media (max-width: 1099px) { .tournament-board { grid-template-columns: 1fr; }}
.tournament-board__hint {
  display: block;
  margin: 0; color: var(--ds-text-secondary); font-size: 13px; line-height: 1.35; text-align: center;
}
.tournament-board__hint-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px;
  padding: 0 6px; border: 1px solid var(--ds-border-strong); border-radius: 999px;
  background: color-mix(in srgb, var(--ds-surface-control) 70%, var(--ds-status-info) 30%);
  color: var(--ds-text-primary); font-weight: 800; line-height: 1; vertical-align: middle;
}
.tournament-board__group {
  border: 1px solid transparent; border-radius: 10px; padding: 8px; background: var(--ds-surface-control);
  border-image: linear-gradient(90deg, var(--group-border-start), var(--group-border-end)) 1;
}
.tournament-board__group-header { padding: 6px; border: 1px solid var(--ds-border-strong); border-radius: 8px; background: var(--ds-surface-control); }
.tournament-board__group-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tournament-board__group-identity { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tournament-board__group-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.tournament-board__group-title h3 { margin: 0; font-size: 1rem; color: var(--ds-text-primary); }
.tournament-board__badge {
  padding: 2px 6px; border-radius: 999px; border: 1px solid var(--ds-border-strong); font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--ds-surface-control) 70%, var(--ds-status-info) 30%); color: var(--ds-text-primary); white-space: pre; text-transform: uppercase;
}
.tournament-board__legend { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tournament-board__legend-pill {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 999px; font-size: 11px;
  font-weight: 700; border: 1px solid var(--ds-border-strong); background: var(--ds-surface-control); color: var(--ds-text-secondary);
}
.tournament-board__legend-pill--champion { border-color: var(--ds-group-champion); color: var(--ds-group-champion); }
.tournament-board__legend-pill--talent { border-color: var(--ds-group-talent); color: var(--ds-group-talent); }
.tournament-board__legend-pill--wild { border-color: var(--ds-group-wild); color: var(--ds-group-wild); }
.tournament-board__legend-pill--adventure { border-color: var(--ds-tier-advanced); color: var(--ds-tier-advanced); }
.tournament-board__legend-pill--feest { border-color: var(--ds-personal-edge); color: var(--ds-personal-edge); }
.tournament-board__legend-pill--new { border-color: var(--ds-mode-race-direction); color: var(--ds-mode-race-direction); }
.tournament-board__legend-pill--unknown { border-color: var(--ds-tier-beginner); color: var(--ds-tier-beginner); }
.tournament-board__legend-pill--inactive { opacity: .45; }
.tournament-board__slots { display: grid; gap: 8px; margin-top: 8px; }
.tournament-board__slot { border: 1px dashed var(--ds-border-strong); border-radius: 8px; padding: 6px; background: var(--ds-surface-control); min-height: 92px; }
.tournament-board__slot--empty {
  display: flex; align-items: center; justify-content: center; color: var(--ds-text-secondary); font-size: 12px;
  background: color-mix(in srgb, var(--ds-surface-control) 82%, var(--ds-status-info) 18%); border-color: var(--ds-border-strong);
}
.tournament-board__station { border: 1px solid var(--ds-border-strong); border-radius: 8px; padding: 6px; background: var(--ds-surface-control); }
.tournament-board__station-title { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12px; color: var(--ds-text-primary); }
.tournament-board__station-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.tournament-board__station-chip img { width: 16px; height: 16px; object-fit: contain; flex: 0 0 16px; }
.tournament-board__station-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tournament-board__utp { font-size: 11px; color: var(--ds-text-secondary); white-space: nowrap; }
.tournament-board__handle {
  padding: 2px 6px; border: 1px solid var(--ds-border-strong); border-radius: 6px; cursor: grab; font: inherit; font-size: 12px;
  background: color-mix(in srgb, var(--ds-surface-control) 70%, var(--ds-status-info) 30%); color: var(--ds-text-primary);
}
.tournament-board__handle:hover { border-color: var(--ds-status-info); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-status-info) 38%, transparent); }
.tournament-board__handle:active { cursor: grabbing; }
.tournament-board__park {
  height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--ds-status-info) 60%, var(--ds-border-strong) 40%);
  background: color-mix(in srgb, var(--ds-status-info) 14%, var(--ds-surface-selected) 86%); color: var(--ds-text-primary);
}
.tournament-board__seat {
  min-height: 72px; border: 1px dashed var(--ds-border-strong); border-radius: 10px; background: var(--ds-surface-control); margin-bottom: 6px;
  display: flex; align-items: stretch; justify-content: stretch; position: relative; overflow: hidden;
  transition: outline-color .15s ease, border-color .15s ease;
}
.tournament-board__seat-hint { font-size: 12px; color: var(--ds-text-secondary); text-align: center; margin: auto; pointer-events: none; }
/* The empty seat and the empty Switch slot: a dashed invitation with a "+". */
.tournament-board__add {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 100%;
  padding: 10px; border: 1px dashed var(--ds-border-strong); border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--ds-surface-control) 88%, var(--ds-status-info) 12%); color: var(--ds-text-secondary); font: inherit; font-size: 15px; font-weight: 600;
}
.tournament-board__add:hover, .tournament-board__add:focus-visible { border-color: var(--ds-status-info); color: var(--ds-text-primary); background: color-mix(in srgb, var(--ds-surface-control) 80%, var(--ds-status-info) 20%); }
.tournament-board__add--slot { min-height: 80px; }
.tournament-board__add-plus {
  display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem;
  border: 1px solid var(--ds-status-info); border-radius: 5px; color: var(--ds-status-info); font-size: 13px; line-height: 1; font-weight: 700;
}
.tournament-board__slot--empty:has(.tournament-board__add) { padding: 6px; justify-content: stretch; }
.tournament-board__seat:has(.tournament-board__add) { border-style: solid; }
/* The source's ✕: the participant or the Switch leaves the Tournament. */
.tournament-board__remove {
  width: 22px; height: 22px; min-width: 22px; padding: 0; border-radius: 999px; cursor: pointer; line-height: 1;
  border: 1px solid color-mix(in srgb, var(--ds-status-error) 65%, var(--ds-border-strong) 35%);
  background: color-mix(in srgb, var(--ds-status-error) 20%, var(--ds-surface-selected) 80%); color: var(--ds-text-body); font: inherit; font-size: 12px; font-weight: 900;
}
.tournament-board__remove:hover { border-color: color-mix(in srgb, var(--ds-status-error) 78%, var(--ds-border-strong) 22%); background: color-mix(in srgb, var(--ds-status-error) 30%, var(--ds-surface-selected) 70%); }
/* "Toevoegen": the sheet an empty seat or slot opens. */
.tournament-add-sheet {
  position: fixed; z-index: 31; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(720px, 100vw); max-height: min(86vh, 760px); overflow-y: auto;
  border: 1px solid var(--ds-border-strong); border-bottom: 0; border-radius: 16px 16px 0 0;
  background: var(--ds-surface-app); box-shadow: 0 -18px 48px var(--ds-scrim); color: var(--ds-text-primary);
}
.tournament-add-sheet__head {
  position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--ds-surface-control); border-bottom: 1px solid var(--ds-border-strong);
}
.tournament-add-sheet__plus { color: var(--ds-status-info); font-size: 20px; font-weight: 700; line-height: 1; }
.tournament-add-sheet__head h3 { margin: 0; font-size: 20px; text-align: center; }
.tournament-add-sheet__kind { color: var(--ds-text-secondary); font-size: 16px; }
.tournament-add-sheet__close { padding: 6px 0 6px 12px; border: 0; background: none; color: var(--ds-text-primary); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.tournament-add-sheet__body { display: grid; gap: 12px; padding: 14px; }
.tournament-add-sheet__target {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--ds-border-strong); border-radius: 12px;
  background: color-mix(in srgb, var(--ds-surface-control) 90%, var(--ds-status-info) 10%); font-size: 16px;
}
.tournament-add-sheet__group { padding: 4px 12px; border-radius: 999px; background: var(--ds-live); color: var(--ds-live-on); font-weight: 800; }
.tournament-add-sheet__place { flex: 1 1 auto; }
.tournament-add-sheet__to-parking {
  padding: 8px 12px; border: 1px solid var(--ds-border-strong); border-radius: 10px; background: var(--ds-surface-selected); color: var(--ds-text-primary); font: inherit; font-size: 14px; cursor: pointer;
}
.tournament-add-sheet__to-parking:disabled { opacity: .45; cursor: not-allowed; }
.tournament-add-sheet__tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.tournament-add-sheet__tab {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 8px 10px;
  border: 1px solid var(--ds-border-strong); border-radius: 12px; background: var(--ds-surface-control); color: var(--ds-text-primary); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.tournament-add-sheet__tab[aria-pressed="true"] { border-color: var(--ds-status-info); background: color-mix(in srgb, var(--ds-surface-control) 70%, var(--ds-status-info) 30%); box-shadow: 0 0 0 1px var(--ds-status-info) inset; }
.tournament-add-sheet__tab-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 5px;
  background: var(--ds-surface-selected); color: var(--ds-status-info); font-size: 14px; font-weight: 800;
}
.tournament-add-sheet__form { display: grid; gap: 10px; }
.tournament-add-sheet__label { color: var(--ds-text-secondary); font-size: 14px; font-weight: 600; }
.tournament-add-sheet__select, .tournament-add-sheet__input {
  width: 100%; min-height: 52px; padding: 10px 14px; border: 1px solid var(--ds-border-strong); border-radius: 12px;
  background: var(--ds-surface-control); color: var(--ds-text-primary); font: inherit; font-size: 17px;
}
.tournament-add-sheet__switches {
  display: grid; gap: 10px; padding: 12px 14px; border: 1px dashed var(--ds-border-strong); border-radius: 12px;
  background: color-mix(in srgb, var(--ds-surface-control) 90%, var(--ds-status-info) 10%);
}
.tournament-add-sheet__check { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 16px; }
.tournament-add-sheet__check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ds-status-info); }
.tournament-add-sheet__hint { margin: 0; color: var(--ds-text-secondary); font-size: 13px; }
.tournament-add-sheet__primary {
  min-height: 60px; border: 1px solid var(--ds-border-strong); border-radius: 12px; background: var(--ds-surface-selected); color: var(--ds-text-primary);
  font: inherit; font-size: 20px; font-weight: 800; cursor: pointer;
}
.tournament-add-sheet__primary:disabled { opacity: .45; cursor: not-allowed; }
/* The CSV row, folded under the phone's title. */
.tournament-op__csv { border: 1px solid var(--ds-border-strong); border-radius: 12px; background: color-mix(in srgb, var(--ds-surface-control) 92%, var(--ds-status-info) 8%); padding: 0; }
.tournament-op__csv-summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-size: 16px; font-weight: 700; list-style: none; }
.tournament-op__csv-summary::-webkit-details-marker { display: none; }
.tournament-op__csv-summary::before { content: "▸"; color: var(--ds-text-secondary); font-size: 12px; }
.tournament-op__csv[open] > .tournament-op__csv-summary::before { content: "▾"; }
.tournament-op__csv-icon {
  width: 18px; height: 18px; border-radius: 3px; background:
    linear-gradient(var(--ds-status-success), var(--ds-status-success)) 0 0 / 100% 100%,
    repeating-linear-gradient(0deg, transparent 0 4px, color-mix(in srgb, var(--ds-text-primary) 10%, transparent) 4px 5px),
    repeating-linear-gradient(90deg, transparent 0 5px, color-mix(in srgb, var(--ds-text-primary) 10%, transparent) 5px 6px);
  background-blend-mode: normal;
}
.tournament-op__csv-step { color: var(--ds-text-secondary); font-weight: 600; }
.tournament-op__csv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px; }
.tournament-op__csv > .tournament-op__hint { padding: 0 14px 10px; margin: 6px 0 0; }
@media (max-width: 599px) { .tournament-op__csv-actions { grid-template-columns: 1fr; }}
/* Admin Acties: the source footer. */
.tournament-op__admin { margin-top: 14px; border: 1px solid var(--ds-border-strong); border-radius: 12px; background: var(--ds-surface-selected); padding: 10px 12px; }
.tournament-op__admin > summary { cursor: pointer; font-weight: 800; letter-spacing: .01em; padding: 2px 0; }
.tournament-op__admin[open] > summary { margin-bottom: 8px; }
.tournament-op__admin-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 8px; align-items: start; min-width: 0; }
.tournament-op__admin-hint { grid-column: 1 / -1; margin: 0 0 2px; }
.tournament-op__admin-section { margin: 0; padding: 10px; border: 1px solid var(--ds-border-strong); border-radius: 10px; background: var(--ds-surface-control); display: grid; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.tournament-op__admin-section h4 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tournament-op__admin-badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--ds-border-strong);
  font-size: 11px; font-weight: 700; color: var(--ds-text-secondary); background: color-mix(in srgb, var(--ds-surface-selected) 84%, var(--ds-status-info) 16%);
}
.tournament-op__admin-field { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ds-text-secondary); }
.tournament-op__admin-field select { min-height: 44px; }
.tournament-op__admin-reason { margin: 0; }
.tournament-op__admin-history { margin: 0; padding-left: 18px; font-size: 12px; color: var(--ds-text-secondary); display: grid; gap: 2px; }

/* The operator toolbar has a variable number of safe review actions. Its
   former fixed grid let one long action consume the whole phone width and
   collapse the first column. These rules belong only to the operator page. */
.ds-race-direction .tournament-op__toolbar.tournament-op__main-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.ds-race-direction .tournament-op__toolbar.tournament-op__main-toolbar > * {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tournament-equipment-review__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .35rem;
  min-width: 0;
}
.tournament-equipment-review__field :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
}
[data-equipment-review] button {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tournament-board__player {
  display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; border-radius: 10px; padding: 8px 9px;
  background: var(--ds-surface-selected); color: var(--ds-text-primary); position: relative;
}
.tournament-board__player--seat { background: var(--seat-tone-bg, var(--ds-surface-selected)); }
.tournament-board__player--seat::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  background: linear-gradient(180deg, var(--ds-border-subtle), color-mix(in srgb, var(--ds-surface-app) 8%, transparent));
}
.tournament-board__seat--dark .tournament-board__player--seat,
.tournament-board__seat--dark .tournament-board__player-name,
.tournament-board__seat--dark .tournament-board__player-meta { color: var(--ds-engine-on-fill); }
.tournament-board__seat--light .tournament-board__player--seat,
.tournament-board__seat--light .tournament-board__player-name,
.tournament-board__seat--light .tournament-board__player-meta { color: var(--ds-live-on); text-shadow: 0 1px 1px var(--ds-scrim); }
.tournament-board__player-info { display: grid; min-width: 0; flex: 1; }
.tournament-board__player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tournament-board__player-meta { font-size: 11px; }
.tournament-board__player-badges { display: inline-flex; gap: 4px; }
.tournament-board__tier {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 999px; font-size: 11px;
  border: 1px solid color-mix(in srgb, var(--ds-surface-app) 36%, transparent); color: var(--ds-action-on-primary); box-shadow: 0 1px 2px color-mix(in srgb, var(--ds-surface-app) 20%, transparent); white-space: nowrap;
}
.tournament-board__tier--champion { background: var(--ds-group-champion); font-weight: 700; }
.tournament-board__tier--talent { background: var(--ds-group-talent); }
.tournament-board__tier--wild { background: var(--ds-group-wild); }
.tournament-board__tier--adventure { background: var(--ds-tier-advanced); }
.tournament-board__tier--feest { background: var(--ds-personal-edge); }
.tournament-board__tier--new { background: var(--ds-mode-race-direction); font-weight: 700; }
.tournament-board__tier--unknown { background: var(--ds-tier-beginner); }
.tournament-board__dragging { opacity: .65; }
.tournament-board__player[data-selected="true"] { outline: 2px solid var(--ds-status-info); outline-offset: -2px; }
.tournament-board__swap-badge {
  min-width: 2rem; height: 1.5rem; padding: 0 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ds-border-strong); background: color-mix(in srgb, var(--ds-surface-control) 70%, var(--ds-status-info) 30%);
  color: var(--ds-text-primary); font: inherit; font-size: 12px; line-height: 1;
}
.tournament-board__swap-badge:hover { border-color: var(--ds-status-info); }
.tournament-move-sheet {
  position: fixed; z-index: 30; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px)); max-height: min(78vh, 640px); overflow-y: auto;
  display: grid; gap: 8px; padding: 16px; border: 1px solid var(--ds-border-strong); border-radius: 16px;
  background: var(--ds-surface-control); box-shadow: 0 18px 48px var(--ds-scrim);
}
.tournament-move-sheet h3 { margin: 0; font-size: 18px; }
.tournament-move-sheet p { margin: 0; color: var(--ds-text-secondary); font-size: 13px; line-height: 1.35; }
.tournament-move-sheet button { min-height: 42px; }
.tournament-move-sheet__station { margin-top: 4px; color: var(--ds-text-primary); font-weight: 700; }
.tournament-board__drop-hover { outline: 2px solid var(--ds-status-info); outline-offset: -2px; }
.tournament-board__unseated { display: grid; gap: 6px; margin-top: 8px; }
.tournament-board__parking-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1099px) { .tournament-board__parking-panels { grid-template-columns: 1fr; }}
.tournament-board__parking-zone { border: 1px solid var(--ds-border-strong); border-radius: 10px; padding: 10px; background: var(--ds-surface-control); }
.tournament-board__parking-zone h4 { margin: 0 0 4px; font-size: 13px; }
.tournament-board__parking-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.tournament-board__stage-head { display: grid; gap: 2px; margin-top: 4px; }
.tournament-board__section-title { margin: 0; }
.tournament-board__stage-total { margin: 0; color: var(--ds-text-secondary); font-size: 12px; }
.tournament-board__status { font-size: 13px; border-radius: 8px; padding: 6px 8px; border: 1px solid var(--ds-border-strong); }
.tournament-board__status--ready {
  border-color: color-mix(in srgb, var(--ds-status-success) 62%, var(--ds-border-strong) 38%);
  background: color-mix(in srgb, var(--ds-status-success) 14%, var(--ds-surface-control) 86%);
  color: color-mix(in srgb, var(--ds-status-success) 84%, var(--ds-live-on) 16%);
}
.tournament-board__status--warning {
  border-color: color-mix(in srgb, var(--ds-status-warning) 62%, var(--ds-border-strong) 38%);
  background: color-mix(in srgb, var(--ds-status-warning) 14%, var(--ds-surface-control) 86%);
  color: color-mix(in srgb, var(--ds-status-warning) 90%, var(--ds-live-on) 10%);
}
.tournament-op__gate--blocked { opacity: .75; }
.tournament-op__gate-reason { border-left: 3px solid var(--ds-status-warning); padding-left: var(--ds-space-sm); }
.tournament-op__attendance-lane {
  min-width: 0; min-height: 20rem; max-height: 58vh; overflow-y: auto; padding: var(--ds-space-md); border: 1px solid var(--ds-border-subtle);
  border-top: 3px solid var(--ds-text-secondary); border-radius: var(--ds-radius-none); background: var(--ds-surface-control);
  display: grid; gap: var(--ds-space-sm); align-content: start; transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tournament-op__attendance-lane--present { border-top-color: var(--ds-status-success); }
.tournament-op__attendance-lane--waiting { border-top-color: var(--ds-status-warning); }
.tournament-op__attendance-lane--absent { border-top-color: var(--ds-status-error); }
.tournament-op__drop-hint { color: var(--ds-text-secondary); font-size: 0.75rem; }
.tournament-op__participant-card {
  position: relative; overflow: hidden; padding: var(--ds-space-sm); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none);
  background: var(--ds-surface-raised); display: grid; gap: var(--ds-space-sm); min-width: 0;
}
.tournament-op__participant-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ds-text-secondary); }
.tournament-op__participant-card--present { border-color: color-mix(in srgb, var(--ds-status-success) 55%, var(--ds-border-subtle)); background: color-mix(in srgb, var(--ds-status-success) 10%, var(--ds-surface-raised)); }
.tournament-op__participant-card--present::before { background: var(--ds-status-success); }
.tournament-op__participant-card--waiting { border-color: color-mix(in srgb, var(--ds-status-warning) 55%, var(--ds-border-subtle)); background: color-mix(in srgb, var(--ds-status-warning) 10%, var(--ds-surface-raised)); }
.tournament-op__participant-card--waiting::before { background: var(--ds-status-warning); }
.tournament-op__participant-card--absent { border-color: color-mix(in srgb, var(--ds-status-error) 55%, var(--ds-border-subtle)); background: color-mix(in srgb, var(--ds-status-error) 8%, var(--ds-surface-raised)); }
.tournament-op__participant-card--absent::before { background: var(--ds-status-error); }
.tournament-op__participant-header { display: flex; align-items: center; gap: var(--ds-space-sm); min-width: 0; }
.tournament-op__participant-identity { display: grid; min-width: 0; flex: 1; }
.tournament-op__participant-identity strong, .tournament-op__participant-identity small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tournament-op__participant-identity small { color: var(--ds-text-secondary); }
.tournament-op__inactive-badge {
  width: fit-content; margin-top: var(--ds-space-xs); padding: 1px var(--ds-space-sm); border: 1px solid var(--ds-border-strong);
  border-radius: 999px; color: var(--ds-text-secondary); background: color-mix(in srgb, var(--ds-text-primary) 10%, transparent); font-size: .7rem; font-weight: 800;
}
.tournament-op__drag-handle {
  width: 2.75rem; min-width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius-none); background: var(--ds-surface-control); color: var(--ds-text-primary); cursor: grab; font: inherit;
}
.tournament-op__drag-handle:active { cursor: grabbing; }
.tournament-op__participant-actions { display: flex; align-items: center; gap: var(--ds-space-sm); flex-wrap: wrap; }
.tournament-op__participant-actions .tournament-op__remove { margin-left: auto; }
.tournament-op__attendance-toggle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tournament-op__attendance-choice {
  min-height: 2.25rem; padding: var(--ds-space-xs); border: 1px solid var(--ds-border-strong);
  background: var(--ds-surface-control); color: var(--ds-text-secondary); font: inherit; font-weight: 900; cursor: pointer;
}
.tournament-op__attendance-choice:first-child { border-radius: var(--ds-radius-none) 0 0 var(--ds-radius-none); }
.tournament-op__attendance-choice:last-child { border-radius: 0 var(--ds-radius-none) var(--ds-radius-none) 0; }
.tournament-op__attendance-choice--present[aria-pressed="true"] { border-color: var(--ds-status-success); background: color-mix(in srgb, var(--ds-status-success) 28%, var(--ds-surface-control)); color: var(--ds-live-on); }
.tournament-op__attendance-choice--waiting[aria-pressed="true"] { border-color: var(--ds-status-warning); background: color-mix(in srgb, var(--ds-status-warning) 28%, var(--ds-surface-control)); color: var(--ds-live-on); }
.tournament-op__attendance-choice--absent[aria-pressed="true"] { border-color: var(--ds-status-error); background: color-mix(in srgb, var(--ds-status-error) 28%, var(--ds-surface-control)); color: var(--ds-live-on); }
.tournament-op__switch {
  display: inline-flex; align-items: center; gap: var(--ds-space-xs); min-height: 2.25rem;
  padding: var(--ds-space-xs) var(--ds-space-sm); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none); font-weight: 800;
}
.tournament-op__table { display: grid; gap: var(--ds-space-xs); overflow-x: auto; min-width: 0; max-width: 100%; }
.tournament-op__row {
  display: grid; grid-template-columns: minmax(8rem, 1fr) 3.5rem minmax(8rem, 10rem) 3rem 3rem auto;
  gap: var(--ds-space-sm); align-items: center; padding: var(--ds-space-sm) 0; border-bottom: 1px solid var(--ds-border-subtle);
  min-width: 30rem;
}
.tournament-op__row--header { color: var(--ds-text-secondary); font-size: 0.85rem; }
.tournament-op__row--absent .tournament-op__cell-name { color: var(--ds-text-secondary); text-decoration: line-through; }
.tournament-op__row--waiting .tournament-op__cell-name { color: var(--ds-status-warning); }
.tournament-op__remove { padding-block: var(--ds-space-xs); }
.tournament-op__controls { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); }
.tournament-op__groups { display: grid; gap: var(--ds-space-lg); grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr)); }
.tournament-op__group {
  padding: var(--ds-space-lg); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-none);
  background: var(--ds-surface-control); display: grid; gap: var(--ds-space-md); align-content: start;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tournament-op__stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--ds-space-sm); }
.tournament-op__station {
  padding: var(--ds-space-sm); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none);
  background: var(--ds-surface-raised); display: grid; gap: var(--ds-space-xs); min-width: 0;
}
.tournament-op__station h5 { color: var(--ds-mode-race-direction); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tournament-op__seat {
  min-height: 2.75rem; padding: var(--ds-space-sm); border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-none);
  color: var(--ds-text-secondary); display: flex; align-items: center; min-width: 0;
}
.tournament-op__seated-player { color: var(--ds-text-primary); font-weight: 700; width: 100%; cursor: grab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tournament-op__unseated { padding: var(--ds-space-sm); border: 1px solid var(--ds-status-warning); border-radius: var(--ds-radius-none); display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); align-items: center; }
.tournament-op__parking {
  padding: var(--ds-space-md); border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-none);
  background: var(--ds-surface-control); display: grid; gap: var(--ds-space-sm); transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tournament-op__parking-list { min-height: 2.75rem; display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); align-items: center; }
.tournament-op__parked-player {
  min-height: 2.75rem; padding: var(--ds-space-sm) var(--ds-space-md); border: 1px solid var(--ds-border-strong);
  border-radius: 999px; background: var(--ds-surface-raised); color: var(--ds-text-primary); display: inline-flex; align-items: center; font-weight: 700; cursor: grab;
}
.tournament-op__seating, .tournament-op__standings, .tournament-op__races, .tournament-op__order {
  margin: 0; padding-left: var(--ds-space-xl); display: grid; gap: var(--ds-space-xs);
}
.tournament-op__seating, .tournament-op__races { list-style: none; padding-left: 0; color: var(--ds-text-secondary); font-size: 0.9rem; }
.tournament-op__entry summary, .tournament-op__import summary, .tournament-op__manual summary,
.tournament-op__guest summary, .tournament-op__history summary { cursor: pointer; font-weight: 600; }
.tournament-op__manual-grid { display: grid; gap: var(--ds-space-sm); }
.tournament-op__manual-row { display: grid; grid-template-columns: minmax(8rem, 1fr) repeat(auto-fit, minmax(4rem, 6rem)); gap: var(--ds-space-sm); align-items: center; }

/* The score-import row, as the source Manager laid it out: the workbook name
   with its points and match badge on the left, the Player picker on the
   right. On a phone the two stack rather than squeezing a select into a few
   millimetres. */
.tournament-op__match-row {
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 14rem);
  gap: var(--ds-space-md);
  align-items: start;
  padding: var(--ds-space-sm) 0;
  border-top: 1px solid var(--ds-border-subtle);
}

.tournament-op__match-source { display: grid; gap: .15rem; min-width: 0; }
.tournament-op__match-source strong { overflow-wrap: anywhere; }
.tournament-op__match-source p { margin: 0; }

.tournament-op__match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-sm);
  align-items: center;
}

.tournament-op__match-badge {
  padding: .1rem .45rem;
  border: 1px solid currentcolor;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

/* The source's severity vocabulary: settled green, strong blue, likely amber,
   anything left to check red. */
.tournament-op__match-badge--settled { color: var(--ds-status-success); }
.tournament-op__match-badge--strong { color: var(--ds-engine-150); }
.tournament-op__match-badge--likely { color: var(--ds-status-warning); }
.tournament-op__match-badge--attention { color: var(--ds-status-error); }

/* The picker is the one control on this row, so it keeps a coarse-pointer
   target even where the surrounding form uses a denser control height. */
.tournament-op__match-row select { min-height: 2.75rem; }

/* The source's selection counter: an option says how often that Player is
   already taken and is coloured by it. Green is the one correct state, red
   means the same participant answers to two workbook rows. */
.tournament-op__match-option--taken { color: var(--ds-status-success); background: color-mix(in srgb, var(--ds-status-success) 14%, var(--ds-surface-raised)); }
.tournament-op__match-option--duplicate { color: var(--ds-status-error); background: color-mix(in srgb, var(--ds-status-error) 14%, var(--ds-surface-raised)); }

/* A native select can ignore option colours, so the control itself carries the
   state: green once it names exactly one Player of this group, red while it
   names nobody or the same Player as another row. */
/* `.ds-race-direction .tournament-op :is(input, select, textarea)`
   paints every field of the console and has the same specificity as a plain
   `.tournament-op__match-row select.is-once`, so it would win on order alone.
   One more class settles it. */
.tournament-op .tournament-op__match-row select.is-once {
  border-color: var(--ds-status-success); color: var(--ds-text-body); background: color-mix(in srgb, var(--ds-status-success) 14%, var(--ds-surface-raised));
}
.tournament-op .tournament-op__match-row select.is-duplicate,
.tournament-op .tournament-op__match-row select.is-open {
  border-color: var(--ds-status-error); color: var(--ds-text-body); background: color-mix(in srgb, var(--ds-status-error) 14%, var(--ds-surface-raised));
}
.tournament-op .tournament-op__match-row select.is-open { font-style: italic; }

@media (max-width: 599px) {
  .tournament-op__match-row { grid-template-columns: minmax(0, 1fr); }}
/* The step-back control reads as an action, not as a stray link: it is the
   one control that undoes a confirmed step. */
.tournament-op__step-back {
  border-color: var(--ds-status-warning);
  color: var(--ds-status-warning);
}
/* A participant who lends a console without playing: the seating counts the
   console, and the roster says so where the tick was made. */
.tournament-op__roster-badge--lender { background: var(--ds-status-warning); color: var(--ds-action-on-primary); }
/* The detaching return is the one that breaks a score coupling on purpose:
   same family as the step-back, but it must not be mistaken for inspection. */
.tournament-op__step-back--detach {
  border-color: var(--ds-status-error);
  color: var(--ds-status-error);
  border-style: dashed;
}

.tournament-op__toggle { display: flex; gap: var(--ds-space-sm); align-items: center; }
.tournament-op__voided { display: flex; gap: var(--ds-space-sm); align-items: center; }
.tournament-op__preview { display: grid; gap: var(--ds-space-sm); color: var(--ds-text-secondary); }
.tournament-op__export { width: 100%; box-sizing: border-box; font-family: ui-monospace, monospace; }
.tournament-op__history ul { margin: var(--ds-space-sm) 0 0; padding-left: var(--ds-space-xl); color: var(--ds-text-secondary); font-size: 0.85rem; }
.tournament-op__incident-form { display: grid; grid-template-columns: minmax(8rem, 0.7fr) minmax(10rem, 1fr) minmax(14rem, 2fr) auto; gap: var(--ds-space-sm); }
.tournament-op__incident-list, .tournament-op__analytics { margin: 0; padding-left: var(--ds-space-xl); display: grid; gap: var(--ds-space-sm); }
.tournament-op__utp { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--ds-space-sm) var(--ds-space-lg); }
.tournament-op__utp h4 { grid-column: 1 / -1; margin-top: var(--ds-space-sm); }
.tournament-op__utp p { margin: 0; padding: var(--ds-space-sm); border-left: 3px solid var(--ds-mode-race-direction); background: var(--ds-surface-control); }
/* Tournament workflow visual baseline — derived from the active original
   Manager. Functional surfaces keep ecosystem contracts, but every step
   shares the Manager's blue panel, border and control language. */
.tournament-op {
  --tournament-bg: var(--ds-surface-app);
  --tournament-panel: var(--ds-surface-control);
  --tournament-elevated: var(--ds-surface-selected);
  --tournament-line: var(--ds-border-strong);
  --tournament-line-strong: var(--ds-border-strong);
  --tournament-text: var(--ds-text-primary);
  --tournament-soft: var(--ds-text-secondary);
  --tournament-accent: var(--ds-status-info);
  --tournament-accent-alt: var(--ds-status-info);
  --tournament-success: var(--ds-status-success);
  --tournament-warning: var(--ds-status-warning);
  --tournament-danger: var(--ds-status-error);
  color: var(--ds-text-body);
}
.tournament-op__switch img { display: block; width: 20px; height: 20px; object-fit: contain; }
.tournament-op__toolbar,
.tournament-op__panel,
.tournament-op__score-guide,
.tournament-op__incoming-card,
.tournament-op__exceptional-roster,
.tournament-op__group,
.tournament-op__parking,
.tournament-op__layout-export-audit {
  border-color: var(--ds-border-subtle);
  background: var(--ds-surface-raised);
}
.tournament-op__toolbar { padding: var(--ds-space-md); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none); }
.tournament-op__stage,
.tournament-op__intro,
.tournament-op__hint,
.tournament-op__layout-export-audit p,
.tournament-op__history ul { color: var(--ds-text-secondary); }
.tournament-op__score-guide { border-inline-start-color: var(--ds-mode-race-direction); }
.tournament-op__score-guide > h4 { color: var(--ds-mode-race-direction); }
.tournament-op__step { border-color: var(--ds-border-subtle); background: var(--ds-surface-raised); color: var(--ds-text-secondary); }
.tournament-op__step--done { border-color: var(--ds-status-success); color: var(--ds-status-success); }
.tournament-op .tt-auth__button {
  border-color: var(--ds-border-strong); background: var(--ds-surface-selected); color: var(--ds-text-body);
  border-radius: .5rem;
}
.tournament-op .tt-auth__button:hover:not(:disabled) { border-color: var(--ds-mode-race-direction); background: var(--ds-surface-hover); }
.tournament-op .tt-auth__button--primary,
.tournament-op__checkpoint .tt-auth__button { border-color: var(--ds-status-success); background: color-mix(in srgb, var(--ds-status-success) 28%, var(--ds-surface-control)); color: var(--ds-text-primary); }
.tournament-op .tt-auth__button:focus-visible { outline-color: var(--ds-mode-race-direction); }
.tournament-op input[type="text"], .tournament-op input[type="search"], .tournament-op input[type="number"],
.tournament-op input[type="date"], .tournament-op input:not([type]), .tournament-op select, .tournament-op textarea {
  border-color: var(--ds-border-strong); background: var(--ds-surface-control); color: var(--ds-text-body);
}
.tournament-op__station, .tournament-op__seat, .tournament-op__parked-player { border-color: var(--ds-border-subtle); background: var(--ds-surface-control); }
.tournament-op__station h5 { color: var(--ds-mode-race-direction); }
@media (max-width: 599px), (hover: none) and (pointer: coarse) {
  body:has(.tournament-op) .ds-context-bar { display: none; }
  body .ds-race-direction.tournament-op {
    width: 100vw; max-width: none; margin-inline: calc(50% - 50vw);
    padding-inline: 16px; box-sizing: border-box; gap: 10px;
  }
  .tournament-op > .ds-display-4 { display: none; }
  .ds-race-direction.tournament-op .tournament-op__content { gap: 12px; }
  .tournament-op__mobile-header { display: grid; gap: 10px; min-width: 0; }
  .tournament-op__mobile-top {
    display: grid; grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px; align-items: center;
  }
  .tournament-op__mobile-back { grid-column: 1 / -1; width: fit-content; font-size: .9rem; }
  .tournament-op__mobile-title {
    grid-column: 1; text-align: center; font-size: 1.02rem; line-height: 1.2;
  }
  .ds-race-direction.tournament-op .tournament-op__mobile-menu {
    grid-column: 2; width: 44px; min-height: 44px; padding: 0;
    font-size: 1.25rem; line-height: 1;
  }
  .tournament-op__mobile-controls {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px auto;
    gap: 6px; align-items: stretch; min-width: 0;
  }
  .tournament-op__mobile-controls > * { min-height: 40px; box-sizing: border-box; }
  .tournament-op__mobile-square,
  .tournament-op__mobile-previous,
  .tournament-op__mobile-saved {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ds-border-strong); border-radius: 8px;
    background: var(--ds-surface-selected); color: var(--ds-text-body);
    text-align: center; text-decoration: none;
  }
  .tournament-op__mobile-square { padding: 0; font-size: 1.2rem; }
  .tournament-op__mobile-previous { padding: 5px 8px; font-size: .78rem; font-weight: 800; line-height: 1.15; }
  .tournament-op__mobile-save { color: var(--ds-text-secondary); }
  .tournament-op__mobile-saved {
    padding: 5px 7px; border-color: var(--ds-status-success); color: var(--ds-status-success);
    background: transparent; font-size: .72rem; font-weight: 850; white-space: nowrap;
  }
  .tournament-op__mobile-phase {
    width: fit-content; max-width: 100%; margin: 0 auto; padding: 5px 14px;
    border: 1px solid var(--ds-mode-race-direction); border-radius: 999px;
    color: var(--ds-mode-race-direction); background: color-mix(in srgb, var(--ds-mode-race-direction) 8%, transparent);
    font-size: .78rem; font-weight: 900; line-height: 1.2; text-align: center;
  }
  .ds-race-direction.tournament-op .tournament-op__main-toolbar { display: none; }
  .ds-race-direction.tournament-op .tournament-op__main-toolbar[data-mobile-open="true"] {
    display: flex; gap: 8px; padding: 10px; border-radius: 12px;
  }
  .tournament-op__main-toolbar[data-mobile-open="true"] > * { max-width: 100%; }
  .ds-race-direction.tournament-op .tournament-op__steps { display: none; }
  .ds-race-direction.tournament-op .tournament-op__step-two {
    width: 100%; padding: 9px 8px 12px; gap: 10px; border-radius: 16px;
  }
  .tournament-op__step-two > h2 { margin: 0; font-size: 1rem; line-height: 1.25; }
  .tournament-op__step-two > .tournament-op__intro {
    max-width: 31ch; justify-self: center; text-align: center; font-size: .8rem; line-height: 1.35;
  }
  .tournament-op__step-help { display: block; }
  .tournament-op__step-help,
  .tournament-op__step-two-csv {
    width: 100%; box-sizing: border-box; border: 1px solid var(--ds-border-strong);
    border-radius: 12px; background: var(--ds-surface-control); overflow: hidden;
  }
  .tournament-op__step-help > summary {
    min-height: 42px; display: flex; align-items: center; padding: 8px 11px;
    box-sizing: border-box; cursor: pointer; font-size: .86rem; font-weight: 800;
  }
  .tournament-op__step-help > .tournament-op__hint { padding: 0 11px 10px; font-size: .78rem; line-height: 1.4; }
  .tournament-op__switch-legend {
    display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 5px 8px;
    color: var(--ds-text-secondary); font-size: .74rem; line-height: 1.2;
  }
  .tournament-op__switch-legend img { display: block; width: 20px; height: 20px; object-fit: contain; }
  .tournament-op__switch-legend-item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
  .tournament-op__switch-legend-item:first-child { flex: none; white-space: nowrap; }
  .tournament-op__switch-legend-item:last-child { flex: 1 1 auto; }
  .tournament-op__switch-legend-item :is(img, strong) { flex: none; }
  .tournament-op__switch-legend-item + .tournament-op__switch-legend-item::before { content: "·"; margin-right: 1px; }
  .tournament-op__step-tip {
    display: block; margin: 0; color: var(--ds-text-secondary);
    font-size: .75rem; line-height: 1.35; text-align: center;
  }
  .tournament-op__step-two-csv > :not(summary) { margin-inline: 11px; max-width: calc(100% - 22px); }
  .tournament-op__step-two-csv > .tt-auth__button { margin-block: 8px 11px; }
  .tournament-op__step-two-csv .tournament-op__csv-summary { min-height: 42px; padding: 8px 11px; font-size: .86rem; }
  .tournament-op__status-board { display: none; }
  .tournament-op__roster-rows--mobile { display: grid; }
  /* Step 2 on a phone: two Switch boxes and the A/W/X toggle leave no room
     beside them, so the name and rank take the first line on their own and
     the controls the second; the SP score sits under the name. */
  .tournament-op__roster-mobile-row .tournament-op__participant-card--row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; row-gap: var(--ds-space-xs);
  }
  .tournament-op__roster-mobile-row .tournament-op__participant-identity { display: contents; }
  .tournament-op__roster-mobile-row .tournament-op__participant-name-row { grid-column: 1; grid-row: 1; align-self: end; }
  .tournament-op__roster-mobile-row .tournament-op__participant-identity small { grid-column: 1; grid-row: 2; align-self: center; }
  .tournament-op__roster-mobile-row .tournament-op__participant-name-row strong { min-width: 0; flex: 1 1 auto; }
  .tournament-op__roster-mobile-row .tournament-op__attendance-toggle { grid-column: 2; grid-row: 1; justify-self: end; }
  .tournament-op__roster-mobile-row .tournament-op__participant-actions { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .tournament-op__attendance-board {
    grid-template-columns: 1fr;
    min-height: 16.25rem;
    max-height: calc(100dvh - 13.75rem);
    overflow-y: auto;
    padding: var(--ds-space-sm);
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-control);
    overscroll-behavior: contain;
  }
  .tournament-op__attendance-lane { min-height: 0; max-height: none; overflow: visible; }
  .tournament-op__drop-hint, .tournament-op__drag-handle { display: none; }
  .tournament-op__participant-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: var(--ds-space-sm) var(--ds-space-md); }
  .tournament-op__participant-header { grid-column: 1 / -1; }
  .tournament-op__attendance-toggle { min-width: 8.5rem; }
  .tournament-op__participant-actions { justify-content: flex-end; }
  .tournament-op__roster-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tournament-op__roster-count { min-width: 0; padding-inline: var(--ds-space-xs); }
  .tournament-op__panel:not(.tournament-op__step-two) { padding: var(--ds-space-md); }
  .tournament-op__search, .tournament-op__move, .tournament-op__guest-form, .tournament-op__incident-form { grid-template-columns: 1fr; }
  .tournament-op__table { overflow: visible; gap: var(--ds-space-md); }
  .tournament-op__row--header { display: none; }
  .tournament-op__row:not(.tournament-op__row--header) {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--ds-space-sm) var(--ds-space-md);
    padding: var(--ds-space-md);
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-none);
    background: var(--ds-surface-control);
  }
  .tournament-op__cell-name {
    grid-column: 1 / 3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
  }
  .tournament-op__cell-seed { grid-column: 3; color: var(--ds-text-secondary); }
  .tournament-op__attendance { grid-column: 1 / -1; width: 100%; }
  .tournament-op__switch { display: flex; align-items: center; gap: var(--ds-space-sm); }
  .tournament-op__remove { justify-self: end; }
  /* Steps 3/7 follow the APK's single-column board rather than retaining the
     desktop chips and square gradient frames on a narrow touch viewport. */
  .tournament-board__phase { display: none; }
  .tournament-board__hint { padding-inline: 6px; font-size: .78rem; }
  .tournament-board__parking-panels { gap: 10px; }
  .tournament-board__parking-zone { padding: 10px; border-radius: 12px; }
  .tournament-board__stage-head { margin-top: 2px; }
  .tournament-board__section-title { font-size: 1rem; line-height: 1.25; }
  .tournament-board__stage-total { font-size: .76rem; }
  .tournament-board__group {
    padding: 8px; border-color: var(--group-border-start); border-radius: 12px;
    border-image: none; background: var(--ds-surface-raised);
  }
  .tournament-board__group-header { padding: 7px; border-radius: 9px; }
  .tournament-board__group-title { align-items: flex-start; }
  .tournament-board__group-identity { padding-top: 2px; }
  .tournament-board__badge {
    padding: 3px 7px; font-size: .65rem; line-height: 1.15; text-transform: none; white-space: nowrap;
  }
  .tournament-board__legend { display: grid; gap: 2px; margin-top: 7px; }
  .tournament-board__legend-pill {
    width: fit-content; padding: 0; border: 0; border-radius: 0; background: transparent;
    font-size: .72rem; line-height: 1.25;
  }
  .tournament-board__status { margin: 0; }
  .tournament-op__checkpoint > .tt-auth__button { width: 100%; }
}

/* Manager parity: score entry (Steps 5/9) and the cumulative image/export
   checkpoints (Steps 4/6/8/10). These deliberately use the active Manager's
   dense navy race-night surface rather than the generic account cards. */
.tournament-score-step { display: grid; gap: 12px; }
.tournament-score-step__phase {
  width: fit-content; margin: 0 auto; padding: 6px 16px; border: 1px solid var(--ds-border-strong);
  border-radius: 999px; background: var(--ds-surface-selected); color: var(--ds-status-info); font-size: .82rem; font-weight: 900;
}
.tournament-score-step__details {
  border: 1px solid var(--ds-border-strong); border-radius: 9px; background: var(--ds-surface-control); overflow: hidden;
}
.tournament-score-step__details > summary { padding: 11px 12px; cursor: pointer; font-weight: 850; }
/* A grid column without an explicit track takes the min-content width of its
   widest child, and a <select> is as wide as its longest option: at 320 px the
   Excel fold was 546 px wide and the fold (overflow-x: hidden) clipped the
   right half of every block. The column may shrink; the selects follow. */
.tournament-score-step__details-body {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0 12px 12px;
}
.tournament-score-step__details-body select { max-width: 100%; }
.tournament-score-step__tie-modes,
/* The one line above the group blocks: import every reviewed group at once. */
.tournament-score-step__excel-all {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 8px 0 4px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ds-text-primary) 10%, transparent); background: color-mix(in srgb, var(--ds-text-primary) 10%, transparent);
  /* A grid item is as wide as its widest word unless it is told otherwise;
     at 320 px this line was 546 px and the fold clipped half the button. */
  min-width: 0; max-width: 100%;
}
.tournament-score-step__excel-all > button { white-space: normal; max-width: 100%; }
.tournament-score-step__excel-all > p { margin: 0; flex: 1 1 220px; min-width: 0; }
.tournament-score-step__excel-preview { display: grid; gap: 8px; }
.tournament-score-step__tie-card,
.tournament-score-step__excel-group {
  display: grid; gap: 7px; padding: 10px; border: 1px solid var(--ds-border-strong); border-radius: 8px; background: var(--ds-surface-selected);
}
.tournament-score-step__tie-card.is-resolved { border-color: var(--ds-status-success); }
.tournament-score-step__group {
  display: grid; gap: 10px; padding: 10px; border: 1px solid var(--ds-border-strong); border-radius: 10px;
  background: var(--ds-surface-control); box-shadow: inset 3px 0 var(--ds-status-info);
}
.tournament-score-step__group-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tournament-score-step__group-header h4 { margin: 0; color: var(--ds-text-primary); }
.tournament-score-step__group-header span {
  padding: 2px 7px; border: 1px solid var(--ds-border-strong); border-radius: 999px; color: var(--ds-text-secondary); font-size: 11px;
}
.tournament-score-step__errors { display: grid; gap: 7px; color: var(--ds-text-secondary); font-size: .82rem; }
.tournament-score-step__errors select { min-height: 34px; padding-block: 4px; }
.tournament-score-step__error-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tournament-score-step__error-choices .tt-auth__button { width: 100%; min-width: 0; min-height: 40px; padding: 5px; }
.tournament-score-step__error-choices .tt-auth__button[aria-pressed="true"] {
  border-color: var(--ds-status-success); background: color-mix(in srgb, var(--ds-status-success) 18%, var(--ds-surface-control));
}
.tournament-score-step__rows { display: grid; gap: 5px; }
.tournament-score-step__row {
  display: grid; grid-template-columns: 2rem minmax(8rem, 1fr) minmax(8rem, auto) 4rem;
  align-items: center; gap: 7px; min-height: 42px; padding: 5px 7px; border: 1px solid var(--ds-border-strong);
  border-radius: 7px; background: var(--ds-surface-selected);
}
.tournament-score-step__rank { color: var(--ds-status-info); font-weight: 900; font-variant-numeric: tabular-nums; }
.tournament-score-step__parts { display: flex; gap: 5px; justify-content: flex-end; }
.tournament-score-step__parts input { width: 4.2rem; min-height: 34px; padding: 4px 6px; text-align: center; }
.tournament-score-step__row > strong:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tournament-score-step__supplied { margin: 0; color: var(--ds-status-success); font-size: .82rem; }
.tournament-score-step__export-hint { margin: -6px 0 0; }
.tournament-score-step__checkpoint {
  position: sticky; bottom: 8px; z-index: 8; display: grid; gap: 5px; padding: 10px;
  border: 1px solid var(--ds-status-success); border-radius: 10px; background: color-mix(in srgb, var(--ds-surface-raised) 96%, var(--ds-status-success)); box-shadow: 0 10px 28px var(--ds-scrim);
}
.tournament-score-step__checkpoint .tt-auth__button { width: 100%; border-color: var(--ds-status-success); background: color-mix(in srgb, var(--ds-status-success) 28%, var(--ds-surface-control)); }

/* min-width:0 is what makes the overflow-x actually engage: without it the
   flex row keeps its intrinsic width and widens the whole document, which
   the Step 10 probe caught at 360px once a finalized night showed the four
   export tabs (2026-09-15). */
.tournament-export-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin;
  min-width: 0; max-width: 100%;
}
.tournament-export-tabs .tt-auth__button { flex: 0 0 auto; min-height: 36px; padding: 6px 10px; font-size: .78rem; }
.tournament-op__lifecycle { display: grid; gap: 8px; border-radius: 16px; }
.tournament-op__lifecycle > h2 { margin: 0; }
.tournament-op__lifecycle > .tt-auth__button,
.tournament-op__lifecycle-confirmation > .tt-auth__button { width: 100%; min-height: 44px; }
.tournament-op__lifecycle-choice { justify-content: flex-start; text-align: left; }
.tournament-op__lifecycle-choice[aria-pressed="true"] {
  border-color: var(--ds-status-success); background: color-mix(in srgb, var(--ds-status-success) 22%, var(--ds-surface-control));
}
.tournament-op__lifecycle-confirmation { display: grid; gap: 8px; }
.tournament-op__lifecycle-confirmation[hidden] { display: none; }
.tournament-op__lifecycle-confirmation > p { margin: 0; color: var(--ds-status-warning); }
.tournament-op__lifecycle-confirmation > .tt-auth__button--primary {
  border-color: var(--ds-status-success); background: color-mix(in srgb, var(--ds-status-success) 28%, var(--ds-surface-control));
}
.tournament-op__report-tools { border-radius: 10px; }
.tournament-op__report-tools > summary { font-weight: 900; cursor: pointer; }
.tournament-op__report-tools[open] { display: grid; gap: 8px; }
.tournament-op__report-tools > .tt-auth__button { width: 100%; }
.tournament-export-preview {
  overflow: hidden; border: 1px solid var(--ds-border-strong); border-radius: 10px; background: var(--ds-surface-raised); color: var(--ds-text-primary);
}
.tournament-export-preview > header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--ds-border-strong); background: linear-gradient(90deg, var(--ds-surface-selected), var(--ds-surface-selected));
}
.tournament-export-preview > header h4,
.tournament-export-preview > header p { margin: 0; }
.tournament-export-preview > header p { color: var(--ds-status-info); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.tournament-export-preview__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 8px; padding: 9px; }
.tournament-export-preview__group { padding: 9px; border: 1px solid var(--ds-border-strong); border-radius: 8px; background: var(--ds-surface-selected); }
.tournament-export-preview__group h5 { margin: 0 0 8px; color: var(--ds-status-info); font-size: .94rem; }
.tournament-export-preview__station { display: grid; gap: 2px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--ds-border-strong) 60%, transparent); font-size: .78rem; }
.tournament-export-preview__station strong { display: flex; align-items: center; gap: 6px; }
.tournament-export-preview__station strong img { width: 18px; height: 18px; object-fit: contain; }
.tournament-export-preview__station span { color: var(--ds-text-body); }
.tournament-export-preview__warning { color: var(--ds-status-warning); }
.tournament-export-preview__standings { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.tournament-export-preview__standings li {
  display: grid; grid-template-columns: 2rem 1fr auto; gap: 6px; padding: 5px 6px; border-radius: 5px; background: var(--ds-surface-control); font-size: .8rem;
}
.tournament-export-preview__standings li strong { color: var(--ds-status-info); }
.tournament-export-preview__standings li > span { display: grid; gap: 1px; }
.tournament-export-preview__standings li small { color: var(--ds-text-secondary); font-size: .68rem; }
.tournament-export-preview__standings li b { color: var(--ds-status-success); }
/* Where the night stands, in the Director's own ten steps. Quiet on purpose:
   this is context for the lines above it, not another thing shouting. */

/* Step 10 hands over to the writing: its own page, its own kind of work. */
.tournament-op__report-link { display: grid; gap: var(--ds-space-xs); justify-items: start; }

/* Step 10 as a checklist: four numbered parts, each with a status and, under
   every button, one line saying what pressing it does. */
.tournament-op__checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--ds-space-md); counter-reset: step-ten; }
.tournament-op__checklist-item {
  counter-increment: step-ten; display: grid; gap: var(--ds-space-sm); min-width: 0;
  padding: var(--ds-space-md); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-none); background: var(--ds-surface-control);
}
.tournament-op__checklist-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm) var(--ds-space-md); }
.tournament-op__checklist-head h3 { margin: 0; }
.tournament-op__checklist-head h3::before {
  content: counter(step-ten); display: inline-grid; place-items: center; inline-size: 1.6em; block-size: 1.6em;
  margin-inline-end: var(--ds-space-sm); border-radius: 999px; background: var(--ds-mode-race-direction); color: var(--ds-action-on-primary); font-size: .85em;
}
.tournament-op__checklist-status {
  padding: 1px 10px; border-radius: 999px; border: 1px solid var(--ds-border-strong); font-size: .8rem; font-weight: 700; color: var(--ds-text-secondary);
}
.tournament-op__checklist-status--done { border-color: var(--ds-mode-race-direction); color: var(--ds-text-primary); }
.tournament-op__checklist-status--blocked { border-style: dashed; }
.tournament-op__caption { margin: 0; font-size: .85rem; max-width: 60ch; }
.tournament-op__finalize { display: grid; gap: var(--ds-space-sm); justify-items: start; }
/* A finalized night prints its result-set id, one unbreakable token that
   made the whole page 24px wider than a 360px phone; and "Afronding
   terugdraaien" did not wrap either (2026-09-15). */
.tournament-op__finalize > p, .tournament-op__finalize .tournament-op__caption {
  overflow-wrap: anywhere; max-width: 100%;
}
.tournament-op__finalize .tt-auth__button { max-width: 100%; white-space: normal; }
.tournament-op__finalize .tournament-op__preview { justify-self: stretch; }
.tournament-op__readiness { margin: 0; padding-left: 0; list-style: none; display: grid; gap: var(--ds-space-xs); }
/* The standing prints its own placement; no second number from the list. */
.tournament-op__step-ten .tournament-op__standings { list-style: none; padding-left: 0; }
/* The character beside the name in the Step 5/9 standing, the size of a line. */
.tournament-op__standing-character {
  width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; margin-right: 6px;
  border-radius: 5px; background: color-mix(in srgb, var(--ds-text-primary) 10%, transparent);
}
.tournament-op__readiness--complete { color: var(--ds-text-primary); }
.tournament-op__readiness--incomplete { color: var(--ds-status-warning); }
.tournament-op__edition--missing { border-color: var(--ds-status-warning); color: var(--ds-status-warning); }
/* One line on screen, the long version one click away (owner: too much text). */
/* The finalize block is a grid with justify-items:start, so a <details>
   would be only as wide as its summary and the paragraph inside would
   push the document wider (caught at 360px, 2026-09-15). */
.tournament-op__detail { margin: 2px 0 8px; justify-self: stretch; min-width: 0; max-width: 100%; }
.tournament-op__detail > summary {
  cursor: pointer; font-size: .82rem; font-weight: 600; list-style: none;
  opacity: .75; padding: 2px 0; width: fit-content;
}
.tournament-op__detail > summary::-webkit-details-marker { display: none; }
.tournament-op__detail > summary::before { content: "\25b8"; margin-right: 5px; font-size: .7em; }
.tournament-op__detail[open] > summary::before { content: "\25be"; }
.tournament-op__detail > summary:hover { opacity: 1; }
.tournament-op__detail > *:not(summary) { margin-top: 4px; max-width: 60ch; }
.tournament-op__text-export { display: grid; gap: var(--ds-space-sm); }
.tournament-op__grants { display: grid; gap: var(--ds-space-sm); }
.tournament-op__grants h5 { margin: 0; }
.tournament-op__grants-list { margin: 0; padding-left: var(--ds-space-xl); display: grid; gap: var(--ds-space-xs); }
.tournament-op__grants-form { display: flex; flex-wrap: wrap; gap: var(--ds-space-sm); align-items: center; }
.tournament-op__grants-form select { min-width: 0; max-width: 100%; }

/* Export and share, folded away: the operator opens it when they need it. */
.tournament-export-fold { margin-top: var(--ds-space-sm); }
.tournament-export-fold > summary { cursor: pointer; padding: var(--ds-space-sm) 0; list-style-position: outside; }
.tournament-export-fold__row { display: grid; gap: 2px; }
.tournament-export-fold__row strong { font-size: .95rem; }
.tournament-export-fold[open] > summary { border-bottom: 1px solid var(--ds-border-subtle); margin-bottom: var(--ds-space-sm); }
.tournament-export-controls,
.tournament-export-excel { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.tournament-export-controls .tt-auth__button,
.tournament-export-excel .tt-auth__button { min-height: 40px; }
.tournament-export-controls .tournament-export-controls__whatsapp { border-color: var(--ds-status-success); background: var(--ds-status-success); }
.tournament-op__layout-export-audit h5 { margin: 12px 0 4px; color: var(--ds-status-info); }
.tournament-op__layout-export-audit ol { margin: 6px 0 0; padding-left: 1.25rem; }
.tournament-op__results-export > .tournament-op__checkpoint { margin-top: 4px; }

@media (max-width: 599px), (hover: none) and (pointer: coarse) {
  .tournament-score-step__row {
    grid-template-columns: 44px minmax(0, 1fr) 84px; gap: 6px; min-height: 44px;
    padding: 2px 0; border: 0; border-radius: 0; background: transparent;
  }
  .tournament-score-step__rank {
    width: 42px; padding: 3px 5px; border-radius: 999px; box-sizing: border-box;
    background: var(--ds-surface-selected); color: var(--ds-text-primary); text-align: center;
  }
  .tournament-score-step__parts { justify-content: flex-end; min-width: 0; }
  .tournament-score-step__parts input { width: 84px; min-width: 0; box-sizing: border-box; }
  .tournament-score-step__parts:has(input:nth-child(2)) { grid-column: 1 / -1; }
  .tournament-score-step__parts:has(input:nth-child(2)) input { flex: 1 1 0; width: 0; }
  .tournament-score-step__row > output { display: none; }
  .tournament-score-step__save { width: 100%; min-height: 42px; }
  .tournament-score-step__checkpoint {
    position: static; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  }
  .tournament-export-preview > header { display: grid; }
  .tournament-export-preview__grid { grid-template-columns: 1fr; padding: 7px; }
  .tournament-export-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .tournament-export-controls__whatsapp { grid-column: 1 / -1; }
  .tournament-layout-step { gap: 12px; }
  .tournament-layout-step__panel { border-radius: 10px; }
  .tournament-layout-step__export-panel > .tournament-op__hint { margin: 0; font-size: .75rem; line-height: 1.35; }
  .tournament-layout-step .tournament-export-picture {
    margin: 0; padding: 10px; border: 1px solid var(--ds-border-strong); border-radius: 10px;
    background: var(--ds-surface-control); box-sizing: border-box;
  }
  .tournament-layout-step .tournament-export-tabs { gap: 8px; overflow: visible; }
  .tournament-layout-step .tournament-export-tabs .tt-auth__button {
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 10px; border-radius: 10px;
    white-space: normal;
  }
  .tournament-layout-step .tournament-export-controls { grid-template-columns: 1fr; margin: 0; }
  .tournament-layout-step .tournament-export-controls__whatsapp { grid-column: auto; }
  .tournament-layout-step .tournament-export-controls .tt-auth__button { width: 100%; min-height: 42px; }
  .tournament-results-step .tournament-export-tabs .tt-auth__button { flex: 1 1 0; min-width: 0; }
  .tournament-layout-step .tournament-op__layout-export-audit { border-left: 1px solid var(--ds-border-subtle); }
  .tournament-layout-step .tournament-op__layout-export-audit h4 { margin-bottom: 8px; font-size: .9rem; }
  .tournament-layout-step .tournament-op__layout-export-audit :is(p, li) { font-size: .75rem; line-height: 1.4; }
  .tournament-layout-step .tournament-op__layout-export-audit ul { margin-top: 8px; padding: 0; list-style: none; }
  .tournament-layout-step__continue { display: grid; justify-content: stretch; gap: 6px; }
  .tournament-layout-step__continue .tt-auth__button { min-height: 52px; font-weight: 900; }
  .tournament-layout-step__continue .tournament-op__hint { margin: 0; text-align: left; font-size: .75rem; line-height: 1.35; }
  .tournament-export-excel { display: grid; }
  .tournament-export-excel .tt-auth__button { width: 100%; }}

.tournament-report { display: grid; gap: var(--ds-space-xl); }

/* Touch targets: inline row links and small controls get a comfortable hit
   area on coarse pointers without changing the desktop rhythm. */
@media (pointer: coarse) {
  .tt-auth__link {
    display: inline-block; padding-block: var(--ds-space-sm); margin-block: calc(-1 * var(--ds-space-sm));
  }
   .track-board__mode, .subnav__tab { min-height: 2.75rem; }}

/* Source Manager Step 0: a single isolated task, with no operation board
   mounted behind it. */
.tournament-director-step {
  min-height: min(700px, calc(100vh - 210px));
  padding: 0 0 28px;
  color: var(--ds-text-primary);
  background: var(--ds-surface-control);
  border: 2px solid var(--ds-border-strong);
  border-radius: 20px;
  overflow: hidden;
}
.tournament-director-step__phase {
  width: fit-content;
  margin: 12px auto 24px;
  padding: 8px 24px;
  color: var(--ds-rank-gold);
  background: var(--ds-surface-control);
  border: 2px solid var(--ds-rank-gold);
  border-radius: 999px;
  font-size: clamp(1rem, 4vw, 1.35rem);
  font-weight: 900;
}
.tournament-director-step > h2 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ds-rank-gold);
  font-size: clamp(1.55rem, 6vw, 2rem);
}
.tournament-director-step__intro {
  margin: 0;
  padding: 34px 16px 20px;
  color: var(--ds-text-secondary);
  background: var(--ds-surface-control);
  font-size: 1.1rem;
  line-height: 1.55;
}
.tournament-director-step__card {
  margin: 0 12px;
  padding: 18px;
  background: var(--ds-surface-selected);
  border: 1px solid var(--ds-border-strong);
  border-radius: 14px;
}
.tournament-director-step__card h3 { margin: 0 0 14px; font-size: 1.45rem; }
.tournament-director-step__label { display: block; margin-bottom: 8px; font-weight: 800; }
.tournament-director-step select,
.tournament-director-step input {
  box-sizing: border-box;
  width: 100%;
  min-height: 64px;
  padding: 0 20px;
  color: var(--ds-live-on);
  background: var(--ds-surface-selected);
  border: 1px solid var(--ds-border-strong);
  border-radius: 14px;
  font: inherit;
  font-size: 1.1rem;
}
.tournament-director-step input { margin-top: 10px; }
.tournament-director-step input[type="time"] {
  box-sizing: border-box; width: 100%; min-height: 64px; padding: 0 20px; color: var(--ds-live-on);
  background: var(--ds-surface-selected); border: 1px solid var(--ds-border-strong); border-radius: 14px; font: inherit; font-size: 1.1rem;
}
.tournament-director-step__hint {
  min-height: 48px;
  margin: 20px 0;
  color: var(--ds-text-secondary);
  line-height: 1.45;
}
.tournament-director-step .tt-auth__button {
  width: 100%;
  min-height: 64px;
  font-size: 1.15rem;
  font-weight: 900;
}
.tournament-director-step .tournament-director-step__pin {
  width: auto;
  min-height: 54px;
  margin-top: 14px;
  background: var(--ds-status-info);
}
.tournament-director-step--start { display: grid; gap: 12px; background: var(--ds-surface-raised); border-color: var(--ds-border-strong); }
.tournament-director-step--start > h2 { border-bottom-color: var(--ds-group-wild); }
.tournament-director-step--start .tournament-director-step__intro { background: var(--ds-surface-selected); }
.tournament-director-step--start .tournament-director-step__card { background: var(--ds-surface-control); border-color: var(--ds-border-strong); }
.tournament-director-step--start > .tournament-director-step__hint,
.tournament-director-step--start > .tt-auth__button { margin-inline: 12px; }
@media (min-width: 600px) {
  .tournament-director-step__card { margin: 0 24px; }}


/* ---------------------------------------------------------------- Track record
   Where a Player is strong and where they should practise. Two columns because
   the question is really two questions, and they should sit side by side on a
   desktop and stack on a phone rather than compete for the same eye line. */

.track-record__columns {
  display: grid;
  /* --sp-5 does not exist. The scale is 1,2,3,4,6,8,12,16, and seventeen
     places in this stylesheet ask for a fifth step that resolves to nothing -
     which is why the two columns were touching. Fixed here with a real step;
     the other sixteen are a separate look. */
  gap: var(--ds-space-lg) var(--ds-space-3xl);
  width: 100%;
  /* One column; two only when there is genuinely room for both. auto-fit was
     producing four tracks, two of them zero-width. */
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1100px) {
  .track-record__columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }}

/* Fixed size, so a row's height never depends on which artwork loaded. */

.track-record__column { display: grid; gap: var(--ds-space-sm); align-content: start; }

.track-record__heading {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 800;
}

.track-record__hint {
  margin: 0;
  color: var(--ds-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.track-record__list {
  display: grid;
  gap: var(--ds-space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.track-record__row {
  display: flex;
  gap: var(--ds-space-md);
  align-items: center;
  padding: var(--ds-space-sm) 0;
  border-top: 1px solid var(--ds-border-subtle);
}

/* This is a compact comparison list, not an activity-card gallery. Give the
   shared track identity a real column width so a long overlaid track name
   cannot grow its 16:9 artwork to almost half the panel. */
.track-record__row > .activity-list__thumb {
  flex: 0 0 10rem;
  width: 10rem;
  min-width: 0;
}

.track-record__row:first-child { border-top: 0; }

/* The text column has to be allowed to shrink, or a long track name pushes the
   verdict off the row on a narrow phone. */
.track-record__text { display: grid; gap: 0.125rem; min-width: 0; flex: 1 1 auto; }

.track-record__name {
  overflow: hidden;
  color: var(--ds-text-primary);
  font-weight: 700;
  text-decoration: underline;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-record__facts {
  color: var(--ds-text-secondary);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.track-record__verdict {
  flex: 0 0 auto;
  font-size: 0.8125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.track-record__verdict--strong { color: var(--ds-delta-faster); }
.track-record__verdict--weak { color: var(--ds-delta-slower); }

@media (max-width: 599px) {
  /* Compose keeps the art, title/facts and verdict as three distinct columns. */
  .track-record__row {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: var(--ds-space-sm);
  }
  .track-record__row > .activity-list__thumb {
    grid-column: 1;
    grid-row: 1;
    width: 6rem;
  }
  .track-record__row .activity-list__track-label { display: none; }
  .track-record__text { grid-column: 2; grid-row: 1; overflow-wrap: anywhere; }
  .track-record__verdict { grid-column: 3; grid-row: 1; text-align: right; white-space: nowrap; }
}

.track-record { min-width: 0; }
.track-record__deep-dive { width: 100%; min-width: 0; max-width: 100%; }

/* The 96-track table is a panel, not a footnote. It was a line of small grey
   text with a marker, under a card, and nobody could see that it opened - so
   it says what it is, says what it holds, and shows the way it swings. */
.track-record__deep-dive {
  margin-top: var(--ds-space-md);
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius-hairline);
  background: var(--ds-surface-control);
}
.track-record__deep-dive[open] { border-color: var(--ds-action-primary); }

.track-record__deep-dive > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-md);
  cursor: pointer;
  padding: var(--ds-space-md);
  color: var(--ds-text-body);
  list-style: none;
}
.track-record__deep-dive > summary::-webkit-details-marker { display: none; }
.track-record__deep-dive-heading { display: grid; gap: 2px; min-width: 0; }
.track-record__deep-dive-phone-title, .track-record__note--phone { display: none; }
.track-record__deep-dive-title {
  font-size: 0.95rem; font-weight: 800; color: var(--ds-text-primary);
}
.track-record__deep-dive-subtitle {
  font-size: 0.78rem; color: var(--ds-text-secondary);
}
.track-record__deep-dive-chevron {
  flex: none; color: var(--ds-text-secondary); font-size: 1rem;
  transition: transform 120ms ease;
}
.track-record__deep-dive[open] .track-record__deep-dive-chevron { transform: rotate(180deg); }
.track-record__deep-dive > summary:hover .track-record__deep-dive-title,
.track-record__deep-dive > summary:focus-visible .track-record__deep-dive-title {
  color: var(--ds-text-primary);
}
/* Everything under the head sits inside the panel's own padding. */
.track-record__deep-dive-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--ds-space-sm);
  padding: 0 var(--ds-space-md);
}
.track-record__deep-dive .track-record__scroller { padding: 0 var(--ds-space-md) var(--ds-space-md); }
.track-record__share {
  border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-hairline);
  background: var(--ds-surface-control); color: var(--ds-text-body);
  min-height: var(--ds-target-min-dense);
  padding: .15rem .6rem; font-size: .75rem; font-weight: 700; cursor: pointer;
}
.track-record__share:hover, .track-record__share:focus-visible {
  border-color: var(--ds-text-primary); color: var(--ds-text-primary);
}

/* The table scrolls inside itself; the page never scrolls sideways. */
.track-record__scroller { overflow-x: auto; width: 100%; }

.track-record__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.track-record__table th,
.track-record__table td {
  padding: var(--ds-space-sm) var(--ds-space-md) var(--ds-space-sm) 0;
  border-bottom: 1px solid var(--ds-border-subtle);
  color: var(--ds-text-body);
  text-align: right;
  white-space: nowrap;
}

.track-record__table thead th {
  color: var(--ds-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.track-record__table th[scope="row"],
.track-record__table thead th:first-child {
  text-align: left;
  white-space: normal;
}

/* The cup is a name with a mark, not a number. Right-aligned it started every
   row in a different place and the column read as a jumble (owner,
   2026-09-16); the figures beside it stay right, where digits line up. */
.track-record__table th:nth-child(2),
.track-record__table td:nth-child(2) { text-align: left; }



/* The sortable headers on the full track table are the design system's SortHeader (Phase 6). */
.track-record__count { margin: var(--ds-space-sm) 0 0; color: var(--ds-text-secondary); font-size: 0.75rem; }
.track-record__filter-row th { padding-top: 0; padding-bottom: var(--ds-space-sm); }
.track-record__filter {
  width: 100%; min-width: 4.25rem; box-sizing: border-box; padding: 2px var(--ds-space-sm);
  border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-hairline); background: var(--ds-surface-control);
  color: var(--ds-text-primary); font: inherit; font-size: 0.75rem; text-transform: none; letter-spacing: 0;
}
.track-record__filter::placeholder { color: var(--ds-text-secondary); opacity: 1; }
.track-record__table th[scope="row"] { display: flex; align-items: center; gap: var(--ds-space-sm); }
/* The picture and the name open that track TrueSkill page; the numbers beside
   them stay plain text (owner, 2026-09-16). */
.track-record__track-link {
  display: inline-flex; align-items: center; gap: var(--ds-space-xs);
  color: inherit; text-decoration: none; min-width: 0;
}
.track-record__track-link:hover > span:last-child, .track-record__track-link:focus-visible > span:last-child {
  color: var(--ds-text-primary); text-decoration: underline;
}
.track-record__thumb { position: relative; display: inline-flex; flex: none; }
.track-record__track-mode { display: none; }
.track-record__track-icon { width: 2.25rem; height: 1.5rem; object-fit: cover; border-radius: 3px; flex: none; }
.track-record__cup-icon {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  object-fit: contain;
  vertical-align: -0.2em;
  margin-right: var(--ds-space-xs);
}
.track-record__table .track-record__win {
  --win-color: transparent;
  background: var(--win-color); color: var(--ds-personal-on-accent); font-weight: 800; text-align: right;
  padding-left: var(--ds-space-sm); padding-right: var(--ds-space-sm); border-radius: 4px;
}

.track-record__table th[scope="col"] { vertical-align: bottom; }

/* A track nobody has raced is still worth listing - that is the point of
   showing all 96 - but it should not compete with the ones that carry data. */
.track-record__table-unraced { color: var(--ds-text-tertiary); }

/* Tournament pictures: the canvas is the preview, shown at its own aspect.
   A results picture is a tall strip - six groups come out 0.29 wide-to-tall -
   so the frame is the box, not the picture: the drawing keeps its shape and
   a readable width, and the box scrolls when the strip is longer than it.
   Bounding the canvas itself in both directions squashed it sideways. */
.tournament-export-picture {
  margin: var(--ds-space-sm) 0; max-height: 70vh; overflow: auto;
}
.tournament-export-picture canvas {
  display: block; width: auto; height: auto;
  max-width: min(38rem, 100%); border-radius: 10px;
}


/* ---------------------------------------------------------------------------
   The night's report (W20, W21) — on the design system since Phase 11.

   The export is a light document with serif headings, and the site used to
   keep that "paper" island inside the dark product. It does not any more: the
   appearance the Player chose is the appearance the whole product answers to.
   The report keeps its order, its words, its reading measure and every link,
   and loses the paper, the serif and the second set of ink it carried.

   The `--report-*` names stay as this document's own aliases of the semantic
   tokens (§20), so every rule below reads one source.
   --------------------------------------------------------------------------- */
.tournament-report {
  --report-paper: var(--ds-surface-raised);
  --report-soft: var(--ds-surface-control);
  --report-line: var(--ds-border-subtle);
  --report-text: var(--ds-text-body);
  --report-muted: var(--ds-text-secondary);
  --report-accent-ink: var(--ds-text-primary);
  --report-kicker: var(--ds-text-secondary);
  --report-numeral: var(--ds-text-primary);
  display: grid;
  gap: var(--ds-space-2xl);
  margin: var(--ds-space-xl) 0;
  color: var(--report-text);
  font-family: var(--ds-font-ui);
  font-size: var(--ds-type-body-size);
  line-height: var(--ds-type-body-line);
}
/* The night's report is a document: not a grid, because the bar that stays in
   view is a child here and a sticky grid item never leaves its own row. The
   administrator's report editor shares the class and keeps its grid. */
.tournament-report--document { display: block; }
.tournament-report__body { display: grid; gap: var(--ds-space-2xl); }
.tournament-report :is(h2, h3, h4, h5, h6) {
  font-family: var(--ds-font-display);
  font-weight: 800; font-style: italic; font-synthesis: style; text-transform: uppercase;
  color: var(--ds-text-primary);
  margin: 0;
}
.tournament-report h3 { font-size: var(--ds-type-display-6-size); line-height: var(--ds-type-display-6-line); }
.tournament-report h4 { font-size: var(--ds-type-title-size); line-height: var(--ds-type-title-line); }
.tournament-report h5 {
  font-family: var(--ds-font-ui); font-style: normal; text-transform: none;
  font-size: var(--ds-type-title-size); font-weight: var(--ds-type-title-weight);
}
.tournament-report__copy { margin: 0; line-height: 1.72; color: var(--report-text); }
.tournament-report__copy--generated { color: var(--report-muted); }
.tournament-report__source { color: var(--report-accent-ink); font-size: .88rem; }
.tournament-report a { color: var(--report-accent-ink); }

.tournament-report__story {
  display: grid; gap: var(--ds-space-md); padding: var(--ds-space-xl);
  border: 1px solid var(--report-line);
  background: var(--report-paper);
}
.tournament-report__more summary { cursor: pointer; color: var(--report-accent-ink); font-weight: 700; }
.tournament-report__more[open] summary { margin-bottom: 8px; }
.tournament-report__more .tournament-report__copy + .tournament-report__copy { margin-top: 10px; }

/* Top 5 gereden banen: the track's own picture behind its row. */
.tournament-report__tracks { display: grid; gap: 10px; }
.tournament-report__top { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tournament-report__top-head,
.tournament-report__top-row {
  position: relative; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--report-line); background: var(--report-paper); overflow: hidden;
}
.tournament-report__top-head {
  background: var(--report-soft); font-weight: 700; font-size: .82rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--report-muted);
}
.tournament-report__top-row { min-height: 52px; }
.tournament-report__top-picture {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .32; z-index: 0;
}
.tournament-report__top-row > span,
.tournament-report__top-row > strong { position: relative; z-index: 1; }
.tournament-report__top-name { font-weight: 700; color: var(--ds-text-primary); }
.tournament-report__top-index,
.tournament-report__top-count { color: var(--report-numeral); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Eindgroepen | Voorronden: the reader picks the groups; the writing stays on the finals. */
.tournament-report__stages { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); margin: var(--ds-space-md) 0 var(--ds-space-sm); }
/* Which groups the reader is reading. The selected one is the calm selected state (§4 A2): the
   tint, the boundary and the ink the system gives a selected control - `var(--ds-surface-hover)` on white was the
   paper's own ink and failed contrast on the product's Light surface (axe, Phase 11). */
.tournament-report__stage {
  min-height: var(--ds-target-min); padding: .35rem .9rem;
  border: 1px solid var(--ds-border-control); background: var(--ds-surface-control);
  color: var(--ds-text-body); font: inherit; font-weight: 700; cursor: pointer;
}
.tournament-report__stage[aria-pressed="true"] {
  background: var(--ds-surface-selected); border-color: var(--ds-text-primary);
  color: var(--ds-text-primary); cursor: default;
  box-shadow: inset 0 -3px 0 var(--ds-text-primary);
}
.tournament-report__stage-hint { flex-basis: 100%; margin: 0; color: var(--report-muted); font-size: .85rem; }
.tournament-report__group {
  display: grid; gap: 14px; padding-left: 14px;
  border-left: 5px solid var(--report-group-accent, var(--ds-border-strong));
}
/* A Player's chart accent keeps its hue and follows the appearance for its
   lightness: one fixed `hsl(H 46% 38%)` was ink for white paper and
   disappeared on the product's own surface. The hue is what tells two
   sections apart, so only the lightness moved (the Android twin took the same
   decision in Phase 11). */


.tournament-report__player--accent-0 { --report-accent: var(--ds-action-primary); }
.tournament-report__player--accent-1 { --report-accent: var(--ds-status-success); }
.tournament-report__player--accent-2 { --report-accent: var(--ds-group-wild); }
.tournament-report__player--accent-3 { --report-accent: var(--ds-status-warning); }
.tournament-report__player--accent-4 { --report-accent: var(--ds-group-talent); }
.tournament-report__player--accent-5 { --report-accent: var(--ds-engine-200); }
.tournament-report__player--accent-6 { --report-accent: var(--ds-tier-advanced); }
.tournament-report__player--accent-7 { --report-accent: var(--ds-engine-150); }
.tournament-report__player--accent-8 { --report-accent: var(--ds-rank-bronze); }
.tournament-report__player--accent-9 { --report-accent: var(--ds-status-info); }
.tournament-report__player--accent-10 { --report-accent: var(--ds-personal-edge); }
.tournament-report__player--accent-11 { --report-accent: var(--ds-tier-beginner); }
.tournament-report__group-meta { margin: 0; color: var(--report-muted); font-size: .9rem; }
.tournament-report__group-tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--report-group-accent, var(--ds-border-strong)) 40%, transparent);
  background: color-mix(in srgb, var(--report-group-accent, var(--ds-border-strong)) 12%, transparent);
  color: var(--ds-text-primary);
  font-size: .78rem; font-weight: 800;
}

.tournament-report__player {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-md); padding: var(--ds-space-lg) var(--ds-space-xl);
  border: 1px solid color-mix(in srgb, var(--report-accent) 22%, var(--report-line));
  background: var(--report-paper); overflow: hidden;
  /* Clear the site's navigation and the bar under it, both measured. */
  scroll-margin-top: calc(var(--report-context-top, 56px) + var(--report-context-offset, 52px));
}
.tournament-report__player::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--report-accent, var(--ds-border-strong));
}
.tournament-report__player-head { display: grid; gap: 2px; }
/* The character stands beside the name (owner, 2026-09-28); a long name wraps above it. */
.tournament-report__player-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 800; }
.tournament-report__meta { margin: 0; color: var(--report-muted); font-size: .92rem; }
/* The SP line: the rank in the standing page's tier badge, the change in colour. */
.tournament-report__sp { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .15rem; }
.tournament-report__sp-rank { font-size: .72rem; }
.tournament-report__sp-delta { font-weight: 700; margin-left: .25rem; }
.tournament-report__sp-split { font-size: .85rem; }
.tournament-report__sp-split .tournament-report__sp-delta { margin-left: 0; }
/* The switch inside a Player's section, and the standing the back link reaches under the bars. */
.tournament-report__player-stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.tournament-report__stage--player { padding: .2rem .7rem; font-size: .8rem; }
#eindstand { scroll-margin-top: calc(var(--report-context-top, 56px) + var(--report-context-offset, 60px)); }
/* A box of its own, or the cell reflows when the picture arrives (measured
   at 6px sideways per icon on the owner's phone profile, 2026-09-15). */
.tournament-report__readout-icon {
  display: inline-block; flex: none; height: 18px; width: 26px; object-fit: contain; vertical-align: middle; margin-right: 4px;
}
.tournament-report__sp-delta--up { color: var(--ds-status-success); }
.tournament-report__sp-delta--down { color: var(--ds-status-error); }
.tournament-report__kpi { margin: 0; color: var(--report-muted); font-size: .86rem; line-height: 1.45; }
.tournament-report__summary-title { margin-top: 6px; }
.tournament-report__analysis-title { color: var(--report-muted); font-size: .92rem; margin-top: 6px; }
.tournament-report__charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 6px; }

.tournament-report__figure { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.tournament-report__figure-title {
  display: flex; align-items: center; gap: 8px; font-weight: 700;
  font-size: var(--ds-type-body-size); color: var(--ds-text-primary);
  font-family: var(--ds-font-ui);
}
.tournament-report__info {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 999px;
  border: 1px solid var(--ds-border-control); color: var(--report-muted);
  font-size: .7rem; font-style: italic; cursor: help; flex: none;
}
.tournament-report__chart-shell {
  border: 1px solid var(--report-line); border-radius: 12px; background: var(--report-paper);
  padding: 6px; touch-action: pan-y;
}
.tournament-report__chart-shell:focus-visible { outline: var(--ds-focus-width) solid var(--ds-focus-ring); outline-offset: 2px; }
.tournament-report__chart { display: block; width: 100%; height: auto; }
/* The shell carries the chart's shape as a class. Two things were tried here
   and are deliberately not used, both measured on a phone profile over one
   scroll pass of a published night (2026-09-16): `content-visibility: auto`
   took the layout shift from 0.03 to 2.6 as sections resized on the way in and
   out, and `aspect-ratio` on the shell more than doubled the main-thread cost
   (4 long tasks to 10) because the SVG inside already sizes itself. */
/* The charts read one ink from the tokens, so they follow the appearance the
   Player chose instead of a paper that is not there any more. */
.tournament-report__grid { stroke: var(--ds-border-subtle); stroke-width: 1; }
.tournament-report__baseline { stroke: var(--ds-border-strong); stroke-width: 1.5; }
.tournament-report__average { stroke: var(--ds-status-warning); stroke-width: 2; stroke-dasharray: 6 5; }
.tournament-report__guide { stroke: var(--ds-status-info); stroke-width: 1.5; stroke-dasharray: 4 4; }
.tournament-report__tick { fill: var(--ds-text-secondary); font-size: 12px; font-family: var(--ds-font-data); }
.tournament-report__axis { fill: var(--ds-text-tertiary); font-size: 12px; font-family: var(--ds-font-data); }
.tournament-report__dot { stroke: var(--ds-surface-raised); stroke-width: 1.2; }
.tournament-report__dot.is-active { r: 6.5; stroke-width: 2; }
.tournament-report__bar.is-active { fill-opacity: 1; }
/* Where a place chart reaches the podium it draws the place in its rank
   colour (§15, §17) rather than a medal glyph. The outline is the surface it
   is drawn on, so it reads over a line. */
.tournament-report__podium text {
  font-size: 17px; font-weight: 700; font-family: var(--ds-font-data); dominant-baseline: middle;
  fill: var(--ds-text-primary);
  paint-order: stroke; stroke: var(--ds-surface-raised); stroke-width: 4px;
}
.tournament-report__podium--gold text { fill: var(--ds-rank-gold); }
.tournament-report__podium--silver text { fill: var(--ds-rank-silver); }
.tournament-report__podium--bronze text { fill: var(--ds-rank-bronze); }
.tournament-report__podium.is-active text { font-size: 24px; }
/* The duel: the half above the rule belongs to this Player, the half below to
   the one they are racing. Green for ahead, red for behind, as the source. */
.tournament-report__duel-area--ahead { fill: color-mix(in srgb, var(--ds-status-success) 22%, transparent); }
.tournament-report__duel-area--behind { fill: color-mix(in srgb, var(--ds-status-error) 20%, transparent); }
.tournament-report__duel-line {
  fill: none; stroke: var(--ds-text-primary); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.tournament-report__dot--ahead { fill: var(--ds-status-success); }
.tournament-report__dot--behind { fill: var(--ds-status-error); }
.tournament-report__duel-name {
  fill: var(--report-muted); font-size: 13px; font-weight: 700;
}

/* The readout the pointer writes, the export's own answer to "what happened
   in race 7?". It rests on the last race so the chart is never mute. */
.tournament-report__readout {
  border: 1px solid var(--report-line); border-radius: 10px; background: var(--report-soft);
  padding: 8px 10px; min-height: 3.2rem;
}
/* The readout is as wide as what it says, so every value stands beside its label rather than
   across a 1300 px chart (owner, 2026-09-28). */
.tournament-report__readout-table { width: auto; max-width: 100%; border-collapse: collapse; font-size: .84rem; }
.tournament-report__readout-table th {
  text-align: left; font-weight: 600; color: var(--report-muted); padding: 1px 8px 1px 0;
  display: flex; align-items: center; gap: 6px;
}
.tournament-report__readout-table td { text-align: left; font-variant-numeric: tabular-nums; padding: 1px 0 1px 10px; vertical-align: top; }
.tournament-report__readout-key { flex: none; }
.tournament-report__readout-lines { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--report-muted); font-size: .8rem; }
/* The pictures stay with their name; a long name may still wrap on a narrow phone. */
.tournament-report__readout-line { display: inline-flex; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.tournament-report__readout-extra { color: var(--report-muted); }
.tournament-report__readout-empty { color: var(--report-muted); }
.tournament-report__back { justify-self: start; color: var(--report-accent-ink); font-size: .85rem; }

/* The heading the export opens with. */
.tournament-report__title {
  margin: 0; font-family: var(--ds-font-display); font-weight: 800; font-style: italic;
  font-synthesis: style; text-transform: uppercase; color: var(--ds-text-primary);
  font-size: var(--ds-type-display-4-size); line-height: var(--ds-type-display-4-line);
}
.tournament-report__title strong { font-weight: 800; }

/* The standing of every group: this is the report's index, so every name is a
   link down to that Player's own section. */
.tournament-report__standings-grid {
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tournament-report__standings { display: grid; gap: 14px; }
/* The head above a row of tables: "Kwalificatie" over the qualifiers,
   "Eindklassen" over the finals. */
.tournament-report__standings-heading {
  margin: 6px 0 0; font-size: 1.25rem; font-weight: 800; color: var(--report-text);
  text-align: center;
}
.tournament-report__standings-heading:first-child { margin-top: 0; }
/* A qualifier row in the colour of the final group the Player went on to. */
/* One colour per destination, the same for every row that went there. */
.tournament-report__waiting {
  margin: 0; padding: 14px 16px; border: 1px dashed var(--report-line);
  border-radius: 10px; color: var(--report-muted); font-size: .92rem; max-width: 70ch;
}

/* The bar that says where the reader is. It sticks under the site's own
   navigation, which is sticky at the top of the page. */
/* The section index sticks under the site's own navigation, which is sticky
   at the top of the page. Everything else about it is the design system's
   SectionIndex (`.ds-index`). */
.tournament-report__context { --ds-index-top: var(--report-context-top, 56px); margin-bottom: var(--ds-space-lg); }
.tournament-report__context:empty { display: none; }

/* The slider the source puts under every chart, spanning exactly the races
   the chart draws. */
.tournament-report__scrubber-wrap { display: block; }
.tournament-report__scrubber { display: block; accent-color: var(--report-accent, var(--ds-text-primary)); }

/* The readout's four shapes: a place chart names the track, the benchmark
   names who is being chased, the distribution names the tracks behind a bar. */
.tournament-report__readout-head {
  margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  font-size: .86rem; font-weight: 700;
}
.tournament-report__readout-head span { color: var(--report-muted); font-weight: 600; font-size: .8rem; }
.tournament-report__readout-head--resting { color: var(--report-muted); font-weight: 600; }
.tournament-report__readout-table--place td { text-align: left; }
.tournament-report__readout-table--place td:first-child { padding-left: 0; }
.tournament-report__readout-place { font-weight: 700; white-space: nowrap; }
.tournament-report__readout-track {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; color: var(--report-muted);
}
.tournament-report__readout-table--compact td { text-align: left; }
.tournament-report__benchmark {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: baseline; justify-content: flex-start;
}
.tournament-report__benchmark-delta { font-weight: 800; font-variant-numeric: tabular-nums; }
.tournament-report__benchmark-unit,
.tournament-report__benchmark-vs { color: var(--report-muted); font-size: .78rem; }
.tournament-report__benchmark-name { color: var(--report-text); font-weight: 600; }
.tournament-report__benchmark-score { font-variant-numeric: tabular-nums; }

@media (max-width: 599px) {
  .tournament-report { padding: 18px 14px 22px; gap: 22px; }
  .tournament-report__body { gap: 22px; }
  .tournament-report__player { padding: 14px 14px 14px 16px; }
  .tournament-report__story { padding: 16px; }
  .tournament-report__standings-grid { grid-template-columns: 1fr; }
  .tournament-report__context { padding: 5px 8px; }}

/* The import's own answer: what went wrong, on which row, in which column,
   and what that column accepts. */
.tournament-op__csv-issues {
  margin-top: var(--ds-space-sm); padding: var(--ds-space-sm) var(--ds-space-md);
  border: 1px solid var(--ds-status-error); border-left-width: 4px; border-radius: var(--ds-radius-none);
  background: color-mix(in srgb, var(--ds-status-error) 12%, transparent);
}
.tournament-op__csv-issues-lead { margin: 0 0 var(--ds-space-xs); font-weight: 700; color: var(--ds-status-error); }
.tournament-op__csv-issues ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .2rem; }
.tournament-op__csv-issues li { overflow-wrap: anywhere; }
.tournament-op__csv-issues-more { margin: var(--ds-space-xs) 0 0; color: var(--ds-text-secondary); }
.tournament-op__csv-rules { margin-top: var(--ds-space-sm); color: var(--ds-text-secondary); font-size: .9rem; }
.tournament-op__csv-rules summary { cursor: pointer; font-weight: 700; }
.tournament-op__csv-rules p { margin: var(--ds-space-xs) 0; }
.tournament-op__csv-rules ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .2rem; }
.tournament-op__csv-rules li { overflow-wrap: anywhere; }

/* The report's accents as classes: the page's Content-Security-Policy allows
   no inline style, so the golden-angle hue per group rank lives here. */

/* Step 5 and Step 9: what the workbook says about this group, beside the
   button that imports it, and the answer after it was pressed. */
.tournament-score-step__excel-loaded { margin: var(--ds-space-xs) 0 0; }
.tournament-score-step__excel-readiness {
  margin: var(--ds-space-sm) 0 0; padding: var(--ds-space-xs) var(--ds-space-sm); border-radius: var(--ds-radius-none);
  font-size: .88rem; font-weight: 600;
}
.tournament-score-step__excel-readiness--ready { background: color-mix(in srgb, var(--ds-status-success) 12%, transparent); color: var(--ds-status-success); }
.tournament-score-step__excel-readiness--blocked { background: color-mix(in srgb, var(--ds-status-error) 12%, transparent); color: var(--ds-status-error); }
/* The reason the button is out, on its own line right above it. */
.tournament-score-step__excel-blocked {
  margin: 6px 0 2px; font-size: .86rem; font-weight: 700; color: var(--ds-status-error);
}
/* An import that is done says so and folds its matching block away; the
   workbook stays loaded because the other groups still need it. */
.tournament-score-step__excel-message--done { color: var(--rc-cyan, var(--ds-mode-race-direction)); font-weight: 700; }
/* A total the Director corrected over the races, and what the races said. */
.tournament-score-step__corrected {
  color: var(--mk8-yellow, var(--ds-status-warning));
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
/* The workbook's own parts disagreeing with its own total. */
.tournament-score-step__segment-mismatch { color: var(--mk8-red, var(--ds-status-error)); font-weight: 700; }

.tournament-score-step__excel-message {
  margin: var(--ds-space-xs) 0 0; font-size: .9rem; color: var(--ds-text-body); overflow-wrap: anywhere;
}
.tournament-score-step__excel-message:empty { display: none; }
.tournament-report__player-character {
  flex: none; width: 34px; height: 34px;
  /* No tile behind the character (owner, 2026-09-28): the art stands on the page. */
  object-fit: contain;
}

/* Rich text in the night's report: a fixed palette of classes, never inline
   style (the page is served under style-src 'self'). The editor's toolbar
   offers exactly these, so what is chosen is what the community sees. */
.tournament-report__rich { margin: 0; line-height: 1.72; color: var(--report-text); }
.tournament-report__rich p { margin: 0 0 8px; }
.tournament-report__rich p:last-child { margin-bottom: 0; }
.tournament-report__rich ul, .tournament-report__rich ol { margin: 4px 0 8px; padding-left: 1.4em; }
.tournament-report__rich blockquote { margin: 6px 0 8px; padding: 4px 12px; border-left: 3px solid var(--report-line); color: var(--report-muted); }
.tournament-report__rich a { color: var(--report-accent-ink); text-decoration: underline; }
.tournament-report__rich mark { padding: 0 2px; border-radius: 3px; }
.tournament-report__block { position: relative; display: grid; gap: 8px; }
.rt-align-center { text-align: center; }
.rt-align-right { text-align: right; }
.rt-indent-1 { margin-left: 1.5rem; }
.rt-indent-2 { margin-left: 3rem; }
.rt-indent-3 { margin-left: 4.5rem; }
.rt-size-s { font-size: .86em; }
.rt-size-l { font-size: 1.18em; }
.rt-size-xl { font-size: 1.4em; }
.rt-font-serif { font-family: Georgia, "Times New Roman", serif; }
.rt-font-mono { font-family: "Courier New", Consolas, monospace; }
.rt-color-red { color: var(--ds-status-error); }
.rt-color-orange { color: var(--ds-mode-race-direction); }
.rt-color-yellow { color: var(--ds-status-warning); }
.rt-color-green { color: var(--ds-status-success); }
.rt-color-blue { color: var(--ds-status-info); }
.rt-color-purple { color: var(--ds-group-wild); }
.rt-color-gray { color: var(--ds-text-tertiary); }
.rt-bg-yellow { background: var(--ds-live-on)2a8; color: var(--ds-action-on-primary); }
.rt-bg-green { background: var(--ds-personal-wash); color: var(--ds-action-on-primary); }
.rt-bg-blue { background: var(--ds-surface-selected); color: var(--ds-action-on-primary); }
.rt-bg-pink { background: var(--ds-surface-selected); color: var(--ds-action-on-primary); }
}
