:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    font-synthesis: none;
    --accent: #1768e5;
    --accent-strong: #0f56c7;
    --accent-soft: #eaf2ff;
    --nav: #111b2d;
    --nav-raised: #1b2940;
    --background: #f4f6f9;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --surface-raised: #ffffff;
    --text: #172033;
    --text-secondary: #5f6d82;
    --text-tertiary: #5f6d82;
    --border: #dce3ec;
    --border-strong: #c8d2df;
    --success: #16794a;
    --success-soft: #eaf7f0;
    --warning: #8a5a00;
    --warning-soft: #fff6df;
    --danger: #b42318;
    --danger-soft: #fff0ef;
    --focus: #91bdf9;
    --shadow-sm: 0 1px 2px rgb(18 32 52 / 0.05);
    --shadow-md: 0 12px 32px rgb(18 32 52 / 0.08);
    --shadow-lg: 0 24px 70px rgb(18 32 52 / 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --sidebar-width: 244px;
    --topbar-height: 68px;
}

/* Public tournament views and publication controls */
.publication-card {
  align-self: start;
}

.publication-heading,
.public-tournament-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.publication-heading h2,
.public-tournament-header h1 {
  margin-bottom: 0;
}

.publication-status--public,
.public-check-in--checked_in,
.public-check-in--complete {
  background: #e9f8ef;
  color: #08783e;
}

.publication-status--private,
.public-check-in--not_checked_in,
.public-check-in--partial {
  background: #fff5d9;
  color: #7a5200;
}

.public-check-in--withdrawn {
  background: #edf0f4;
  color: #536174;
}

.publication-form {
  display: grid;
  gap: 1rem;
}

.publication-switch {
  align-items: center;
  background: #f6f9fd;
  border: 1px solid #d6e0ed;
  border-radius: 0.875rem;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0.875rem 1rem;
}

.publication-switch span {
  display: grid;
  gap: 0.25rem;
}

.publication-switch small {
  color: #536174;
  font-weight: 400;
  line-height: 1.35;
}

.publication-switch-control {
  display: grid;
  flex: 0 0 auto;
  height: 44px;
  place-items: center;
  position: relative;
  width: 52px;
}

.publication-card .publication-switch-control input[type="checkbox"] {
  cursor: inherit;
  height: 44px;
  inset: 0;
  margin: 0;
  min-height: 44px;
  opacity: 0;
  position: absolute;
  width: 52px;
  z-index: 1;
}

.publication-switch-control > span[aria-hidden] {
  background: #dce2eb;
  border: 1px solid #aeb8c8;
  border-radius: 999px;
  display: block;
  height: 28px;
  position: relative;
  transition: background-color 160ms ease, border-color 160ms ease;
  width: 48px;
}

.publication-switch-control > span[aria-hidden]::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(17 27 45 / 25%);
  content: "";
  height: 20px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 160ms ease;
  width: 20px;
}

.publication-switch-control input:checked + span {
  background: #1769e8;
  border-color: #1769e8;
}

.publication-switch-control input:checked + span::after {
  transform: translateX(20px);
}

.publication-switch-control input:focus-visible + span {
  outline: 3px solid #91bdf9;
  outline-offset: 3px;
}

.publication-share-links {
  border-top: 1px solid #dce4ef;
  display: grid;
  gap: 0.875rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}

.publication-share-links h3 {
  margin: 0;
}

.publication-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.publication-embed-list {
  display: grid;
  gap: 0.75rem;
}

.publication-embed-list label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.publication-embed-list code {
  background: #111b2d;
  border-radius: 0.625rem;
  color: #f7f9fc;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-x: auto;
  padding: 0.75rem;
  white-space: nowrap;
}

.public-tournament-page {
  background: #f3f6fa;
  color: #111b2d;
  margin: 0;
  min-height: 100vh;
}

.public-tournament-page > main {
  margin: 0 auto;
  max-width: 90rem;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.public-site-bar {
  align-items: center;
  background: #111b2d;
  color: #fff;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0.5rem clamp(1rem, 3vw, 2.5rem);
}

.public-site-bar > a {
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.public-site-bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.public-site-bar nav a {
  border-radius: 0.45rem;
  color: #dce8f8;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  text-decoration: none;
}

.public-site-bar nav a.active,
.public-site-bar nav a:focus-visible,
.public-site-bar nav a:hover {
  background: #fff;
  color: #111b2d;
}

.public-tournament-view {
  background: #fff;
  border: 1px solid #d9e2ee;
  border-radius: 1rem;
  box-shadow: 0 1rem 2.5rem rgb(17 27 45 / 8%);
  overflow: hidden;
}

.public-tournament-header {
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  border-bottom: 1px solid #d9e2ee;
  padding: clamp(1rem, 3vw, 2rem);
}

.public-tournament-header p {
  margin-bottom: 0;
}

.public-live-status,
.public-check-in {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.4rem 0.65rem;
  white-space: nowrap;
}

.public-live-status {
  background: #e9f8ef;
  color: #08783e;
}

.public-live-status::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 0.45rem;
  margin: 0.2rem 0.4rem 0 0;
  width: 0.45rem;
}

.public-live-status--offline {
  background: #fff1ef;
  color: #a32d24;
}

.public-tournament-view .print-section,
.public-round-links {
  padding: clamp(1rem, 3vw, 2rem);
}

.public-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.public-table-scroll table {
  margin: 0;
  min-width: 58rem;
  width: 100%;
}

.public-table-scroll th,
.public-table-scroll td {
  vertical-align: middle;
}

.public-display-number,
.public-round-cell {
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.public-display-number {
  color: #16345f;
  font-weight: 800;
}

.public-round-cell {
  min-width: 3.25rem;
}

.public-round-token {
  align-items: center;
  background: #edf1f6;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  color: #334155;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 2rem;
  min-width: 2.4rem;
  padding: 0.25rem 0.45rem;
  white-space: nowrap;
}

.public-round-token.result-win {
  background: #eaf8ef;
  border-color: #86d4a8;
  color: #14733d;
}

.public-round-token.result-loss {
  background: #fff1f1;
  border-color: #f4b5b5;
  color: #ae3030;
}

.public-round-token.result-draw {
  background: #f4efff;
  border-color: #c5b4ed;
  color: #6442a5;
}

.public-round-token.bye {
  background: #fff6d9;
  border-color: #f0cc7a;
  color: #8a5b00;
}

.public-team-standings-table tbody,
.pairings-print-table .team-match-print-heading {
  break-inside: avoid;
  page-break-inside: avoid;
}

.team-public-summary-row {
  background: #edf4ff;
}

.team-public-summary-row th {
  color: #16345f;
  text-align: left;
}

.team-public-member-row td {
  background: #fbfcfe;
  color: #536174;
}

.public-view-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  padding: clamp(1rem, 3vw, 2rem);
}

.public-view-card {
  background: #f7faff;
  border: 1px solid #d6e0ed;
  border-radius: 0.875rem;
  display: grid;
  gap: 0.35rem;
  min-height: 6rem;
  padding: 1rem;
  text-decoration: none;
}

.public-view-card:hover,
.public-view-card:focus-visible {
  border-color: #1769e8;
  box-shadow: 0 0 0 3px rgb(23 105 232 / 14%);
}

.public-view-card span {
  color: #536174;
}

.public-round-links {
  border-top: 1px solid #d9e2ee;
}

.public-round-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.public-bracket-frame {
  margin: 0;
  overflow: auto;
  padding: clamp(0.5rem, 2vw, 1.5rem);
}

.public-bracket-frame img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
  min-width: min(42rem, 100%);
}

@media (max-width: 640px) {
  .publication-heading,
  .public-tournament-header {
    align-items: stretch;
    flex-direction: column;
  }

  .publication-status,
  .public-live-status {
    align-self: flex-start;
  }

  .publication-switch {
    align-items: flex-start;
  }

  .public-tournament-page > main {
    padding: 0;
  }

  .public-site-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-site-bar nav {
    justify-content: flex-start;
  }

  .public-tournament-view {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    box-shadow: none;
    min-height: 100vh;
  }

  .public-table-scroll {
    margin-inline: -1rem;
    padding-inline: 1rem;
  }
}

