:root {
  --bg: #f5f8f7;
  --card: rgba(255, 255, 255, 0.94);
  --card-strong: #ffffff;
  --line: #d7e1dc;
  --text: #17211d;
  --muted: #5d6f67;
  --accent: #363f3b;
  --accent-soft: rgba(54, 63, 59, 0.07);
  --accent-strong: #232b27;
  --rubber: #d43f32;
  --gold: #c9972d;
  --silver: #94a3b8;
  --bronze: #b66a3c;
  --danger: #aa5333;
  --shadow: 0 1px 2px rgba(25, 44, 37, 0.05);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: #f7faf9;
}

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

button {
  cursor: pointer;
}

.page-shell {
  width: min(1360px, calc(100% - 28px));
  margin: 16px auto 36px;
}

.layout {
  display: grid;
  gap: 14px;
}

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

.input-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.workspace-panel.is-hidden {
  display: none !important;
}

.workspace-panel.is-race-workspace .input-top-grid,
.workspace-panel.is-race-workspace #configDetailsCard {
  display: none;
}

.tournament-workspace {
  padding: 14px 16px;
  margin-bottom: 10px;
}

.dashboard-view-selector {
  position: sticky;
  top: 8px;
  z-index: 20;
  padding: 6px;
  margin-bottom: 10px;
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.card {
  background: var(--card);
  border: 1px solid rgba(37, 71, 59, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.app-header-top,
.app-header-switch {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.app-header-main {
  max-width: none;
  min-width: 0;
  flex: 1 1 auto;
}

.app-header-title-row {
  display: grid;
  gap: 6px;
  align-content: start;
}

.app-header-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: center;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  justify-self: center;
  margin-inline: 0;
}

.app-header-switch {
  width: 100%;
  display: grid;
  gap: 18px;
  align-items: stretch;
  justify-content: stretch;
}

.app-header-switch-copy {
  max-width: 780px;
}

.app-header-switch-copy h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  color: var(--text);
}

.app-header-hint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero h1,
.step-card h2,
.section-heading h3,
.summary-banner h3,
.team-summary-card h3,
.winner-card strong {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1;
}

.hero-copy {
  max-width: 64ch;
  margin: 0;
  line-height: 1.55;
}

.hero-copy,
.workspace-header h2,
.step-header p,
.section-heading p,
.muted-text,
.winner-card span,
.message,
.team-summary-card dt {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--rubber);
  font-weight: 650;
}

.hero-actions,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.print-select-field {
  min-width: 220px;
}

.print-select-field select {
  min-height: 46px;
  border-radius: 999px;
  padding: 10px 42px 10px 16px;
}

.print-document {
  display: none;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.workspace-header p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.9rem;
}

.compact-header {
  margin-bottom: 0;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-primary-actions {
  justify-content: flex-end;
}

.workspace-utilities {
  margin: 0 0 10px;
  border-top: 1px solid rgba(37, 71, 59, 0.1);
}

.workspace-utilities summary {
  width: fit-content;
  cursor: pointer;
  padding: 10px 0 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.round-checkpoint-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.07);
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.round-checkpoint-panel.is-empty {
  background: rgba(245, 248, 247, 0.88);
  border-color: rgba(37, 71, 59, 0.1);
}

.round-checkpoint-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.round-checkpoint-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.round-checkpoint-select-field {
  min-width: 0;
}

.template-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(320px, auto);
  gap: 10px;
  align-items: end;
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(245, 248, 247, 0.88);
  border: 1px solid rgba(37, 71, 59, 0.1);
}

.template-select-field {
  min-width: 0;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  font-weight: 600;
}

.inline-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.template-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.ghost-button.danger {
  color: var(--danger);
  border-color: rgba(170, 83, 51, 0.28);
}

.view-switch-card {
  padding: 20px 24px;
  margin-bottom: 20px;
}

.workspace-view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  align-items: stretch;
  justify-self: stretch;
}

.view-tab-button {
  border-radius: 8px;
  border: 1px solid rgba(37, 71, 59, 0.12);
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.9);
  min-height: 46px;
  display: grid;
  gap: 3px;
  align-content: center;
  justify-items: center;
  text-align: center;
  width: 100%;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.view-tab-title {
  font-size: 0.94rem;
  line-height: 1.1;
  font-weight: 500;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.view-tab-copy {
  display: none;
  color: var(--muted);
  line-height: 1.5;
  max-width: 34ch;
  margin: 0 auto;
}

.view-tab-button.is-active {
  background: #fff;
  color: var(--accent-strong);
  border-color: rgba(37, 53, 47, 0.28);
  box-shadow: inset 0 -2px 0 rgba(37, 53, 47, 0.22);
}

.view-tab-button:hover {
  transform: translateY(-1px);
}

.workspace-header h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.tournament-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  -webkit-overflow-scrolling: touch;
}

.tab-chip-shell {
  flex: 0 0 220px;
  min-width: 220px;
  position: relative;
  transition: opacity 0.18s ease;
  will-change: transform;
}

.tab-chip {
  border: 1px solid rgba(37, 71, 59, 0.12);
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 62px 10px 40px;
  border-radius: 8px;
  display: grid;
  gap: 3px;
  text-align: left;
  width: 100%;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.tab-chip.is-active {
  background: #fff;
  border-color: rgba(37, 53, 47, 0.28);
}

.tab-chip-shell.is-dragging {
  position: fixed;
  z-index: 40;
  margin: 0;
  opacity: 1;
  pointer-events: none;
  transition: none;
}

.tab-chip-shell.is-dragging .tab-chip {
  transform: rotate(-1deg) scale(1.02);
  box-shadow: 0 20px 38px rgba(109, 98, 88, 0.18);
}

.tab-chip-placeholder {
  flex: 0 0 auto;
}

.tab-chip-placeholder-card {
  height: 100%;
  border-style: dashed;
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.06);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.tab-drag-handle {
  position: absolute;
  top: 9px;
  left: 8px;
  z-index: 1;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 71, 59, 0.14);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  cursor: grab;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.tab-drag-handle:active {
  cursor: grabbing;
}

.tab-drag-handle:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: 0 8px 18px rgba(109, 98, 88, 0.12);
}

.tab-chip-tools {
  display: flex;
  gap: 4px;
  position: absolute;
  top: 8px;
  right: 7px;
  z-index: 1;
}

.tab-tool-button {
  border: 1px solid rgba(37, 71, 59, 0.14);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.88rem;
  min-width: 0;
}

.tab-tool-button.icon-only {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
}

.tab-tool-icon {
  width: 14px;
  height: 14px;
}

.tab-tool-button.danger {
  color: var(--danger);
}

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

.tab-chip-title {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-chip-meta {
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  font-size: 0.94rem;
  font-weight: 550;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: #fff;
  color: var(--text);
  border-color: rgba(37, 71, 59, 0.16);
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border-color: rgba(37, 71, 59, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.mode-card:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.step-card {
  padding: 20px;
}

.race-day-shell {
  display: grid;
  gap: 10px;
}

.race-day-topline,
.race-day-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(37, 71, 59, 0.13);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.race-day-topline {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  padding: 18px 20px;
}

.race-day-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.race-day-topline h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2.4rem);
  line-height: 1.05;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.race-day-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 8px;
  align-content: stretch;
  min-width: min(470px, 100%);
}

.race-day-status-grid span {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 71, 59, 0.11);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
  text-transform: uppercase;
}

.race-day-status-grid strong {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
}

.race-day-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.race-day-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 10px;
  align-items: start;
}

.race-day-main-grid.is-single {
  grid-template-columns: 1fr;
}

.race-day-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px 20px;
}

.race-day-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.race-day-panel-header > div {
  min-width: 0;
}

