.home-internal-match-card {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.home-internal-match-card .card-label {
  display: block;
  margin-bottom: 12px;
}

.home-internal-match-card .card-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.home-internal-match-card .card-label-row .card-label {
  margin-bottom: 0;
}

.home-mode-info-btn {
  flex: 0 0 auto;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  min-width: 1.375rem;
  min-height: 1.375rem;
  padding: 0;
  margin: 0;
  border: 1.5px solid rgba(248, 250, 252, 0.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(248, 250, 252, 0.92);
  font: inherit;
  line-height: 0;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.home-mode-info-glyph {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  transform: translateY(-0.5px);
}

.home-mode-info-btn:hover,
.home-mode-info-btn:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(125, 211, 252, 0.7);
  outline: none;
}

.cf-neo-skin .home-mode-info-btn {
  border-color: var(--neo-surface-border, rgba(125, 211, 252, 0.45));
  background: rgba(255, 255, 255, 0.1);
  color: rgba(248, 250, 252, 0.92);
}

.cf-neo-skin .home-mode-info-btn:hover,
.cf-neo-skin .home-mode-info-btn:focus-visible {
  border-color: var(--neo-surface-border-strong, rgba(94, 234, 212, 0.65));
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.home-mode-info-sheet {
  display: grid;
  gap: 14px;
}

.home-mode-info-lead {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.home-mode-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.home-mode-info-list li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text, #0f172a);
}

.home-mode-info-emoji {
  line-height: 1.45;
}

.home-internal-match-help {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.home-internal-match-actions {
  display: grid;
  gap: 10px;
}

.ext-table-wrap {
  overflow-x: auto;
}

.ext-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ext-table th,
.ext-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ext-table th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ext-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ext-group-col {
  white-space: nowrap;
  color: var(--text-muted);
}

.ext-file-input {
  display: block;
  margin: 8px 0 12px;
}

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

.ext-file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ext-file-choose {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  white-space: nowrap;
}

.ext-file-name {
  font-size: 0.8125rem;
  color: var(--text-muted);
  min-width: 0;
}

.ext-error-list {
  margin: 8px 0 0;
  color: #fecaca;
  font-size: 0.8125rem;
}

.ext-csv-error-panel {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(252, 165, 165, 0.35);
  background: rgba(127, 29, 29, 0.28);
}

.ext-csv-error-summary {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.35;
  color: #fecaca;
}

.ext-csv-error-summary:last-child {
  margin-bottom: 0;
}

.ext-csv-error-details {
  margin: 8px 0 0;
  padding-left: 18px;
  color: rgba(254, 226, 226, 0.92);
}

.ext-csv-error-details li + li {
  margin-top: 4px;
}

.ext-csv-error-more {
  list-style: none;
  margin-left: -18px;
  opacity: 0.8;
  font-style: italic;
}

.ext-hidden {
  display: none !important;
}

.cf-neo-skin .ext-table th,
.cf-neo-skin .ext-table td {
  border-bottom-color: var(--neo-surface-border);
}

.cf-neo-skin .home-internal-match-help {
  color: rgba(248, 250, 252, 0.82);
}

body[data-page="external-hub"] .main > .card,
body[data-page="external-teams"] .main > .card,
body[data-page="external-teams"] #ext-teams-hub > .card,
body[data-page="external-teams"] #ext-team-edit > .card,
body[data-page="external-friendly"] .main > .card,
body[data-page="external-tournament"] .main > .card,
body[data-page="external-tournament-setup"] .main > .card,
body[data-page="external-tournament-schedule"] .main > .card {
  background: var(--neo-surface);
  border: 1px solid var(--neo-surface-border);
  box-shadow: none;
  border-radius: 24px;
  color: #ecfdf5;
}

.cf-neo-skin .home-internal-match-card .card-label {
  color: rgba(248, 250, 252, 0.72);
}

button.home-action-card {
  width: 100%;
  font: inherit;
  cursor: pointer;
  appearance: none;
  text-align: left;
}

.ext-card-icon {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.ext-sheet-options {
  display: grid;
  gap: 8px;
}

.ext-sheet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: var(--radius-btn, 16px);
  border: 1.5px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: var(--neo-surface-soft);
  color: #ecfdf5;
  box-sizing: border-box;
  box-shadow: none;
  filter: none;
}

.cf-bottom-sheet--ext-csv-mode .ext-sheet-option,
.cf-bottom-sheet--ext-csv-mode .play-track-squad-add-entry,
.cf-bottom-sheet--ext-csv-mode .ext-squad-card,
.cf-bottom-sheet--ext-csv-mode .ext-squad-card .play-track-squad-add-entry {
  box-shadow: none !important;
  filter: none !important;
}

.ext-sheet-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
  flex: 1 1 auto;
}

.ext-sheet-option-copy strong {
  font-size: 0.9375rem;
  line-height: 1.25;
}

.ext-sheet-option-copy span {
  font-size: 0.8125rem;
  line-height: 1.35;
  opacity: 0.8;
  color: rgba(236, 253, 245, 0.78);
}

.ext-sheet-options--with-icons .ext-sheet-option .app-icon-tile {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  margin: 0;
}

.ext-sheet-options--with-icons .ext-sheet-option .app-icon-img {
  width: 28px;
  height: 28px;
}

.ext-sheet-option:hover,
.ext-sheet-option:focus-visible {
  border-color: var(--neo-surface-border-strong, rgba(94, 234, 212, 0.38));
  background: var(--neo-surface);
  outline: none;
}

.ext-sheet-option.is-selected {
  border-color: var(--neo-surface-border-strong, rgba(94, 234, 212, 0.45));
  background: var(--neo-surface-strong);
  outline: none;
}

.ext-sheet-option.is-danger {
  border-color: rgba(251, 113, 133, 0.42);
}

.ext-sheet-option.is-danger .ext-sheet-option-copy strong {
  color: #fecdd3;
}

.ext-sheet-option.is-danger:hover,
.ext-sheet-option.is-danger:focus-visible {
  border-color: rgba(251, 113, 133, 0.62);
  background: rgba(127, 29, 29, 0.22);
}

.ext-sheet-option:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.ext-sheet-options--compact {
  gap: 8px;
}

.ext-sheet-options--compact .ext-sheet-option {
  align-items: center;
  padding: 12px 16px;
}

.ext-sheet-options--compact .ext-sheet-option strong {
  font-size: 0.9375rem;
}

/* Optional stacked cards — only when explicitly requested. */
.ext-sheet-options--stacked {
  gap: 12px;
}

.ext-sheet-option--stacked {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 118px;
  padding: 18px 16px 16px;
  text-align: center;
  border-radius: 20px;
}

.ext-sheet-option--stacked .ext-sheet-option-copy {
  text-align: center;
  justify-items: center;
  width: 100%;
}

.ext-sheet-option--stacked .app-icon-tile {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

body[data-page="external-setup"] .main > .card {
  background: var(--neo-surface);
  border: 1px solid var(--neo-surface-border);
  box-shadow: none;
  border-radius: 24px;
  color: #ecfdf5;
}

body[data-page="external-setup"] .player-picker,
body[data-page="external-setup"] .player-picker-control {
  width: 100%;
}

body[data-page="external-setup"] .player-picker-list {
  left: 0;
  right: 0;
}

.cf-bottom-sheet--picker .cf-sheet-picker-list .player-picker-option--add {
  color: #5eead4;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.cf-bottom-sheet--picker .cf-sheet-picker-list .player-picker-option--empty {
  color: rgba(248, 250, 252, 0.72);
  font-style: italic;
}

#ext-create-team-modal-overlay.modal-overlay {
  z-index: 2600;
}

body.ext-create-team-modal-open {
  overflow: hidden;
}

body.ext-create-team-modal-open .app {
  pointer-events: none;
}

body.ext-create-team-modal-open #ext-create-team-modal-overlay,
body.ext-create-team-modal-open #ext-create-team-modal-overlay * {
  pointer-events: auto;
}

#ext-create-team-modal-overlay .add-team-name-modal {
  width: min(100%, 22rem);
}

#ext-create-team-error {
  margin-top: 10px;
  color: #fecaca;
}