@media print {
  .public-tournament-page,
  .public-tournament-page > main {
    background: #fff;
    padding: 0;
  }

  .public-tournament-view {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .public-live-status {
    display: none;
  }

  .public-site-bar {
    display: none;
  }

  .public-table-scroll,
  .public-bracket-frame {
    overflow: visible;
  }
}

.mixed-ko-selection {
    display: grid;
    gap: 1rem;
}

.mixed-ko-selection-heading,
.mixed-ko-groups,
.inline-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.mixed-ko-preview {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border, #d5dbe5);
    border-radius: 0.65rem;
    background: var(--surface-muted, #f6f8fb);
}

.mixed-ko-groups fieldset {
    flex: 1 1 20rem;
    display: flex;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
}

.group-check {
    white-space: nowrap;
}

.macmahon-assignment-section {
    overflow: visible;
}

.macmahon-assignment-section .section-heading-row {
    align-items: end;
    margin-bottom: 20px;
}

.macmahon-assignment-form {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.macmahon-settings-title {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.macmahon-settings-title strong,
.macmahon-settings-title span {
    display: block;
}

.macmahon-settings-title strong {
    font-size: 0.83rem;
}

.macmahon-settings-title span {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.macmahon-segmented {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 3px;
    border-radius: 10px;
    background: #edf0f4;
}

.macmahon-segmented button {
    min-height: 36px;
    border: 0;
    padding: 0 15px;
    background: transparent;
    box-shadow: none;
    color: #66758a;
    font-size: 0.7rem;
}

.macmahon-segmented button:hover {
    border: 0;
    background: rgb(255 255 255 / 0.62);
    box-shadow: none;
    color: var(--accent);
}

.macmahon-segmented button.active {
    background: #fff;
    box-shadow: 0 2px 6px rgb(26 39 61 / 0.12);
    color: var(--accent);
}

.macmahon-info {
    display: flex;
    gap: 10px;
    margin: 16px 18px 0;
    border: 1px solid #cfe0f7;
    border-radius: 10px;
    padding: 11px 13px;
    background: #f3f8ff;
    color: #3b5f8d;
}

.macmahon-info span {
    font-weight: 800;
}

.macmahon-info p {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.5;
}

.macmahon-group-cards {
    display: grid;
    gap: 9px;
    padding: 16px 18px;
}

.macmahon-group-card {
    display: grid;
    grid-template-columns: 66px minmax(310px, 1.25fr) minmax(180px, 0.75fr) 38px;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    background: #fff;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.macmahon-group-card:hover {
    border-color: #bfd0e6;
    box-shadow: 0 5px 16px rgb(27 45 74 / 0.05);
}

.macmahon-group-score {
    display: grid;
    width: 62px;
    height: 58px;
    place-items: center;
    align-content: center;
    border-radius: 11px;
    background: var(--success-soft);
    color: var(--success);
}

.macmahon-group-score small {
    font-size: 0.5rem;
    font-weight: 820;
    letter-spacing: 0.06em;
}

.macmahon-group-score strong {
    margin-top: 2px;
    font-size: 1.2rem;
}

.macmahon-group-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 9px;
}

.macmahon-group-fields label {
    display: grid;
    gap: 5px;
    color: #667489;
    font-size: 0.62rem;
    font-weight: 750;
}

.macmahon-group-fields input,
.macmahon-group-fields select {
    width: 100%;
    min-height: 40px;
}

.macmahon-group-preview {
    min-width: 0;
}

.macmahon-group-preview strong,
.macmahon-group-preview span {
    display: block;
}

.macmahon-group-preview strong {
    font-size: 0.72rem;
}

.macmahon-group-preview span {
    margin-top: 4px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.64rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.macmahon-remove-group {
    display: grid;
    width: 38px;
    min-height: 38px;
    place-items: center;
    border-color: transparent;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: var(--danger);
    font-size: 1.15rem;
}

.macmahon-remove-group:hover {
    border-color: #f0c0bc;
    background: var(--danger-soft);
    box-shadow: none;
    color: var(--danger);
}

.macmahon-add-group {
    display: flex;
    width: calc(100% - 36px);
    min-height: 44px;
    margin: 0 18px 16px;
    border: 1px dashed #b7c6d9;
    background: #fafcff;
    box-shadow: none;
    color: var(--accent);
}

.macmahon-add-group:hover {
    border-color: #78a8e8;
    background: #f2f7ff;
    box-shadow: none;
}

.macmahon-validation {
    display: flex;
    gap: 11px;
    margin: 0 18px 18px;
    border: 1px solid #a9d9bd;
    border-radius: 10px;
    padding: 12px;
    background: var(--success-soft);
    color: #236b42;
}

.macmahon-validation.warning {
    border-color: #e6cc83;
    background: var(--warning-soft);
    color: var(--warning);
}

.macmahon-validation > span {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.72);
    font-weight: 850;
}

.macmahon-validation strong {
    font-size: 0.72rem;
}

.macmahon-validation p {
    margin: 3px 0 0;
    font-size: 0.66rem;
}

.macmahon-assignment-form > .form-result:not(:empty) {
    margin: 0 18px 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--background);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 80% -10%, rgb(63 126 225 / 0.08), transparent 34rem),
        var(--background);
    color: var(--text);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

body.has-open-sidebar {
    overflow: hidden;
}

a {
    color: var(--accent-strong);
    text-underline-offset: 0.16em;
}

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

button,
a,
input,
select,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

[hidden] {
    display: none !important;
}

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

.skip-link {
    position: fixed;
    z-index: 200;
    top: 8px;
    left: 50%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: #fff;
    transform: translate(-50%, -160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    z-index: 80;
    top: 0;
    display: flex;
    height: 100vh;
    min-width: 0;
    flex-direction: column;
    padding: 18px 13px 14px;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.025), transparent 44%),
        var(--nav);
    color: #dce4ef;
    box-shadow: 8px 0 30px rgb(13 24 41 / 0.06);
}

.app-identity--sidebar {
    position: sticky;
    z-index: 3;
    top: -18px;
    display: grid;
    flex: 0 0 auto;
    gap: 1px;
    margin-top: -18px;
    padding-top: 18px;
    padding-bottom: 8px;
    background: var(--nav);
}

.brand {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    padding: 0 9px;
    color: #fff;
    text-decoration: none;
}

.brand strong {
    overflow: hidden;
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-version {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.55rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.035em;
    line-height: 1.25;
    white-space: nowrap;
}

.app-version i {
    font-style: normal;
}

.app-identity--sidebar .app-version {
    margin-left: 56px;
    color: #8998ad;
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(145deg, #2f83ff, #135dce);
    box-shadow: 0 7px 18px rgb(0 83 197 / 0.34);
    color: #fff;
    font-size: 1rem;
}

.tournament-context {
    margin-top: 22px;
}

.tournament-context-card {
    display: grid;
    min-height: 64px;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #2b3b55;
    border-radius: var(--radius-md);
    background: var(--nav-raised);
    color: #fff;
    box-shadow: inset 0 1px rgb(255 255 255 / 0.04);
}

.tournament-context-copy {
    min-width: 0;
}

.tournament-context-card small,
.tournament-context-card strong,
.tournament-context-card em {
    display: block;
}

.tournament-context-card small {
    color: #8f9db2;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tournament-context-card strong {
    overflow: hidden;
    margin-top: 2px;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tournament-context-card em {
    margin-top: 2px;
    color: #aeb9c9;
    font-size: 0.64rem;
    font-style: normal;
}

.tournament-monogram {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    background: #dcebff;
    color: #285992;
    font-size: 0.68rem;
    font-weight: 800;
}

.primary-nav {
    display: grid;
    gap: 3px;
    margin-top: 20px;
}

.tournament-back-link {
    color: #9fb3cf;
}

.tournament-back-link strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-section-label {
    margin: 17px 9px 6px;
    color: #77869c;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-link {
    display: grid;
    min-height: 44px;
    grid-template-columns: 25px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: 10px;
    color: #b8c3d2;
    text-decoration: none;
}

.nav-link:hover {
    background: rgb(255 255 255 / 0.055);
    color: #fff;
}

.nav-link.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 9px 22px rgb(23 104 229 / 0.25);
}

.nav-link > span {
    color: #8fa0b6;
    font-size: 0.9rem;
    text-align: center;
}

.nav-link.active > span {
    color: #d9e9ff;
}

.nav-link strong {
    overflow: hidden;
    font-size: 0.73rem;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.completed-round-nav {
    display: grid;
    gap: 3px;
}

.nav-round-link {
    min-height: 38px;
    margin-left: 12px;
}

.nav-round-link > span {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid #465874;
    border-radius: 50%;
    font-size: 0.63rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.nav-round-link.active > span {
    border-color: #d9e9ff;
}

.sidebar-footer {
    display: grid;
    min-height: 58px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 12px 8px 0;
    border-top: 1px solid #26364e;
}

.sidebar-footer > .nav-link {
    grid-column: 1 / -1;
}

.avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #31435f;
    color: #dbe8f9;
    font-size: 0.63rem;
    font-weight: 800;
}

.user-copy {
    min-width: 0;
}

.user-copy strong,
.user-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    color: #f3f6fa;
    font-size: 0.68rem;
}

.user-copy small {
    margin-top: 2px;
    color: #8998ad;
    font-size: 0.59rem;
}

.logout-form {
    display: block;
}

.main-column {
    min-width: 0;
}

.topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    display: grid;
    min-height: var(--topbar-height);
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / 0.9);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-subtle);
}

.language-control {
    position: relative;
    display: inline-flex;
    min-width: 0;
    justify-self: end;
}

.language-menu {
    display: none;
}

.language-switcher a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.language-switcher a:hover,
.language-switcher a.active {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--accent-strong);
}

.language-switcher--auth {
    grid-column: 1 / -1;
    justify-self: start;
    border-color: rgb(255 255 255 / 0.24);
    background: rgb(255 255 255 / 0.08);
}

.language-switcher--auth a {
    color: #c8d4e5;
}

.language-switcher--auth a:hover,
.language-switcher--auth a.active {
    background: rgb(255 255 255 / 0.14);
    box-shadow: none;
    color: #fff;
}

.topbar-brand {
    display: none;
    color: var(--text);
    font-weight: 750;
    text-decoration: none;
}

.app-identity--topbar {
    display: none;
    min-width: 0;
}

.topbar-context {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 680;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1ea35b;
    box-shadow: 0 0 0 4px rgb(30 163 91 / 0.12);
}

.topbar .menu-button {
    display: none;
}

.sidebar-scrim {
    position: fixed;
    z-index: 70;
    inset: 0;
    border: 0;
    background: rgb(9 18 32 / 0.48);
    backdrop-filter: blur(2px);
}

.shell {
    width: min(100%, 1580px);
    min-width: 0;
    margin: 0 auto;
    padding: 34px 38px 64px;
}

.page-header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 22px;
}

.home-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 28px;
    margin-bottom: 26px;
}

.home-page-copy {
    max-width: 680px;
}

.home-page-copy > p:last-child {
    max-width: 560px;
    margin-top: 9px;
    font-size: 0.98rem;
    line-height: 1.55;
}

.home-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.home-page-actions .button-link {
    min-height: 46px;
}

.home-page-actions svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.home-tournaments {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.home-tournaments-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 22px 18px;
}

.home-tournaments-heading h2 {
    font-size: 1.18rem;
}

.home-tournaments-heading h2 + p {
    max-width: 620px;
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.55;
}

.home-tournament-tools {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(170px, auto);
    gap: 10px;
    padding: 0 22px 16px;
}

.home-tournament-search,
.home-tournament-filter {
    position: relative;
    display: block;
}

.home-tournament-search svg {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-tertiary);
    stroke-linecap: round;
    stroke-width: 1.8;
    transform: translateY(-50%);
    pointer-events: none;
}

.home-tournament-search input {
    padding-left: 40px;
    background: var(--surface-subtle);
}

.home-tournament-filter select {
    min-width: 170px;
    background-color: var(--surface-subtle);
}

.home-filter-summary {
    min-height: 20px;
    padding: 0 22px 8px;
    color: var(--text-tertiary);
    font-size: 0.76rem;
}

.home-tournament-list {
    padding: 0;
    border-top: 1px solid var(--border);
    margin: 0;
    list-style: none;
}

.home-tournament-item + .home-tournament-item {
    border-top: 1px solid var(--border);
}

.home-tournament-card {
    padding: 20px 22px;
    background: var(--surface);
    transition: background 150ms ease;
}

.home-tournament-card:hover {
    background: #fbfcfe;
}

.home-tournament-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.home-tournament-identity {
    min-width: 0;
}

.home-tournament-title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.home-tournament-title-row h3 {
    min-width: 0;
    font-size: 1.02rem;
}

.home-tournament-title-row h3 a {
    color: var(--text);
    text-decoration: none;
}

.home-tournament-title-row h3 a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

.home-tournament-identity > p {
    margin-top: 5px;
    font-size: 0.82rem;
}

.home-tournament-status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 6px;
    border: 1px solid #c8d5e6;
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--accent-soft);
    color: #24558f;
    font-size: 0.72rem;
    font-weight: 720;
    white-space: nowrap;
}

.home-tournament-status > span {
    font-size: 0.65rem;
}

.home-tournament-status--running,
.home-tournament-status--completed,
.home-tournament-status--fesa_exported {
    border-color: #9fd8ba;
    background: var(--success-soft);
    color: var(--success);
}

.home-tournament-status--archived {
    border-color: var(--border-strong);
    background: #eef1f5;
    color: var(--text-secondary);
}

.home-tournament-open {
    min-width: 102px;
}

.home-tournament-open > span:last-child {
    font-size: 1.25rem;
    line-height: 0;
}

.home-tournament-metadata {
    display: grid;
    grid-template-columns: 1.1fr 0.6fr 1fr 1fr;
    gap: 12px;
    margin: 18px 0 0;
}

.home-tournament-metadata > div {
    min-width: 0;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
}

.home-tournament-metadata dt,
.home-tournament-history dt {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 680;
}

.home-tournament-metadata dd,
.home-tournament-history dd {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.home-tournament-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
}

.home-tournament-footer > p {
    font-size: 0.78rem;
}

.home-tournament-footer > p span {
    margin-right: 7px;
    color: var(--text-tertiary);
}

.home-tournament-actions {
    min-width: 0;
}

.home-tournament-actions summary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    border-radius: 9px;
    padding: 7px 10px;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.home-tournament-actions summary::-webkit-details-marker {
    display: none;
}

.home-tournament-actions summary:hover {
    background: var(--accent-soft);
}

.home-tournament-actions summary > span:first-child {
    letter-spacing: 0.08em;
}

.home-tournament-actions[open] {
    flex: 1 0 100%;
}

