/* Base layout */
:root {
  --color-danger: #b00020;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #333;
}

.card {
  background: #ffffff;
  padding: 2.5rem 3rem;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.testing-banner {
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border: 2px solid var(--color-danger);
  border-radius: 8px;
  background: rgba(176, 0, 32, 0.08);
  color: #3a0b13;
  animation: testing-banner-pulse 1.6s ease-in-out infinite;
}

.time-banner {
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border: 2px solid var(--color-danger);
  border-radius: 8px;
  background: rgba(176, 0, 32, 0.08);
  color: #3a0b13;
  animation: testing-banner-pulse 1.6s ease-in-out infinite;
}

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

.time-banner-title {
  font-weight: 700;
}

.time-banner-text {
  margin-top: 6px;
}

@keyframes testing-banner-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(176, 0, 32, 0.00);
    background-color: rgba(176, 0, 32, 0.08);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(176, 0, 32, 0.14); /* Size of the red glow of the alert box */
    background-color: rgba(176, 0, 32, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .testing-banner,
  .time-banner { animation: none; }
}

h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  color: #1e3c72;
}

.subtitle {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1.8rem;
}

.page-subtitle-stack {
  margin-bottom: 1.8rem;
}

.page-subtitle-stack .subtitle {
  margin-bottom: 0;
}

.page-subtitle-stack .subtitle + .subtitle {
  margin-top: 0;
}

.page-subtitle-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 1.8rem;
}

.page-subtitle-row .subtitle {
  grid-column: 2;
  margin-bottom: 0;
}

.stats-top-ip-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  max-width: 360px;
  margin: 3px 0;
}

.stats-top-ip-row__ip {
  opacity: 0.9;
}

.stats-top-ip-row__sep {
  opacity: 0.6;
}

.stats-top-ip-row__count {
  opacity: 0.8;
}

.subtitle-scope {
  grid-column: 3;
  justify-self: end;
  font-size: 0.95rem;
  color: #666;
}

.instructions {
  text-align: left;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  color: #444;
}

.nav-sep {
  margin: 0 8px;
  opacity: 0.6;
}

.section {
  margin-top: 14px;
}

.section-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.error-text {
  margin-top: 12px;
  color: var(--color-danger);
  font-weight: 600;
}

.muted {
  opacity: 0.75;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Slight spacing below the "Teams" header */
#teams {
  margin-top: 2px;
}

input[type="text"]:focus {
  outline: none;
  border-color: #2a5298;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.example {
  font-size: 0.8rem;
  color: #777;
  margin-top: 0.4rem;
}

button {
  margin-top: 1.6rem;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: #2a5298;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
}

button:hover { background: #1e3c72; }

/* Main page: download button turns into Abbrechen while a job runs */
#downloadBtn.is-cancel {
  /* Keep the running/cancel state in the same blue family as the default button. */
  background: #1e3c72;
}

/* #downloadBtn.is-cancel:hover {
  background: #1e3c72;
} */

button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) inset;
}

/* ---- Stats: /stats (route logs) ---- */

.stats-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 170px) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.stats-filter-group {
  min-width: 0;
}

.stats-log-select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  background: #ffffff;
  color: #333;
}

.stats-log-select:focus {
  outline: none;
  border-color: #2a5298;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.stats-ip-filter {
  border-color: var(--color-danger);
}

.stats-filter-group--ip label {
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.stats-filter-group--ip .compact-select {
  font-size: 0.82rem;
  height: 26px;
  min-height: 26px;
  padding: 0.25rem 1.6rem 0.25rem 0.45rem;
}

.stats-ip-filter:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.15);
}

/* ---- Stats: /stats/runs/leagues (API refresh page) ---- */

.runs-api-nav {
  margin-bottom: 8px;
}

.runs-api-nav-sep {
  margin: 0 8px;
  opacity: 0.6;
}