#app-toast.app-toast--black {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
  z-index: 2800 !important;
}

.ext-setup-start-now-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
}

.ext-setup-start-now-label input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #111;
}

.ext-setup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ext-setup-actions .btn-primary,
.ext-setup-actions .btn-secondary {
  width: 100%;
}

.ext-schedule-assign-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 2px;
}

.ext-schedule-assign-form .login-field,
.ext-schedule-assign-form .player-picker,
.ext-schedule-assign-form .player-picker-control,
.ext-schedule-assign-form .player-combobox,
.ext-schedule-assign-form .custom-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cf-bottom-sheet--ext-update-teams .cf-bottom-sheet-body {
  padding-left: 16px;
  padding-right: 16px;
  overflow-x: hidden;
}

.cf-bottom-sheet--ext-update-teams .player-picker-list {
  position: static !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 8px 0 0 !important;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 16px;
  color: #fff;
  max-height: min(240px, 42vh);
  overflow: auto;
}

.cf-bottom-sheet--ext-update-teams .player-picker-option {
  color: #fff;
  padding: 12px 14px;
}

.cf-bottom-sheet--ext-update-teams .player-picker-option[aria-selected="true"],
.cf-bottom-sheet--ext-update-teams .player-picker-option:hover,
.cf-bottom-sheet--ext-update-teams .player-picker-option:focus {
  background: rgba(45, 212, 191, 0.24);
  color: #fff;
}

.ext-schedule-assign-form .modal-actions {
  margin-top: 8px;
}

.cf-bottom-sheet--ext-csv .cf-bottom-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  padding-top: 16px;
}

.cf-bottom-sheet--ext-csv .ext-csv-add-btn,
.cf-bottom-sheet--ext-csv .cf-bottom-sheet-actions .btn-primary {
  width: 100%;
  min-height: 48px;
  margin: 0;
}

.cf-bottom-sheet--ext-csv .ext-csv-add-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body[data-page="external-prep"] .main > .card {
  background: var(--neo-surface);
  border: 1px solid var(--neo-surface-border);
  box-shadow: none;
  border-radius: 24px;
  color: #ecfdf5;
}

body.ext-squad-open .cf-bottom-sheet-overlay,
body.ext-squad-open .cf-bottom-sheet-overlay--stacked,
body.ext-squad-open .modal-overlay,
body.ext-squad-open #ext-add-player-overlay,
body.ext-squad-open #ext-manage-add-overlay,
body.ext-squad-open #neo-confirm-modal-overlay {
  z-index: 5200;
}

/* Set up team also sets play-track-squad-open, which hides .app (and the drawer
   inside it). Keep .app mounted so a body-reparented drawer can open above the
   squad page; hide only the page chrome. */
body.ext-squad-open.play-track-squad-open .app,
body.ext-toss-open.play-track-squad-open .app {
  display: flex !important;
  pointer-events: none !important;
  background: transparent !important;
  z-index: auto;
}

body.ext-squad-open .app > .header,
body.ext-toss-open .app > .header,
body.ext-squad-open.play-track-squad-open .app > .header,
body.ext-toss-open.play-track-squad-open .app > .header,
body.ext-squad-open.play-track-squad-open .app > .main,
body.ext-toss-open.play-track-squad-open .app > .main {
  display: none !important;
  pointer-events: none !important;
}

body.ext-squad-open .drawer,
body.ext-toss-open .drawer,
body.ext-squad-open.play-track-squad-open .drawer,
body.ext-toss-open.play-track-squad-open .drawer,
body.ext-squad-open .drawer.ext-drawer-portaled,
body.ext-toss-open .drawer.ext-drawer-portaled {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 6400 !important;
}

body.ext-squad-open .drawer-overlay,
body.ext-toss-open .drawer-overlay,
body.ext-squad-open.play-track-squad-open .drawer-overlay,
body.ext-toss-open.play-track-squad-open .drawer-overlay,
body.ext-squad-open .drawer-overlay.ext-drawer-portaled,
body.ext-toss-open .drawer-overlay.ext-drawer-portaled {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 6350 !important;
}

body.ext-squad-open .drawer:not(.open),
body.ext-toss-open .drawer:not(.open),
body.ext-squad-open.play-track-squad-open .drawer:not(.open),
body.ext-toss-open.play-track-squad-open .drawer:not(.open) {
  pointer-events: none !important;
}

body.ext-squad-open .drawer-overlay:not(.open),
body.ext-toss-open .drawer-overlay:not(.open),
body.ext-squad-open.play-track-squad-open .drawer-overlay:not(.open),
body.ext-toss-open.play-track-squad-open .drawer-overlay:not(.open) {
  display: none !important;
  pointer-events: none !important;
}

body.ext-squad-open #neo-confirm-modal-overlay,
body.ext-squad-open #ext-prep-popup-overlay {
  z-index: 5400;
}

body.ext-squad-open .app-toast,
body.play-track-squad-open .app-toast {
  z-index: 6000 !important;
}