.home-tournament-actions-panel {
    display: grid;
    gap: 14px;
    margin-top: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.home-tournament-history {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.home-tournament-secondary-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.home-tournament-secondary-actions form {
    display: inline-flex;
}

.home-tournament-secondary-actions button {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.75rem;
}

.home-empty-state,
.home-filter-empty {
    display: grid;
    min-height: 240px;
    place-items: center;
    align-content: center;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding: 28px;
    background: var(--surface-subtle);
    text-align: center;
}

.home-empty-state h3 {
    margin-top: 4px;
    font-size: 1rem;
}

.home-empty-state p {
    max-width: 430px;
    font-size: 0.84rem;
}

.home-empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.home-empty-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.home-filter-empty {
    min-height: 160px;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.page-header > div {
    min-width: 0;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(1.85rem, 3vw, 2.45rem);
    font-weight: 760;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 730;
    letter-spacing: -0.015em;
}

h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 720;
}

p {
    margin: 0;
    color: var(--text-secondary);
}

.page-header h1 + p,
h1 + p {
    margin-top: 9px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent-strong);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.section-intro {
    margin: 6px 0 18px;
    font-size: 0.78rem;
}

.tournament-heading {
    align-items: center;
}

.crumb {
    margin-bottom: 14px;
    color: var(--text-tertiary);
    font-size: 0.76rem;
}

.crumb a {
    color: inherit;
    text-decoration: none;
}

.crumb a:hover {
    color: var(--accent);
}

form {
    display: grid;
    min-width: 0;
    gap: 13px;
}

label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: #4d5b70;
    font-size: 0.78rem;
    font-weight: 620;
}

label:has(> input[type="checkbox"]):not(.check-in-toggle) {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 9px;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 9px 11px;
    background: #fff;
    color: var(--text);
    box-shadow: inset 0 1px 2px rgb(18 32 52 / 0.03);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #adbaca;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(23 104 229 / 0.12);
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    min-height: 18px;
    flex: 0 0 auto;
    accent-color: var(--accent);
    box-shadow: none;
}

textarea {
    resize: vertical;
}

button,
.button-link {
    display: inline-flex;
    width: fit-content;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 9px 14px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 5px 14px rgb(23 104 229 / 0.18);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

button:hover,
.button-link:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    box-shadow: 0 7px 18px rgb(23 104 229 / 0.23);
}

button:active,
.button-link:active {
    transform: translateY(1px);
}

.button-link {
    border-color: var(--border-strong);
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.button-link:hover {
    border-color: #aebccc;
    background: #f8fafc;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.button-link.compact,
.danger-button.compact {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.75rem;
}

.icon-button {
    display: inline-grid;
    width: 40px;
    min-height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-color: transparent;
    border-radius: 10px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.icon-button:hover {
    border-color: rgb(255 255 255 / 0.08);
    background: rgb(255 255 255 / 0.08);
    box-shadow: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 18px;
}

.form-grid {
    display: grid;
    gap: 13px;
}

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

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

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

.settings-card > form + form,
.settings-card > form + p,
.settings-card > p + form {
    margin-top: 16px;
}

.settings-card .panel {
    margin: 14px 0 0;
    padding: 14px;
    background: var(--surface-subtle);
    box-shadow: none;
}

.settings-form-fields,
.settings-fieldset {
    display: grid;
    min-width: 0;
    gap: 13px;
    padding: 0;
    border: 0;
    margin: 0;
}

.settings-fieldset {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.settings-fieldset legend {
    padding: 0 7px;
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 800;
}

.settings-form [data-tournament-settings-readonly] {
    margin: 0;
}

.danger-zone {
    border-color: #efc7c3;
    background: linear-gradient(180deg, #fff, #fffafa);
}

.danger-button {
    border-color: var(--danger);
    background: var(--danger);
    box-shadow: 0 5px 14px rgb(180 35 24 / 0.16);
}

.danger-button:hover {
    border-color: #8f1d15;
    background: #8f1d15;
    box-shadow: 0 7px 18px rgb(180 35 24 / 0.2);
}

.round-command {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid #c8d9f3;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(100deg, rgb(234 242 255 / 0.9), rgb(255 255 255 / 0.96)),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.round-number {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 15px;
    background: var(--accent);
    box-shadow: 0 8px 18px rgb(23 104 229 / 0.22);
    color: #fff;
    font-size: 1.45rem;
    font-weight: 800;
}

.round-command small,
.round-command strong {
    display: block;
}

.round-command small {
    color: #60728a;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.round-command strong {
    margin-top: 2px;
    font-size: 1rem;
}

.round-command p {
    margin-top: 3px;
    font-size: 0.72rem;
}

.round-command-actions,
.round-command-actions form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
}

.section-heading-row > table,
.section-heading-row > .empty {
    grid-column: 1 / -1;
}

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

.action-card {
    display: grid;
    min-height: 240px;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.action-card-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 1rem;
    font-weight: 800;
}

.action-card h2 {
    font-size: 1.15rem;
}

.action-card p {
    margin-top: 7px;
    font-size: 0.8rem;
    line-height: 1.6;
}

.round-backup-workspace {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.round-backup-heading,
.round-backup-upload {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.round-backup-heading h2,
.round-backup-upload h3 {
    margin: 0;
}

.round-backup-heading p:last-child,
.round-backup-upload-copy p {
    margin-top: 7px;
    color: var(--muted);
}

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

.round-backup-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.round-backup-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 18px;
    min-width: 0;
}

.round-backup-copy strong {
    color: var(--text-strong);
}

.round-backup-copy span,
.round-backup-copy time {
    color: var(--muted);
    font-size: 0.82rem;
}

.round-backup-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.round-backup-actions form {
    margin: 0;
}

.round-backup-actions .button-link,
.round-backup-actions button {
    width: auto;
    white-space: nowrap;
}

.round-backup-empty {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--muted);
    background: var(--surface);
}

.round-backup-upload {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.7fr) auto;
    align-items: end;
    gap: 16px;
}

.round-backup-file {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.round-backup-file input {
    min-width: 0;
    width: 100%;
}

.round-backup-preview,
.round-backup-restore,
.round-backup-upload > .form-result {
    grid-column: 1 / -1;
}

.round-backup-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
}

.round-backup-preview[hidden],
.round-backup-restore[hidden] {
    display: none;
}

.round-backup-preview > span {
    min-width: 0;
}

.round-backup-restore {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 20px;
}

.page-heading > div:first-child {
    max-width: 760px;
}

.page-heading h1 {
    font-size: clamp(1.7rem, 2.5vw, 2.2rem);
}

.page-heading h1 + p {
    margin-top: 7px;
    font-size: 0.8rem;
}

.page-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.round-command.success {
    border-color: #abd9bf;
    background:
        linear-gradient(100deg, rgb(234 247 239 / 0.92), rgb(255 255 255 / 0.96)),
        var(--surface);
}

.round-command.success .round-number {
    background: var(--success);
    box-shadow: 0 8px 18px rgb(22 121 74 / 0.2);
}

.button-link.primary-action {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 5px 14px rgb(23 104 229 / 0.18);
}

.button-link.primary-action:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    color: #fff;
    box-shadow: 0 7px 18px rgb(23 104 229 / 0.23);
}

.accept-warnings {
    display: inline-flex;
    width: auto;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 650;
}

.accept-warnings input {
    width: 16px;
    min-height: 16px;
}

.data-panel {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.tabs {
    display: flex;
    min-height: 52px;
    gap: 22px;
    padding: 0 18px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.tabs button {
    position: relative;
    min-height: 51px;
    flex: 0 0 auto;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-weight: 720;
}

.tabs button:hover {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--accent);
}

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

.tabs button.active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--accent);
    content: "";
}

.tabs b {
    min-width: 20px;
    margin-left: 3px;
    padding: 2px 5px;
    border-radius: 999px;
    background: #eef1f5;
    font-size: 0.58rem;
}

.add-player-panel {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: #f7fbff;
}

.add-player-intro {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 13px;
}

.add-player-intro strong {
    font-size: 0.82rem;
}

.add-player-intro span {
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.add-player-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.add-player-method {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.add-player-method h3 {
    margin: 0 0 5px;
    font-size: 0.76rem;
}

.add-player-method > .muted {
    min-height: 34px;
    margin: 0 0 11px;
    font-size: 0.65rem;
}

.add-player-method form {
    display: grid;
    align-items: end;
    gap: 10px;
}

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

.rating-player-search-status {
    min-height: 17px;
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
}

.rating-player-search-status--error {
    color: var(--danger);
}

.rating-player-suggestions {
    position: absolute;
    z-index: 25;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    max-height: 310px;
    overflow-y: auto;
    border: 1px solid #b8c9e5;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 16px 35px rgb(35 63 105 / 18%);
}

.rating-player-suggestion {
    display: grid;
    width: 100%;
    min-height: 50px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    color: var(--text);
    text-align: left;
}

.rating-player-suggestion:last-child {
    border-bottom: 0;
}

.rating-player-suggestion:hover,
.rating-player-suggestion.active {
    border-color: var(--border);
    background: #edf5ff;
    box-shadow: none;
    color: var(--text);
    transform: none;
}

.rating-player-suggestion strong {
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rating-player-suggestion-meta {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rating-player-suggestion-elo {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    min-width: 42px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 850;
    text-align: right;
}

.director-picker {
    position: relative;
    display: grid;
    min-width: 0;
    gap: 8px;
}

.director-suggestions {
    position: absolute;
    z-index: 25;
    top: 64px;
    right: 0;
    left: 0;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #b8c9e5;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 16px 35px rgb(35 63 105 / 18%);
}

.director-suggestions [data-director-option] {
    display: grid;
    width: 100%;
    gap: 2px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    color: var(--text);
    text-align: left;
}

.director-suggestions [data-director-option]:last-child {
    border-bottom: 0;
}

.director-suggestions [data-director-option]:hover,
.director-suggestions [data-director-option]:focus-visible {
    background: #edf5ff;
    color: var(--text);
    transform: none;
}

.director-suggestions small,
.director-chip small {
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 650;
}

.director-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.director-chip {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 1px solid #b8c9e5;
    border-radius: 9px;
    background: #edf5ff;
}

.director-chip > span {
    display: grid;
    min-width: 0;
}

.director-chip strong,
.director-chip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.director-chip [data-director-remove] {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

.api-entry-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.api-entry-divider::before,
.api-entry-divider::after {
    height: 1px;
    flex: 1;
    background: var(--border);
    content: "";
}

.add-player-manual summary {
    margin-bottom: 12px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 800;
}

.add-player-manual:not([open]) {
    align-self: start;
}

.add-player-panel label {
    gap: 5px;
    color: #69778d;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.add-player-panel input,
.add-player-panel textarea {
    width: 100%;
    min-width: 0;
    min-height: 39px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    text-transform: none;
}

.add-player-panel textarea {
    min-height: 142px;
    padding: 9px 10px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    line-height: 1.4;
}

.add-player-panel input[type="file"] {
    min-height: 0;
    padding: 7px;
    border: 1px dashed var(--border-strong);
    background: var(--surface-subtle);
}

.add-player-panel input[type="file"]::file-selector-button {
    margin-right: 8px;
    padding: 6px 9px;
    border: 0;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
    font: inherit;
}

.add-player-panel .api-miss-check {
    display: flex;
    min-width: 130px;
    align-items: center;
    gap: 7px;
    padding-bottom: 9px;
    font-size: 0.59rem;
    line-height: 1.25;
}

.add-player-panel .api-miss-check input {
    width: 16px;
    min-height: 16px;
}

.table-tools {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
}

.tool-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.table-tools .tool-actions > select {
    width: 200px;
    flex: 0 1 200px;
}

.tool-actions > .inline-form,
.tool-actions > .button-link {
    flex: 0 0 auto;
}

.tool-actions > .inline-form {
    flex-wrap: nowrap;
}

.tool-actions button,
.tool-actions .button-link {
    white-space: nowrap;
}

.search {
    display: flex;
    width: min(330px, 50%);
    min-height: 39px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid #ccd5e2;
    border-radius: 9px;
    background: #fff;
    color: #8794a7;
}

.search:focus-within {
    border-color: #8bb8f4;
    box-shadow: 0 0 0 3px rgb(71 139 234 / 0.12);
}

.search input {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    border: 0;
    padding: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font-size: 0.72rem;
}

.table-tools select {
    min-height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 0 30px 0 9px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    contain: layout;
}

.player-table {
    min-width: 1500px;
    border-collapse: collapse;
}

.player-table th,
.player-table td {
    height: 52px;
    padding: 8px 9px;
    vertical-align: middle;
    white-space: nowrap;
}

.player-table tbody tr {
    background: #fff;
}

.player-table tbody tr:hover td {
    background: #f8fbff;
}

.player-table tbody tr.has-bye td {
    background: #fffbeb;
}

.player-table tbody tr.is-out td {
    background: #f7f8fa;
    color: var(--text-tertiary);
}

.player-table th:nth-child(1),
.player-table td:nth-child(1) {
    position: sticky;
    z-index: 3;
    left: 0;
    width: 42px;
    background: inherit;
}

.player-table th:nth-child(2),
.player-table td:nth-child(2) {
    position: sticky;
    z-index: 3;
    left: 42px;
    min-width: 145px;
    background: inherit;
    box-shadow: 8px 0 14px -14px #26364e;
}

.player-table thead th {
    z-index: 4;
}

.round-header-link {
    display: grid;
    min-height: 52px;
    place-items: center;
    margin: -8px -9px;
    border-radius: 7px;
    color: inherit;
    text-decoration: none;
}

.round-header-link:hover,
.round-header-link:focus-visible {
    background: #e9f2ff;
    color: var(--accent);
}

.player-table th:last-child,
.player-table td:last-child {
    position: sticky;
    z-index: 4;
    right: 0;
    width: 58px;
    min-width: 58px;
    background: inherit;
    box-shadow: -8px 0 14px -14px #26364e;
    text-align: center;
}

.player-table input,
.player-table select {
    min-height: 34px;
    border: 1px solid #d3dae5;
    border-radius: 7px;
    padding: 0 8px;
    background: #fff;
    color: #253047;
    font-size: 0.68rem;
}

.player-table input {
    width: 76px;
}

.player-table input[name="last_name"],
.player-table input[name="first_name"] {
    width: 126px;
}

.player-table input[name="nationality"] {
    width: 54px;
    text-transform: uppercase;
}

.player-table input[name="grade"] {
    width: 86px;
}

.player-table input[name="start_number"] {
    width: 46px;
}

.metric {
    color: var(--success);
    font-weight: 780;
}

.current-round-cell {
    min-width: 96px;
}

.round-history {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.round-token {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 5px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.66rem;
    font-weight: 780;
    text-decoration: none;
}

button.round-token {
    font-family: inherit;
    line-height: normal;
    cursor: pointer;
    box-shadow: none;
}

button.round-token:hover,
button.round-token:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.round-token small {
    color: inherit;
    font-size: 0.58rem;
}

.round-token.result-win {
    border-color: #86d4a8;
    background: #eaf8ef;
    color: #14733d;
}

.round-token.result-loss {
    border-color: #f4b5b5;
    background: #fff1f1;
    color: #ae3030;
}

.round-token.result-draw {
    border-color: #c5b4ed;
    background: #f4efff;
    color: #6442a5;
}

.round-token.bye {
    border-color: #f0cc7a;
    background: #fff6d9;
    color: #8a5b00;
}

.round-token.manual {
    border-color: #c5b4ed;
    background: #fbf9ff;
    color: #6442a5;
}

.round-token.ko-selection-token {
    border-color: #a5b4fc;
    background: #eef2ff;
    color: #4338ca;
}

.historical-result-correction {
    display: inline-flex;
}

.historical-result-popover {
    display: none;
}

.historical-result-popover:popover-open {
    display: grid;
    gap: 12px;
}

.historical-result-popover h3,
.historical-result-popover p {
    margin: 0;
}

.historical-result-notice {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid #bfd5f4;
    border-radius: 9px;
    background: var(--accent-soft);
    color: #24466f;
    font-size: 0.68rem;
    white-space: normal;
}

.historical-result-popover .result-buttons {
    flex-wrap: wrap;
}

.historical-result-advanced {
    padding-top: 2px;
    border-top: 1px solid var(--border);
}

.historical-result-advanced summary {
    padding: 9px 0;
    color: var(--accent-strong);
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.round-empty {
    color: #a5afbd;
}

.pairing-editor {
    position: relative;
    width: fit-content;
}

.cell-action {
    display: grid;
    width: 32px;
    min-height: 32px;
    place-items: center;
    border: 1px dashed #8aa3c4;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
}

button.cell-action {
    padding: 0;
    box-shadow: none;
    font-family: inherit;
    line-height: normal;
}

.cell-action:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.pairing-editor-popover {
    width: min(420px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    gap: 0;
    margin: auto;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    color: var(--text);
    overscroll-behavior: contain;
    white-space: normal;
}

.pairing-editor-popover:popover-open {
    display: grid;
}

.pairing-editor-popover::backdrop {
    background: rgb(17 27 45 / 0.18);
    backdrop-filter: blur(1px);
}

.pairing-editor-header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.pairing-editor-header > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.pairing-editor-header small {
    color: var(--text-tertiary);
    font-size: 0.6rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pairing-editor-header strong {
    font-size: 0.86rem;
}

.pairing-editor-close {
    display: inline-grid;
    width: 34px;
    min-height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-color: var(--border-strong);
    border-radius: 9px;
    padding: 0;
    background: #fff;
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    line-height: 1;
}

.pairing-editor-close:hover {
    border-color: #aebccc;
    background: #eef3f8;
    box-shadow: none;
    color: var(--text);
}

.pairing-editor-intro {
    margin: 0;
    padding: 12px 16px 0;
    color: var(--text-secondary);
    font-size: 0.67rem;
    line-height: 1.45;
}

.pairing-editor-popover .pairing-editor-form {
    gap: 11px;
    padding: 12px 16px 14px;
}

.pairing-editor-popover label {
    gap: 5px;
    font-size: 0.62rem;
}

.pairing-editor-popover select,
.pairing-editor-popover input:not([type="checkbox"]):not([type="hidden"]) {
    width: 100%;
}

.pairing-editor-handicap {
    display: grid;
    min-width: 0;
    gap: 10px;
    margin: 0;
    border: 1px solid #d5e1f1;
    border-radius: 11px;
    padding: 10px;
    background: #f8fbff;
}

.pairing-editor-handicap-toggle {
    min-height: 36px !important;
    color: var(--text);
    cursor: pointer;
}

.pairing-editor-handicap-toggle > span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.pairing-editor-handicap-toggle strong {
    font-size: 0.69rem;
}

.pairing-editor-handicap-toggle small {
    color: var(--text-tertiary);
    font-size: 0.58rem;
    font-weight: 500;
    line-height: 1.35;
}

.pairing-editor-handicap-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
}

.pairing-editor-handicap-fields[hidden] {
    display: none;
}

.pairing-editor-handicap-preview {
    grid-column: 1 / -1;
    display: grid;
    gap: 3px;
    margin: 0;
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
    line-height: 1.35;
}

.pairing-editor-handicap-preview span {
    color: var(--text-tertiary);
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pairing-editor-handicap-preview strong {
    font-size: 0.64rem;
}

.pairing-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.pairing-editor-actions button {
    min-height: 38px;
    white-space: nowrap;
}

.manual-prepairing-remove-form {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px 14px;
}

.manual-prepairing-remove-form .danger-button {
    border-color: #e4aaa5;
    background: #fff;
    box-shadow: none;
    color: var(--danger);
}

.manual-prepairing-remove-form .danger-button:hover {
    border-color: var(--danger);
    background: #fff6f5;
    box-shadow: none;
}

.pairing-editor-alternative {
    margin: 0 16px 14px;
    border-top: 1px solid var(--border);
}

.pairing-editor-alternative > summary {
    padding: 11px 0 5px;
    color: var(--accent-strong);
    font-size: 0.64rem;
    font-weight: 750;
    cursor: pointer;
}

.pairing-editor-alternative form {
    gap: 9px;
    padding-top: 8px;
}

@media (max-width: 480px) {
    .pairing-editor-popover {
        width: min(360px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .pairing-editor-handicap-fields {
        grid-template-columns: 1fr;
    }

    .pairing-editor-handicap-preview {
        grid-column: 1;
    }
}

.player-row-meta {
    margin-top: 12px;
    font-size: 0.58rem;
}

.player-menu-trigger {
    display: inline-grid;
    width: 36px;
    min-height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: #fff;
    box-shadow: none;
    color: var(--text-secondary);
}

.player-menu-trigger:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.player-menu-trigger svg {
    width: 20px;
    height: 20px;
    fill: currentcolor;
}

.player-menu-trigger--labeled {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    align-items: center;
    justify-self: start;
    gap: 7px;
    padding: 5px 10px;
    font-size: 0.68rem;
    font-weight: 750;
    white-space: nowrap;
}

.player-menu-trigger--labeled svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.player-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-size: 0.65rem;
    font-weight: 780;
}

.player-status--withdrawn {
    color: var(--danger);
}

.player-status--late_joined {
    color: var(--accent);
}

.player-status-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.player-action-dialog {
    width: min(720px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.player-action-dialog::backdrop {
    background: rgb(15 23 42 / 0.48);
    backdrop-filter: blur(2px);
}

.player-action-dialog-panel {
    padding: 20px;
}

.player-action-dialog header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.player-action-dialog header small {
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.player-action-dialog h2 {
    margin: 3px 0 0;
    font-size: 1.25rem;
}

.dialog-close {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: none;
    color: var(--text-secondary);
    font-size: 1.35rem;
}

.player-menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.player-menu-actions form {
    margin: 0;
}

.player-edit-details {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.player-edit-details > summary {
    padding: 13px 14px;
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.player-menu-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 14px 14px;
}

.player-menu-edit-form label {
    display: grid;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 750;
}

.player-menu-edit-form input,
.player-menu-edit-form select {
    width: 100%;
}

.player-edit-wide,
.player-edit-actions {
    grid-column: 1 / -1;
}

.player-edit-actions {
    display: flex;
    justify-content: flex-end;
}

.player-danger-zone {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #efc7c3;
    border-radius: 12px;
    background: #fffafa;
}

.player-danger-zone > strong {
    color: var(--danger);
    font-size: 0.72rem;
}

.player-danger-zone > p {
    margin: 4px 0 12px;
    color: var(--text-tertiary);
    font-size: 0.62rem;
}

.player-delete-form {
    margin: 0;
}

.player-api-reset {
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: 0.6rem;
}

.player-api-reset summary {
    color: var(--accent-strong);
    cursor: pointer;
}

.player-api-reset label {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 0.59rem;
}

.player-api-reset input {
    width: 15px;
    min-height: 15px;
}

.data-panel > footer {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 0.64rem;
}

.table-help {
    display: flex;
    align-items: center;
    gap: 7px;
}

.table-help i {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.58rem;
    font-style: normal;
    font-weight: 850;
}

.workspace-empty {
    margin: 18px;
}

.section,
.panel,
.toolbar {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.section {
    margin-top: 20px;
    padding: 22px;
    overflow-x: auto;
}

.section > h2 {
    position: sticky;
    left: 0;
    margin-bottom: 17px;
}

.panel {
    padding: 20px;
}

.panel > h2,
.panel > h3 {
    margin-bottom: 4px;
}

.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
    padding: 14px;
}

.toolbar > form,
.toolbar form {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar > form > input:not([type="hidden"]),
.toolbar > form > select {
    width: 120px;
}

.toolbar > form > label {
    width: auto;
}

.toolbar .round-action-blockers {
    flex-basis: 100%;
}

.inline-form {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.inline-form input:not([type="hidden"]),
.inline-form select {
    width: auto;
    min-width: 76px;
    min-height: 38px;
    padding: 7px 9px;
}

.inline-form button,
.player-edit-form button {
    min-height: 38px;
    padding: 7px 11px;
}

.status {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    border: 1px solid #c8d5e6;
    border-radius: 999px;
    padding: 6px 11px;
    background: var(--accent-soft);
    color: #24558f;
    font-size: 0.72rem;
    font-weight: 720;
    text-transform: capitalize;
}

.status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-error {
    border-color: #efc7c3;
    background: var(--danger-soft);
    color: var(--danger);
}

.admin-settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin-top: 18px;
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-dashboard-card {
    display: block;
    margin: 0;
    color: inherit;
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.admin-dashboard-card:hover,
.admin-dashboard-card:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.admin-dashboard-card h2 {
    margin-bottom: 8px;
}

.admin-dashboard-card p {
    margin: 0;
    color: var(--text-secondary);
}

.admin-status-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.admin-status-list > div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
}

.admin-status-list dt {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-status-list dd {
    margin: 5px 0 0;
    font-weight: 720;
}

.admin-log-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.admin-log-filter .inline-actions {
    grid-column: 1 / -1;
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.admin-backup-history {
    width: 100%;
    margin-top: 22px;
}

.admin-backup-history code {
    font-size: 0.68rem;
    overflow-wrap: anywhere;
}

.status-success {
    border-color: #9fd8ba;
    background: #effaf4;
    color: #147548;
}

.status-badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
}

.status-badge--active {
    border-color: #9fd8ba;
    background: var(--success-soft);
    color: #147548;
}

.status-badge--warning {
    border-color: #ddbc6b;
    background: var(--warning-soft);
    color: #76550a;
}

.admin-settings-form button {
    justify-self: start;
}

.admin-settings-section > .inline-form {
    margin-top: 12px;
}

.admin-create-user-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(150px, auto);
    align-items: end;
    gap: 10px;
    margin-top: 18px;
}

.admin-create-user-form button {
    width: 100%;
}

.admin-user-form {
    display: flex;
    min-width: 0;
    align-items: end;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-user-form label {
    width: auto;
}

.admin-user-form select {
    min-width: 130px;
}

.admin-table {
    margin-top: 16px;
}

.admin-mail-callout {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #ddbc6b;
    border-radius: var(--radius-md);
    background: var(--warning-soft);
    color: #604300;
}

.admin-mail-callout p {
    min-width: min(360px, 100%);
    flex: 1 1 360px;
    margin: 0;
}

.admin-invitation-state {
    display: grid;
    min-width: min(310px, 100%);
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 12px;
}

.admin-invitation-state > span:not(.status-badge),
.admin-invitation-state > form {
    grid-column: 1 / -1;
}

.admin-invitation-state > span:not(.status-badge) {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.admin-invitation-state button {
    width: 100%;
}

.account-invitation-form .muted {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.45;
}

.admin-log-details + .admin-log-details {
    margin-top: 6px;
}

.admin-log-details summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 700;
}

.admin-log-details pre {
    max-width: 52rem;
    max-height: 20rem;
    margin: 8px 0 0;
    padding: 12px;
    overflow: auto;
    border-radius: var(--radius-sm);
    background: #111b2d;
    color: #e8eef7;
    font-size: 0.7rem;
    white-space: pre-wrap;
}

.evaluation-status {
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.muted,
.empty {
    color: var(--text-tertiary);
}

.empty {
    display: grid;
    min-height: 116px;
    place-items: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    text-align: center;
}

.warning {
    color: var(--warning);
    font-weight: 650;
}

.round-action-blockers {
    padding: 13px 15px;
    border: 1px solid #efd28d;
    border-radius: var(--radius-md);
    background: var(--warning-soft);
}

.round-action-blockers p {
    color: #664400;
    font-weight: 730;
}

.round-action-blockers ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

table {
    width: 100%;
    min-width: 720px;
    border-spacing: 0;
    border-collapse: separate;
    font-size: 0.78rem;
}

th,
td {
    padding: 11px 10px;
    border-bottom: 1px solid #e6ebf1;
    background: var(--surface);
    text-align: left;
    vertical-align: top;
}

thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    background: #f6f8fb;
    color: #66758a;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
}

[data-ko-player-table] .ko-table-sort {
    display: inline-flex;
    width: auto;
    min-height: 36px;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    margin: -6px -8px;
    border: 0;
    border-radius: 7px;
    padding: 6px 8px;
    background: transparent;
    color: inherit;
    box-shadow: none;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: 1;
    text-transform: inherit;
    white-space: nowrap;
}

[data-ko-player-table] .ko-table-sort:hover {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent-strong);
    box-shadow: none;
}

[data-ko-player-table] .ko-table-sort:active {
    transform: none;
}

.ko-table-sort-indicator {
    display: inline-flex;
    width: 12px;
    flex: 0 0 12px;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1;
}

[data-ko-player-table] th[aria-sort]:not([aria-sort="none"]) .ko-table-sort {
    color: var(--accent-strong);
}

[data-ko-player-table] th[aria-sort]:not([aria-sort="none"]) .ko-table-sort-indicator {
    color: var(--accent);
}

tbody tr {
    transition: background 120ms ease;
}

tbody tr:hover td {
    background: #fbfcfe;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td .toolbar {
    margin: 0;
    padding: 8px;
    border-radius: var(--radius-md);
    box-shadow: none;
}

.player-edit-form {
    display: grid;
    grid-template-columns: 72px repeat(4, minmax(104px, 1fr)) repeat(3, 92px) minmax(132px, 1fr) auto;
    gap: 7px;
    align-items: center;
}

.player-edit-form input,
.player-edit-form select,
.player-edit-form button {
    min-width: 0;
    min-height: 38px;
    padding: 7px 9px;
}

.result-cell:focus {
    border-color: var(--accent);
    outline: 2px solid var(--focus);
}

.result-cell.is-pasted {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.result-cell.is-saving {
    background: #f3f7fd;
}

.result-cell.is-saved {
    border-color: #83b99a;
    background: var(--success-soft);
}

.result-cell.is-invalid {
    border-color: #d1746d;
    background: var(--danger-soft);
}

.reset-api-field {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 0.68rem;
}

.reset-api-field input {
    width: 16px;
    min-height: 16px;
}

.form-result {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.form-result--success {
    border-color: #82b997;
    background: var(--success-soft);
}

.form-result--warning,
.form-result--pending {
    border-color: #ddbc6b;
    background: var(--warning-soft);
}

.form-result--error {
    border-color: #d47b75;
    background: var(--danger-soft);
}

.form-result .button-link,
.form-result .inline-form {
    margin-top: 2px;
}

.import-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 11px;
}

.import-summary,
.result-detail-list {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.import-summary h3,
.result-detail-list h3 {
    margin: 0;
}

.import-summary p {
    font-size: 0.75rem;
}

.result-detail-list dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 5px 11px;
    margin: 0;
    font-size: 0.74rem;
}

.result-detail-list dt {
    color: var(--text-secondary);
    font-weight: 700;
}

.result-detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.result-warning-context {
    display: grid;
    gap: 4px;
}

.result-warning-context__title {
    color: var(--text);
    font-weight: 700;
}

.toast-region {
    position: fixed;
    z-index: 150;
    right: 20px;
    bottom: 20px;
    display: grid;
    width: min(360px, calc(100% - 40px));
    gap: 9px;
    pointer-events: none;
}

.toast {
    padding: 13px 15px;
    border: 1px solid #334258;
    border-radius: var(--radius-md);
    background: #172238;
    box-shadow: var(--shadow-lg);
    color: #fff;
    font-size: 0.78rem;
    pointer-events: auto;
}

.toast--error {
    border-color: #f3a6a1;
    background: #8f2019;
}

.auth-page {
    background:
        radial-gradient(circle at 18% 8%, rgb(47 131 255 / 0.19), transparent 30rem),
        linear-gradient(145deg, #101a2d, #192742);
}

.auth-shell {
    display: grid;
    width: min(1020px, calc(100% - 32px));
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    align-items: center;
    gap: clamp(40px, 8vw, 110px);
    margin: 0 auto;
    padding: 48px 0;
}

.auth-brand {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    color: #fff;
}

.auth-brand .brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    font-size: 1.45rem;
}

.auth-brand strong,
.auth-brand span {
    display: block;
}

.auth-brand strong {
    font-size: clamp(1.75rem, 4vw, 3rem);
    letter-spacing: -0.045em;
}

.auth-brand div > span {
    margin-top: 7px;
    color: #aebbd0;
}

.auth-brand .auth-version {
    display: inline-flex;
    margin-top: 10px;
    color: #8f9db2;
    font-size: 0.62rem;
}

.auth-card {
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid rgb(255 255 255 / 0.4);
    border-radius: 24px;
    background: rgb(255 255 255 / 0.97);
    box-shadow: 0 28px 90px rgb(3 10 23 / 0.32);
}

.auth-card > h1 {
    font-size: 1.8rem;
    padding-bottom: 2px;
}

.auth-card .panel {
    margin-top: 18px;
    padding: 0;
    border: 0;
    box-shadow: none;
}

.print-view {
    padding: 28px;
    background: #fff;
}

.round-pairings-print {
    display: none;
}

.print-header,
.print-section {
    margin-bottom: 28px;
    overflow-x: auto;
}

.print-meta {
    color: #555;
    font-size: 0.82rem;
}

.print-result-field {
    display: block;
    min-width: 56px;
    min-height: 22px;
    border-bottom: 1px solid #555;
}

/* Current round workspace, aligned with Prototype 05. */
.round-page-heading {
    margin-bottom: 18px;
}

.round-page-heading .eyebrow {
    color: var(--accent-strong);
}

.round-bye-panel {
    display: flex;
    min-height: 60px;
    align-items: center;
    gap: 13px;
    margin: 0 0 12px;
    padding: 11px 15px;
    border: 1px solid #efc75e;
    border-radius: var(--radius-md);
    background: var(--warning-soft);
    color: #5e4200;
}

.round-bye-badge {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: #f5d77b;
    color: #604300;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.03em;
}

.round-bye-panel strong {
    font-size: 0.84rem;
}

.round-bye-panel p {
    margin: 2px 0 0;
    font-size: 0.68rem;
}

.round-menu-button {
    display: grid;
    width: 32px;
    min-height: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 800;
    box-shadow: none;
    cursor: pointer;
}

.round-menu-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
    color: var(--accent-strong);
}

.round-bye-menu {
    margin-left: auto;
}

.round-popover {
    width: min(680px, calc(100vw - 80px));
    max-height: min(720px, calc(100vh - 80px));
    padding: 15px;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.round-popover::backdrop {
    background: rgb(17 27 45 / 0.18);
    backdrop-filter: blur(1px);
}

.round-bye-editor-item {
    display: grid;
    gap: 12px;
}

.round-action-blockers {
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid #ecd17f;
    border-radius: var(--radius-md);
    background: var(--warning-soft);
    color: #664900;
    font-size: 0.72rem;
}

.round-action-blockers p {
    margin: 0;
    font-weight: 800;
}

.round-action-blockers ul {
    margin: 3px 0 0;
    padding-left: 18px;
}

.round-action-blockers form {
    margin-top: 10px;
}

.round-progress {
    display: flex;
    width: min(520px, 100%);
    align-items: center;
    justify-content: center;
    margin: 12px auto 18px;
}

.round-progress-step {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 32px max-content;
    align-items: center;
    gap: 9px;
    color: var(--text-tertiary);
}

.round-progress-number {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 800;
}

.round-progress-step strong,
.round-progress-step small {
    display: block;
}

.round-progress-step strong {
    color: var(--text);
    font-size: 0.7rem;
}

.round-progress-step small {
    margin-top: 2px;
    font-size: 0.59rem;
}

.round-progress-step.complete .round-progress-number {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.round-progress-step.current .round-progress-number {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    color: var(--accent-strong);
}

.round-progress-line {
    width: clamp(24px, 5vw, 78px);
    height: 1px;
    margin: 0 10px;
    background: var(--border-strong);
}

.round-pairings-panel {
    position: relative;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.round-panel-heading {
    display: flex;
    min-height: 64px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 17px;
    border-bottom: 1px solid var(--border);
}

.round-panel-heading h2 {
    font-size: 0.84rem;
}

.round-panel-heading p {
    margin: 3px 0 0;
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.round-live-note {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.62rem;
    white-space: nowrap;
}

.round-live-note > span {
    width: 6px;
    height: 22px;
    border-radius: 3px;
    background: #bdebd1;
}

.round-drag-status {
    flex-basis: 100%;
    margin-top: -8px;
    color: var(--accent);
    font-size: 0.64rem;
    font-weight: 700;
}

.round-drag-status:empty {
    display: none;
}

.round-drag-status--error {
    color: var(--danger);
}

.round-table-scroll {
    overflow-x: auto;
}

.round-table {
    min-width: 1130px;
    margin: 0;
    border: 0;
    table-layout: fixed;
}

.round-table th,
.round-table td {
    border-right: 0;
}

.round-table th {
    padding: 11px 12px;
    background: #f5f7fa;
    color: #66758b;
    font-size: 0.58rem;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.round-table td {
    height: 60px;
    padding: 8px 12px;
    vertical-align: middle;
}

.round-table th:nth-child(1) {
    width: 126px;
}

.round-table th:nth-child(2),
.round-table th:nth-child(4) {
    width: 170px;
}

.round-table th:nth-child(3) {
    width: 28px;
}

.round-table th:nth-child(5) {
    width: 104px;
}

.round-table th:nth-child(6) {
    width: 220px;
}

.round-table th:nth-child(7) {
    width: 330px;
}

.round-pairing-row {
    transition: background 150ms ease, box-shadow 150ms ease;
}

.round-pairing-row.round-dragging {
    opacity: 0.45;
}

.round-pairing-row.round-drag-target td {
    background: #eaf3ff;
    box-shadow: inset 0 -3px 0 var(--accent);
}

.round-pairing-row.round-drag-selected td {
    background: #f4f8ff;
}

.round-pairing-row.result-recorded {
    background: linear-gradient(90deg, var(--success-soft), #fff 24%);
    box-shadow: inset 4px 0 0 var(--success);
}

.round-board-control {
    display: flex;
    align-items: center;
    gap: 7px;
}

.round-drag-handle {
    display: grid;
    width: 26px;
    min-height: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #edf2f7;
    color: #789;
    cursor: grab;
    font-size: 0.72rem;
    letter-spacing: -0.25em;
    touch-action: none;
    user-select: none;
}

.round-drag-handle:hover,
.round-drag-handle:focus-visible,
.round-drag-handle[aria-pressed="true"] {
    background: #dceaff;
    color: var(--accent);
}

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

.board-badge {
    display: grid;
    width: 34px;
    min-height: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #1d304b;
    color: #fff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
}

.board-badge:hover,
.board-badge:focus-visible {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgb(23 104 229 / 0.18);
}

.round-board-popover {
    width: 250px;
}

.round-board-popover form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
}

.round-board-popover form label {
    display: grid;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.63rem;
    font-weight: 750;
}

.round-player strong,
.round-player small,
.round-handicap strong,
.round-handicap small {
    display: block;
}

.round-player strong {
    overflow: hidden;
    color: #11203a;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.round-player small,
.round-handicap small {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 0.61rem;
}

.round-versus {
    color: var(--text-tertiary);
    text-align: center;
}

.source-tag {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    background: #edf2f7;
    color: #4d5e76;
    font-size: 0.6rem;
    font-weight: 750;
    white-space: nowrap;
}

.source-manual,
.source-manual_prepairing,
.source-edited {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.round-handicap strong {
    font-size: 0.7rem;
    line-height: 1.3;
}

.round-handicap-trigger {
    display: block;
    width: 100%;
    min-width: 164px;
    border: 0;
    border-radius: 7px;
    padding: 4px 6px;
    background: transparent;
    box-shadow: none;
    color: inherit;
    text-align: left;
}

.round-handicap-trigger:hover,
.round-handicap-trigger:focus-visible {
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px rgb(23 104 229 / 0.18);
}

.round-handicap-popover {
    width: min(420px, calc(100vw - 32px));
}

.round-handicap-popover .pairing-editor-form {
    display: grid;
    gap: 11px;
    padding: 12px 1px 14px;
}

.round-handicap-popover label {
    gap: 5px;
    font-size: 0.62rem;
}

.round-handicap-popover select,
.round-handicap-popover input:not([type="checkbox"]):not([type="hidden"]) {
    width: 100%;
}

.round-handicap-remove-form {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.round-result-cell {
    display: flex;
    align-items: center;
    gap: 7px;
}

.result-buttons {
    display: flex;
    gap: 6px;
}

.result-buttons form {
    margin: 0;
}

button.result-option {
    display: grid;
    width: 88px;
    min-height: 46px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 7px;
    border-color: #cbd7e6;
    padding: 5px 8px;
    background: #fff;
    box-shadow: none;
    color: #20334e;
    text-align: left;
}

button.result-option:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
}

button.result-option.selected {
    border-color: var(--success);
    background: var(--success-soft);
    color: #0e6139;
}

.result-option > span:last-child,
.result-option strong,
.result-option small {
    display: block;
}

.result-option strong {
    font-size: 0.68rem;
}

.result-option small {
    font-size: 0.55rem;
}

.outcome-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 7px;
    background: #edf2f7;
    color: #526781;
    font-size: 0.7rem;
}

.round-result-menu {
    width: 30px;
    min-height: 46px;
    height: 46px;
    background: #f7f9fb;
}

.round-result-popover {
    width: min(680px, calc(100vw - 80px));
}

.round-result-popover > p {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.round-advanced-result-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    align-items: end;
    gap: 10px;
}

.round-advanced-result-form label {
    display: grid;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
}

.round-advanced-result-form input,
.round-advanced-result-form select {
    width: 100%;
}

.round-advanced-result-form .result-help {
    grid-column: 1 / -1;
}

.round-panel-action {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 17px;
    border-top: 1px solid var(--border);
    background: #fbfcfd;
}

.round-panel-action form {
    margin: 0;
}

.round-panel-action .secondary-action {
    border-color: #e9aaa5;
    background: #fff;
    box-shadow: none;
    color: var(--danger);
}

.round-primary-action {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-left: auto;
}

.round-missing-count {
    color: var(--warning);
    font-size: 0.66rem;
    font-weight: 800;
}

.round-blank-slate {
    display: grid;
    min-height: 300px;
    place-items: center;
    align-content: center;
    gap: 9px;
    text-align: center;
}

.round-blank-slate > span {
    color: var(--accent);
    font-size: 2.5rem;
}

.round-blank-slate p {
    max-width: 520px;
    margin: 0;
    color: var(--text-secondary);
}

@media (max-width: 1180px) {
    :root {
        --sidebar-width: 78px;
    }

    .sidebar {
        padding-right: 10px;
        padding-left: 10px;
    }

    .brand {
        justify-content: center;
        padding: 0;
    }

    .app-identity--sidebar {
        justify-items: center;
    }

    .app-identity--sidebar .app-version {
        display: grid;
        justify-items: center;
        gap: 0;
        margin-left: 0;
        font-size: 0.47rem;
        letter-spacing: 0;
        line-height: 1.2;
    }

    .app-identity--sidebar .app-version i {
        display: none;
    }

    .brand > strong,
    .tournament-context-copy,
    .nav-section-label,
    .nav-link strong,
    .user-copy,
    .logout-form {
        display: none;
    }

    .tournament-context-card {
        display: grid;
        width: 50px;
        min-height: 50px;
        grid-template-columns: 1fr;
        place-items: center;
        margin-right: auto;
        margin-left: auto;
        padding: 7px;
    }

    .nav-link {
        width: 50px;
        grid-template-columns: 1fr;
        place-items: center;
        margin-right: auto;
        margin-left: auto;
        padding: 0;
    }

    .nav-link > span {
        font-size: 1rem;
    }

    .sidebar-footer {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        padding-right: 0;
        padding-left: 0;
    }

    .shell {
        padding-right: 26px;
        padding-left: 26px;
    }

    .admin-create-user-form {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

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

    .player-csv-import {
        grid-column: 1 / -1;
    }

    .round-table {
        min-width: 1000px;
    }

    .macmahon-group-card {
        grid-template-columns: 66px minmax(0, 1fr) 38px;
    }

    .macmahon-group-preview {
        grid-column: 2;
    }

    .macmahon-remove-group {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 760px) {
    :root {
        --topbar-height: 60px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        z-index: 90;
        width: min(286px, calc(100vw - 54px));
        padding: 18px 13px 14px;
        transform: translateX(-105%);
        transition: transform 200ms ease;
        visibility: hidden;
    }

    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
    }

    .brand {
        justify-content: flex-start;
        padding: 0 9px;
    }

    .app-identity--sidebar {
        justify-items: stretch;
    }

    .app-identity--sidebar .app-version {
        display: inline-flex;
        justify-items: initial;
        gap: 5px;
        margin-left: 56px;
        font-size: 0.55rem;
        letter-spacing: 0.035em;
        line-height: 1.25;
    }

    .app-identity--sidebar .app-version i {
        display: inline;
    }

    .brand > strong,
    .tournament-context-copy,
    .nav-section-label,
    .nav-link strong,
    .user-copy,
    .logout-form {
        display: block;
    }

    .tournament-context-card {
        display: grid;
        width: auto;
        min-height: 64px;
        grid-template-columns: 34px minmax(0, 1fr);
        place-items: initial;
        margin-right: 0;
        margin-left: 0;
        padding: 10px;
    }

    .nav-link {
        width: auto;
        grid-template-columns: 25px minmax(0, 1fr);
        place-items: initial;
        margin-right: 0;
        margin-left: 0;
        padding: 0 10px;
    }

    .sidebar-footer {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        justify-items: initial;
        padding-right: 8px;
        padding-left: 8px;
    }

    .logout-form {
        display: block;
    }

    .topbar .menu-button,
    .app-identity--topbar {
        display: inline-grid;
    }

    .app-identity--topbar {
        gap: 1px;
    }

    .topbar-brand {
        display: block;
        overflow: hidden;
        font-size: 0.72rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-identity--topbar .app-version {
        color: var(--text-tertiary);
        font-size: 0.48rem;
    }

    .menu-button {
        color: var(--text);
    }

    .menu-button:hover {
        border-color: var(--border);
        background: var(--surface-subtle);
    }

    .topbar {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        padding: 0 14px;
    }

    .topbar .language-switcher {
        gap: 0;
        padding: 2px;
    }

    .topbar .language-switcher a {
        min-height: 44px;
        padding: 7px;
        font-size: 0.7rem;
    }

    .topbar-context {
        display: none;
    }

    .topbar-user {
        padding: 0 9px;
        font-size: 0;
    }

    .shell {
        padding: 24px 14px 50px;
    }

    .home-page-header {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 18px;
        margin-bottom: 20px;
    }

    .home-page-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: start;
    }

    .home-page-actions .button-link {
        width: 100%;
        min-height: 48px;
    }

    .home-tournaments-heading {
        padding: 18px 16px 15px;
    }

    .home-tournament-tools {
        grid-template-columns: 1fr;
        padding: 0 16px 14px;
    }

    .home-tournament-filter select {
        width: 100%;
    }

    .home-filter-summary {
        padding: 0 16px 7px;
    }

    .home-tournament-card {
        padding: 18px 16px;
    }

    .home-tournament-card-header {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .home-tournament-open {
        width: fit-content;
    }

    .home-tournament-metadata {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-tournament-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .home-tournament-actions,
    .home-tournament-actions summary {
        width: 100%;
    }

    .home-tournament-actions summary {
        justify-content: flex-start;
    }

    .home-tournament-secondary-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .home-tournament-secondary-actions > *,
    .home-tournament-secondary-actions form,
    .home-tournament-secondary-actions button {
        width: 100%;
    }

    .home-empty-state {
        min-height: 220px;
        padding: 24px 18px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading-actions,
    .page-heading-actions > * {
        width: 100%;
    }

    .macmahon-assignment-section .section-heading-row > button {
        width: 100%;
    }

    .macmahon-settings-title {
        align-items: stretch;
        flex-direction: column;
    }

    .macmahon-segmented,
    .macmahon-segmented button {
        width: 100%;
    }

    .macmahon-group-card {
        grid-template-columns: 62px minmax(0, 1fr) 38px;
        align-items: start;
    }

    .macmahon-group-fields {
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: 1fr;
    }

    .macmahon-group-preview {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .macmahon-remove-group {
        grid-column: 3;
        grid-row: 1;
    }

    .macmahon-info,
    .macmahon-group-cards {
        margin-right: 12px;
        margin-left: 12px;
    }

    .macmahon-group-cards {
        padding-right: 0;
        padding-left: 0;
    }

    .macmahon-add-group {
        width: calc(100% - 24px);
        margin-right: 12px;
        margin-left: 12px;
    }

    .macmahon-validation {
        margin-right: 12px;
        margin-left: 12px;
    }

    .add-player-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .add-player-methods {
        grid-template-columns: 1fr;
    }

    .player-csv-import {
        grid-column: auto;
    }

    .table-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .search {
        width: 100%;
    }

    .tool-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .table-tools .tool-actions > select {
        width: 100%;
        flex-basis: 100%;
    }

    .data-panel > footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-grid,
    .export-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .round-backup-item,
    .round-backup-copy,
    .round-backup-upload,
    .round-backup-preview {
        grid-template-columns: minmax(0, 1fr);
    }

    .round-backup-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
    }

    .round-backup-actions .button-link,
    .round-backup-actions button,
    .round-backup-actions form,
    .round-backup-upload > button {
        width: 100%;
    }

    .round-backup-restore {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-settings-form {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-grid,
    .admin-status-list,
    .admin-log-filter {
        grid-template-columns: 1fr;
    }

    .admin-log-filter .inline-actions {
        grid-column: 1;
    }

    .admin-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-create-user-form {
        display: flex;
        align-items: stretch;
        flex-direction: column;
    }

    .admin-create-user-form label,
    .admin-create-user-form button {
        width: 100%;
    }

    .round-command {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 12px;
    }

    .round-number {
        width: 48px;
        height: 48px;
        border-radius: 13px;
        font-size: 1.15rem;
    }

    .round-command-actions {
        grid-column: 1 / -1;
        align-items: stretch;
        flex-direction: column;
    }

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

    .section-heading-row {
        grid-template-columns: 1fr;
    }

    .section-heading-row > table,
    .section-heading-row > .empty {
        grid-column: 1;
    }

    .page-header > .toolbar,
    .page-header > p {
        align-self: stretch;
    }

    .page-header .button-link {
        width: 100%;
    }

    .section,
    .panel {
        padding: 16px;
        border-radius: var(--radius-md);
    }

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

    .toolbar > *,
    .toolbar > form,
    .toolbar .button-link,
    .toolbar button {
        width: 100%;
    }

    .toolbar > form {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar > form > input:not([type="hidden"]),
    .toolbar > form > select,
    .toolbar > form > label {
        width: 100%;
    }

    .player-edit-form {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .player-menu-edit-form {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        display: flex;
        min-height: 100vh;
        flex-direction: column;
        justify-content: center;
        gap: 30px;
        padding: 32px 0;
    }

    .auth-brand {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .auth-brand .brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 13px;
        font-size: 1.05rem;
    }

    .auth-brand strong {
        font-size: 1.35rem;
    }

    .auth-brand div > span {
        font-size: 0.8rem;
    }

    .auth-card {
        width: 100%;
        border-radius: var(--radius-lg);
    }

    .round-page-heading {
        align-items: flex-start;
    }

    .round-live-note {
        display: none;
    }

    .round-progress {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .round-progress-line {
        width: 26px;
        flex: 0 0 auto;
    }

    .round-panel-action {
        align-items: stretch;
        flex-direction: column;
    }

    .round-panel-action > form,
    .round-panel-action > form button,
    .round-primary-action,
    .round-primary-action form,
    .round-primary-action button {
        width: 100%;
    }

    .round-primary-action {
        align-items: stretch;
        flex-direction: column;
    }

    .round-popover {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 90px);
    }

    .player-table th:nth-child(2),
    .player-table td:nth-child(2) {
        position: static;
        z-index: auto;
        left: auto;
        box-shadow: none;
    }

    .round-advanced-result-form {
        grid-template-columns: 1fr;
    }

    .round-advanced-result-form .result-help {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    :root {
        --topbar-height: 94px;
    }

    .topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: 52px 34px;
        column-gap: 8px;
        padding: 4px 14px 0;
    }

    .topbar .menu-button {
        grid-column: 1;
        grid-row: 1;
    }

    .topbar .language-control {
        grid-column: 2;
        grid-row: 1;
    }

    .topbar > .button-link,
    .topbar > .topbar-user {
        grid-column: 3;
        grid-row: 1;
    }

    .app-identity--topbar {
        display: flex;
        grid-column: 1 / -1;
        grid-row: 2;
        align-items: baseline;
        justify-self: center;
        gap: 8px;
    }

    .topbar-brand {
        display: block;
        font-size: 0.72rem;
    }

    .app-identity--topbar .app-version {
        font-size: 0.48rem;
    }

    .topbar .language-switcher {
        display: none;
    }

    .topbar .language-menu {
        position: relative;
        display: block;
    }

    .topbar .language-menu summary {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        gap: 6px;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 7px 9px;
        background: var(--surface);
        color: var(--text-secondary);
        font-size: 0.72rem;
        font-weight: 700;
        cursor: pointer;
        list-style: none;
    }

    .topbar .language-menu summary::-webkit-details-marker {
        display: none;
    }

    .topbar .language-menu summary svg {
        width: 17px;
        height: 17px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.6;
    }

    .topbar .language-menu[open] summary {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgb(23 104 229 / 0.12);
        color: var(--accent-strong);
    }

    .topbar .language-menu nav {
        position: absolute;
        z-index: 80;
        top: calc(100% + 7px);
        right: 0;
        display: grid;
        width: max-content;
        min-width: 150px;
        gap: 3px;
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface);
        box-shadow: var(--shadow-md);
    }

    .topbar .language-menu nav a {
        display: flex;
        min-height: 44px;
        align-items: center;
        border-radius: 8px;
        padding: 8px 10px;
        color: var(--text-secondary);
        font-size: 0.8rem;
        font-weight: 680;
        text-decoration: none;
    }

    .topbar .language-menu nav a:hover,
    .topbar .language-menu nav a.active {
        background: var(--accent-soft);
        color: var(--accent-strong);
    }

    .home-page-actions {
        grid-template-columns: 1fr;
    }

    .home-tournament-history {
        grid-template-columns: 1fr;
    }

    .player-edit-form {
        grid-template-columns: 1fr;
    }

    .result-detail-list dl {
        grid-template-columns: 1fr;
    }

    .result-detail-list dd {
        margin-bottom: 6px;
    }
}

@media (pointer: coarse) {
    button,
    .button-link,
    .nav-link,
    .language-switcher a,
    summary,
    input,
    select {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.bracket-section {
    min-width: 0;
}

.bracket-toolbar,
.bracket-print-header,
.bracket-print-legend {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bracket-toolbar {
    flex-wrap: wrap;
    margin: 16px 0 10px;
}

.bracket-toolbar button {
    min-width: 42px;
    padding: 7px 12px;
}

.bracket-toolbar output {
    min-width: 64px;
    text-align: center;
    font-weight: 700;
}

.bracket-live-status {
    margin-left: auto;
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 700;
}

.bracket-live-status::before {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentcolor;
    content: "";
}

.bracket-live-status.has-warning {
    color: var(--warning);
}

.bracket-viewport {
    max-height: 72vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: grab;
    overscroll-behavior: contain;
    touch-action: none;
}

.bracket-viewport.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.bracket-canvas {
    width: max-content;
    min-width: 100%;
}

.bracket-canvas svg {
    display: block;
    max-width: none;
}

.bracket-meta {
    margin: 9px 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.bracket-state {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
}

.bracket-state--inconsistent {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.ko-match-label {
    display: inline-flex;
    width: max-content;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25;
}

.round-board-control {
    flex-wrap: wrap;
}

.bracket-print-page {
    overflow: visible;
    background: #fff;
}

.bracket-print-page main {
    width: 100%;
    padding: 18px;
}

.bracket-print-header {
    justify-content: space-between;
    border-bottom: 2px solid #172033;
}

.bracket-print-header p,
.bracket-print-header h1 {
    margin: 0 0 6px;
}

.bracket-print-artifact svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 160mm;
}

.bracket-print-legend {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.78rem;
}

.bracket-print-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bracket-print-legend i {
    display: inline-block;
    width: 34px;
    border-top: 2px solid #8792a2;
}

.bracket-print-legend .winner-line {
    border-top: 5px solid #c62828;
}

.bracket-print-legend .loser-line {
    border-top-style: dashed;
}

@page bracket {
    size: A4 landscape;
    margin: 8mm;
}

@media print {
    .public-table-scroll,
    [data-player-workspace] > .table-wrap {
        max-height: none;
        overflow: visible;
    }

    .hover-card {
        display: none !important;
    }

    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    @page standings {
        size: A4 landscape;
        margin: 10mm;
    }

    :root {
        background: #fff;
        color: #000;
    }

    body {
        background: #fff;
    }

    .sidebar,
    .sidebar-scrim,
    .topbar,
    .skip-link,
    .toast-region,
    .toolbar,
    .crumb,
    form,
    .inline-form,
    .button-link {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .shell {
        width: auto;
        max-width: none;
        padding: 0;
    }

    .section,
    .panel,
    .print-view {
        border: 0;
        padding: 0;
        margin-top: 0;
        overflow: visible;
        box-shadow: none;
    }

    .print-section--standings {
        page: standings;
    }

    body.round-pairings-print-mode .shell > :not(.round-pairings-print) {
        display: none !important;
    }

    body.round-pairings-print-mode .round-pairings-print {
        display: block;
    }

    .print-view .print-header,
    .print-view .print-section {
        margin-bottom: 12px;
    }

    .print-view .print-header h1,
    .print-view .print-section h2 {
        margin: 0 0 4px;
    }

    .print-view .print-header p {
        margin: 2px 0;
    }

    .bracket-print-page main {
        page: bracket;
        padding: 0;
    }

    .player-workspace-page > :not([data-player-workspace]),
    [data-player-workspace] > :not(.table-wrap),
    [data-player-workspace] .player-status-column,
    [data-player-workspace] .player-actions-column,
    [data-player-workspace] .pairing-editor {
        display: none !important;
    }

    [data-player-workspace] {
        page: standings;
        border: 0;
        padding: 0;
        overflow: visible;
        background: #fff;
        box-shadow: none;
    }

    [data-player-workspace] .table-wrap {
        border: 0;
        overflow: visible;
    }

    [data-player-workspace] .player-table {
        width: 100%;
        min-width: 0;
        font-size: 0.58rem;
    }

    [data-player-workspace] .player-table th,
    [data-player-workspace] .player-table td {
        position: static;
        left: auto;
        height: auto;
        padding: 2px 3px;
        line-height: 1.1;
        vertical-align: middle;
    }

    [data-player-workspace] .player-table th:nth-child(1),
    [data-player-workspace] .player-table td:nth-child(1),
    [data-player-workspace] .player-table th:nth-child(4),
    [data-player-workspace] .player-table td:nth-child(4),
    [data-player-workspace] .player-table th:nth-child(5),
    [data-player-workspace] .player-table td:nth-child(5),
    [data-player-workspace] .player-table th:nth-child(6),
    [data-player-workspace] .player-table td:nth-child(6),
    [data-player-workspace] .player-table th:nth-child(7),
    [data-player-workspace] .player-table td:nth-child(7),
    [data-player-workspace] .player-table th:nth-child(8),
    [data-player-workspace] .player-table td:nth-child(8),
    [data-player-workspace] .player-table th:nth-last-child(5),
    [data-player-workspace] .player-table td:nth-last-child(5),
    [data-player-workspace] .player-table th:nth-last-child(4),
    [data-player-workspace] .player-table td:nth-last-child(4),
    [data-player-workspace] .player-table th:nth-last-child(3),
    [data-player-workspace] .player-table td:nth-last-child(3) {
        width: 1%;
        white-space: nowrap;
    }

    [data-player-workspace] .player-table th:nth-child(2),
    [data-player-workspace] .player-table td:nth-child(2),
    [data-player-workspace] .player-table th:nth-child(3),
    [data-player-workspace] .player-table td:nth-child(3) {
        width: auto;
        white-space: normal;
    }

    [data-player-workspace] .current-round-cell,
    [data-player-workspace] .round-history {
        width: 1%;
        min-width: 0;
        white-space: nowrap;
    }

    [data-player-workspace] .round-token {
        min-height: 0;
        gap: 2px;
        padding: 1px 4px;
        border-radius: 4px;
        font-size: inherit;
        line-height: 1.1;
    }

    [data-player-workspace] .round-header-link {
        display: inline;
        min-height: 0;
        margin: 0;
        border-radius: 0;
    }

    [data-player-workspace] [data-player-row][hidden] {
        display: table-row !important;
    }

    table {
        min-width: 0;
        table-layout: auto;
        break-inside: auto;
        page-break-inside: auto;
    }

    thead {
        display: table-header-group;
    }

    th,
    td {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .print-section table {
        font-size: 0.6rem;
    }

    .print-view th,
    .print-view td {
        position: static;
        height: auto;
        padding: 2px 3px;
        line-height: 1.1;
        vertical-align: middle;
    }

    .print-view thead th,
    [data-player-workspace] thead th {
        font-size: 0.56rem;
        letter-spacing: 0.02em;
    }

    .print-section--standings :is(th, td):nth-child(1),
    .print-section--standings :is(th, td):nth-child(2),
    .print-section--standings :is(th, td):nth-child(4),
    .print-section--standings :is(th, td):nth-child(5),
    .print-section--standings :is(th, td):nth-child(6),
    .print-section--standings :is(th, td):nth-child(7),
    .print-section--standings :is(th, td):nth-child(8),
    .print-section--standings :is(th, td):nth-child(9),
    .print-section--standings :is(th, td):nth-child(10),
    .print-section--standings :is(th, td):nth-child(11),
    .print-section--pairings :is(th, td):nth-child(1),
    .print-section--pairings :is(th, td):nth-child(2) {
        width: 1%;
        white-space: nowrap;
    }

    .print-section--standings :is(th, td):nth-child(3),
    .print-section--standings :is(th, td):nth-child(12),
    .print-section--pairings :is(th, td):nth-child(3),
    .print-section--pairings :is(th, td):nth-child(4) {
        width: auto;
        white-space: normal;
    }

    .print-section--pairings :is(th, td):nth-child(5) {
        width: 28%;
        white-space: normal;
    }

    .print-view .print-result-field {
        min-width: 28px;
        min-height: 14px;
    }

    tr {
        break-inside: avoid-page;
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

.team-setup-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.28fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.team-player-pool,
.team-card,
.team-workspace-notice {
    border: 1px solid var(--border-color, #d7dde7);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(17 27 45 / 6%);
}

.team-player-pool {
    position: sticky;
    z-index: 2;
    top: calc(var(--topbar-height) + 16px);
    max-height: calc(100vh - var(--topbar-height) - 32px);
    max-height: calc(100dvh - var(--topbar-height) - 32px);
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.team-player-pool h2 {
    margin-top: 0;
}

.team-pool-hint {
    margin: -4px 0 12px;
    color: var(--muted-color, #647087);
    font-size: 0.82rem;
    line-height: 1.35;
}

.team-player-pool ul,
.team-member-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.team-player-pool li,
.team-member-list li {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f5f7fb;
}

.team-player-pool li[data-team-pool-player] {
    cursor: grab;
    transition: box-shadow 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.team-player-pool li[data-team-pool-player]:hover {
    box-shadow: 0 4px 12px rgb(32 104 224 / 14%);
    transform: translateY(-1px);
}

.team-player-pool li[data-team-pool-player]:active {
    cursor: grabbing;
}

.team-player-pool li[data-team-pool-player].is-dragging {
    opacity: 0.55;
}

.team-player-pool li span,
.team-member-list small {
    color: var(--muted-color, #647087);
    font-size: 0.78rem;
}

.team-setup-form {
    min-width: 0;
}

.team-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
    gap: 16px;
}

.team-card {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
}

.team-card header,
.team-card footer,
.team-card form {
    display: flex;
    gap: 12px;
    align-items: end;
    justify-content: space-between;
    min-width: 0;
}

.team-card label {
    min-width: 0;
}

.team-card input,
.team-card select {
    width: 100%;
    min-width: 0;
}

.team-average {
    display: grid;
    flex: 0 0 auto;
    margin: 0;
    text-align: right;
}

.team-average strong {
    font-size: 1.35rem;
}

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

.team-drop-hint {
    margin: 0;
    padding: 10px 12px;
    border: 1px dashed var(--border-color, #d7dde7);
    border-radius: 10px;
    background: #f8faff;
    color: var(--muted-color, #647087);
    font-size: 0.82rem;
    line-height: 1.35;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.team-drop-hint.is-drop-target {
    border-color: var(--primary-color, #2068e0);
    background: rgb(32 104 224 / 10%);
    color: var(--primary-color, #2068e0);
}

.team-delete {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    min-height: 24px;
    color: #a12622;
    line-height: 1.35;
    white-space: nowrap;
}

.team-delete input {
    width: auto;
}

.team-setup-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 18px;
}

.team-setup-actions p {
    margin: 0 auto 0 0;
    color: var(--muted-color, #647087);
}

.team-workspace-notice {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px 16px;
}

.team-workspace-notice ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 auto 0 0;
}

.manual-team-prepairing {
    margin-bottom: 14px;
    padding: 14px 16px;
}

.manual-team-prepairing header h2,
.manual-team-prepairing header p {
    margin: 0;
}

.manual-team-prepairing > form,
.manual-team-prepairing li {
    display: flex;
    gap: 10px;
    align-items: end;
    min-width: 0;
}

.manual-team-prepairing > form label {
    flex: 1 1 220px;
    min-width: 0;
}

.manual-team-prepairing select {
    width: 100%;
}

.manual-team-prepairing ul {
    display: grid;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.manual-team-prepairing li {
    justify-content: space-between;
}

.public-table-scroll,
[data-player-workspace] > .table-wrap {
    position: relative;
    max-height: min(68dvh, 52rem);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.public-table-scroll thead th,
[data-player-workspace] > .table-wrap thead th {
    position: sticky;
    z-index: 12;
    top: 0;
    box-shadow: 0 1px 0 #d5deea, 0 5px 12px rgb(17 27 45 / 8%);
}

.result-index {
    color: #24466f;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    text-align: center;
}

.result-index--team strong,
.result-kind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-index--team strong {
    gap: 0.25rem;
}

.result-kind {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.3rem;
    background: #285da8;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.result-reference {
    position: relative;
    display: inline-flex;
    min-width: 32px;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.result-reference--player .player-result-token {
    border-radius: 999px;
}

.team-result-token {
    border-width: 2px;
    border-color: #6d8fbd;
    border-radius: 0.42rem;
    background: #eaf1fb;
    color: #173d70;
}

.team-result-token strong {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.team-result-token .result-kind {
    width: 1rem;
    height: 1rem;
    background: #285da8;
    color: #fff;
    font-size: 0.52rem;
}

.hover-card-reference {
    outline: none;
}

.result-reference:focus-visible > .public-round-token,
.result-reference.is-open > .public-round-token,
.opponent-history-reference:focus-visible > :first-child,
.opponent-history-reference.is-open > :first-child {
    box-shadow: 0 0 0 3px rgb(23 105 232 / 14%);
}

.hover-card {
    position: fixed;
    inset: auto;
    margin: 0;
    border: 1px solid #9fb4cf;
    border-radius: 0.55rem;
    background: #13233b;
    box-shadow: 0 0.75rem 2rem rgb(17 27 45 / 22%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.35;
    pointer-events: none;
    white-space: normal;
}

.result-opponent-tooltip {
    width: max-content;
    max-width: min(22rem, calc(100vw - 1rem));
    padding: 0.55rem 0.7rem;
}

.hover-card:not([popover]) {
    display: none;
}

.hover-card-reference.is-open > .hover-card:not([popover]) {
    display: block;
}

.opponent-history-reference {
    position: relative;
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    border-radius: 0.35rem;
    cursor: help;
    text-decoration: underline dotted #7890ad 1px;
    text-underline-offset: 0.22rem;
}

.opponent-history-reference > :first-child {
    min-width: 0;
    border-radius: inherit;
}

.opponent-history-popover {
    width: min(25rem, calc(100vw - 1rem));
    max-height: min(24rem, calc(100dvh - 1rem));
    padding: 0;
    overflow: hidden auto;
}

.opponent-history-popover:popover-open {
    display: grid;
}

.hover-card-reference.is-open > .opponent-history-popover:not([popover]) {
    display: grid;
}

.opponent-history-title {
    padding: 0.7rem 0.8rem 0.55rem;
    border-bottom: 1px solid rgb(255 255 255 / 16%);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.opponent-history-list {
    display: grid;
}

.opponent-history-item {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgb(255 255 255 / 11%);
}

.opponent-history-item:last-child {
    border-bottom: 0;
}

.opponent-history-item > small,
.opponent-history-name small {
    color: #b9c8da;
    font-size: 0.65rem;
}

.opponent-history-name {
    display: grid;
    min-width: 0;
    gap: 0.1rem;
}

.opponent-history-name strong {
    overflow-wrap: anywhere;
}

.opponent-history-result {
    min-width: 2.5rem;
    padding: 0.2rem 0.4rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 12%);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.opponent-history-result.result-win {
    background: #dff7e8;
    color: #08733f;
}

.opponent-history-result.result-loss {
    background: #fde9ec;
    color: #9d2539;
}

.opponent-history-result.result-draw {
    background: #e7eef8;
    color: #31557e;
}

.opponent-history-empty {
    padding: 0.8rem;
    color: #d7e1ed;
}

.team-row-group .team-summary-row > *,
.team-public-summary-row > * {
    border-top: 2px solid #91a8c6;
    border-bottom-color: #c4d1e2;
    background: #e7eef8;
    color: #173d70;
    font-weight: 760;
}

.team-summary-row > :first-child,
.team-public-summary-row > :first-child {
    box-shadow: inset 4px 0 #285da8;
}

.team-summary-row th {
    text-align: left;
}

.team-summary-row th strong,
.team-member-row td:nth-child(3) small {
    display: block;
}

.team-board-position,
.team-average-inline,
.team-member-metrics {
    color: var(--muted-color, #647087);
    font-size: 0.78rem;
    white-space: nowrap;
}

.team-member-row > * {
    background: #fbfcfe;
}

.team-public-member-row > * {
    background: #fbfcfe;
}

.team-member-row td:nth-child(3) {
    min-width: 150px;
}

.team-match-heading th,
.team-match-print-heading th {
    padding: 9px 12px;
    background: #e9eef7;
    text-align: left;
}

.team-match-heading th > *,
.team-match-print-heading th > * {
    margin-right: 12px;
}

.team-match-score {
    display: inline-block;
    white-space: nowrap;
}

.team-match-score.pending {
    color: var(--muted-color, #647087);
}

.team-match-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.team-match-actions form {
    margin: 0;
}

.team-match-actions button {
    white-space: nowrap;
}

.portable-import-page {
    display: grid;
    gap: 18px;
}

.portable-import-form {
    display: grid;
    gap: 0;
    padding: 0;
    overflow: visible;
}

.portable-import-step {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid var(--border);
}

.portable-import-step > div:last-child,
.portable-import-step header > div {
    min-width: 0;
}

.portable-import-step-number {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
}

.portable-import-step header {
    margin-bottom: 16px;
}

.portable-import-step h2,
.portable-import-step header p,
.portable-import-actions p,
.portable-import-identity span,
.portable-import-identity strong,
.portable-import-identity small {
    margin: 0;
}

.portable-import-step header p {
    margin-top: 4px;
    color: var(--text-secondary);
}

.portable-import-file {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px dashed #9eb5d8;
    border-radius: 12px;
    background: #f7faff;
}

.portable-import-file > span {
    font-weight: 850;
}

.portable-import-file input[type="file"] {
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}

.portable-import-file input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.portable-import-file small,
.portable-import-mode small,
.portable-import-confirm small,
.portable-import-identity small {
    color: var(--text-secondary);
}

.portable-import-help {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-subtle);
}

.portable-import-help summary {
    cursor: pointer;
    font-weight: 800;
}

.portable-import-help ul {
    margin: 12px 0;
    padding-left: 20px;
}

.portable-import-help details {
    margin-top: 12px;
}

.portable-import-help textarea {
    min-height: 150px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

.portable-import-mode > label {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
}

.portable-import-mode > label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px rgb(31 111 235 / 10%);
}

.portable-import-mode input,
.portable-import-confirm input {
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin-top: 2px;
}

.portable-import-mode span,
.portable-import-confirm span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.portable-import-overwrite {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
    gap: 14px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #efc86f;
    border-radius: 11px;
    background: #fffaf0;
}

.portable-import-overwrite[hidden] {
    display: none;
}

.portable-import-overwrite select {
    width: 100%;
    min-width: 0;
}

.portable-import-confirm {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 9px;
    background: rgb(255 255 255 / 70%);
}

.portable-import-people {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.portable-import-identity,
.portable-user-picker {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-subtle);
}

.portable-import-identity {
    display: grid;
    gap: 3px;
}

.portable-import-identity span {
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portable-import-identity strong,
.portable-import-identity small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.portable-user-picker {
    position: relative;
    display: grid;
    gap: 7px;
}

.portable-user-picker input[type="search"] {
    width: 100%;
    min-width: 0;
}

.portable-user-suggestions {
    position: absolute;
    z-index: 30;
    top: 78px;
    right: 14px;
    left: 14px;
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid #b8c9e5;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 16px 35px rgb(35 63 105 / 18%);
}

.portable-user-suggestions [data-portable-user-option] {
    display: grid;
    width: 100%;
    gap: 2px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    color: var(--text);
    text-align: left;
}

.portable-user-suggestions [data-portable-user-option]:hover,
.portable-user-suggestions [data-portable-user-option]:focus-visible {
    background: var(--accent-soft);
    color: var(--text);
    transform: none;
}

.portable-user-suggestions small {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.portable-import-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
}

.portable-import-actions > div {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.check-in-workspace {
    display: grid;
    gap: 18px;
}

.check-in-intro,
.check-in-tools,
.check-in-group,
.check-in-player {
    border: 1px solid var(--border-color, #d7dde7);
    background: #fff;
}

.check-in-intro {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-radius: 14px;
}

.check-in-intro h2,
.check-in-intro p,
.check-in-group h2 {
    margin: 0;
}

.check-in-intro > strong {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 999px;
    background: #edf4ff;
    color: var(--primary-color, #2068e0);
    white-space: nowrap;
}

.check-in-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.35fr);
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
}

.check-in-tools label,
.check-in-tools input,
.check-in-tools select {
    width: 100%;
    min-width: 0;
}

.check-in-groups {
    display: grid;
    gap: 16px;
}

.check-in-group {
    min-width: 0;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgb(17 27 45 / 5%);
}

.check-in-group[hidden],
.check-in-player[hidden] {
    display: none;
}

.check-in-group > header {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 14px 16px;
    background: #f5f8fd;
}

.check-in-group > header > div {
    min-width: 0;
}

.check-in-group > header small,
.check-in-player-copy span,
.check-in-player-status {
    color: var(--muted-color, #647087);
    font-size: 0.82rem;
}

.check-in-group > header h2 {
    overflow-wrap: anywhere;
}

.check-in-group > header > strong {
    flex: 0 0 auto;
    font-size: 0.86rem;
    white-space: nowrap;
}

.check-in-list {
    display: grid;
}

.check-in-player {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto) 52px;
    gap: 16px;
    align-items: center;
    min-width: 0;
    padding: 12px 16px;
    border-width: 1px 0 0;
}

.check-in-player:first-child {
    border-top: 0;
}

.check-in-player.is-pending {
    opacity: 0.65;
}

.check-in-player.has-error {
    background: #fff2f1;
}

.check-in-player-copy {
    display: grid;
    min-width: 0;
}

.check-in-player-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.check-in-player-status {
    min-width: 0;
    text-align: right;
}

.check-in-player.has-error .check-in-player-status {
    color: #a12622;
}

.check-in-player form {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.check-in-toggle {
    position: relative;
    display: grid;
    width: 52px;
    height: 44px;
    min-height: 44px;
    place-items: center;
    gap: 0;
    padding: 0;
    border-radius: 999px;
    cursor: pointer;
    touch-action: manipulation;
}

.check-in-toggle input {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 44px;
    margin: 0;
    opacity: 0;
    cursor: inherit;
}

.check-in-toggle input:disabled {
    cursor: not-allowed;
}

.check-in-toggle > span[aria-hidden] {
    position: relative;
    display: block;
    width: 48px;
    height: 28px;
    border: 1px solid #aeb8c8;
    border-radius: 999px;
    background: #dce2eb;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.check-in-toggle > span[aria-hidden]::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(17 27 45 / 25%);
    content: '';
    transition: transform 120ms ease;
}

.check-in-toggle input:checked + span {
    border-color: var(--primary-color, #2068e0);
    background: var(--primary-color, #2068e0);
}

.check-in-toggle input:checked + span::after {
    transform: translateX(20px);
}

.check-in-toggle input:focus-visible + span {
    outline: 3px solid rgb(32 104 224 / 25%);
    outline-offset: 2px;
}

.check-in-toggle input:disabled + span {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .public-table-scroll,
    [data-player-workspace] > .table-wrap {
        max-height: min(70dvh, 36rem);
    }

    .public-round-cell .result-reference,
    .opponent-history-reference {
        min-width: 44px;
        min-height: 44px;
    }

    .portable-import-step {
        grid-template-columns: 1fr;
        padding: 18px 14px;
    }

    .portable-import-mode,
    .portable-import-overwrite,
    .portable-import-people {
        grid-template-columns: 1fr;
    }

    .portable-import-actions {
        align-items: stretch;
        flex-direction: column;
        padding: 16px 14px;
    }

    .portable-import-actions > div {
        display: grid;
        grid-template-columns: 1fr;
    }

    .portable-import-actions button {
        width: 100%;
    }

    .team-setup-layout {
        grid-template-columns: 1fr;
    }

    .team-player-pool {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .team-card header,
    .team-card footer,
    .team-card form,
    .team-setup-actions,
    .team-workspace-notice {
        align-items: stretch;
        flex-direction: column;
    }

    .team-average {
        text-align: left;
    }

    .manual-team-prepairing > form {
        align-items: stretch;
        flex-direction: column;
    }

    .team-match-actions {
        width: 100%;
    }

    .check-in-intro,
    .check-in-group > header {
        align-items: flex-start;
        flex-direction: column;
    }

    .check-in-intro > strong,
    .check-in-group > header > strong {
        white-space: normal;
    }

    .check-in-tools {
        grid-template-columns: 1fr;
    }

    .check-in-player {
        grid-template-columns: minmax(0, 1fr) 52px;
        gap: 6px 12px;
    }

    .check-in-player-status {
        grid-column: 1;
        grid-row: 2;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .check-in-player form {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media print {
    [data-player-workspace] > .table-wrap {
        max-height: none;
        overflow: visible;
    }

    .team-player-pool,
    .team-workspace-notice,
    .team-setup-actions {
        display: none !important;
    }

    .team-row-group,
    .team-match-print-heading {
        break-inside: avoid-page;
        page-break-inside: avoid;
    }

    .team-summary-row > * {
        background: #e8edf5 !important;
        font-weight: 700;
    }

    .team-member-row > * {
        padding-top: 1px !important;
        padding-bottom: 1px !important;
    }
}