.runs-api-error {
  margin-top: 12px;
  color: var(--color-danger);
  font-weight: 600;
}

.runs-api-overview {
  margin-top: 14px;
}

.runs-api-overview-stats {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.runs-api-overview-last-run {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.runs-api-traffic-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  vertical-align: middle;
}

.runs-api-traffic-dot--green {
  background: #16a34a;
  border-color: #0a7a2f;
}

.runs-api-traffic-dot--red {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.runs-api-traffic-dot--unknown {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(0, 0, 0, 0.25);
}

.stats-bar-chart {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.stats-bar-chart__yaxis {
  width: 44px;
  height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0 26px 0;
  box-sizing: border-box;
}

.stats-bar-chart__yaxis-label {
  font-size: 0.72rem;
  opacity: 0.7;
  text-align: right;
  line-height: 1;
}

.stats-bar-chart__plot {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 170px;
  padding: 10px 8px;
  border: 1px solid #eee;
  border-radius: 8px;
  box-sizing: border-box;
  min-width: 0;
}

.stats-bar-chart__col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
}

.stats-bar-chart__bar {
  width: 100%;
  background: var(--bar-color, #4f7cff);
  height: var(--bar-height, 0px);
  min-height: var(--bar-min-height, 0px);
  border-radius: 3px 3px 0 0;
}

.stats-bar-chart__bar--blue {
  --bar-color: #4f7cff;
}

.stats-bar-chart__bar--green {
  --bar-color: #16a34a;
}

.stats-bar-chart__xlab {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 4px;
  white-space: nowrap;
}

.runs-api-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.runs-api-overview-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.runs-api-inline-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.runs-api-section-title {
  font-weight: 700;
}

.runs-api-section-title--spaced {
  margin-bottom: 6px;
}

.runs-api-refresh-form {
  margin: 0;
  position: relative;
}

.runs-api-refresh-btn {
  margin: 0;
  width: auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.runs-api-cron-btn {
  background: transparent;
  color: #2a5298;
  border: 1px solid #2a5298;
}

.runs-api-cron-btn:hover {
  background: rgba(42, 82, 152, 0.12);
}

.runs-api-cron-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.runs-api-cron-active {
  gap: 8px;
}

.runs-api-cron-active-label {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.runs-api-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.runs-api-toggle-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.runs-api-toggle-track {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: rgba(42, 82, 152, 0.25);
  border: 1px solid rgba(42, 82, 152, 0.5);
  transition: background 120ms ease, border-color 120ms ease;
  box-sizing: border-box;
}

.runs-api-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
  transition: transform 120ms ease;
}

.runs-api-toggle-input:checked + .runs-api-toggle-track {
  background: rgba(42, 82, 152, 0.95);
  border-color: rgba(42, 82, 152, 1);
}

.runs-api-toggle-input:checked + .runs-api-toggle-track .runs-api-toggle-thumb {
  transform: translate(20px, -50%);
}

.runs-api-toggle-input:focus-visible + .runs-api-toggle-track {
  outline: 2px solid rgba(42, 82, 152, 0.75);
  outline-offset: 2px;
}

.runs-api-toggle-state {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
  min-width: 28px;
  text-align: left;
}

.runs-api-toggle-on {
  display: none;
}

.runs-api-toggle-input:checked ~ .runs-api-toggle-state .runs-api-toggle-on {
  display: inline;
}

.runs-api-toggle-input:checked ~ .runs-api-toggle-state .runs-api-toggle-off {
  display: none;
}

.runs-api-refresh-btn:disabled,
.runs-api-refresh-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.runs-api-refresh-btn:disabled:hover,
.runs-api-refresh-btn[aria-disabled="true"]:hover {
  background: #2a5298;
  transform: none;
  box-shadow: none;
}

.runs-api-refresh-triggered {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin: 6px 0 0 0;
  font-size: 0.8rem;
  opacity: 0.75;
  white-space: nowrap;
  pointer-events: none;
}

.runs-api-muted {
  opacity: 0.75;
}

.runs-api-muted--dash {
  opacity: 0.7;
}

.runs-api-delta {
  display: inline;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.runs-api-delta--up {
  color: #0a7a2f;
}

.runs-api-delta--down {
  color: var(--color-danger);
}

.runs-api-delta--zero {
  color: #000;
}

.runs-api-runs {
  margin-top: 14px;
}

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

.runs-api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.runs-api-col,
.runs-api-cell {
  padding: 6px 18px 6px 0;
  white-space: nowrap;
}

.runs-api-col {
  text-align: left;
}

.runs-api-col--time {
  width: 170px;
}

.runs-api-col--status {
  width: 90px;
}

.runs-api-col--duration {
  width: 90px;
  text-align: right;
}

.runs-api-col--teams {
  width: 110px;
}

.runs-api-col--counts {
  width: 150px;
}

.runs-api-row {
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.runs-api-row--last-success {
  background: rgba(0, 0, 0, 0.04);
}

.runs-api-cell--time {
  opacity: 0.9;
}

.runs-api-cell--duration {
  text-align: right;
}

.runs-api-details {
  margin-top: 14px;
  display: none;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
}

.runs-api-details--inline {
  display: block;
  margin-top: 0;
}

.log-level-day-card {
  margin-bottom: 10px;
}

.log-level-day-card:last-child {
  margin-bottom: 0;
}

.runs-api-details-row td {
  padding: 0.4rem 0;
}

.runs-api-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runs-api-details-title {
  font-weight: 700;
}

.runs-api-monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.runs-api-details-clear {
  margin: 0;
  width: auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.runs-api-details-links {
  margin: 10px 0 0 0;
  display: none;
  font-size: 0.9rem;
}

.runs-api-details-pre {
  margin: 10px 0 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.35;
  max-height: 420px;
  overflow: auto;
}

/* Running refresh indicator (spinner + subtle animation) */

.leagues-refresh-running {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  margin: 8px 0 10px 0;
  animation: leaguesFadeIn 220ms ease-out;
  max-width: 100%;
  box-sizing: border-box;
}

.leagues-refresh-running .spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: rgba(0, 0, 0, 0.55);
  animation: leaguesSpin 900ms linear infinite;
  flex: 0 0 auto;
}

.leagues-refresh-running-content {
  flex: 1 1 auto;
  min-width: 0;
}

.leagues-refresh-running-title {
  opacity: 0.9;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.leagues-refresh-running-line {
  opacity: 0.75;
  font-size: 0.9rem;
  line-height: 1.25;
}

.leagues-refresh-running-line--wrap {
  overflow-wrap: anywhere;
  word-break: break-word;
}


.leagues-refresh-running-cancel {
  margin-left: auto;
  flex: 0 0 auto;
}

@keyframes leaguesSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes leaguesFadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inline button that reads like part of a sentence (used for modal links) */
.text-link-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  width: auto;
  display: inline;
  font: inherit;
  font-weight: 600;
  color: #1e3c72;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.text-link-btn:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

.text-link-btn:active {
  transform: none;
  box-shadow: none;
}

.text-link-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
  border-radius: 4px;
}

/* Inline highlight for option names in explanatory text */
.option-accent {
  color: #1e3c72;
  font-style: italic;
  font-weight: 600;
}

.league-presets {
  text-align: left;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 10px 12px;
}

.league-presets--scope {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.14);
}
.league-presets-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e3c72;
  font-size: 0.95rem;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.section-title-row--two-col {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}

.section-title-col {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-title-col--right {
  justify-self: start;
}

.busy-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: busy-spin 0.8s linear infinite;
}

@keyframes busy-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .busy-spinner {
    animation: none;
  }
}

.section-title-row .multi-clear-btn {
  margin-left: auto;
}

.section-title-row .league-presets-title {
  margin-bottom: 0;
}

.option-row {
  margin-top: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 0;
}

.format-options-wrap {
  margin-top: 10px;
}

.format-options-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.format-options-tooltip {
  margin-left: 8px;
}

.filter-options-tooltip {
  margin-left: 8px;
}

.filter-options-wrap {
  margin-top: 12px;
}

.option-details {
  margin: 0;
  width: 100%;
}

.option-details-summary {
  list-style: none;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  user-select: none;
}

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

.option-details-summary::marker {
  content: '';
}

.option-details-summary-text {
  font-weight: 700;
  color: #1e3c72;
  font-size: 0.95rem;
}

.overregional-selection-summary-wrap {
  margin-top: 6px;
}

.overregional-selection-summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 6px;
  color: #1e3c72;
  opacity: 0.85;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.overregional-selection-row {
  display: contents;
}

.overregional-selection-row + .overregional-selection-row {
  margin-top: 2px;
}

.overregional-selection-label {
  font-weight: 700;
  opacity: 0.9;
  grid-column: 1;
}

.overregional-selection-values {
  min-width: 0;
  grid-column: 2;
}

#overregionalOptionsDetails[open] + .overregional-selection-summary-wrap {
  display: none;
}

.option-details-caret {
  margin-left: 6px;
  color: #1e3c72;
  font-size: 0.95rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 120ms ease;
  pointer-events: none;
}

.option-details[open] .option-details-caret {
  transform: rotate(180deg);
}

.option-details-box {
  margin-top: 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.info-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-btn {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: none;
  background: #2a5298;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  margin-top: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.info-btn:hover {
  background: #1e3c72;
  transform: none;
  box-shadow: none;
}

.info-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.info-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: 280px;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 10px 10px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
  color: #333;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
}

.info-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-left: 1px solid #e4e4e4;
  border-top: 1px solid #e4e4e4;
  transform: rotate(45deg);
}

.info-popover.is-fixed::before {
  left: var(--arrow-x, 10px);
  right: auto;
}

.info-popover.no-arrow::before {
  display: none;
}

/* For section headings, keep the tooltip visually closer to the label text */
.section-title-row .info-popover {
  left: 0;
  right: auto;
  top: calc(100% + 6px);
}

.section-title-row .info-popover::before {
  left: 6px;
  right: auto;
}

@media (max-width: 520px) {
  html, body {
    overflow-x: hidden;
  }

  /*
    On phones, the anchor can be close to the viewport edge.
    Center popovers and constrain their width so they stay readable.
  */
  .info-popover {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
  }

  .info-popover::before {
    left: 50%;
    right: auto;
    transform: translateX(-50%) rotate(45deg);
  }

  .section-title-row .info-popover {
    left: 50%;
    right: auto;
  }

  .section-title-row .info-popover::before {
    left: 50%;
    right: auto;
  }
}
.league-presets label {
  display: block;
  font-weight: 500;
  margin: 4px 0;
}

.league-multiselect {
  position: relative;
  margin-top: 2px;
}

.league-multiselect.is-disabled {
  opacity: 0.55;
}

.league-multiselect.is-disabled .league-select-input input[type="text"] {
  background: #f3f3f3;
  cursor: not-allowed;
}

.league-multiselect.is-disabled,
.league-multiselect.is-disabled * {
  pointer-events: none;
}


.league-select-input {
  position: relative;
}

/* Make the league selector visually read as a dropdown */
.league-select-input input[type="text"] {
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  padding-right: 3.4rem;
  border-color: #2a5298;
  background: #ffffff;
}

.league-search-clear {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  margin-top: 0;
  padding: 0;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1e3c72;
  font: inherit;
  line-height: 1;
}

.league-search-clear.show {
  display: inline-flex;
}

.league-search-clear:hover {
  background: transparent;
  transform: translateY(-50%);
  box-shadow: none;
}

.league-select-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #1e3c72;
  pointer-events: none;
  font-weight: 700;
}

.league-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  max-height: 240px;
  overflow: auto;
  z-index: 50;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.league-dropdown.show {
  display: block;
}

.league-dropdown-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: none;
  margin-top: 0;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.95rem;
}