.ext-squad-page .play-track-squad-page-lead {
  padding: 12px 16px 10px;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Natural stack: sections + Close/Toss sit under the last card (no bottom stretch gap). */
.play-track-squad-page.ext-squad-page .play-track-squad-sheet-main {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto !important;
  min-height: 0;
  height: auto;
  justify-content: flex-start;
}

.play-track-squad-page.ext-squad-page > .play-track-squad-sheet-body {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ext-squad-sticky {
  flex: 0 0 auto;
  padding: 4px 0 14px;
}

.ext-squad-page .play-track-squad-tabs {
  margin: 0 0 10px;
}

.ext-squad-page .play-track-squad-tabs .auth-tab {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.ext-squad-side-meta {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  line-height: 1.35;
}

.ext-squad-side-meta-text {
  min-width: 0;
}

.ext-squad-side-meta .ext-squad-view-only-info {
  flex: 0 0 auto;
}

.ext-squad-view-only-sheet {
  gap: 10px;
}

.ext-squad-view-only-copy {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: inherit;
  opacity: 0.92;
}

.cf-neo-skin .cf-bottom-sheet--neo .ext-squad-view-only-sheet .home-mode-info-lead,
.cf-neo-skin .cf-bottom-sheet--neo .ext-squad-view-only-copy {
  color: rgba(248, 250, 252, 0.92);
  opacity: 1;
}

.ext-squad-page .play-track-squad-sheet-scroll {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 6px;
  overflow: visible;
}

.ext-squad-section {
  margin: 0;
}

.ext-squad-card {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 0 10px;
  border: 1px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  border-radius: 16px;
  background: var(--neo-surface-soft);
  overflow: hidden;
}

.ext-squad-section-title {
  margin: 0 0 8px;
  padding: 0 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.72);
}

.ext-squad-option-hint {
  margin: 0 0 8px;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.82);
}

.ext-squad-card .ext-squad-option-hint {
  padding: 0 14px;
}

.ext-squad-sep {
  display: block;
  height: 0;
  margin: 8px 14px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.ext-squad-page .play-track-squad-add-entry {
  margin: 0;
}

.ext-squad-card .play-track-squad-add-entry {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.ext-squad-card .play-track-squad-add-entry-btn {
  padding: 10px 14px;
  min-height: 44px;
}

.ext-squad-page .play-track-squad-page-footer.play-track-squad-footer-actions {
  margin-top: 20px;
  padding-top: 6px;
  padding-bottom: 12px;
}

.ext-squad-page .play-track-squad-page-footer .btn-primary,
.ext-squad-page .play-track-squad-page-footer .btn-secondary {
  min-height: 42px;
}

@media (max-height: 700px) {
  .ext-squad-page .play-track-squad-page-lead {
    padding-top: 8px;
    padding-bottom: 6px;
  }

  .ext-squad-page .play-track-squad-sheet-scroll {
    gap: 12px;
  }

  .ext-squad-sticky {
    padding-bottom: 10px;
  }

  .ext-squad-card {
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .ext-squad-page .play-track-squad-page-footer.play-track-squad-footer-actions {
    margin-top: 16px;
    padding-top: 4px;
    padding-bottom: 10px;
  }
}

.ext-squad-sheet-help {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.82);
}

.ext-group-sheet-section {
  margin: 0 0 18px;
}

.ext-group-sheet-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.72);
}

.cf-bottom-sheet--ext-csv #ext-squad-csv-sample {
  width: 100%;
  margin: 0 0 12px;
}

.cf-bottom-sheet--ext-csv .ext-file-picker {
  margin: 0 0 16px;
}

.cf-bottom-sheet--ext-csv .ext-file-choose {
  flex: 0 0 auto;
  width: auto;
}

.cf-bottom-sheet--ext-toss .toss-setup {
  padding-bottom: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cf-bottom-sheet--ext-toss .cf-bottom-sheet-body {
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-gutter: stable both-edges;
}

.cf-bottom-sheet--ext-toss .toss-team-legend {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cf-bottom-sheet--ext-toss .cf-bottom-sheet-actions {
  display: flex;
}

.cf-bottom-sheet--ext-toss .cf-bottom-sheet-actions .btn-primary {
  width: 100%;
}

.ext-role-trigger {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  min-height: 48px;
}

.cf-bottom-sheet--ext-edit-setup .login-field {
  margin-bottom: 12px;
}

.cf-bottom-sheet--ext-squad-check .play-track-squad-player-list,
.cf-bottom-sheet--ext-squad-check .team-squad-player-list {
  display: grid;
  gap: 12px;
}

.cf-bottom-sheet--ext-squad-check .cf-bottom-sheet-actions {
  display: flex;
  gap: 10px;
}

.cf-bottom-sheet--ext-squad-check .cf-bottom-sheet-actions .btn-secondary,
.cf-bottom-sheet--ext-squad-check .cf-bottom-sheet-actions .btn-primary {
  flex: 1 1 0;
}

#ext-add-player-overlay.modal-overlay,
#ext-manage-add-overlay.modal-overlay {
  z-index: 5300;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

#ext-add-player-overlay .add-player-modal,
#ext-manage-add-overlay .add-player-modal {
  width: min(100%, 26rem);
  max-width: calc(100vw - 2rem);
  max-height: min(86vh, 100%);
  height: auto;
  margin: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #1a3a5c 0%, #2a6b78 52%, #3d9b8f 100%);
  color: #f8fafc;
  border: none !important;
  outline: none;
  box-shadow: 0 18px 48px rgba(8, 15, 30, 0.45);
}

#ext-add-player-overlay .add-player-modal-form,
#ext-manage-add-overlay .add-player-modal-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#ext-add-player-overlay .add-player-modal-fields,
#ext-manage-add-overlay .add-player-modal-fields {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#ext-add-player-overlay .custom-input,
#ext-add-player-overlay .player-combobox,
#ext-manage-add-overlay .custom-input,
#ext-manage-add-overlay .player-combobox {
  background: rgba(8, 24, 40, 0.42);
  border: 1.5px solid rgba(94, 234, 212, 0.5);
  color: #fff;
}

#ext-add-player-overlay .custom-input::placeholder,
#ext-manage-add-overlay .custom-input::placeholder {
  color: rgba(236, 253, 245, 0.55);
}

.cf-bottom-sheet--ext-csv #ext-manage-csv-sample {
  width: 100%;
  margin: 0 0 12px;
}

.ext-squad-card--sheet {
  margin: 0;
}

.cf-bottom-sheet--ext-confirm .cf-bottom-sheet-actions {
  display: flex;
  gap: 10px;
}

.cf-bottom-sheet--ext-confirm .cf-bottom-sheet-actions .btn-secondary,
.cf-bottom-sheet--ext-confirm .cf-bottom-sheet-actions .btn-primary {
  flex: 1 1 0;
}

.cf-bottom-sheet--ext-confirm .ext-squad-sheet-help {
  margin: 0;
  text-align: center;
}

.cf-bottom-sheet--popup.cf-bottom-sheet--ext-save-prompt {
  position: relative;
  width: min(calc(100% - 40px), 19.5rem) !important;
  max-width: 19.5rem !important;
  border-radius: 20px !important;
  border: 1px solid rgba(94, 234, 212, 0.22);
  box-shadow: 0 18px 44px rgba(2, 12, 27, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cf-bottom-sheet--popup.cf-bottom-sheet--ext-save-prompt .cf-bottom-sheet-header {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0;
  border: none;
  background: transparent;
  z-index: 2;
}

.cf-bottom-sheet--popup.cf-bottom-sheet--ext-save-prompt .cf-bottom-sheet-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  opacity: 0.7;
}

.cf-bottom-sheet--popup.cf-bottom-sheet--ext-save-prompt .cf-bottom-sheet-body {
  padding: 24px 20px 4px;
}

.ext-save-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.ext-save-prompt-title {
  margin: 0;
  padding: 0 18px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  color: #f8fafc;
}

.ext-save-prompt-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(226, 232, 240, 0.78);
}

.cf-bottom-sheet--popup.cf-bottom-sheet--ext-save-prompt .cf-bottom-sheet-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px 18px;
}

.ext-save-prompt-btn {
  flex: 0 0 auto;
  min-width: 6.5rem;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.ext-save-prompt-btn:active {
  transform: scale(0.96);
}

.ext-save-prompt-btn--ghost {
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.08);
  color: #fda4af;
}

.ext-save-prompt-btn--primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #042f2e;
  box-shadow: 0 6px 14px rgba(45, 212, 191, 0.28);
}

#ext-prep-popup-overlay .neo-confirm-modal {
  width: min(100%, 22rem);
}

#ext-prep-popup-overlay .modal-actions {
  display: flex;
}

#ext-prep-popup-overlay .modal-actions .btn-primary {
  width: 100%;
}

.match-awards .match-series-standing {
  margin: 0 0 10px;
  color: #fde68a;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.ext-friendly-format-card {
  display: grid;
  gap: 12px;
}