.race-day-panel h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.2;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.race-day-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.92rem;
}

.race-day-state-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(199, 154, 50, 0.14);
  color: #715414;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.race-command-panel {
  gap: 14px;
}

.race-command-main,
.race-command-round {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.race-command-copy {
  min-width: 0;
}

.race-command-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.race-command-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.race-command-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(37, 71, 59, 0.1);
  border-radius: 8px;
  background: #f7faf8;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 550;
}

.race-command-round {
  padding-top: 12px;
  border-top: 1px solid rgba(37, 71, 59, 0.1);
}

.race-command-round h3 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
}

.clicktt-import-actions,
.race-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clicktt-meta-list {
  display: grid;
  gap: 6px;
  margin: 0;
}

.clicktt-meta-list div,
.race-day-metrics div {
  display: grid;
  grid-template-columns: minmax(94px, max-content) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid rgba(37, 71, 59, 0.08);
}

.clicktt-meta-list dt,
.race-day-metrics span {
  color: var(--muted);
  font-weight: 550;
}

.clicktt-meta-list dd {
  margin: 0;
  text-align: left;
  font-weight: 550;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.race-day-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.race-day-metrics div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-height: 58px;
}

.race-day-metrics strong {
  font-size: 1.05rem;
}

.race-participant-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.race-participant-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 53, 47, 0.06);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.race-participant-strip small {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
}

.race-roster-panel {
  gap: 12px;
}

.tt-race-roster-list {
  display: grid;
  gap: 8px;
}

.race-quota-notice {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(132, 94, 35, 0.28);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.82);
  color: #5b4630;
  font-size: 0.9rem;
}

.race-quota-notice.is-danger {
  border-color: rgba(166, 51, 43, 0.32);
  background: rgba(255, 242, 240, 0.88);
  color: #65302a;
}

.race-quota-notice p,
.race-quota-notice ul {
  margin: 0;
}

.race-quota-notice p {
  font-weight: 600;
}

.race-quota-notice ul {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}

.tt-race-roster-row {
  display: grid;
  grid-template-columns: 36px minmax(220px, 1fr) minmax(96px, 0.22fr) minmax(150px, 0.28fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(37, 71, 59, 0.1);
  border-radius: 8px;
  background: #fff;
}

.tt-race-roster-row.is-muted {
  opacity: 0.68;
}

.tt-race-roster-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 36px;
  border-radius: 8px;
  background: rgba(37, 53, 47, 0.06);
  color: var(--muted);
  font-weight: 600;
}

.tt-race-roster-name,
.tt-race-roster-rating,
.tt-race-roster-status {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tt-race-roster-name span,
.tt-race-roster-rating span,
.tt-race-roster-status span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
}

.tt-race-roster-name input,
.tt-race-roster-rating input,
.tt-race-roster-status select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 71, 59, 0.18);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

.tt-race-roster-rating input {
  text-align: right;
}

.race-round-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.race-setting-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(37, 71, 59, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.race-setting-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.race-flow-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: race-flow;
}

.race-flow-list li {
  counter-increment: race-flow;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--muted);
  font-weight: 550;
}

.race-flow-list li::before {
  content: counter(race-flow);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
  font-size: 0.75rem;
}

.race-flow-list li.is-done::before,
.race-flow-list li.is-active::before {
  background: var(--accent);
  color: #fff;
}

.race-flow-list li.is-active {
  color: var(--text);
}

.race-result-panel .current-round-list,
.race-round-entry-shell {
  min-width: 0;
}

.race-result-panel .round-entry-list {
  gap: 8px;
}

.race-result-panel .round-entry-row {
  background: #f8faf9;
}

.race-result-panel .round-entry-row > span {
  min-width: 0;
}

.race-result-control-stack {
  display: grid;
  gap: 7px;
  min-width: min(260px, 100%);
}

.set-score-field {
  display: grid;
  gap: 4px;
  min-width: 160px;
}

.set-score-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.set-score-field input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(37, 71, 59, 0.2);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}

.set-score-field input.is-invalid {
  border-color: rgba(170, 83, 51, 0.75);
  background: rgba(170, 83, 51, 0.07);
}

.set-score-error {
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
}

.tt-race-round-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(37, 71, 59, 0.1);
  border-radius: 8px;
  background: #f8faf9;
}

.tt-race-round-action > span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.tt-race-bye-inline {
  margin: 8px 0 0;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 600;
}

.tt-race-bye-notice {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(199, 154, 50, 0.28);
  border-radius: 8px;
  background: rgba(246, 239, 228, 0.74);
}

.tt-race-bye-notice strong {
  color: var(--ink);
}

.tt-race-bye-notice div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tt-race-bye-notice span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 600;
}

.round-entry-row.tt-race-entry-row {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
}

.tt-race-match-label {
  min-width: 0;
}

.tt-race-score-area {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.tt-race-score-area .set-score-field {
  min-width: 0;
}

.tt-race-bye-row {
  border: 1px solid rgba(199, 154, 50, 0.24);
  background: rgba(246, 239, 228, 0.78);
}

.tt-race-bye-row > strong {
  justify-self: end;
  color: var(--accent-strong);
}

.set-score-summary-pill {
  justify-self: end;
  min-width: 62px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(11, 122, 85, 0.18);
  border-radius: 8px;
  background: rgba(11, 122, 85, 0.08);
  color: var(--accent-strong);
  text-align: center;
}

.set-score-summary-pill.has-detail {
  min-width: 90px;
  display: grid;
  gap: 2px;
  align-content: center;
  text-align: right;
}

.set-score-summary-pill strong {
  color: var(--accent-strong);
  font-size: 0.98rem;
  line-height: 1;
}

.set-score-summary-pill small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
}