.league-dropdown-item:hover {
  background: rgba(42, 82, 152, 0.10);
}

.league-dropdown-empty {
  padding: 10px 10px;
  color: #777;
  font-size: 0.9rem;
}

.league-dropdown-count {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  color: #777;
  font-size: 0.85rem;
  background: #ffffff;
  border-bottom: 1px solid #e4e4e4;
  z-index: 1;
}

/* Compact Verband selection row */
.verbaende-row {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  width: 100%;
}

.verbaende-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.verbaende-stack-row {
  display: grid;
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  width: 100%;
}

.verbaende-stack-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.league-presets-title--inline {
  margin-bottom: 0;
}

.overregional-details-box .verbaende-stack-row + .verbaende-stack-row {
  margin-top: 10px;
}

.verband-compact {
  min-width: 0;
}


.compact-select-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.verband-hint {
  margin-top: 6px;
  color: var(--color-danger);
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-content .disclaimer-title {
  color: var(--color-danger);
}

.verband-hint--full {
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-select {
  width: 100%;
  padding: 0.35rem 1.8rem 0.35rem 0.5rem;
  font-size: 0.88rem;
  border-radius: 6px;
  border: 1px solid #2a5298;
  background: #ffffff;
  color: #333;
  box-sizing: border-box;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 30px;
  min-height: 30px;
  min-width: 0;
}

select.compact-select::-ms-expand {
  display: none;
}

select.compact-select {
  background-image: none;
  cursor: pointer;
}

.compact-select-btn {
  display: inline-flex;
  align-items: center;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
  background: #ffffff;
  color: #333;
  font-weight: 400;
  transition: none;
  height: 30px;
  min-width: 0;
}

button.compact-select-btn:hover {
  background: #ffffff;
  transform: none;
  box-shadow: none;
}

button.compact-select-btn:active {
  background: #ffffff;
  transform: none;
  box-shadow: none;
}

.compact-select-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #1e3c72;
  pointer-events: none;
  font-weight: 700;
  z-index: 2;
  background: #ffffff;
  padding-left: 4px;
  padding-right: 2px;
}

.compact-select-controls {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  z-index: 2;
  background: #ffffff;
  font-size: 0.88rem;
  padding-left: 6px;
  padding-right: 9px;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
  pointer-events: none;
  /* Redraw border segments covered by the masking overlay.
     This avoids 1px inset hacks that can cause hairline gaps on mobile. */
  box-shadow:
    inset 0 1px 0 #2a5298,
    inset 0 -1px 0 #2a5298,
    inset -1px 0 0 #2a5298;
}

.compact-select-controls .compact-select-caret {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  line-height: 18px;
  font-family: inherit;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.compact-select-wrap--with-caret .compact-select,
.compact-select-wrap--with-caret .compact-select-btn {
  padding-right: 5.1rem;
}

.compact-select-wrap--with-caret .compact-select-clear {
  right: 28px;
}

.compact-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  z-index: 60;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.compact-dropdown.show {
  display: block;
}

.compact-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 400;
  color: #333;
}

/* Override generic label styling inside .league-presets for compact dropdown rows */
.league-presets label.compact-dropdown-item {
  display: flex;
  margin: 0;
  font-weight: 400;
}

/* Ensure checkbox-label rows inside compact dropdowns match Verband typography */
.compact-dropdown label.compact-dropdown-item {
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 400;
  color: #333;
}

/* Overregional dropdown: slightly larger option text for readability */
#overregionalVerbandDropdown .compact-dropdown-item,
#overregionalVerbandDropdown label.compact-dropdown-item {
  font-size: 0.95rem;
  line-height: 1.2;
}