/* Hide empty format shell so H2H/Tournament never flash a hollow card before options render. */
.ext-friendly-format-card:empty {
  display: none;
}

/* Avoid painting H2H Match setup while redirecting a tournament draft away. */
html.ext-setup-booting body[data-page="external-setup"] .app {
  visibility: hidden;
}

/* Hide prep hub until draft kind is applied — avoids H2H Edit-series flicker on tournament. */
html.ext-prep-booting body[data-page="external-prep"] .main {
  visibility: hidden;
}

html.ext-prep-tournament #ext-prep-edit-row {
  display: none !important;
}

.ext-friendly-format-card #ext-friendly-continue,
.ext-friendly-format-card #ext-tournament-continue {
  width: 100%;
  margin: 4px 0 8px;
}

.ext-pending-block {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
}

.ext-pending-block--sheet {
  margin: 0;
}

.ext-pending-chevron-row {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: var(--neo-surface, rgba(47, 79, 110, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.ext-pending-chevron-row:hover,
.ext-pending-chevron-row:focus-visible {
  border-color: var(--neo-surface-border-strong, rgba(94, 234, 212, 0.45));
}

.ext-pending-chevron-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.ext-pending-chevron-copy strong {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}

.ext-pending-chevron-copy span {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.82);
}

.ext-pending-chevron-row .history-group-chevron {
  flex: 0 0 auto;
}

.ext-pending-chevron-row--loading {
  cursor: default;
  pointer-events: none;
  opacity: 0.95;
}

.ext-pending-loader {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #86efac;
  animation: extPendingSpin 0.7s linear infinite;
}

.ext-pending-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 16px 20px;
  text-align: center;
}

.ext-pending-loading .ext-pending-loader {
  width: 22px;
  height: 22px;
}

.ext-pending-loading-text {
  margin: 0;
}

@keyframes extPendingSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ext-pending-loader {
    animation: none;
  }
}

.ext-schedule-hub {
  display: grid;
  gap: 12px;
}

.ext-schedule-hub-banner {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: var(--neo-surface, rgba(47, 79, 110, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.ext-schedule-hub-banner.ext-series-hub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 16px;
}

.ext-series-hub-banner-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.ext-series-hub-banner .ext-series-hub-end,
.ext-schedule-hub-banner .ext-pending-end {
  flex: 0 0 auto;
  margin-right: 2px;
  padding: 8px 12px;
  border-radius: 999px;
}

.ext-schedule-hub-banner strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.ext-schedule-hub-banner span {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(248, 250, 252, 0.86);
}

.ext-schedule-hub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ext-schedule-hub-actions .btn-secondary {
  width: 100%;
  min-height: 42px;
}

.ext-schedule-hub-nav,
.ext-schedule-sheet-nav {
  display: grid;
  gap: 12px;
}

.ext-schedule-hub-nav .ext-pending-chevron-row,
.ext-schedule-sheet-nav .ext-pending-chevron-row {
  margin: 0;
}

.ext-schedule-sheet-nav {
  margin: 0 0 12px;
}

.ext-pending-heading {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted, rgba(248, 250, 252, 0.72));
}

.ext-pending-card {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.2);
  color: inherit;
}

.ext-pending-card-main {
  display: grid;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ext-pending-card-main .ext-pending-when {
  font-size: 0.8125rem;
  opacity: 0.78;
  color: rgba(236, 253, 245, 0.78);
}

.ext-pending-card strong {
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.3;
}

.ext-pending-card span {
  font-size: 0.8125rem;
  line-height: 1.3;
  color: rgba(236, 253, 245, 0.9);
}

.ext-pending-card .ext-schedule-row-when {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.72);
}

.ext-pending-card .ext-schedule-row-result.is-won,
.ext-pending-card .ext-schedule-row-result.is-won .ext-schedule-result-text {
  color: #34d399;
}

.ext-pending-end {
  width: auto;
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
}

button.ext-pending-card--chevron {
  appearance: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.ext-pending-card--chevron .ext-pending-card-main {
  pointer-events: none;
}

.ext-pending-card--chevron .history-group-chevron {
  flex: 0 0 auto;
  opacity: 0.8;
}

.cf-bottom-sheet--setup > .ext-pending-chevron-row[data-ext-tournament-options],
.cf-bottom-sheet-body > .ext-pending-chevron-row[data-ext-tournament-options] {
  margin: 0 0 12px;
}

.cf-bottom-sheet-body > .ext-schedule-sheet-nav > .ext-pending-chevron-row[data-ext-tournament-options] {
  margin: 0;
}

.ext-pending-detail {
  display: grid;
  gap: 6px;
  text-align: center;
  padding: 4px 0 8px;
}

.ext-pending-series-name,
.ext-pending-score {
  margin: 0;
  font-weight: 700;
}

.ext-pending-left,
.ext-pending-played {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.82);
}

.cf-bottom-sheet--ext-pending .cf-bottom-sheet-actions {
  display: flex;
  gap: 10px;
}

.ext-schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
}

.ext-schedule-nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 0;
}

.ext-schedule-nav-row.profile-option-row,
.ext-schedule-nav-row.group-select-action-btn {
  width: 100%;
  border: 1.5px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  border-radius: var(--radius-btn, 16px);
  border-bottom: 1.5px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: var(--neo-surface-soft);
  box-shadow: none;
  padding: 14px 16px;
  color: #ecfdf5;
}

.ext-schedule-nav-row .profile-option-hint {
  color: rgba(236, 253, 245, 0.72);
}

.ext-schedule-nav-row.group-select-action-btn:last-child {
  border-bottom: 1.5px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
}

.cf-neo-skin .ext-schedule-nav-row.group-select-action-btn:hover,
.cf-neo-skin .ext-schedule-nav-row.group-select-action-btn:focus-visible {
  background: var(--neo-surface-strong);
  border-color: var(--neo-surface-border-strong, rgba(94, 234, 212, 0.45));
}

.ext-schedule-groups-panel {
  margin: 4px 0 12px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.18));
  background: rgba(8, 15, 30, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ext-schedule-groups-help {
  margin: 0 0 14px;
}

.ext-schedule-groups-count-field {
  margin-bottom: 10px;
}

.ext-schedule-groups-toolbar {
  margin: 0 0 14px;
}

.ext-schedule-groups-toolbar .btn-secondary {
  width: 100%;
}

.ext-schedule-group-count-row {
  display: flex;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
}

.ext-schedule-group-count-row .group-access-role-editor,
.ext-schedule-group-teams .group-access-role-editor {
  align-items: stretch;
  width: auto;
  max-width: 100%;
}

.ext-schedule-group-count-row .group-access-role-combo,
.ext-schedule-group-teams .group-access-role-combo {
  width: 100%;
  min-width: 9.5rem;
}

.ext-schedule-group-count-row .group-access-role-trigger,
.ext-schedule-group-teams .group-access-role-trigger {
  width: 100%;
  min-width: 9.5rem;
  max-width: 12rem;
  border-color: var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: var(--neo-surface-soft);
  color: #ecfdf5;
  box-shadow: none;
}

.ext-schedule-group-count-row .group-access-role-trigger:focus-visible,
.ext-schedule-group-count-row .group-access-role-trigger[aria-expanded="true"],
.ext-schedule-group-teams .group-access-role-trigger:focus-visible,
.ext-schedule-group-teams .group-access-role-trigger[aria-expanded="true"] {
  border-color: var(--neo-surface-border-strong, rgba(94, 234, 212, 0.45));
  background: var(--neo-surface-strong);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.16);
}