.set-score-summary-pill.is-empty {
  border-color: rgba(37, 71, 59, 0.1);
  background: rgba(37, 71, 59, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.empty-round-state {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 14px;
  border: 1px dashed rgba(37, 71, 59, 0.2);
  border-radius: 8px;
  background: #fff;
}

.empty-round-state.compact {
  min-height: 120px;
  align-content: center;
}

.tt-race-standings {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(37, 71, 59, 0.12);
}

.tt-race-standings-table {
  min-width: 620px;
}

.tt-race-standings-table th,
.tt-race-standings-table td {
  white-space: nowrap;
}

.clicktt-xml-preview {
  min-height: 248px;
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(37, 71, 59, 0.13);
  border-radius: 8px;
  background: #18211e;
  color: #e6f4ee;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
}

.clicktt-xml-preview code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.step-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.step-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.config-step-header {
  display: grid;
  gap: 10px;
}

.config-step-header .step-title-row {
  gap: 18px;
}

.config-step-header p {
  margin: 0;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.mode-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.mode-card.is-active {
  border-color: rgba(11, 122, 85, 0.5);
  background: rgba(11, 122, 85, 0.08);
  box-shadow: inset 0 -3px 0 rgba(212, 63, 50, 0.42);
}

.mode-card.is-static {
  cursor: default;
}

.mode-card.is-static:hover {
  transform: none;
}

.mode-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.mode-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.mode-description {
  color: var(--muted);
  line-height: 1.5;
}

.message-area {
  min-height: 20px;
}

.message {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(11, 122, 85, 0.08);
  border: 1px solid rgba(11, 122, 85, 0.14);
}

.wizard-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: min(860px, calc(100vh - 28px));
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.wizard-dialog::backdrop {
  background: rgba(45, 42, 38, 0.36);
  backdrop-filter: blur(4px);
}

.wizard-shell {
  display: grid;
  gap: 16px;
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  background: var(--card-strong);
  border: 1px solid rgba(37, 71, 59, 0.14);
  box-shadow: var(--shadow);
}

.wizard-header,
.wizard-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wizard-header h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.duplicate-dialog {
  width: min(680px, calc(100% - 24px));
}

.duplicate-dialog-shell {
  gap: 18px;
}

.duplicate-dialog-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.duplicate-choice-button {
  min-height: 92px;
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: center;
  text-align: center;
  border-radius: 8px;
}

.duplicate-choice-button strong {
  font-size: 1.25rem;
}

.duplicate-choice-button span {
  line-height: 1.35;
}

.duplicate-dialog-footer {
  justify-content: flex-end;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.wizard-progress-item {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 9px;
  border-radius: 8px;
  background: rgba(245, 248, 247, 0.8);
  border: 1px solid rgba(37, 71, 59, 0.1);
  color: var(--muted);
}

.wizard-progress-item span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.wizard-progress-item strong {
  font-size: 0.84rem;
  line-height: 1.25;
}

.wizard-progress-item.is-active,
.wizard-progress-item.is-complete {
  color: var(--accent-strong);
  background: rgba(11, 122, 85, 0.09);
  border-color: rgba(11, 122, 85, 0.2);
}

.wizard-body {
  min-height: 250px;
  display: grid;
  align-content: start;
}

.wizard-field-grid,
.wizard-summary-grid {
  display: grid;
  gap: 16px;
}

.wizard-field-grid.two-columns,
.wizard-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wizard-participant-step {
  display: grid;
  gap: 16px;
}

.wizard-player-names {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.wizard-player-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.wizard-info-panel {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(11, 122, 85, 0.16);
  border-radius: 8px;
  background: rgba(11, 122, 85, 0.07);
}

.wizard-info-panel strong {
  color: var(--accent-strong);
  font-size: 1rem;
}

.wizard-info-panel span {
  color: var(--muted);
  line-height: 1.45;
}

.wizard-field-grid input,
.wizard-field-grid select {
  height: 52px;
}

.wizard-checkbox-field {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.wizard-checkbox-field input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--accent-strong);
}

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

.wizard-choice-card {
  min-height: 132px;
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: left;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.wizard-choice-card.is-active {
  border-color: rgba(11, 122, 85, 0.48);
  background: rgba(11, 122, 85, 0.09);
  box-shadow: inset 0 -3px 0 rgba(212, 63, 50, 0.42);
}

.wizard-choice-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.wizard-choice-card:hover:not(:disabled) {
  transform: translateY(-1px);
}

.wizard-summary-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.wizard-summary-item span {
  color: var(--muted);
  font-weight: 600;
}

.wizard-summary-item strong {
  line-height: 1.3;
}

.wizard-footer {
  align-items: center;
  padding-top: 4px;
}

.wizard-footer-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.config-form {
  display: grid;
  gap: 18px;
}

.config-form input,
.config-form select {
  height: 52px;
  line-height: 1.2;
  border-radius: 8px;
}

.config-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.config-overview-card,
.config-details-card {
  height: 100%;
}

.app-header,
.config-overview-card {
  height: 100%;
}

.app-header {
  align-content: start;
}

.app-header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 auto;
  align-items: stretch;
}

.app-header-main,
.config-step-header {
  flex: 1 1 auto;
}

.config-details-shell {
  display: grid;
  gap: 18px;
}

.round-robin-participant-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  gap: 18px;
  align-items: start;
}

.form-grid,
.dual-names,
.sheet-grid,
.team-summary-grid {
  display: grid;
  gap: 18px;
}

.side-panel-stack {
  display: grid;
  gap: 18px;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.field-stack {
  display: grid;
  gap: 14px;
}

.form-grid-compact-count {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 200px);
}

.form-grid-round-robin-top {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.9fr) 180px;
  align-items: start;
}

.form-grid-round-robin-bottom {
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: start;
}

.round-robin-name-field {
  min-width: 0;
}

.round-robin-mode-field {
  min-width: 0;
}

.round-robin-count-field {
  justify-self: end;
}

.compact-number-field {
  width: 100%;
  max-width: 200px;
  justify-self: start;
}

.compact-number-field input {
  text-align: center;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

label span {
  font-size: 0.95rem;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(15, 118, 110, 0.26);
  outline-offset: 2px;
}

.name-section {
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.random-draw-section {
  display: grid;
  gap: 8px;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.stacked-name-grid {
  max-width: 100%;
}

.round-robin-player-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.team-name-fields {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.double-config-section {
  display: grid;
  gap: 16px;
}

.double-config-list,
.double-match-list {
  display: grid;
  gap: 14px;
}

.double-config-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.double-config-header,
.double-match-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.double-config-dual {
  align-items: start;
}

.double-config-title {
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--text);
}

.double-match-row {
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.double-match-controls {
  width: min(100%, 980px);
  flex: 1 1 760px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.double-match-row.is-complete {
  background: rgba(15, 118, 110, 0.1);
}

.double-match-copy {
  display: grid;
  gap: 4px;
  min-width: 240px;
  flex: 1 1 320px;
}

.double-match-copy span {
  color: var(--muted);
}

.double-round-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text);
}

.double-round-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}


.participant-import-section {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
  align-content: start;
}

.team-config-columns .participant-import-section {
  padding: 16px;
  border-radius: 8px;
  background: rgba(246, 239, 228, 0.52);
  border: 1px dashed rgba(125, 105, 79, 0.18);
}

.participant-import-textarea textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}

.participant-import-team-name {
  max-width: 100%;
}

.participant-import-toolbar,
.participant-import-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.file-picker-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
}

.file-picker-button input {
  display: none;
}

.participant-import-checkbox {
  width: fit-content;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.participant-import-checkbox input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent-strong);
}

.participant-import-file-note,
.participant-import-empty,
.participant-import-team-note,
.participant-import-warning {
  color: var(--muted);
  line-height: 1.45;
}

.participant-import-file-note {
  font-size: 0.9rem;
}

.participant-import-preview {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.participant-import-summary {
  display: grid;
  gap: 6px;
}

.participant-import-summary p {
  margin: 0;
}

.participant-import-summary strong {
  color: var(--accent-strong);
}

.participant-import-warning {
  color: var(--danger);
}

.participant-import-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.participant-import-list li {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(246, 239, 228, 0.78);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.participant-import-list li span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.participant-import-list li.is-duplicate {
  background: rgba(170, 83, 51, 0.1);
  border-color: rgba(170, 83, 51, 0.26);
}

.duplicate-badge,
.numbered-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.duplicate-badge {
  color: var(--danger);
  background: rgba(170, 83, 51, 0.12);
}

.numbered-badge {
  color: var(--accent-strong);
  background: rgba(15, 118, 110, 0.12);
}

.participant-import-more {
  color: var(--muted);
  font-weight: 700;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading.compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading-actions {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}

.history-tool-button {
  min-width: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 105, 79, 0.18);
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

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

.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.output-footer-toolbar {
  margin-top: 20px;
  margin-bottom: 0;
}

.sheet-meta {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sheet-meta-stack {
  display: grid;
  gap: 8px;
}

.sheet-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.sheet-mode-note,
.field-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.page-footer-status {
  margin-top: 16px;
  padding: 0 8px 8px;
  text-align: center;
  color: var(--muted);
}

.page-footer-status p {
  margin: 6px 0 0;
}

.round-backup-status {
  display: inline-grid;
  gap: 4px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.14);
  color: var(--text);
  text-align: left;
}

.round-backup-status strong,
.round-backup-status span {
  font-size: 0.9rem;
}

.round-backup-status span {
  color: var(--muted);
}

.summary-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(199, 154, 50, 0.14));
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.summary-banner.team-summary-banner,
.summary-banner.dual-summary-banner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  padding: 0;
  background: transparent;
  border: none;
}

.summary-banner-panel {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(199, 154, 50, 0.14));
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.summary-winner-card {
  padding: 22px;
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  box-shadow: none;
}

.sheet-stack {
  display: grid;
  gap: 18px;
}

.team-sheet-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.round-robin-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.round-robin-main-grid.is-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.round-robin-main-grid.is-compact > * {
  min-width: 0;
}

.table-card,
.current-round-card,
.sheet-area,
.sheet-stack {
  min-width: 0;
}

.table-card {
  overflow: hidden;
}

.team-summary-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.table-card,
.team-summary-card,
.winner-card {
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.wide-card {
  grid-column: auto;
}

.team-matrix-card {
  display: block;
}

.round-robin-matrix-card .matrix-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.round-robin-matrix-card.is-compact .table-wrapper {
  overflow-x: visible;
}

.round-robin-matrix-card.is-compact .table-wrapper {
  display: none;
}

.compact-matrix-overview {
  display: none;
}

.round-robin-matrix-card.is-compact .compact-matrix-overview {
  display: grid;
  grid-template-columns: repeat(var(--matrix-columns), minmax(0, 1fr));
  width: 100%;
  border: 1px solid rgba(37, 71, 59, 0.14);
  background: rgba(37, 71, 59, 0.08);
}

.compact-matrix-cell {
  min-width: 0;
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 8px 5px;
  border-right: 1px solid rgba(37, 71, 59, 0.12);
  border-bottom: 1px solid rgba(37, 71, 59, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: clamp(0.76rem, 1.5vw, 0.95rem);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.compact-matrix-header,
.compact-matrix-corner {
  background: #edf5f1;
  color: var(--accent-strong);
}

.compact-matrix-cell.is-diagonal {
  background: rgba(37, 71, 59, 0.07);
  color: var(--muted);
  font-size: 1.2rem;
}

.compact-matrix-cell.is-open {
  color: var(--muted);
}

.compact-matrix-cell.is-complete {
  background: rgba(11, 122, 85, 0.1);
  color: var(--accent-strong);
}

.round-robin-matrix-card.is-compact .matrix-table th,
.round-robin-matrix-card.is-compact .matrix-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.25;
  vertical-align: middle;
}

.round-robin-matrix-card .matrix-table th,
.round-robin-matrix-card .matrix-table td {
  box-sizing: border-box;
  min-width: 0;
  height: 64px;
}

.round-robin-matrix-card .matrix-table thead th {
  height: 56px;
}

.round-robin-matrix-card.is-compact .matrix-table th,
.round-robin-matrix-card.is-compact .matrix-table td {
  min-width: 0;
}

.round-robin-matrix-card.compact-small .matrix-table th,
.round-robin-matrix-card.compact-small .matrix-table td {
  padding: 6px 6px;
  font-size: 0.94rem;
  height: 58px;
}

.round-robin-matrix-card.compact-small .matrix-table td {
  min-width: 0;
}

.round-robin-matrix-card.compact-small .matrix-table tbody tr {
  height: 58px;
}

.round-robin-matrix-card.compact-medium .matrix-table th,
.round-robin-matrix-card.compact-medium .matrix-table td {
  padding: 6px 6px;
  height: 64px;
}

.round-robin-matrix-card.compact-medium .matrix-table {
  min-width: 0;
}

.round-robin-matrix-card.compact-medium .matrix-table td {
  min-width: 0;
}

.round-robin-matrix-card.compact-medium .matrix-table tbody tr {
  height: 64px;
}

.team-matrix-wrapper {
  display: block;
}

.team-summary-card.is-winner,
.winner-card {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.7));
}

.winner-card {
  display: grid;
  gap: 10px;
  align-content: center;
  justify-items: start;
}

.winner-card.is-draw {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12), rgba(255, 255, 255, 0.72));
}