button.compact-dropdown-item--btn {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
}

.compact-dropdown-item:hover {
  background: rgba(42, 82, 152, 0.10);
}

.compact-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.compact-select-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: none;
  background: #ffffff;
  color: #1e3c72;
  cursor: pointer;
  line-height: 1;
  display: none;
  z-index: 2;
}

.compact-select-controls .compact-select-clear {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  background: transparent;
  pointer-events: auto;
  transition: none;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.compact-select-controls .compact-select-clear.show {
  display: inline-block;
}

.compact-select-controls .compact-select-clear:hover {
  transform: none;
}

.compact-select-clear.show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.compact-select-clear:hover {
  background: transparent;
  transform: translateY(-50%);
  box-shadow: none;
}

.overregional-wrap {
  min-width: 0;
}

@media (max-width: 520px) {
  .section-title-row--two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 0;
  }

  .verbaende-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 0;
  }

  .verbaende-stack-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
    align-items: start;
  }

  .verband-compact,
  .overregional-wrap {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  /*
    On mobile, the Verband hint must be allowed to wrap.
    Otherwise `white-space: nowrap` can force the card to expand horizontally.
  */
  .verband-hint--full {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

.overregional-inline {
  width: 100%;
}

.overregional-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.overregional-multiselect {
  margin-top: 0;
}

.overregional-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overregional-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.overregional-empty {
  display: inline-block;
  width: 0;
}

/* Make checkbox list tighter */
.overregional-checkboxes .option-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
}

.league-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.multi-clear-btn {
  width: auto;
  margin: 0;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(200, 50, 50, 0.28);
  background: rgba(200, 50, 50, 0.12);
  color: #8a1f1f;
  font-size: 0.80rem;
  font-weight: 600;
  line-height: 1.15;
  box-shadow: none;
}

.multi-clear-btn:hover {
  background: rgba(200, 50, 50, 0.18);
  transform: none;
}

.multi-clear-btn:active {
  transform: none;
  box-shadow: none;
}

.league-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(42, 82, 152, 0.10);
  border: 1px solid rgba(42, 82, 152, 0.22);
  color: #1e3c72;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 0.80rem;
  font-weight: 600;
  line-height: 1.15;
  max-width: 100%;
}