.ext-schedule-group-count-row .group-access-role-menu,
.ext-schedule-group-teams .group-access-role-menu {
  left: 0;
  right: auto;
  min-width: 100%;
  width: max(100%, 9.5rem);
  box-sizing: border-box;
  border-color: var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: linear-gradient(180deg, rgba(26, 58, 92, 0.98) 0%, rgba(36, 90, 110, 0.96) 100%);
}

.ext-schedule-group-count-row .group-access-role-option.is-selected,
.ext-schedule-group-teams .group-access-role-option.is-selected {
  border-color: var(--neo-surface-border-strong, rgba(94, 234, 212, 0.45));
  background: rgba(45, 212, 191, 0.18);
}

.ext-schedule-group-count-row .group-access-role-badge,
.ext-schedule-group-teams .group-access-role-badge {
  border: 1px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: var(--neo-surface-soft);
  color: #ecfdf5;
}

.cf-bottom-sheet-body .ext-schedule-group-teams,
.cf-bottom-sheet-body .ext-schedule-group-count-row {
  overflow: visible;
}

.cf-bottom-sheet-body .ext-schedule-group-teams .group-access-role-editor.is-open,
.cf-bottom-sheet-body .ext-schedule-group-count-row .group-access-role-editor.is-open {
  z-index: 40;
}

.cf-bottom-sheet-body .ext-schedule-group-teams .group-access-role-editor.is-open .group-access-role-combo,
.cf-bottom-sheet-body .ext-schedule-group-count-row .group-access-role-editor.is-open .group-access-role-combo {
  z-index: 41;
}

.ext-schedule-group-teams {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}

.ext-schedule-group-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.16));
  background: rgba(255, 255, 255, 0.06);
}

.ext-schedule-group-team:last-child {
  border-bottom: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.16));
}

.ext-schedule-group-team:has(.group-access-role-editor.is-open) {
  z-index: 30;
}

.ext-schedule-group-team-name {
  font-weight: 700;
  min-width: 0;
  flex: 1;
}

.ext-schedule-group-team select {
  width: 7.5rem;
  flex-shrink: 0;
}

.ext-schedule-toolbar .btn-secondary {
  width: auto;
}

.ext-schedule-when-col {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
}

.ext-schedule-cancel-link {
  grid-column: 1;
  justify-self: start;
  margin: 0;
  padding: 0 0 0 6px;
  border: 0;
  background: transparent;
  color: #fde68a;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ext-tables-tabs,
.ext-tables-group-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.ext-tables-tab,
.ext-tables-group-tab {
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.28);
  color: inherit;
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.ext-tables-tab.is-active,
.ext-tables-group-tab.is-active {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.18);
}

.ext-tables-panel {
  display: grid;
  gap: 12px;
}

.ext-points-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.28);
}

.ext-points-table {
  width: max-content;
  max-width: none;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.8125rem;
}

.ext-points-table--compact {
  width: max-content;
  min-width: 0;
}

.ext-points-table--fit {
  width: auto;
  min-width: 0;
}

.ext-points-table th,
.ext-points-table td {
  padding: 8px 6px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
  text-overflow: clip;
}

.ext-points-table th {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.8;
  padding-bottom: 6px;
  font-weight: 800;
}

.ext-points-table .ext-points-team,
.ext-points-table th.ext-points-team-head {
  text-align: left;
  font-weight: 800;
  padding-left: 8px;
  padding-right: 8px;
  width: 1%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.ext-points-table .ext-col-pos,
.ext-points-table th:first-child,
.ext-points-table td:first-child {
  width: 2.2rem;
  min-width: 2.2rem;
  padding-left: 8px;
  padding-right: 4px;
}

.ext-points-table .ext-col-num,
.ext-points-table td.ext-col-num,
.ext-points-table th.ext-col-num {
  width: 2.4rem;
  min-width: 2.4rem;
  padding-left: 4px;
  padding-right: 4px;
}

.ext-points-table .ext-col-nrr,
.ext-points-table .ext-col-form,
.ext-points-table .ext-col-best,
.ext-points-table td.ext-col-best,
.ext-points-table th.ext-col-best {
  width: 2.8rem;
  min-width: 2.8rem;
  padding-left: 5px;
  padding-right: 5px;
}

.cf-bottom-sheet--ext-tables .ext-points-scroll {
  border-radius: 14px;
}

.cf-bottom-sheet--ext-tables .ext-points-table {
  font-size: 0.8rem;
}

.cf-bottom-sheet--ext-tables .ext-points-table--fit {
  margin-right: auto;
}

.ext-points-row.is-qualified .ext-points-team {
  color: #bbf7d0;
}

.ext-points-row.is-cutoff td {
  border-bottom: 2px solid rgba(52, 211, 153, 0.85);
}

.ext-lb-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ext-bracket-wrap {
  display: grid;
  gap: 18px;
}

.ext-bracket-round {
  display: grid;
  gap: 10px;
}

.ext-bracket-round .ext-pending-heading {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.72);
}

.ext-bracket-match {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.34);
}

.ext-bracket-match strong {
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.35;
  color: #f8fafc;
}

.ext-bracket-match span {
  font-size: 0.8125rem;
  font-weight: 650;
  color: rgba(248, 250, 252, 0.88);
}

.ext-bracket-match.is-review {
  border-color: rgba(251, 191, 36, 0.8);
}

.ext-needs-review {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fde68a;
}

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

.ext-stage-list li {
  position: relative;
  padding-left: 0.9rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.9);
}

.ext-stage-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.88);
}

.ext-pending-block .ext-pending-heading {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.72);
}

.cf-bottom-sheet--ext-tables .cf-bottom-sheet-body,
.cf-bottom-sheet--external-format .cf-bottom-sheet-body,
.cf-bottom-sheet--ext-pending .cf-bottom-sheet-body {
  /* Keep last option/match card border above sheet clip + device safe area. */
  padding-bottom: max(24px, calc(16px + var(--cricfuego-safe-bottom, env(safe-area-inset-bottom, 0px))));
}

.cf-bottom-sheet--external-format .ext-sheet-options,
.cf-bottom-sheet--ext-pending .ext-schedule-list,
.cf-bottom-sheet--ext-tables .ext-schedule-list {
  margin-bottom: 4px;
}

.ext-points-scroll--sheet {
  max-height: min(58vh, 420px);
}

.cf-bottom-sheet--ext-tables .ext-tables-group-tabs {
  margin-top: 0;
}

.cf-bottom-sheet--ext-tables .ext-bracket-wrap {
  margin-top: 4px;
}

.ext-schedule-start-actions {
  display: grid;
  gap: 12px;
  margin: 16px 0 8px;
}

.ext-schedule-start-actions[hidden] {
  display: none;
}

.ext-schedule-start-copy {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 700;
}

.ext-schedule-sheet-note {
  margin: 18px 10px 4px;
  padding: 0;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: #f8fafc;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.18);
}

.cf-neo-skin .ext-schedule-sheet-note {
  color: #ffffff;
}

.ext-schedule-start-buttons {
  display: flex;
  gap: 10px;
}

.ext-schedule-start-buttons .btn-secondary,
.ext-schedule-start-buttons .btn-primary {
  flex: 1 1 0;
}