.winner-breakdown {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.winner-metric {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.winner-metric-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.winner-metric-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.winner-metric-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-summary-card dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.team-summary-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(125, 105, 79, 0.22);
}

.team-summary-card dd,
.team-summary-card dt {
  margin: 0;
}

.team-summary-card dd {
  font-weight: 700;
}

.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.matrix-table,
.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 580px;
}

.matrix-table {
  table-layout: auto;
}

.matrix-table th,
.matrix-table td,
.stats-table th,
.stats-table td {
  border: 1px solid rgba(125, 105, 79, 0.18);
  padding: 6px 7px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.matrix-table th {
  min-width: 96px;
}

.matrix-table td {
  min-width: 104px;
}

.matrix-table tbody tr {
  height: 64px;
}

.matrix-table thead th,
.stats-table thead th {
  position: sticky;
  top: 0;
  background: #edf5f1;
  z-index: 1;
}

.stats-table tbody td:first-child,
.stats-table tbody td:nth-child(2) {
  background: rgba(255, 250, 242, 0.94);
}

.matrix-table tbody th {
  background: #edf5f1;
}

.matrix-name-col {
  width: 12%;
}

.matrix-score-col {
  width: auto;
}

.matrix-summary-col {
  width: 9%;
}

.matrix-number-heading,
.matrix-summary-heading {
  color: var(--accent-strong);
}

.matrix-table th.matrix-player-heading {
  text-align: left;
  white-space: nowrap;
}

.matrix-player-heading,
.matrix-summary-cell {
  line-height: 1.15;
}

.matrix-player-inline {
  max-width: 100%;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.matrix-summary-cell span {
  display: block;
}

.matrix-player-number {
  display: inline-block;
  width: 18px;
  flex: 0 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.matrix-player-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.matrix-summary-cell {
  background: #f4f8f6;
  color: var(--text);
}

.matrix-summary-cell strong {
  display: block;
  font-size: 1rem;
}

.matrix-summary-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.matrix-place-cell.place-first strong {
  color: var(--accent-strong);
}

.matrix-place-cell.is-tied span {
  color: var(--danger);
}

.matrix-table td.diagonal-cell {
  background: #d9dedb;
  color: #3f5049;
  font-weight: 800;
}

.mirrored-cell {
  color: var(--muted);
  background: transparent;
}

.score-select {
  min-width: 82px;
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 8px;
  text-align: center;
  text-align-last: center;
}

.round-plan-grid {
  display: grid;
  gap: 14px;
}

.round-control-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.round-counter-input {
  min-width: 96px;
  width: 96px;
}

.round-control-label {
  font-weight: 700;
  color: var(--text);
}

.round-counter-input input {
  text-align: center;
}

.round-counter-total {
  color: var(--muted);
  font-weight: 600;
}

.round-nav-button {
  border-radius: 999px;
  padding: 12px 16px;
  border: 1px solid rgba(125, 105, 79, 0.18);
  background: rgba(255, 255, 255, 0.9);
}

.round-nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.current-round-list {
  display: grid;
  gap: 12px;
}

.player-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.player-mini-card {
  padding: 16px;
  border-radius: 8px;
  background: rgba(246, 239, 228, 0.72);
  border: 1px solid rgba(125, 105, 79, 0.12);
  display: grid;
  gap: 10px;
}

.player-mini-header,
.player-mini-metrics {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.player-mini-header span,
.player-mini-metrics span {
  color: var(--muted);
}

.progress-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.progress-pill,
.round-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(246, 239, 228, 0.9);
  border: 1px solid rgba(125, 105, 79, 0.14);
}

.progress-pill.is-complete,
.round-status-badge.is-complete {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.progress-pill.is-progress,
.round-status-badge.is-progress {
  background: rgba(199, 154, 50, 0.16);
  color: #7a5a13;
}

.progress-pill.is-pending,
.round-status-badge.is-pending {
  background: rgba(148, 163, 184, 0.16);
  color: #4e6278;
}

.round-overview-toggle {
  margin-top: 18px;
  border: 1px solid rgba(125, 105, 79, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.round-overview-toggle summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  list-style: none;
}

.round-overview-toggle summary::-webkit-details-marker {
  display: none;
}

.round-overview-toggle summary::after {
  content: "+";
  float: right;
  color: var(--accent-strong);
}

.round-overview-toggle[open] summary::after {
  content: "-";
}

.round-overview-body {
  padding: 0 16px 16px;
}

.details-toggle {
  margin-top: 18px;
  border: 1px solid rgba(125, 105, 79, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.details-toggle summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  list-style: none;
}

.details-toggle-compact summary {
  padding: 14px 16px;
}

.details-toggle summary::-webkit-details-marker {
  display: none;
}

.details-toggle summary::after {
  content: "+";
  float: right;
  color: var(--accent-strong);
}

.details-toggle[open] summary::after {
  content: "-";
}

.details-toggle-body {
  padding: 0 16px 16px;
}

.font-size-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
  margin-bottom: 12px;
}

.font-size-toolbar-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.font-size-button-row {
  display: inline-flex;
  gap: 8px;
}

.font-size-button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(125, 105, 79, 0.18);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.player-stats-table-shell {
  --player-stats-font-size: 1rem;
  --player-stats-cell-padding-y: 12px;
  --player-stats-cell-padding-x: 10px;
  --player-stats-min-width: 580px;
}

.player-stats-table-shell .stats-table {
  width: max-content;
  min-width: var(--player-stats-min-width);
  margin: 0 auto;
  font-size: var(--player-stats-font-size);
}

.player-stats-table-shell .stats-table th,
.player-stats-table-shell .stats-table td {
  padding: var(--player-stats-cell-padding-y) var(--player-stats-cell-padding-x);
}

.player-stats-table-shell.is-font-small {
  --player-stats-font-size: 0.9rem;
  --player-stats-cell-padding-y: 8px;
  --player-stats-cell-padding-x: 7px;
  --player-stats-min-width: 500px;
}

.player-stats-table-shell.is-font-medium {
  --player-stats-font-size: 1rem;
  --player-stats-cell-padding-y: 12px;
  --player-stats-cell-padding-x: 10px;
  --player-stats-min-width: 580px;
}

.player-stats-table-shell.is-font-large {
  --player-stats-font-size: 1.08rem;
  --player-stats-cell-padding-y: 14px;
  --player-stats-cell-padding-x: 12px;
  --player-stats-min-width: 640px;
}

.round-entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.round-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 180px);
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(246, 239, 228, 0.72);
}

.round-entry-row span {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.compact-select {
  width: auto;
  min-width: 92px;
}

.round-card {
  padding: 16px;
  border-radius: 8px;
  background: rgba(246, 239, 228, 0.72);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.round-card.is-active-round {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
}

.round-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.round-card h4 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.round-pairings {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.round-pairing {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.round-pairing strong {
  color: var(--muted);
}

.round-pairing.is-complete {
  background: rgba(15, 118, 110, 0.1);
}

.round-pairing.is-complete strong {
  color: var(--accent-strong);
}

.bye-row {
  background: rgba(148, 163, 184, 0.12);
}

.place-first td:first-child,
.place-first td:nth-child(2) {
  background: rgba(199, 154, 50, 0.22);
}

.place-second td:first-child,
.place-second td:nth-child(2) {
  background: rgba(148, 163, 184, 0.22);
}

.place-third td:first-child,
.place-third td:nth-child(2) {
  background: rgba(182, 106, 60, 0.2);
}

.is-tied td:first-child {
  font-weight: 700;
  color: var(--danger);
}

.groups-config-grid {
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(150px, 190px));
}

.groups-placement-toggle {
  width: fit-content;
  margin: 0;
}

.groups-grid,
.knockout-round-grid,
.knockout-match-grid {
  display: grid;
  gap: 18px;
}

.groups-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.group-stage-card {
  min-width: 0;
}

.group-matrix-table,
.group-ranking-table {
  min-width: 520px;
}

.group-ranking-wrapper {
  margin-top: 16px;
}

.knockout-waiting-state,
.knockout-match-card {
  padding: 16px;
  border-radius: 8px;
  background: rgba(246, 239, 228, 0.72);
  border: 1px solid rgba(125, 105, 79, 0.12);
}

.knockout-waiting-state {
  display: grid;
  gap: 6px;
}

.knockout-waiting-state p {
  margin: 0;
  color: var(--muted);
}

.knockout-round-focus {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.knockout-round-focus h4 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.knockout-match-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.knockout-match-card {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.knockout-match-card div {
  display: grid;
  gap: 4px;
}

.knockout-match-card span {
  color: var(--muted);
}

.knockout-match-card.is-complete {
  background: rgba(15, 118, 110, 0.1);
}

.knockout-match-stack {
  display: grid;
  gap: 8px;
}

.placement-round-focus {
  padding-top: 4px;
}

.schedule-config-section {
  display: grid;
  gap: 16px;
}

.schedule-config-grid,
.field-name-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.schedule-card {
  padding: 0;
}

.schedule-toggle {
  margin-top: 0;
  border: none;
  background: transparent;
}

.schedule-toggle summary {
  padding: 20px;
}

.schedule-toggle-body {
  padding: 0 20px 20px;
}

.schedule-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.schedule-meta-row span,
.schedule-match-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.schedule-match-type {
  margin-right: 8px;
  background: rgba(199, 154, 50, 0.14);
  color: #7a5a13;
}

.schedule-table td:nth-child(4) {
  text-align: left;
}

.schedule-table tr.is-complete td {
  background: rgba(15, 118, 110, 0.06);
}

.compact-schedule-list {
  display: none;
}

.tt-race-round-history {
  display: grid;
  gap: 12px;
}

.tt-race-round-history .compact-schedule-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-schedule-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(82px, 0.28fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(37, 71, 59, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.compact-schedule-row.is-complete {
  background: rgba(11, 122, 85, 0.08);
}

.compact-schedule-row.is-bye {
  border-color: rgba(199, 154, 50, 0.24);
  background: rgba(246, 239, 228, 0.78);
}

.compact-schedule-row em {
  justify-self: end;
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.compact-schedule-time {
  display: grid;
  gap: 4px;
}

.compact-schedule-time strong {
  color: var(--text);
  font-size: 1.05rem;
}

.compact-schedule-time span,
.compact-schedule-meta span {
  color: var(--muted);
  font-weight: 700;
}

.compact-schedule-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.compact-schedule-main > strong {
  min-width: 0;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.compact-schedule-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-section,
.participant-import-preview,
.double-config-card,
.double-match-row,
.sheet-toolbar,
.summary-banner,
.summary-banner-panel,
.summary-winner-card,
.table-card,
.team-summary-card,
.winner-card,
.winner-metric,
.player-mini-card,
.round-entry-row,
.round-card,
.round-pairing,
.knockout-waiting-state,
.knockout-match-card,
.details-toggle,
.round-overview-toggle,
.wizard-checkbox-field,
.wizard-summary-item {
  border-radius: 8px;
  border-color: rgba(37, 71, 59, 0.12);
}

.name-section,
.double-config-card,
.table-card,
.team-summary-card,
.winner-card,
.player-mini-card,
.round-card,
.knockout-waiting-state,
.knockout-match-card,
.participant-import-preview {
  background: rgba(255, 255, 255, 0.78);
}

.sheet-toolbar,
.details-toggle,
.round-overview-toggle,
.round-entry-row,
.round-pairing,
.winner-metric,
.wizard-checkbox-field,
.wizard-summary-item {
  background: rgba(245, 248, 247, 0.82);
}

.summary-banner,
.summary-banner-panel,
.team-summary-card.is-winner,
.winner-card {
  background: linear-gradient(135deg, rgba(11, 122, 85, 0.11), rgba(255, 255, 255, 0.9));
  border-color: rgba(11, 122, 85, 0.18);
}

.winner-card.is-draw {
  background: linear-gradient(135deg, rgba(93, 111, 103, 0.12), rgba(255, 255, 255, 0.9));
}

.matrix-table th,
.matrix-table td,
.stats-table th,
.stats-table td {
  border-color: rgba(37, 71, 59, 0.14);
}

.matrix-table thead th,
.stats-table thead th {
  background: #edf5f1;
}

.stats-table tbody td:first-child,
.stats-table tbody td:nth-child(2) {
  background: rgba(255, 255, 255, 0.96);
}

.matrix-table tbody th {
  background: #edf5f1;
}

.matrix-table td.diagonal-cell {
  background: #d9dedb;
  color: #3f5049;
}

.mirrored-cell {
  background: transparent;
}

.progress-pill,
.round-status-badge {
  background: rgba(245, 248, 247, 0.95);
  border-color: rgba(37, 71, 59, 0.12);
}

.progress-pill.is-complete,
.round-status-badge.is-complete,
.round-card.is-active-round,
.round-pairing.is-complete,
.double-match-row.is-complete,
.knockout-match-card.is-complete,
.schedule-table tr.is-complete td {
  background: rgba(11, 122, 85, 0.09);
}

input,
select,
textarea,
.config-form input,
.config-form select,
.score-select {
  border-radius: 8px;
}

.live-stage,
.live-title-block,
.live-progress-panel,
.live-panel,
.live-winner-banner {
  border-radius: 8px;
}

.live-stage {
  background:
    linear-gradient(135deg, rgba(7, 85, 61, 0.98), rgba(16, 34, 28, 0.98)),
    #07553d;
}

.live-kicker {
  letter-spacing: 0;
  color: #ffb4aa;
}

.live-title-block h1 {
  letter-spacing: 0;
}
@media (max-width: 980px) {
  .round-robin-main-grid.is-compact,
  .round-robin-main-grid.compact-small,
  .round-robin-main-grid.compact-medium {
    grid-template-columns: 1fr;
  }

  .groups-config-grid,
  .groups-grid,
  .knockout-match-grid {
    grid-template-columns: 1fr;
  }

  .groups-placement-toggle {
    width: 100%;
  }

  .knockout-match-card {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-card .table-wrapper {
    display: none;
  }

  .compact-schedule-list {
    display: grid;
    gap: 10px;
  }
}

@media (max-width: 980px) {
  .race-day-topline,
  .workspace-header,
  .sheet-toolbar,
  .summary-banner,
  .section-heading.compact {
    flex-direction: column;
    align-items: stretch;
  }

  .app-header-top,
  .app-header-switch {
    flex-direction: column;
    align-items: stretch;
  }

  .app-header-title-row,
  .step-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .workspace-view-tabs,
  .race-day-board,
  .race-day-main-grid,
  .round-checkpoint-toolbar,
  .template-toolbar {
    grid-template-columns: 1fr;
  }

  .round-checkpoint-toolbar button,
  .template-actions {
    justify-content: stretch;
  }

  .round-checkpoint-toolbar button,
  .template-actions button {
    width: 100%;
  }

  .wizard-progress,
  .wizard-choice-grid,
  .wizard-field-grid.two-columns,
  .wizard-player-name-grid,
  .wizard-summary-grid {
    grid-template-columns: 1fr;
  }

  .wizard-body {
    min-height: 0;
  }

  .wizard-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-footer-actions {
    justify-content: stretch;
  }

  .wizard-footer-actions > * {
    flex: 1 1 140px;
  }

  .input-top-grid {
    grid-template-columns: 1fr;
  }

  .race-day-status-grid {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-summary-grid,
  .team-sheet-main-grid,
  .round-robin-main-grid,
  .dual-names,
  .form-grid-round-robin-bottom,
  .round-robin-player-grid,
  .summary-banner.team-summary-banner,
  .summary-banner.dual-summary-banner,
  .form-grid-round-robin-top,
  .form-grid-compact-count {
    grid-template-columns: 1fr;
  }

  .winner-breakdown,
  .duplicate-choice-grid {
    grid-template-columns: 1fr;
  }

  .double-match-controls {
    grid-template-columns: 1fr;
  }

  .compact-number-field {
    max-width: 100%;
  }

  .page-shell {
    width: min(100% - 20px, 1440px);
    margin-top: 14px;
  }

  .tab-chip {
    min-width: 0;
  }

  .round-entry-row {
    align-items: stretch;
    flex-direction: column;
  }

  .tab-chip-tools,
  .round-card-header,
  .player-mini-header,
  .player-mini-metrics {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .round-robin-participant-layout {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1180px) {
  .round-robin-main-grid.compact-small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1380px) {
  .round-robin-main-grid.compact-medium {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .team-sheet-main-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .team-matrix-wrapper {
    display: block;
  }
}

.live-workspace-panel {
  gap: 0;
}

.live-stage {
  width: min(100%, 1720px);
  min-height: calc(100svh - 48px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 24px;
  padding: clamp(22px, 3vw, 44px);
  border-radius: 8px;
  color: #f8fbf7;
  background:
    linear-gradient(135deg, rgba(10, 79, 74, 0.97), rgba(33, 45, 38, 0.98)),
    #0a4f4a;
  box-shadow: 0 28px 80px rgba(21, 36, 32, 0.28);
  overflow: auto;
}

.live-stage:fullscreen {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
}

.live-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 24px;
  align-items: stretch;
}

.live-title-block,
.live-progress-panel,
.live-panel,
.live-winner-banner {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.live-title-block {
  display: grid;
  gap: 18px;
  align-content: center;
  padding: clamp(24px, 4vw, 46px);
  border-radius: 8px;
}

.live-kicker {
  margin: 0;
  color: #d7c98f;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.live-title-block h1 {
  margin: 0;
  color: #ffffff;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2.25rem, 4.2vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.live-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.live-meta-row span,
.live-match-type {
  border-radius: 999px;
  padding: 8px 12px;
  color: #f8fbf7;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.live-progress-panel {
  display: grid;
  gap: 12px;
  align-content: center;
  justify-items: start;
  padding: 24px;
  border-radius: 8px;
}

.live-progress-value {
  color: #ffffff;
  font-size: clamp(2.8rem, 5.2vw, 5.4rem);
  line-height: 0.9;
  font-weight: 800;
}

.live-progress-label {
  color: rgba(248, 251, 247, 0.74);
  font-weight: 700;
}

.live-progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.live-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d7c98f;
}

.live-fullscreen-button {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 12px 16px;
  color: #102c2a;
  background: #ffffff;
  font-weight: 800;
}

.live-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr);
  gap: 24px;
  align-items: stretch;
}

.is-tt-race-live .live-main-grid {
  grid-template-columns: minmax(760px, 1.5fr) minmax(420px, 0.75fr);
}

.live-panel,
.live-winner-banner {
  border-radius: 8px;
  padding: clamp(20px, 3vw, 34px);
}

.live-panel-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.live-ranking-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.live-ranking-heading-row .live-panel-heading {
  margin-bottom: 0;
}

.live-ranking-limit-field {
  width: min(100%, 220px);
  display: grid;
  gap: 8px;
  color: rgba(248, 251, 247, 0.72);
  font-size: 0.9rem;
  font-weight: 800;
}

.live-ranking-limit-field select {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 10px 38px 10px 14px;
  color: #102c2a;
  background:
    linear-gradient(45deg, transparent 50%, #102c2a 50%),
    linear-gradient(135deg, #102c2a 50%, transparent 50%),
    #ffffff;
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px),
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  font-weight: 900;
  appearance: none;
  -webkit-appearance: none;
}

.live-panel h2,
.live-winner-banner h2 {
  margin: 0;
  color: #ffffff;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1.05;
}

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

.is-tt-race-live .live-round-columns {
  grid-template-columns: 1fr;
}

.live-round-columns h3 {
  margin: 0 0 12px;
  color: rgba(248, 251, 247, 0.76);
  font-size: clamp(1.1rem, 1.7vw, 1.5rem);
}

.live-match-list,
.live-ranking-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.live-match-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.live-round-panel .live-match-row {
  grid-template-columns: auto minmax(0, 1fr) max-content;
  gap: 12px;
  padding: 12px 14px;
}

.live-match-row strong {
  min-width: 0;
  color: #ffffff;
  font-size: clamp(1.08rem, 1.8vw, 1.55rem);
  overflow-wrap: normal;
  word-break: normal;
}

.live-round-panel .live-match-row strong {
  font-size: clamp(1rem, 1.2vw, 1.28rem);
  line-height: 1.15;
}

.live-match-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1em 0.35em;
  align-items: baseline;
}

.live-round-panel .live-match-players {
  flex-wrap: nowrap;
  align-items: center;
}

.live-match-player {
  white-space: nowrap;
}

.live-round-panel .live-match-player {
  min-width: 0;
}

.live-match-versus {
  color: rgba(248, 251, 247, 0.58);
  font-size: 0.82em;
  font-weight: 600;
  white-space: nowrap;
}

.live-match-row em {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 70px;
  color: #d7c98f;
  font-style: normal;
  font-size: clamp(1.2rem, 1.9vw, 1.75rem);
  font-weight: 900;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.live-match-score small {
  max-width: min(30vw, 360px);
  color: rgba(248, 251, 247, 0.66);
  font-size: 0.48em;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

.live-match-row.is-complete {
  background: rgba(215, 201, 143, 0.16);
}

.live-match-row.is-bye {
  background: rgba(215, 201, 143, 0.22);
}

.live-result-matrix-panel {
  display: grid;
  gap: 16px;
}

.live-matrix-wrapper {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.live-result-matrix-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: auto;
  color: #f8fbf7;
  font-size: clamp(0.88rem, 1.05vw, 1.05rem);
}

.live-result-matrix-table th,
.live-result-matrix-table td {
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 10px 12px;
  text-align: center;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.08);
}

.live-result-matrix-table thead th,
.live-result-matrix-table tbody th {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  font-weight: 900;
}

.live-result-matrix-table tbody th {
  text-align: left;
}

.live-result-matrix-table td strong,
.live-result-matrix-table td small {
  display: block;
}

.live-result-matrix-table td small {
  margin-top: 3px;
  color: rgba(248, 251, 247, 0.64);
  font-size: 0.72em;
  line-height: 1.2;
}

.live-result-matrix-table td.is-complete {
  background: rgba(215, 201, 143, 0.18);
  color: #ffffff;
}

.live-result-matrix-table td.is-open {
  color: rgba(248, 251, 247, 0.58);
}

.live-result-matrix-table td.is-diagonal {
  color: rgba(248, 251, 247, 0.72);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.live-empty-state {
  margin: 0;
  padding: 18px;
  border-radius: 8px;
  color: rgba(248, 251, 247, 0.72);
  background: rgba(255, 255, 255, 0.08);
}

.live-ranking-panel {
  display: grid;
  gap: 22px;
  align-content: start;
}

.live-team-standings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.live-team-standings article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 8px;
  color: rgba(248, 251, 247, 0.76);
  background: rgba(255, 255, 255, 0.1);
}

.live-team-standings article.is-leading {
  color: #ffffff;
  background: rgba(215, 201, 143, 0.18);
}

.live-team-standings strong {
  color: #ffffff;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.95;
}

.live-team-standings em,
.live-ranking-row em,
.live-ranking-row small,
.live-winner-banner span {
  color: rgba(248, 251, 247, 0.7);
  font-style: normal;
}

.live-ranking-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 6px 14px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.live-ranking-row > span {
  grid-row: span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: #102c2a;
  background: #ffffff;
  font-size: 1.22rem;
  font-weight: 900;
}

.live-ranking-row-compact > span {
  grid-row: span 2;
}

.live-ranking-row strong {
  min-width: 0;
  color: #ffffff;
  font-size: clamp(1.15rem, 1.65vw, 1.65rem);
  overflow-wrap: normal;
  word-break: normal;
}

.live-ranking-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  min-width: 0;
}

.live-ranking-metrics em,
.live-ranking-metrics small {
  line-height: 1.15;
  white-space: nowrap;
}

.live-ranking-row.place-first > span {
  background: var(--gold);
}

.live-ranking-row.place-second > span {
  background: var(--silver);
}

.live-ranking-row.place-third > span {
  background: var(--bronze);
  color: #ffffff;
}

.live-winner-banner {
  display: grid;
  gap: 10px;
  background: rgba(215, 201, 143, 0.18);
}

.live-winner-banner.is-draw {
  background: rgba(148, 163, 184, 0.18);
}

@media (max-width: 1100px) {
  .live-hero,
  .live-main-grid,
  .live-round-columns {
    grid-template-columns: 1fr;
  }

  .live-stage {
    min-height: auto;
  }
}

@media (max-width: 1240px) {
  .is-tt-race-live .live-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .live-stage {
    padding: 16px;
    border-radius: 8px;
  }

  .live-title-block,
  .live-progress-panel,
  .live-panel,
  .live-winner-banner {
    border-radius: 8px;
  }

  .live-match-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .live-match-player {
    white-space: normal;
  }

  .live-round-panel .live-match-players {
    flex-wrap: wrap;
  }

  .live-match-row em {
    justify-items: start;
    text-align: left;
  }

  .live-result-matrix-table {
    min-width: 580px;
  }

  .live-team-standings {
    grid-template-columns: 1fr;
  }

  .live-ranking-heading-row {
    flex-direction: column;
  }

  .live-ranking-limit-field {
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .page-shell {
    width: 100%;
    margin: 0;
  }

  .hero-actions,
  .app-header-switch,
  .race-day-shell,
  .participant-import-section,
  .template-toolbar,
  .tournament-workspace,
  .sheet-toolbar,
  #modeChooser,
  #configForm,
  #messageArea {
    display: none !important;
  }

  .card,
  .table-card,
  .team-summary-card,
  .winner-card {
    box-shadow: none;
    background: #fff;
    border-color: #bbb;
  }

  .step-card {
    padding: 16px;
    break-inside: avoid;
  }

  .layout {
    gap: 10px;
  }
}


.scoring-rules-toggle {
  border: 1px solid rgba(125, 105, 79, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.scoring-rules-toggle summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.scoring-rules-toggle summary::-webkit-details-marker {
  display: none;
}

.scoring-rules-toggle summary span {
  color: var(--accent-strong);
  font-size: 0.88rem;
}

.scoring-rules-body {
  padding: 0 16px 16px;
  display: grid;
  gap: 14px;
}

.scoring-points-grid,
.scoring-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.player-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.42fr);
  gap: 10px;
  align-items: end;
}

.participant-status-field {
  min-width: 0;
}

.participant-status-select,
.match-status-select {
  width: 100%;
}

.match-result-controls {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) 30px;
  gap: 6px;
  align-items: start;
  min-width: 116px;
  max-width: 180px;
}

.normal-result-control-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
  width: 100%;
  min-width: min(100%, 164px);
  max-width: 460px;
}

.normal-result-control-stack .match-result-controls {
  width: 100%;
  margin-inline: 0;
}

.normal-set-score-field {
  min-width: 0;
}

.normal-set-score-field input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding-block: 9px;
  font-size: 0.9rem;
}

.match-result-controls .score-select {
  width: 100%;
}

.matrix-table .score-select {
  min-height: 36px;
  height: 36px;
  padding: 6px 5px;
}

.normal-result-control-stack .score-select {
  height: 42px;
  min-height: 42px;
  padding-block: 9px;
}

.matrix-table .match-result-controls,
.current-round-list .match-result-controls {
  width: 100%;
  margin-inline: auto;
}

.matrix-table .match-result-controls {
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  align-items: center;
  min-width: 0;
  max-width: 92px;
}

.round-robin-matrix-card.is-compact .matrix-table .match-result-controls {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 86px;
  gap: 3px;
}

.round-robin-matrix-card.is-compact .matrix-table .score-select {
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 5px 4px;
}

.matrix-table .match-anomaly-trigger {
  width: 100%;
  height: 12px;
  min-height: 12px;
  padding: 0;
  border-color: transparent;
  color: rgba(37, 71, 59, 0.38);
  background: transparent;
  font-size: 0;
}

.matrix-table .match-anomaly-trigger::before {
  content: "";
  display: block;
  width: min(42px, 72%);
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.matrix-table .match-anomaly-control.is-active .match-anomaly-trigger,
.matrix-table .match-anomaly-trigger:hover,
.matrix-table .match-anomaly-trigger:focus-visible {
  border-color: transparent;
  color: #7d3d24;
  background: rgba(183, 89, 42, 0.05);
}

.round-robin-matrix-card.is-compact .matrix-table .match-anomaly-trigger {
  width: 100%;
  height: 11px;
  min-height: 11px;
  font-size: 0;
}

.round-robin-matrix-card.is-compact .matrix-table .match-anomaly-panel {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  width: min(220px, 82vw);
}

.match-anomaly-control {
  position: relative;
}

.match-anomaly-trigger {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(125, 105, 79, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.match-anomaly-trigger::-webkit-details-marker {
  display: none;
}

.match-anomaly-control.is-active .match-anomaly-trigger,
.match-anomaly-control[open] .match-anomaly-trigger {
  border-color: rgba(170, 83, 51, 0.32);
  background: rgba(170, 83, 51, 0.1);
  color: var(--danger);
}

.match-anomaly-panel {
  position: absolute;
  right: 0;
  z-index: 5;
  width: min(240px, 72vw);
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(125, 105, 79, 0.18);
  border-radius: 8px;
  background: var(--card-strong);
  box-shadow: 0 14px 34px rgba(54, 44, 32, 0.16);
}

.match-status-select {
  width: 100%;
}

.match-status-chip {
  grid-column: 1 / -1;
  justify-self: start;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(170, 83, 51, 0.1);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
}

.player-name-with-status {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.player-name-with-status.is-withdrawn {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.player-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid rgba(125, 105, 79, 0.18);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.player-status-badge.is-withdrawn {
  border-color: rgba(170, 83, 51, 0.25);
  background: rgba(170, 83, 51, 0.1);
  color: var(--danger);
}

.player-status-badge.is-missing {
  border-color: rgba(199, 154, 50, 0.28);
  background: rgba(199, 154, 50, 0.12);
  color: #7a5a12;
}

.player-mini-card.is-withdrawn {
  opacity: 0.72;
}

@media (min-width: 760px) {
  .normal-result-control-stack {
    grid-template-columns: minmax(190px, 1fr) minmax(116px, 180px);
    gap: 8px 10px;
  }

  .normal-result-control-stack .match-result-controls {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .normal-set-score-field {
    grid-column: 1;
    grid-row: 1;
  }

  .round-entry-row:has(.normal-result-control-stack) {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 42%);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: auto;
    margin: 10px;
  }

  .workspace-header > div,
  .app-header-main,
  .config-overview-card,
  .hero,
  .step-card {
    min-width: 0;
  }

  .workspace-primary-actions,
  .app-header-actions,
  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

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

  .workspace-primary-actions button,
  .app-header-actions button,
  .hero-actions button {
    width: 100%;
  }

  .workspace-view-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .view-tab-button {
    min-height: 42px;
    padding: 8px 6px;
  }

  .view-tab-title {
    font-size: 0.84rem;
  }

  .tab-chip-shell {
    flex-basis: 210px;
    min-width: 210px;
  }

  .hero h1 {
    font-size: 1.78rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .race-day-topline,
  .race-day-panel,
  .race-day-panel-header {
    align-items: stretch;
  }

  .race-day-status-grid,
  .race-day-metrics,
  .race-round-control {
    grid-template-columns: 1fr;
  }

  .race-day-panel-header,
  .race-command-main,
  .race-command-round,
  .clicktt-import-actions,
  .race-export-actions {
    flex-direction: column;
  }

  .race-command-actions,
  .race-command-actions button {
    width: 100%;
  }

  .race-command-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tt-race-roster-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .tt-race-roster-rating,
  .tt-race-roster-status,
  .tt-race-roster-row button {
    grid-column: 2;
  }

  .clicktt-import-actions button,
  .race-export-actions button,
  .race-day-panel-header button {
    width: 100%;
  }

  .clicktt-xml-preview {
    min-height: 180px;
    max-height: 240px;
    font-size: 0.72rem;
  }

  .hero-copy,
  .workspace-header p,
  .view-tab-copy,
  .step-header p {
    overflow-wrap: anywhere;
  }

  .player-config-row {
    grid-template-columns: 1fr;
  }

  .match-result-controls {
    min-width: 116px;
  }

  .normal-result-control-stack {
    max-width: none;
  }

  .round-robin-matrix-card.is-compact {
    padding: 16px;
  }

  .compact-matrix-cell {
    min-height: 48px;
    padding: 6px 3px;
    font-size: 0.72rem;
  }

  .round-robin-matrix-card.is-compact .matrix-table th,
  .round-robin-matrix-card.is-compact .matrix-table td {
    padding: 7px 4px;
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .matrix-table tbody tr,
  .round-robin-matrix-card.is-compact .matrix-table tbody tr {
    height: 58px;
  }

  .round-robin-matrix-card.is-compact .matrix-table .match-result-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    max-width: 86px;
  }

  .round-robin-matrix-card.is-compact .matrix-table .score-select {
    min-height: 34px;
    padding: 5px 2px;
    font-size: 0.82rem;
  }

  .round-robin-matrix-card.is-compact .matrix-table .match-anomaly-trigger {
    width: 100%;
    height: 11px;
    min-height: 11px;
    font-size: 0;
  }

  .round-entry-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tt-race-score-area {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .set-score-summary-pill {
    justify-self: end;
  }

  .table-wrapper {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  .matrix-table,
  .stats-table {
    min-width: 520px;
  }

  .tt-race-standings-table {
    min-width: 560px;
  }

  .round-entry-row .match-result-controls,
  .round-entry-row .score-select {
    width: 100%;
    max-width: none;
  }

  .compact-schedule-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-schedule-row > .round-status-badge {
    justify-self: start;
  }
}

.card,
.wizard-dialog,
.wizard-shell,
.view-tab-button,
.tab-chip,
.mode-card,
.wizard-choice-card,
.name-section,
.participant-import-preview,
.double-config-card,
.double-match-row,
.sheet-toolbar,
.summary-banner,
.summary-banner-panel,
.summary-winner-card,
.table-card,
.team-summary-card,
.winner-card,
.winner-metric,
.player-mini-card,
.round-entry-row,
.round-card,
.round-pairing,
.knockout-waiting-state,
.knockout-match-card,
.details-toggle,
.round-overview-toggle,
.wizard-checkbox-field,
.wizard-summary-item,
.live-stage,
.live-title-block,
.live-progress-panel,
.live-panel,
.live-winner-banner {
  border-radius: 8px;
}