.league-chip-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-chip-remove {
  border: none;
  background: transparent;
  margin-top: 0;
  padding: 0;
  cursor: pointer;
  color: #1e3c72;
  font: inherit;
  line-height: 1;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.league-chip-remove:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

footer {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #aaa;
}

#loader {
  display: none;
  margin-top: 12px;
  font-weight: 600;
  color: #1e3c72;
}

#progressWrap {
  display: none;
}

#jobProgress {
  width: 100%;
  height: 12px;
  accent-color: #2a5298;
}

#message {
  margin-top: 10px;
  color: green;
  font-weight: 600;
}

.share-link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.share-link-row a {
  white-space: nowrap;
}

.copy-link-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  width: auto;
  margin-top: 0;
  color: #1e3c72;
}

.copy-link-btn:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

.copy-link-btn:active {
  transform: none;
  box-shadow: none;
}

/* Side icons + modals */
.side-icons {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1200;
}
.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.icon-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,0.22); }
.icon-svg { width:22px; height:22px; fill:#1e3c72; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: #fff;
  border-radius: 10px;
  max-width: 720px;
  width: 100%;
  padding: 18px 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  position: relative;
  color: #222;
  font-family: inherit;
  /* Make modal content scrollable on small screens */
  max-height: calc(100vh - 80px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  color: #666;
}
.modal-content h2 { margin-top: 0; color: #1e3c72; text-align: center; }
.modal-content ol,
.modal-content ul {
  text-align: left;
  display: inline-block;
}
.modal-content li { margin-bottom: 0.3rem; }