.ext-schedule-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.ext-schedule-row.ext-pending-card {
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.34);
}

.ext-schedule-row.ext-pending-card.is-open:not(.is-played) {
  border-color: rgba(45, 212, 191, 0.72);
  background: rgba(15, 118, 110, 0.22);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.12);
}

.ext-schedule-row .ext-pending-card-main {
  gap: 4px;
}

.ext-schedule-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.ext-schedule-row-round {
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.25;
  color: #f8fafc;
}

.ext-schedule-row-when {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  color: rgba(226, 232, 240, 0.72);
}

.ext-schedule-row-teams {
  display: block;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.94);
}

.ext-schedule-row-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 750;
  line-height: 1.3;
  color: rgba(226, 232, 240, 0.78);
}

.ext-schedule-row-result.is-won {
  color: #34d399;
}

.ext-schedule-row-result.is-live {
  color: #fde68a;
}

.ext-schedule-row-result.is-waiting {
  color: rgba(226, 232, 240, 0.62);
}

.ext-schedule-result-check {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  position: relative;
}

.ext-schedule-result-check::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 4.5px;
  height: 8.5px;
  border: solid #34d399;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ext-schedule-when {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.ext-schedule-when .cf-chevron {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
}

.ext-schedule-when:disabled {
  opacity: 0.55;
  cursor: default;
}

.ext-schedule-live {
  display: inline-block;
  margin-left: 4px;
  color: #fde68a;
  font-weight: 800;
}

.ext-schedule-note {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.85;
}

.ext-schedule-row.is-live {
  border-color: rgba(253, 230, 138, 0.7);
}

.ext-schedule-when.is-live .cf-chevron {
  background: rgba(253, 230, 138, 0.28) !important;
}

.ext-schedule-row.is-locked .ext-pending-card-main {
  cursor: default;
}

.ext-schedule-row.is-played {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.34);
  box-shadow: none;
}

.ext-schedule-sheet-nav .ext-pending-chevron-row .cf-chevron,
.ext-schedule-hub-nav .ext-pending-chevron-row .cf-chevron {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
}

.cf-bottom-sheet--ext-pending .cf-bottom-sheet-actions .btn-secondary,
.cf-bottom-sheet--ext-pending .cf-bottom-sheet-actions .btn-primary {
  flex: 1 1 0;
}

body[data-page="external-teams"] .main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding-bottom: 16px;
}

#ext-teams-hub {
  display: grid;
  gap: 16px;
  align-content: start;
  width: 100%;
}

#ext-teams-sheet-panels.hidden {
  display: none !important;
}

body[data-page="external-teams"] .card {
  height: fit-content;
}

body[data-page="external-teams"] .group-select-existing-card .profile-option-hint {
  margin: 0;
}

body[data-page="external-teams"] .group-list {
  margin: 0;
  padding: 0;
}

body[data-page="external-teams"] .group-list-item {
  padding-bottom: 10px;
  margin-bottom: 10px;
}

body[data-page="external-teams"] .group-list-card {
  padding: 12px 14px;
}

body[data-page="external-teams"] .group-list-meta {
  gap: 2px;
}

body[data-page="external-teams"] button.group-list-access-link {
  appearance: none;
  width: fit-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  min-height: 0;
  height: auto;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #5eead4;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.ext-team-card {
  cursor: default;
}

.ext-team-access-badge {
  width: fit-content;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  margin-top: 6px;
  font-size: 0.72rem;
}

.ext-team-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.ext-team-edit-open[data-page="external-teams"] .main {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 10px;
  padding-bottom: 10px;
}

html.keyboard-open body.ext-team-edit-open[data-page="external-teams"] .main {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(16px, calc(12px + var(--keyboard-inset, 0px)));
}

#ext-team-edit {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.keyboard-open #ext-team-edit {
  overflow: visible;
}

html.keyboard-open #ext-edit-name,
html.keyboard-open #ext-edit-name-wrap {
  scroll-margin-top: 16px;
  scroll-margin-bottom: 140px;
}

#ext-team-edit .page-banner {
  flex: 0 0 auto;
  padding: 12px 16px;
}

#ext-team-edit .page-banner h1 {
  margin: 0;
  font-size: 1.15rem;
}

#ext-team-edit .page-banner p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.ext-edit-card {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  height: auto !important;
}

#ext-edit-name-wrap {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 14px 14px;
  border-radius: 16px;
  border: 1px solid var(--neo-surface-border, rgba(125, 211, 252, 0.32));
  background: rgba(8, 28, 40, 0.42);
  position: relative;
  z-index: 1;
  overflow: visible;
}

#ext-edit-name-wrap .team-label {
  margin-bottom: 6px;
}

#ext-edit-name-wrap .custom-input {
  width: 100%;
  box-sizing: border-box;
}

#ext-edit-checklist .ext-pending-chevron-row {
  margin-top: 0;
}

#ext-edit-checklist {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  overflow: visible;
}

#ext-edit-checklist .remove-players-toolbar {
  flex: 0 0 auto;
  margin: 0;
  gap: 12px;
}

#ext-edit-checklist .remove-players-trigger {
  white-space: nowrap;
}

#ext-edit-checklist .ext-edit-checklist-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(38dvh, 260px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

#ext-edit-checklist .play-track-squad-player-list {
  gap: 4px;
}

#ext-edit-checklist .ext-edit-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 2.1rem;
  padding: 4px 8px;
}

#ext-edit-checklist .ext-edit-player-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

#ext-edit-checklist .ext-edit-player-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#ext-edit-add-menu {
  flex: 0 0 auto;
}

#ext-edit-add-menu .ext-squad-card {
  padding: 6px 0;
}

#ext-edit-add-menu .ext-squad-card .play-track-squad-add-entry-btn {
  padding: 6px 14px;
}

#ext-edit-add-menu .ext-squad-sep {
  margin: 4px 14px;
}

.ext-edit-unregistered-wrap {
  margin: 14px 0 0;
}

.ext-edit-unregistered-wrap.ext-hidden {
  display: none !important;
}

.ext-edit-unregistered-card {
  margin: 0;
  padding: 6px 0;
}

.ext-edit-unregistered-card .play-track-squad-add-entry-btn {
  padding: 6px 14px;
}

.cf-bottom-sheet--ext-csv-mode #ext-csv-mode-sample {
  width: 100%;
  margin: 14px 0 0;
}

.team-squad-player-option .squad-add-player-main,
.play-track-squad-player-row .squad-add-player-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.squad-add-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squad-add-player-phone {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.72);
  text-align: right;
}

.ext-unregistered-edit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ext-unregistered-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 233, 216, 0.22);
  background: rgba(8, 28, 40, 0.32);
}

.ext-unregistered-edit-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.ext-unregistered-edit-copy strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #f8fafc;
}

.ext-unregistered-edit-meta {
  font-size: 0.75rem;
  color: rgba(248, 250, 252, 0.68);
}

.ext-unregistered-edit-row .btn-icon-edit {
  flex: 0 0 auto;
}

.ext-edit-footer {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  margin: 16px 0 0;
  padding: 2px 0 0;
  position: static;
}

.ext-edit-footer .btn-primary,
.ext-edit-footer .btn-secondary {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  min-height: 42px;
  padding: 8px 14px;
  font-size: 0.875rem;
}

body[data-page="external-tournament-setup"] .main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
}

body[data-page="external-tournament-setup"] .ext-tournament-setup-card {
  padding: 18px 16px 16px;
  overflow: hidden;
  min-width: 0;
}

body[data-page="external-tournament-setup"] .ext-setup-row,
.cf-bottom-sheet--ext-edit-setup .ext-setup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.cf-bottom-sheet--ext-edit-setup .ext-setup-row .login-field {
  margin-bottom: 0;
}

/* Date/time triggers share one layout so the neo chevron stays vertically centered. */
.ext-date-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  height: 42px;
  padding: 0 8px 0 14px;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  overflow: hidden;
}

.ext-date-trigger > span:not(.cf-chevron):not(.profile-option-chevron) {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.ext-date-trigger .cf-chevron,
.ext-date-trigger .profile-option-chevron {
  align-self: center !important;
  position: relative !important;
  top: auto !important;
  margin: 0 !important;
}

.cf-bottom-sheet--ext-edit-setup .ext-date-trigger {
  color: inherit;
  font: inherit;
}

body[data-page="external-tournament-setup"] .ext-setup-row .login-field,
body[data-page="external-tournament-setup"] .ext-setup-row .custom-input,
body[data-page="external-tournament-setup"] .ext-date-trigger {
  min-width: 0;
  max-width: 100%;
}

body[data-page="external-tournament-setup"] .ext-setup-row .login-field {
  margin-bottom: 0;
}

body[data-page="external-tournament-setup"] .ext-date-trigger {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  padding-inline: 10px 8px;
}

.ext-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}

.ext-cal-title {
  font-size: 0.95rem;
  font-weight: 800;
}

.ext-cal-nav {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.16));
  background: rgba(15, 23, 42, 0.28);
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

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

.ext-cal-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.7;
  padding: 4px 0 8px;
}

.ext-cal-day {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ext-cal-day.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.ext-cal-day.is-selected {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.18);
}

.ext-cal-day.is-disabled {
  opacity: 0.35;
  cursor: default;
}

.ext-time-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ext-time-heading {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.75;
}

.ext-time-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ext-time-chip {
  min-width: 52px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--neo-surface-border, rgba(255, 255, 255, 0.16));
  background: rgba(15, 23, 42, 0.28);
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ext-time-colon {
  font-size: 1.25rem;
  font-weight: 800;
}

body[data-page="external-tournament-setup"] .ext-setup-row + .login-field,
body[data-page="external-tournament-setup"] .login-field + .ext-setup-row,
body[data-page="external-tournament-setup"] .ext-setup-row + .ext-setup-row,
body[data-page="external-tournament-setup"] .ext-setup-row + .ext-tournament-teams-block,
body[data-page="external-tournament-setup"] .login-field + .ext-tournament-teams-block {
  margin-top: 14px;
}

body[data-page="external-tournament-setup"] .ext-tournament-teams-block .card-label {
  display: block;
  margin-bottom: 10px;
}

#ext-tournament-add-team .profile-option-copy {
  min-width: 0;
}

#ext-tournament-add-team .profile-option-hint {
  white-space: nowrap;
}

.ext-tournament-selected-wrap {
  margin-top: 10px;
}

.ext-tournament-selected-panel,
.ext-tournament-added-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.18));
  background: rgba(8, 15, 30, 0.28);
}

.ext-tournament-added-list {
  margin: 0 0 14px;
}

.ext-tournament-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.16));
  background: rgba(15, 23, 42, 0.28);
}

.ext-tournament-selected-panel .ext-tournament-team-row {
  background: rgba(255, 255, 255, 0.06);
}

.ext-tournament-team-name {
  font-weight: 700;
  min-width: 0;
}

.ext-tournament-pick-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 16px;
}

.cf-bottom-sheet--ext-add-team .ext-tournament-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 0;
}

.cf-bottom-sheet--ext-add-team .ext-add-team-or {
  margin: 14px 0 2px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.cf-bottom-sheet--ext-add-team .ext-add-team-panel {
  margin: 12px 0 0;
  padding: 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.18));
  background: rgba(8, 28, 36, 0.35);
}

.cf-bottom-sheet--ext-add-team .ext-add-team-panel--search {
  border-color: rgba(56, 189, 180, 0.42);
}

.cf-bottom-sheet--ext-add-team .ext-add-team-panel--create {
  border-color: rgba(255, 255, 255, 0.22);
}

.cf-bottom-sheet--ext-add-team .ext-add-team-panel .login-field {
  margin: 0;
}

.cf-bottom-sheet--ext-add-team .ext-tournament-create-form .form-hint[hidden] {
  display: none;
  margin: 0;
}

.cf-bottom-sheet--ext-add-team .ext-tournament-create-form .btn-primary {
  margin-top: 0;
}

.cf-bottom-sheet--ext-add-team .ext-tournament-pick-list {
  margin-bottom: 0;
}

.ext-schedule-summary,
.ext-schedule-match-summary-block {
  display: block;
  margin: 0 0 10px;
  color: rgba(226, 252, 245, 0.92);
  font-size: 0.92rem;
  line-height: 1.35;
}

.ext-schedule-manual-assign {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ext-schedule-manual-fixture {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
}

.ext-schedule-manual-when {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  opacity: 0.78;
}

.ext-tournament-pick-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--neo-surface-border, rgba(255, 255, 255, 0.16));
  background: rgba(15, 23, 42, 0.28);
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.ext-tournament-create-form .btn-primary {
  width: 100%;
}

body[data-page="external-tournament-setup"] #ext-tournament-setup-form .modal-actions {
  margin-top: 18px;
}

body[data-page="external-tournament-setup"] #ext-tournament-add-team {
  width: 100%;
}

.cf-bottom-sheet--ext-edit-setup .ext-setup-row--dates,
body[data-page="external-tournament-setup"] .ext-setup-row--dates {
  margin-top: 18px;
}

.cf-bottom-sheet--ext-edit-setup .ext-setup-row--dates .team-label,
body[data-page="external-tournament-setup"] .ext-setup-row--dates .team-label {
  display: block;
  margin: 8px 0 10px;
  line-height: 1.35;
}

.cf-bottom-sheet--ext-edit-setup .ext-tournament-teams-block,
body[data-page="external-tournament-setup"] .ext-tournament-teams-block {
  margin-top: 22px;
}

.cf-bottom-sheet--ext-edit-setup .ext-tournament-teams-block .team-label,
.cf-bottom-sheet--ext-edit-setup .ext-tournament-teams-block .card-label,
body[data-page="external-tournament-setup"] .ext-tournament-teams-block .team-label,
body[data-page="external-tournament-setup"] .ext-tournament-teams-block .card-label {
  display: block;
  margin: 8px 0 12px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: none;
}

.cf-bottom-sheet--ext-edit-setup #ext-tournament-add-team,
body[data-page="external-tournament-setup"] #ext-tournament-add-team {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(125, 211, 252, 0.55) !important;
  background: rgba(8, 28, 40, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cf-bottom-sheet--ext-edit-setup #ext-tournament-add-team .profile-option-copy strong {
  font-size: 0.95rem;
}


.ext-pending-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ext-pending-heading .app-icon-tile {
  flex: 0 0 22px;
}

/* Tournament leaderboard modal (series-style layout) */
.cf-bottom-sheet--tlb .tlb-root {
  display: grid;
  gap: 12px;
  padding-bottom: 8px;
}
.tlb-header-card {
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, rgba(12, 58, 68, 0.95), rgba(8, 36, 48, 0.9));
}
.tlb-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.tlb-header-name {
  font-size: 1.05rem;
  font-weight: 800;
}
.tlb-header-format {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}
.tlb-header-status {
  margin: 8px 0 0;
  color: rgba(226, 252, 245, 0.92);
  font-size: 0.9rem;
}
.tlb-header-progress {
  margin: 4px 0 0;
  font-size: 0.78rem;
  opacity: 0.72;
}
.tlb-kind-tabs,
.tlb-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tlb-kind-tab,
.tlb-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 28, 36, 0.45);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}
.tlb-kind-tab.is-active,
.tlb-chip.is-active {
  border-color: rgba(45, 212, 191, 0.7);
  background: rgba(13, 148, 136, 0.28);
}
.tlb-cap-stack {
  display: grid;
  gap: 8px;
}
.tlb-cap-card {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 28, 36, 0.4);
}
.tlb-cap-card--orange { border-color: rgba(251, 191, 36, 0.55); }
.tlb-cap-card--purple { border-color: rgba(167, 139, 250, 0.55); }
.tlb-cap-card--field { border-color: rgba(94, 234, 212, 0.45); }
.tlb-cap-card--potm { border-color: rgba(250, 204, 21, 0.7); }
.tlb-cap-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(250, 204, 21, 0.95);
}
.tlb-cap-card--purple .tlb-cap-label { color: rgba(196, 181, 253, 0.95); }
.tlb-cap-card--field .tlb-cap-label { color: rgba(153, 246, 228, 0.95); }
.tlb-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tlb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.tlb-table th,
.tlb-table td {
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}
.tlb-table thead th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.78;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.tlb-table th.is-sortable { cursor: pointer; }
.tlb-col-num { text-align: center !important; font-variant-numeric: tabular-nums; }
.tlb-col-chev { width: 18px; opacity: 0.55; text-align: center !important; }
.tlb-row.is-lead { background: rgba(45, 212, 191, 0.1); }
.tlb-player {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 140px;
}
.tlb-badge {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.tlb-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}
.tlb-metric { font-weight: 800; }
.tlb-rank {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  font-weight: 800;
}
.tlb-rank.is-gold { background: #f59e0b; color: #111827; }
.tlb-rank.is-silver { background: #94a3b8; color: #111827; }
.tlb-rank.is-bronze { background: #d97706; color: #111827; }
.tlb-econ.is-good { color: #34d399; }
.tlb-econ.is-amber { color: #fbbf24; }
.tlb-econ.is-bad { color: #f87171; }
.tlb-detail td {
  padding-top: 0;
  padding-bottom: 12px;
  font-size: 0.75rem;
  opacity: 0.82;
  white-space: normal;
}
.tlb-hint,
.tlb-empty {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.78;
}
.tlb-share-bar {
  position: sticky;
  bottom: 0;
  padding: 10px 0 4px;
  background: linear-gradient(180deg, transparent, rgba(8, 28, 36, 0.92) 30%);
}
.tlb-share-btn { width: 100%; }

/* —— Knockout Bracket modal (tbk) —— */
.cf-bottom-sheet--tbk .cf-bottom-sheet-body {
  padding-top: 4px;
}

.tbk-root {
  display: grid;
  gap: 16px;
  padding: 0 2px 12px;
  color: #f8fafc;
}

.tbk-intro {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.78);
}

.tbk-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tbk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.tbk-pill.is-played {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
}

.tbk-round {
  display: grid;
  gap: 10px;
}

.tbk-round-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.tbk-round-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.92);
}

.tbk-round-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.55);
  white-space: nowrap;
}

.tbk-round-summary {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(52, 211, 153, 0.28);
  background: rgba(15, 118, 110, 0.18);
}

.tbk-round-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tbk-round-summary-played {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #6ee7b7;
}

.tbk-toggle {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.88);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.tbk-adv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tbk-adv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(8, 28, 36, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 0.75rem;
  font-weight: 700;
  color: #f8fafc;
}

.tbk-round-matches {
  display: grid;
  gap: 10px;
}

.tbk-round-matches.hidden {
  display: none;
}

.tbk-match {
  display: grid;
  gap: 0;
  padding: 10px 12px 8px;
  border-radius: 16px;
  border: 1.5px solid rgba(52, 211, 153, 0.32);
  background: linear-gradient(165deg, rgba(15, 118, 110, 0.28), rgba(8, 47, 73, 0.35));
  cursor: default;
}

.tbk-match[role="button"] {
  cursor: pointer;
}

.tbk-match.is-live {
  border-color: rgba(248, 113, 113, 0.85);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.25);
}

.tbk-team-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 4px;
  border-radius: 10px;
}

.tbk-team-row.is-winner {
  background: rgba(16, 185, 129, 0.18);
}

.tbk-team-row.is-loser {
  opacity: 0.55;
}

.tbk-team-row.is-placeholder .tbk-team-name,
.tbk-team-row .tbk-team-name.is-italic {
  font-style: italic;
  color: rgba(248, 250, 252, 0.62);
}

.tbk-badge {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
  background: var(--tbk-team, #0d9488);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.tbk-badge--dashed {
  background: transparent;
  border: 1.5px dashed rgba(148, 163, 184, 0.7);
  color: rgba(248, 250, 252, 0.7);
}

.tbk-badge--bye {
  background: rgba(100, 116, 139, 0.45);
  color: #e2e8f0;
}

.tbk-team-name {
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tbk-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.tbk-win-check,
.tbk-confirm-check {
  color: #34d399;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}

.tbk-match-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 8px 4px 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.tbk-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.tbk-status.is-played {
  color: rgba(248, 250, 252, 0.78);
}

.tbk-status.is-confirmed {
  color: #6ee7b7;
}

.tbk-status.is-live {
  color: #fca5a5;
}

.tbk-status.is-scheduled {
  color: #93c5fd;
}

.tbk-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
  animation: tbk-live-pulse 1.4s ease-out infinite;
}

@keyframes tbk-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.tbk-scorecard-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.72);
  white-space: nowrap;
}

.tbk-connector {
  margin: -4px 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.55);
}

.tbk-champion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
}

.tbk-champion--pending {
  border: 1.5px dashed rgba(251, 191, 36, 0.7);
  background: rgba(251, 191, 36, 0.08);
  color: rgba(254, 243, 199, 0.92);
  font-size: 0.8125rem;
  font-weight: 700;
}

.tbk-champion--won {
  border: 1.5px solid rgba(251, 191, 36, 0.65);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(15, 118, 110, 0.25));
}

.tbk-champ-trophy,
.tbk-champ-chip {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.55);
  font-size: 1.1rem;
}

.tbk-champion--won > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tbk-champ-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fde68a;
}

.tbk-champion--won strong {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.tbk-champ-margin {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(254, 243, 199, 0.85);
}

.tbk-stages {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.tbk-stages-heading {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.7);
}

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

.tbk-stage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 28, 36, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.tbk-stage-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.tbk-stage-name {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tbk-stage-pill {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.tbk-stage-pill.is-winner {
  background: rgba(251, 191, 36, 0.28);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.55);
}

.tbk-stage-pill.is-final {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.55);
}

.tbk-stage-pill.is-earlier {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.45);
}
