:root {
  color-scheme: light;

  /* Hintergrundhierarchie */
  --bg:             #f2f5f0;
  --surface:        #ffffff;
  --surface-muted:  #eaf0e7;
  --surface-raised: #f7faf6;

  /* Rahmen */
  --line:           #cdd7c9;

  /* Text */
  --text:           #111b12;
  --muted:          #546356;

  /* Grün-Akzent — Tennisgrün */
  --accent:         #1a6647;
  --accent-strong:  #114531;
  --accent-soft:    #d6ebdf;
  --accent-xsoft:   #eef6f1;

  /* Danger */
  --danger:         #8f2a2a;
  --danger-soft:    #f0dcdc;

  /* Schatten-System */
  --shadow-sm: 0 1px 3px rgba(17, 27, 18, 0.07), 0 1px 2px rgba(17, 27, 18, 0.05);
  --shadow-md: 0 4px 12px rgba(17, 27, 18, 0.08), 0 2px 4px rgba(17, 27, 18, 0.05);
  --shadow-lg: 0 12px 32px rgba(17, 27, 18, 0.10), 0 4px 10px rgba(17, 27, 18, 0.06);
  --shadow:    var(--shadow-md);

  /* Radius-System */
  --r-sm:   6px;
  --r:      10px;
  --r-lg:   14px;
  --r-full: 999px;

  /* Transitions */
  --tx-fast: 120ms ease;
  --tx:      180ms ease;

  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 80% 40% at 50% -10%,
    rgba(26, 102, 71, 0.055) 0%,
    transparent 70%
  );
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

.app-shell--vm-context .tab-button[data-view="dashboard"] {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%, rgba(26, 102, 71, 0.16) 0%, transparent 68%),
    radial-gradient(ellipse 55% 45% at 92% 105%, rgba(196, 88, 22, 0.09) 0%, transparent 55%),
    var(--bg);
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(100%, 420px);
  border: 1px solid rgba(26, 102, 71, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 48px rgba(17, 27, 18, 0.13), 0 4px 12px rgba(17, 27, 18, 0.07);
  padding: 32px 32px 28px;
}

.auth-card picture {
  justify-self: center;
}

.auth-card picture img {
  width: 240px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(17, 27, 18, 0.12));
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label,
.match-date,
.roster-field,
.tournament-actions label {
  display: grid;
  gap: 5px;
}

.auth-form span,
.match-date span,
.roster-field span,
.tournament-actions label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-form input,
.match-date input,
.match-date select,
.roster-field input,
.tournament-actions select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 10px;
  background: var(--surface-raised);
  color: var(--text);
  transition: border-color var(--tx-fast), box-shadow var(--tx-fast);
}

.auth-form input:focus,
.match-date input:focus,
.match-date select:focus,
.roster-field input:focus,
.tournament-actions select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(26, 102, 71, 0.18);
}

.primary-button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.auth-hint,
.auth-message p,
.auth-error {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-error {
  min-height: 1.3em;
  color: var(--danger);
  font-weight: 750;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.auth-link {
  color: var(--accent);
  text-decoration: underline;
  font-size: 0.85em;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  line-height: 1.45;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.public-registration-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%, rgba(26, 102, 71, 0.16) 0%, transparent 68%),
    radial-gradient(ellipse 55% 45% at 92% 105%, rgba(196, 88, 22, 0.09) 0%, transparent 55%),
    var(--bg);
}

.public-registration-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.public-registration-card {
  width: min(100%, 430px);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(26, 102, 71, 0.18);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-lg);
}

.public-registration-card picture {
  display: grid;
  place-items: center;
}

.public-registration-card img {
  width: min(180px, 72%);
  height: auto;
}

.public-registration-card h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.18;
}

.public-registration-round {
  margin: -4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.public-registration-message,
.public-registration-error {
  margin: 0;
  padding: 11px 12px;
  border-radius: 8px;
  line-height: 1.45;
}

.public-registration-message {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text);
}

.public-registration-message.is-success {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-xsoft);
}

.public-registration-error {
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.public-registration-login-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

.public-registration-account {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: #eef8f2;
}

.public-registration-account > p {
  margin: 0;
  color: var(--accent-strong, #075838);
  font-size: 0.92rem;
  font-weight: 800;
}

.public-registration-account dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.public-registration-account dl div {
  display: grid;
  gap: 3px;
}

.public-registration-account dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.public-registration-account dd {
  margin: 0;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.public-registration-form label {
  display: grid;
  gap: 6px;
}

.public-registration-form label span {
  font-weight: 760;
}

.public-registration-form small {
  color: var(--muted);
  line-height: 1.35;
}

.public-registration-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--surface);
}

.public-registration-privacy-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.public-registration-form [data-partner-wish] {
  display: none;
}

.public-registration-form:has(input[name="events"][value="doubles"]:checked) [data-partner-wish],
.public-registration-form:has(input[name="events"][value="mixed_doubles"]:checked) [data-partner-wish] {
  display: flex;
}

.public-registration-privacy-hint a {
  font-weight: 750;
}

.public-registration-privacy {
  display: grid;
  gap: 8px;
}

.public-registration-form .public-registration-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.public-registration-choice__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-weight: 400 !important;
}

.public-registration-choice__copy strong {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
}

.public-registration-choice__copy small {
  font-size: 0.78rem;
  line-height: 1.3;
}

@media (max-width: 520px) {
  .public-registration-form .public-registration-choice {
    gap: 8px;
    padding: 9px;
  }

  .public-registration-choice__copy strong {
    font-size: 0.86rem;
  }
}

.registration-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.onboarding-step {
  display: grid;
  gap: 14px;
}

.profile-step {
  gap: 16px;
}

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

.onboarding-phone-field {
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(26, 102, 71, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 246, 241, 0.78) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.onboarding-phone-field span {
  color: var(--accent-strong);
}

.onboarding-phone-field input,
.onboarding-phone-field select {
  min-height: 52px;
  border-color: rgba(26, 102, 71, 0.18);
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 27, 18, 0.04);
}

.profile-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.profile-status a {
  color: var(--accent-strong);
  font-weight: 700;
}

.onboarding-phone-field input::placeholder {
  color: #738376;
}

.onboarding-field-hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
}

.onboarding-step--phone .onboarding-actions {
  margin-top: 8px;
}

.onboarding-actions .primary-button {
  min-width: 132px;
}

.onboarding-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  font-size: 0.85em;
}

.text-button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

.pw-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-wrapper input {
  width: 100%;
  padding-right: 40px;
}

.pw-reveal {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0;
  border-radius: 0 8px 8px 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.pw-reveal:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(26, 102, 71, 0.04) 39px,
      rgba(26, 102, 71, 0.04) 40px
    ),
    rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand img {
  width: clamp(44px, 7vw, 64px);
  height: auto;
  flex: 0 0 auto;
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  line-height: 1.08;
}

.brand h1 span + span {
  margin-left: 0.3ch;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

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

.user-menu {
  position: relative;
  flex: 0 1 auto;
}

.context-switcher {
  position: relative;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
}

.context-switcher-label {
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ctx-label-short {
  display: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
  transition: background var(--tx-fast), border-color var(--tx-fast);
}

.user-chip-button {
  width: 100%;
}

.context-switcher .user-chip span:first-child,
.user-chip-full {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-avatar {
  display: none;
}

.role-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  min-width: 190px;
  max-width: min(280px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.role-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  font-weight: 750;
}

.role-menu button .nav-icon {
  margin-right: 0;
}

.role-menu-section {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.role-menu-section button:last-child {
  border-bottom: 0;
}

.role-menu > button:last-child {
  border-bottom: 0;
}

.role-menu button:hover,
.role-menu button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.role-menu .danger-menu-item {
  color: var(--danger);
}

.role-menu .danger-menu-item:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.menu-version {
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button,
.danger-button,
.clear-match,
.request-change,
.invite-match,
.match-options button,
.tab-button,
.group-button {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  transition: border-color var(--tx-fast), background var(--tx-fast), color var(--tx-fast);
}

a.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

a.tennis04-reserve,
a.whatsapp-reserve {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.icon-button:hover,
.clear-match:hover,
.request-change:hover,
.invite-match:hover,
.tab-button:hover,
.group-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-xsoft);
}

.user-chip:hover {
  background: var(--accent-xsoft);
  border-color: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.primary-button {
  transition: background var(--tx-fast), border-color var(--tx-fast), transform var(--tx-fast);
}

.primary-button:active,
.icon-button:active,
.tab-button:active,
.group-button:active,
.mobile-priority-button:active {
  transform: scale(0.97);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.75;
  vertical-align: -2px;
  pointer-events: none;
}

.tab-button .nav-icon,
.mobile-priority-button .nav-icon,
.mobile-more-button .nav-icon {
  margin-right: 5px;
}

.tab-button.active .nav-icon,
.mobile-priority-button.active .nav-icon,
.mobile-more-button.active .nav-icon {
  opacity: 1;
}

.danger-button {
  color: var(--danger);
  border-color: #e3b8b8;
  background: var(--danger-soft);
}

.layout {
  display: grid;
  grid-template-columns: minmax(185px, 230px) minmax(0, 1fr);
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 40px) 40px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 96px;
}

.sidebar-head,
.group-header,
.match-title,
.match-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sidebar-head {
  margin-bottom: 12px;
}

.sidebar output,
.group-progress span,
.match-state {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.group-list {
  display: grid;
  gap: 6px;
}

.other-groups {
  display: grid;
  gap: 6px;
}

.group-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
}

.group-button--switch-hint {
  position: relative;
  --group-switch-hint-shadow-base: 0 0 0 1px rgba(26, 102, 71, 0.3);
  box-shadow: var(--group-switch-hint-shadow-base), 0 0 0 0 rgba(26, 102, 71, 0.18);
  animation: group-switch-hint-pulse 2.4s ease-in-out infinite;
}

.group-button.active.group-button--switch-hint {
  --group-switch-hint-shadow-base: inset 0 0 0 1px var(--accent);
}

.group-switch-hint {
  position: absolute;
  right: 2px;
  bottom: calc(100% + 8px);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(26, 102, 71, 0.2);
  border-radius: var(--r-full);
  background: var(--accent-strong);
  color: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.group-collapse-hint {
  right: auto;
  left: 0;
}

@keyframes group-switch-hint-pulse {
  0%,
  100% {
    box-shadow: var(--group-switch-hint-shadow-base), 0 0 0 0 rgba(26, 102, 71, 0.18);
  }
  50% {
    box-shadow: var(--group-switch-hint-shadow-base), 0 0 0 7px rgba(26, 102, 71, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .group-button--switch-hint {
    animation: none;
  }
}

.group-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.group-button.own-group {
  border-color: var(--accent);
}

.group-button small {
  color: var(--muted);
  font-weight: 750;
}

.group-label-compact,
.group-toggle-compact,
.group-label-pill {
  display: none;
}

.group-accordion-toggle {
  display: none;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  color: var(--accent-strong);
  padding: 0 12px;
  font-weight: 800;
  text-align: left;
}

.community-toggle {
  display: none;
  width: 100%;
  min-height: 44px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  color: var(--accent-strong);
  padding: 0 12px;
  text-align: left;
  font-weight: 800;
}

.content {
  min-width: 0;
  touch-action: pan-y pinch-zoom;
}

.layout {
  touch-action: pan-y pinch-zoom;
}

.group-header {
  margin-bottom: 18px;
}

.group-progress {
  min-width: 180px;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 8px;
  border-radius: var(--r-full);
  background: var(--line);
}

.progress-track div {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.tabs {
  display: none;
}

.mobile-priority-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.nav-order-pending {
  visibility: hidden;
}

.mobile-nav-edit-overlay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.mobile-nav-edit-overlay__title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.mobile-nav-edit-overlay__done {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 9px;
  line-height: 1;
}

.mobile-scroll-row {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.mobile-priority-nav .mobile-priority-button {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 46px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  text-align: center;
  padding: 6px 4px;
  font-size: 0.7rem;
  border-color: var(--line);
  background: var(--surface);
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-priority-nav .mobile-priority-button .nav-icon {
  margin-right: 0;
}

/* VMS-2026-Admin-Mini-Nav: Breite am Label-Inhalt statt an einem festen
   min-width ausrichten, damit lange Labels (z. B. "Rollenverwaltung") nicht
   per Ellipsis abgeschnitten werden. Nur für die per JS markierten
   VMS-Admin-Buttons, damit Sommercup/Spieler/Spielleiter unverändert bleiben. */
.mobile-priority-nav .mobile-priority-button.vm-admin-nav-item {
  flex: 0 0 auto;
  width: max-content;
  min-width: max-content;
  overflow: visible;
  text-overflow: clip;
}

.mobile-more-button {
  flex-shrink: 0;
  min-height: 38px;
  white-space: nowrap;
  text-align: center;
  padding: 0 14px;
  font-size: 0.875rem;
  border-color: var(--line);
  background: var(--surface);
}

.mobile-priority-nav .mobile-priority-button.active,
.mobile-more-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}

.mobile-priority-nav.edit-mode .tab-button {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  border-color: color-mix(in oklab, var(--accent) 38%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent);
}

.mobile-priority-nav.edit-mode .tab-button.dragging {
  opacity: 1;
  cursor: grabbing;
  transform: scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 0 2px color-mix(in oklab, var(--accent) 55%, white);
  z-index: 25;
}

.mobile-priority-nav .tab-button.is-shaking {
  animation: nav-wiggle 130ms ease-in-out infinite alternate;
}

@keyframes nav-wiggle {
  0% { transform: rotate(-1.9deg) translateY(-0.5px); }
  100% { transform: rotate(1.9deg) translateY(0.5px); }
}

.mobile-more-menu {
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
}

.mobile-more-menu summary {
  cursor: pointer;
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--muted);
  list-style: none;
  white-space: nowrap;
  font-size: 0.875rem;
}

.mobile-more-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-more-list [data-view="messages"][data-unread-count]:not([data-unread-count=""])::after {
  content: attr(data-unread-count);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  margin-left: 5px;
  padding: 0 4px;
  vertical-align: middle;
  line-height: 1;
}

.mobile-more-list [data-view="registrations"][data-registration-open="1"]::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border-radius: var(--r-full);
  background: #1a84d7;
  vertical-align: middle;
}

.tabs .tab-button[data-view="registrations"][data-registration-open="1"] {
  position: relative;
}

.tabs .tab-button[data-view="registrations"][data-registration-open="1"]::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: #1a84d7;
}

.mobile-more-menu summary[data-unread-count]:not([data-unread-count=""])::after {
  content: attr(data-unread-count);
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: var(--r-full);
  border: 2px solid var(--surface-muted);
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 0 3px;
  line-height: 1;
}

.mobile-more-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 200;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  display: grid;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}

.mobile-more-menu.open-up .mobile-more-list {
  top: auto;
  bottom: calc(100% + 4px);
}

.mobile-more-list .mobile-more-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.mobile-more-list .mobile-more-button .nav-icon {
  margin-right: 0;
}

#player-search-view.mobile-focus-availability .player-search-layout > .player-side-panel:first-child,
#player-search-view.mobile-focus-availability .player-search-panel,
#player-search-view.mobile-focus-availability .player-profile {
  display: none;
}

#player-search-view.mobile-focus-open-matches .player-search-layout > .player-side-panel:last-child,
#player-search-view.mobile-focus-open-matches .player-search-panel,
#player-search-view.mobile-focus-open-matches .player-profile {
  display: none;
}

#player-search-view.mobile-focus-community .player-search-layout {
  display: none;
}

.tab-button {
  min-height: 40px;
  border-color: transparent;
  background: transparent;
  flex: 0 0 auto;
  min-width: 110px;
  padding: 8px 12px;
}

.tab-button.active {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.readonly-note {
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 750;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  transition: box-shadow var(--tx);
}

.match-card:hover {
  box-shadow: var(--shadow-lg);
}

.match-card.save-feedback {
  animation: save-flash 0.8s ease-out;
}

@keyframes save-flash {
  0% { background: var(--surface); }
  25% { background: var(--accent-soft); }
  100% { background: var(--surface); }
}

.match-card.error-feedback {
  animation: error-flash 0.8s ease-out;
}

@keyframes error-flash {
  0%  { background: var(--surface); }
  25% { background: var(--danger-soft); }
  100% { background: var(--surface); }
}

.match-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.historical-rounds {
  margin-top: 2rem;
}

.historical-rounds > h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.historical-round {
  margin-bottom: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.historical-round > summary,
.historical-round--notice {
  min-height: 52px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 700;
}

.historical-round > summary { cursor: pointer; }
.historical-round > summary::marker { color: var(--muted); }
.historical-round-status { color: var(--muted); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.historical-round-content { padding: 0 1rem 1rem; }
.historical-round-content .match-list { margin-top: 0; }

.match-card--readonly-history .match-options,
.match-card--readonly-history .match-date,
.match-card--readonly-history .invite-row,
.match-card--readonly-history .match-footer button,
.match-card--readonly-history .termin-menu {
  display: none !important;
}

@media (max-width: 640px) {
  .historical-round > summary,
  .historical-round--notice { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
  .historical-round-content { padding-inline: 0.65rem; }
}

.match-label-date {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  overflow-wrap: anywhere;
}

.match-label-date::before {
  content: "·";
  margin-right: 6px;
  color: var(--line);
}

.score-area {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(3, minmax(58px, 76px));
  column-gap: 8px;
  row-gap: 8px;
  margin-top: 16px;
}

.score-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.player-name {
  overflow-wrap: anywhere;
  color: var(--text);
}

.score-grid input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  text-align: center;
  font-weight: 800;
}

.score-grid input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(26, 102, 71, 0.18);
}

.score-grid input:disabled {
  color: var(--muted);
  background: var(--surface-muted);
}

.match-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
}

.wo-buttons {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.match-options span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.match-options button {
  position: relative;
  overflow: hidden;
  min-height: 34px;
  padding: 0 12px;
}

.match-options button.wo-loser {
  border-color: #d69b9b;
  background: #f7e4e4;
  color: #7d2626;
}

.match-options button.wo-winner {
  border-color: #9fc8b7;
  background: #e2f1e9;
  color: var(--accent-strong);
}

.wo-label {
  position: relative;
  z-index: 1;
}

.wo-stamp {
  display: none;
}

.wo-loser .wo-stamp {
  display: block;
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  transform: translate(-50%, -50%) rotate(-10deg);
  color: rgba(154, 47, 47, 0.34);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

.match-date {
  display: inline-grid;
  margin-top: 12px;
}

.match-date-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
}

.match-date-confirm {
  width: 36px;
  min-height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  color: var(--accent);
  cursor: pointer;
}

.match-date-confirm:hover:not(:disabled) { background: var(--accent-soft); }

.match-date-hint {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.mobile-date-picker-proxy {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
}

.invite-row {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.check-availability,
.invite-match {
  min-height: 40px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cancel-reservation {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--danger);
  border-radius: var(--r);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
}

.invite-actions {
  display: grid;
  gap: 8px;
}

.invite-actions .invite-match,
.invite-actions .tennis04-reserve,
.invite-actions .whatsapp-reserve {
  width: 100%;
  justify-content: center;
}

.whatsapp-reserve {
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0 12px;
  font-weight: 800;
}

.whatsapp-reserve--icon {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  flex-shrink: 0;
}

.whatsapp-reserve--icon svg {
  width: 16px;
  height: 16px;
}

.selected-invite-slot {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
  display: grid;
  gap: 8px;
  width: 100%;
}

.selected-invite-summary-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reservation-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 10px 12px;
}

.reservation-card.common {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.reservation-card strong {
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.reservation-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.reservation-status.strong {
  color: var(--accent-strong);
  font-weight: 850;
}

.primary-reservation {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.invite-slot-panel {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 8px;
}

.invite-slot-day {
  display: grid;
  gap: 6px;
}

.invite-slot-day h4 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.invite-slot-day > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.invite-slot-chip {
  display: grid;
  gap: 2px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text);
  padding: 6px 11px;
  text-align: left;
}

.invite-slot-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.invite-slot-chip.opponent-available {
  border-color: var(--accent);
}

.invite-slot-chip small {
  color: var(--accent-strong);
  font-weight: 800;
}

.court-selection-inline {
  display: grid;
  gap: 4px;
}

.court-selection-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.court-choices-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.court-choice {
  display: inline-block;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.court-choice:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.court-choice:active {
  transform: scale(0.96);
}

.message-actions,
.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-slot-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

.calendar-slot-actions .invite-slot-panel {
  max-height: 280px;
}

.accept-invite,
.message-jump,
.message-reject,
.message-resolve,
.tennis04-reserve {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
  font-weight: 800;
}

.tennis04-reserve {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@media (min-width: 860px) {
  .invite-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.message-jump {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.message-resolve {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.message-reject {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.match-card.target-match {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(29, 107, 79, 0.18), var(--shadow);
}

.planned-info-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.planned-info-date {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-muted);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}

.planned-info-date .result-hint {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.played-result-table {
  flex: 1;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.played-result-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(32px, 0.55fr));
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.played-result-table__row--head {
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.played-result-table__cell {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.played-result-table__row--head .played-result-table__cell {
  background: transparent;
  color: var(--muted);
  min-height: auto;
  padding: 0 2px;
}

.played-result-table__cell--player {
  justify-content: flex-start;
}

.played-result-table__cell--loser {
  color: var(--muted);
  font-weight: 400;
}

.played-result-winner {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 4px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
}

.played-result-winner svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.planned-date-part,
.planned-time-part {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.planned-time-sep {
  color: var(--line);
  padding: 0 2px;
}


/* Termin-Aktionsmenü – analog zu .mobile-more-menu / .role-menu */
.termin-menu {
  position: relative;
  flex-shrink: 0;
}

.termin-menu-trigger {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--accent);
  border: none;
  background: none;
}

.termin-menu-trigger::-webkit-details-marker { display: none; }

.planned-court-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  gap: 5px;
}

.termin-menu-trigger:hover,
.termin-menu[open] .termin-menu-trigger {
  background: var(--accent-soft);
}

.termin-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 200;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  display: grid;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}

.termin-menu.open-up .termin-menu-list {
  top: auto;
  bottom: calc(100% + 4px);
}

.termin-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  text-align: left;
  font-weight: 400;
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
}

.termin-menu-item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.termin-menu-item--danger {
  border-color: var(--danger);
  color: var(--danger);
}

.termin-menu-item--danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.termin-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.match-footer {
  flex-wrap: wrap;
  margin-top: 12px;
}

.result-hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.result-hint.complete {
  color: var(--accent-strong);
  font-weight: 750;
}

.result-hint.planned {
  color: var(--text);
  font-weight: 750;
  font-size: 0.95rem;
  flex: 1;
}

.match-date-toggle {
  font-size: 0.82rem;
  min-height: 34px;
  padding: 0 10px;
}

.match-card--planned .cancel-reservation {
  background: none;
  border-color: var(--danger);
  color: var(--danger);
  font-size: 0.875rem;
  min-height: 36px;
}

/* Gespielte Matchkarte: Eingabe-UI ausblenden */
.match-card--played .score-area,
.match-card--played .match-date,
.match-card--played .invite-row,
.match-card--played .match-footer { display: none; }

.planned-court-hint.played-meta--pending { color: var(--muted); }
.planned-court-hint.played-meta--rejected { color: var(--danger); }

/* Ergebnis-Bearbeiten-Modus: Termin- und Speichern-UI ausblenden */
.match-card--played-edit .invite-row,
.match-card--played-edit .confirm-score { display: none; }

/* CT-Header-Zelle mit Papierkorb */
.score-grid-ct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.score-ct-clear {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}

@media (max-width: 520px) {
  .played-result-table__row {
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(28px, 0.48fr));
    gap: 3px;
  }

  .played-result-table__cell {
    min-height: 20px;
    padding: 0 3px;
    font-size: 0.78rem;
  }

  .played-result-table__row--head {
    font-size: 0.68rem;
  }

  .played-result-winner {
    font-size: 0.84rem;
  }
}

.score-ct-clear:hover { color: var(--danger); }

.result-hint.invalid {
  color: var(--danger);
  font-weight: 750;
}

.clear-match {
  min-height: 40px;
  padding: 0 12px;
}

.confirm-score {
  min-height: 40px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  font-weight: 700;
}

.request-change {
  min-height: 40px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.backup-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.backup-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.backup-status-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 12px;
}

.backup-status-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.backup-status-item strong {
  overflow-wrap: anywhere;
}

.backup-config {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.backup-config label {
  display: grid;
  gap: 5px;
}

.backup-config span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.backup-config input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
}

.backup-config input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(26, 102, 71, 0.18);
}

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

.backup-message {
  min-height: 1.35em;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.backup-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 14px 14px 10px;
  flex-wrap: wrap;
}

.backup-selection-count {
  color: var(--muted);
  font-weight: 800;
}

.backup-select-cell {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.backup-select-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.backup-select-wrap input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.backup-list-toolbar + .backup-table {
  border-top: 1px solid var(--line);
}

.backup-table thead th {
  border-bottom: 1px solid var(--line);
}

.backup-table tbody tr {
  box-shadow: inset 0 -1px 0 var(--line);
}

.backup-table tbody td {
  border-bottom: 0;
}

.backup-table th:nth-child(4),
.backup-table td:nth-child(4) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 180px;
}

.backup-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  min-height: 100%;
}

.backup-table th:last-child,
.backup-table td:last-child {
  width: 132px;
}

.backup-row-actions .icon-button {
  min-height: 34px;
  min-width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.role-permissions-panel {
  display: grid;
  gap: 16px;
}

.role-permissions-notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 650;
}

#role-permissions-body {
  display: grid;
  gap: 14px;
}

.role-permission-role {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.role-permission-role__head {
  margin: -12px -12px 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.role-permission-role h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.role-permission-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 190px);
  gap: 10px;
  align-items: center;
}

.role-permission-row span {
  font-weight: 650;
}

.role-permission-row select {
  min-width: 0;
}

.role-permission-row select:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.role-permissions-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.role-permissions-message {
  color: var(--muted);
  font-weight: 650;
}

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

.audit-log-filters {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.audit-log-filters summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
}

.audit-log-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
  align-items: end;
}

.audit-log-filter-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.audit-log-filter-grid input,
.audit-log-filter-grid select {
  min-width: 0;
}

.audit-log-card-list {
  display: grid;
  gap: 10px;
}

.audit-log-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.audit-log-card__time,
.audit-log-card__meta,
.audit-log-card__reference,
.audit-log-card__summary {
  color: var(--muted);
  font-size: 0.85rem;
}

.audit-log-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-log-card p {
  margin: 0;
  overflow-wrap: break-word;
}

.audit-log-table-wrap {
  display: none;
}

.audit-log-table td {
  vertical-align: top;
}

.audit-log-table td:nth-child(6),
.audit-log-table td:nth-child(7) {
  min-width: 180px;
}

.audit-log-load-more {
  justify-self: center;
}

.audit-log-dialog::backdrop {
  background: rgba(20, 24, 20, 0.35);
}

.audit-log-dialog {
  border: 0;
  padding: 0;
  border-radius: var(--r);
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  background: transparent;
}

.audit-log-dialog__panel {
  display: grid;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.audit-log-dialog__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.audit-log-dialog__head h2 {
  margin: 2px 0 0;
  font-size: 1.1rem;
}

.audit-log-dialog__body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.audit-log-detail-list,
.audit-log-json-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.audit-log-detail-list > div,
.audit-log-json-list > div {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 10px;
}

.audit-log-detail-list dt,
.audit-log-json-list dt {
  color: var(--muted);
  font-weight: 650;
}

.audit-log-detail-list dd,
.audit-log-json-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-log-resolved-value,
.audit-log-technical-id {
  display: block;
}

.audit-log-resolved-value {
  font-weight: 700;
}

.audit-log-technical-id {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.audit-log-detail-block {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.audit-log-detail-block h3 {
  margin: 0;
  font-size: 0.95rem;
}

.audit-log-detail-block pre {
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-muted);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

@media (min-width: 860px) {
  .audit-log-card-list {
    display: none;
  }

  .audit-log-table-wrap {
    display: block;
  }
}

@media (max-width: 560px) {
  .audit-log-filter-grid,
  .audit-log-dialog__body {
    padding: 0 12px 12px;
  }

  .audit-log-detail-list > div,
  .audit-log-json-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 560px) {
  .role-permission-row {
    grid-template-columns: 1fr;
  }
}

.registration-layout {
  display: grid;
  gap: 16px;
}

/* Booking Profiles: keep the admin form structured without changing shared form UI. */
.booking-profile-admin {
  gap: 18px;
}

.registration-layout.booking-profile-admin {
  grid-template-columns: minmax(0, 1fr);
}

.booking-profile-list {
  display: grid;
  gap: 10px;
}

.booking-profile-admin__heading {
  display: grid;
  gap: 4px;
}

.booking-profile-admin__heading h3,
.booking-profile-admin__heading p {
  margin: 0;
}

.booking-profile-form {
  display: grid;
  gap: 14px;
  min-width: 0;
  width: min(100%, 1160px);
  box-sizing: border-box;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
}

.booking-profile-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.booking-profile-group h4,
.booking-profile-group__title {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.booking-profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 280px));
  gap: 12px 16px;
  min-width: 0;
}

.booking-profile-fields--three {
  grid-template-columns: repeat(3, minmax(180px, 220px));
}

.booking-profile-group--base .booking-profile-fields {
  grid-template-columns: minmax(220px, 28rem) auto;
}

.booking-profile-group--base .booking-profile-checkbox {
  justify-self: start;
}

.booking-profile-fields label,
.booking-profile-time-windows label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.booking-profile-fields input:not([type="checkbox"]),
.booking-profile-fields select,
.booking-profile-time-windows textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
  background: var(--surface-raised);
  color: var(--text);
}

/* Numeric controls stay readable without stretching across the whole grid cell. */
.booking-profile-fields input[name="name"] {
  max-width: 28rem;
}

.booking-profile-fields input[name="minNoticeMinutes"],
.booking-profile-fields input[name="minDurationMinutes"],
.booking-profile-fields input[name="maxDurationMinutes"],
.booking-profile-fields input[name="slotMinutes"],
.booking-profile-fields input[name="maxFutureActiveBookings"],
.booking-profile-fields input[name="maxBookingsPerLocalDay"] {
  max-width: 8ch;
}

.booking-profile-fields input[name="maxAdvanceDays"] {
  max-width: 6ch;
}

.booking-profile-fields select[name="courtDefaultAccess"],
.booking-profile-fields--courts select {
  max-width: 14ch;
}

.booking-profile-checkbox {
  display: flex !important;
  align-items: center;
  align-self: end;
  gap: 8px !important;
  min-height: 40px;
  color: var(--text) !important;
}

.booking-profile-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.booking-profile-court-exceptions legend {
  padding: 0 4px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.booking-profile-fields--courts {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.booking-profile-fields--courts label {
  font-weight: 700;
}

.booking-profile-time-windows textarea {
  resize: vertical;
  min-height: 120px;
  padding: 10px;
}

.booking-profile-time-windows .field-hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.booking-time-window-grid {
  display: grid;
  gap: 6px;
  max-width: 620px;
}

.booking-time-window-grid__head,
.booking-time-window-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 100px 100px;
  align-items: center;
  gap: 10px;
}

.booking-time-window-grid__head {
  padding: 0 10px 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.booking-time-window-row {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-muted);
}

.booking-time-window-row select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
}

.booking-time-window-day {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 700;
}

.booking-time-window-day input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.booking-profile-actions {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* Court operations: keep section headings and forms in a predictable desktop flow. */
#court-operations-body .registration-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

#court-operations-body .booking-view > label {
  display: grid;
  grid-template-columns: auto minmax(140px, 160px);
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--muted);
  font-weight: 750;
}

#court-operations-body .booking-view > label input,
#court-operations-body [data-court-operation-create] input,
#court-operations-body [data-court-operation-create] select,
#court-operations-body .court-operation-court-form input {
  box-sizing: border-box;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 7px 9px;
  background: var(--surface-raised);
  color: var(--text);
}

#court-operations-body [data-court-operation-create] {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 220px));
  align-items: end;
  gap: 12px 16px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

#court-operations-body [data-court-operation-create] > label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

#court-operations-body [data-court-operation-create] > fieldset {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

#court-operations-body [data-court-operation-create] > fieldset legend {
  padding: 0 4px;
  color: var(--text);
  font-weight: 800;
}

#court-operations-body .court-operation-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: var(--text);
  font-weight: 700;
}

#court-operations-body .court-operation-check input,
#court-operations-body .court-operation-court-form input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

#court-operations-body [data-court-operation-create] .registration-actions,
#court-operations-body [data-court-operation-create] [data-court-operation-preview-result] {
  grid-column: 1 / -1;
}

#court-operations-body [data-court-operation-create] .registration-actions {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

#court-operations-body .court-operation-court-form {
  display: grid;
  grid-template-columns: 150px minmax(180px, 260px) 120px auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#court-operations-body .court-operation-court-form label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 700px) {
  #court-operations-body [data-court-operation-create],
  #court-operations-body .court-operation-court-form {
    grid-template-columns: 1fr;
  }

  #court-operations-body [data-court-operation-create] > fieldset,
  #court-operations-body [data-court-operation-create] .registration-actions,
  #court-operations-body [data-court-operation-create] [data-court-operation-preview-result] {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .booking-profile-form {
    padding: 10px;
  }

  .booking-profile-group {
    padding: 12px;
  }

  .booking-profile-fields,
  .booking-profile-fields--three,
  .booking-profile-group--base .booking-profile-fields {
    grid-template-columns: 1fr;
  }

  .booking-time-window-grid {
    max-width: none;
  }

  .booking-time-window-grid__head,
  .booking-time-window-row {
    grid-template-columns: minmax(0, 1fr) 86px 86px;
    gap: 6px;
  }
}

.registration-overview,
.registration-detail {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.registration-section-head,
.registration-detail-head,
.registration-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.registration-section-head h3,
.registration-detail-head h3,
.registration-entry-head h3 {
  margin: 0;
}

.registration-message {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.registration-card-list,
.registration-entry-list {
  display: grid;
  gap: 10px;
}

.registration-card,
.registration-entry-card,
.registration-form,
.registration-link-box,
.registration-meta-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.registration-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.registration-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.registration-card-main {
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.registration-card-main strong {
  font-size: 1rem;
}

.registration-card-main span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
}

.registration-counts,
.registration-actions,
.registration-entry-actions,
.registration-form-actions,
.registration-entry-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge--pending {
  background: #fff7d6;
  color: #735300;
  border-color: #e9c94d;
}

.registration-detail {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.registration-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0;
  overflow: hidden;
}

.registration-meta-grid span {
  display: grid;
  gap: 2px;
  padding: 10px;
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.registration-meta-grid strong {
  color: var(--text);
  font-size: 0.78rem;
}

.registration-selection-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.registration-selection-summary span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
}

.registration-selection-summary strong {
  color: var(--text);
  font-size: 0.78rem;
}

.registration-pairing-summary {
  display: grid;
  gap: 10px;
}

.registration-pairing-summary header h3,
.registration-pairing-summary header .kicker {
  margin: 0;
}

.registration-pairing-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.registration-pairing-summary__grid article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.registration-pairing-summary__grid h4,
.registration-pairing-summary__grid p {
  margin: 0;
}

.registration-pairing-summary__grid ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.registration-pairing-summary__grid li button.pairing-summary-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--tx-fast), background var(--tx-fast), color var(--tx-fast);
}

.registration-pairing-summary__grid li button.pairing-summary-link:hover {
  border-color: var(--accent);
  background: var(--accent-xsoft);
  color: var(--accent-strong);
}

.registration-pairing-summary__grid li button.pairing-summary-link:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.registration-pairing-summary__finished {
  grid-column: 1 / -1;
}

.registration-pairing-seed-group + .registration-pairing-seed-group {
  margin-top: 12px;
}

.registration-pairing-seed-group h5 {
  margin: 0 0 6px;
  font-size: 0.86rem;
}

.registration-pairing-seed-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.registration-pairing-seed {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.registration-pairing-seed[draggable="true"] {
  cursor: grab;
}

.registration-pairing-seed.is-dragging {
  opacity: 0.45;
}

.registration-pairing-seed__number {
  color: var(--accent);
  font-weight: 800;
  text-align: center;
}

.registration-pairing-seed__name {
  min-width: 0;
}

.registration-pairing-seed__name small {
  color: var(--muted);
}

.registration-pairing-seed__handle {
  color: var(--muted);
  font-size: 1.1rem;
}

.registration-entry-partner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.registration-entry-partner > div,
.registration-entry-partner > button {
  grid-column: 1 / -1;
}

.registration-entry-partner p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.registration-entry-partner label {
  display: grid;
  gap: 5px;
}

.registration-entry-pairing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.registration-entry-pairing > div:first-child {
  grid-column: 1 / -1;
}

.registration-entry-pairing p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.registration-entry-pairing__event {
  display: grid;
  gap: 7px;
  align-content: start;
}

.registration-entry-pairing__event label {
  display: grid;
  gap: 5px;
}

.registration-link-box {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.registration-link-box label {
  display: grid;
  gap: 6px;
}

.registration-link-box input {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registration-form {
  display: grid;
  gap: 12px;
  padding: 12px;
}

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

.registration-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.registration-form-grid--full {
  grid-column: 1 / -1;
}

.registration-form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.registration-choice.is-disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
}

.registration-choice small {
  color: inherit;
}

.registration-own-panel {
  display: grid;
  gap: 10px;
}

.registration-checkbox {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.registration-event-choice {
  display: grid;
  gap: 9px;
}

.registration-event-choice > label {
  display: grid;
  gap: 6px;
}

.registration-event-choice fieldset,
.public-registration-events {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.registration-event-choice legend,
.public-registration-events legend {
  width: 100%;
  padding: 0;
  color: var(--text);
  font-weight: 750;
  font-size: 0.88rem;
}

.registration-event-choice legend small,
.public-registration-events legend small {
  color: var(--muted);
  font-weight: 500;
}

.registration-event-choice fieldset label,
.public-registration-events label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  width: auto;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.2;
}

.registration-event-choice input[type="checkbox"],
.public-registration-events input[type="checkbox"] {
  box-sizing: border-box;
  flex: 0 0 18px;
  width: 18px !important;
  height: 18px;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 4px !important;
}

.registration-entry-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.registration-limits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.registration-limits legend {
  grid-column: 1 / -1;
}

.registration-limits label {
  display: grid;
  gap: 5px;
}

.registration-limits label span,
.registration-limits small {
  color: var(--muted);
  font-size: 0.8rem;
}

.partner-wish {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.partner-wish[hidden] {
  display: none;
}

.partner-wish legend {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.partner-wish label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.partner-wish label span {
  color: var(--muted);
  font-size: 0.8rem;
}

.partner-wish label input,
.partner-wish label select {
  width: 100%;
}

.partner-wish__toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.partner-wish__toggle-btn {
  flex: 1 1 30%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 0.84rem;
  cursor: pointer;
}

.partner-wish__toggle-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.partner-wish__match {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.partner-wish__match[hidden] {
  display: none;
}

.partner-wish__match-btn {
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.registration-entry-partner.partner-wish {
  display: flex;
  flex-direction: column;
}

.registration-entry-partner.partner-wish label {
  display: flex;
  flex-direction: column;
}

.registration-capacity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.registration-capacity span {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 0.84rem;
}

.registration-entry-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.registration-entry-filters label {
  display: grid;
  gap: 5px;
  min-width: 160px;
}

.registration-entry-filters label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.registration-entry-filters p {
  margin: 0 0 10px auto;
  color: var(--muted);
  font-weight: 700;
}

.registration-entry-table {
  min-width: 1080px;
}

.registration-entry-table td {
  vertical-align: middle;
}

.registration-entry-table td:first-child {
  min-width: 160px;
}

.registration-entry-table th:nth-child(3),
.registration-entry-table td:nth-child(3) {
  text-align: center;
}

.registration-entry-table th:nth-child(4),
.registration-entry-table td:nth-child(4) {
  text-align: center;
}

.registration-entry-table th:nth-child(5),
.registration-entry-table td:nth-child(5) {
  text-align: center;
}

.registration-entry-table tbody tr[data-entry-id] {
  cursor: pointer;
}

.registration-entry-table tbody tr[data-entry-id]:hover {
  background: var(--accent-soft);
}

.registration-entry-table__empty {
  color: var(--muted);
  text-align: center;
}

.registration-entry-card--details {
  margin-top: 2px;
}

.registration-entry-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.registration-entry-card header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.registration-entry-card header span,
.registration-entry-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.registration-entry-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.registration-note {
  display: grid;
  gap: 6px;
}

.registration-entry-data {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.registration-entry-data label {
  display: grid;
  gap: 5px;
}

.registration-entry-data label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.registration-entry-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-muted);
}

.registration-entry-identity > div,
.registration-entry-identity label {
  display: grid;
  gap: 4px;
}

.registration-entry-identity p,
.registration-entry-identity label span {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .registration-entry-identity {
    grid-template-columns: 1fr;
  }

  .registration-entry-identity button {
    width: 100%;
  }
}

.registration-note textarea {
  width: 100%;
  resize: vertical;
}

.registration-entry-audit {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.registration-entry-audit h4 {
  margin: 0;
  font-size: 0.9rem;
}

.registration-entry-audit ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.registration-entry-audit li {
  display: grid;
  gap: 2px;
}

.registration-entry-audit li span {
  color: var(--muted);
  font-size: 0.84rem;
}

.player-registration-view,
.player-registration-list {
  display: grid;
  gap: 12px;
}

.player-registration-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.player-registration-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.player-registration-card__head h3 {
  margin: 0;
}

.player-registration-card__meta {
  display: grid;
  gap: 8px;
}

.player-registration-card__meta span,
.player-registration-card__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.player-registration-card__meta strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 0.78rem;
}

@media (min-width: 900px) {
  .registration-layout {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    align-items: start;
  }
}

.player-search-panel,
.player-profile,
.player-side-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.field-hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.availability-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}

.availability-hint-dismiss {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
  flex-shrink: 0;
}

.player-search-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 14px;
  min-width: 0;
}

.player-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.player-search-form label {
  display: grid;
  flex: 1 1 260px;
  gap: 5px;
}

.player-search-form span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.player-search-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
}

.player-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.player-result {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.player-result.active,
.player-result.highlighted,
.player-result:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.player-result span,
.player-search-message {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.player-result strong,
.player-result > span:not(.player-initials) {
  grid-column: 2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-initials {
  grid-row: 1 / span 2;
  grid-column: 1;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.player-result mark {
  border-radius: var(--r-sm);
  background: #fff3a8;
  color: inherit;
}

.player-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.player-profile-head > div {
  min-width: 0;
}

.player-profile-head h3,
.player-profile-head .kicker {
  overflow-wrap: anywhere;
}

.player-match-section {
  display: grid;
  gap: 10px;
}

.player-detail-toggle {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 10px;
}

.player-detail-toggle summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
  list-style: none;
}

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

.player-detail-toggle summary::after {
  content: "Anzeigen";
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.player-detail-toggle[open] summary::after {
  content: "Ausblenden";
}

.player-detail-toggle > :not(summary) {
  margin-top: 10px;
}

.player-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.player-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 12px;
}

.player-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.player-stat strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.availability-calendar {
  overflow-x: auto;
  padding-bottom: 4px;
}

.availability-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.availability-day {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 8px;
}

.availability-day.today {
  border-color: var(--accent);
}

.availability-day h4 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.availability-day > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.availability-time {
  display: inline-grid;
  align-content: center;
  gap: 2px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  padding: 4px 10px;
  text-align: center;
}

.availability-time small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.availability-group-players {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--accent);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.availability-time.selected .availability-group-players {
  color: #c8f0de;
}

.availability-time.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.availability-time.selected small {
  color: #eef8f2;
}

.availability-time:disabled {
  background: #edf0ec;
  color: var(--muted);
}

.availability-time.unavailable:disabled {
  border-style: dashed;
  background: #e5e8e3;
}

/* Bereits gespeicherter Slot, der aktuell keinen freien Platz mehr hat: bleibt
   abwählbar (nicht :disabled), darf aber optisch nicht wie ein normal
   nutzbarer grüner Slot wirken. */
.availability-time.selected.unavailable {
  border-style: dashed;
  background: var(--accent-soft, #cfe3d8);
  color: var(--accent-strong, var(--accent));
}

.availability-time.selected.unavailable small {
  color: inherit;
}

.availability-time.has-booking {
  min-height: 40px;
}

.inline-warning {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff8e6;
  color: #73520d;
  padding: 8px 10px;
  font-weight: 750;
}

.availability-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 0 10px;
  font-weight: 750;
}

.availability-pills,
.h2h-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.h2h-buttons .icon-button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.availability-pills span,
.mini-match {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 8px 10px;
  font-weight: 750;
}

.availability-pills.common span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.open-match-date {
  margin-top: 8px;
  justify-content: space-between;
}

.open-match-edit {
  flex-shrink: 0;
}

.availability-day-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.availability-day-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 10px;
}

.availability-day-card h4 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.85rem;
}

.availability-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.availability-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 750;
}

#my-open-matches {
  display: grid;
  gap: 10px;
}

.mini-match {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 14px;
  min-width: 0;
}

.h2h-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 12px;
}

.h2h-summary > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-match-list {
  display: grid;
  gap: 8px;
}

.player-match-item .match-title {
  align-items: flex-start;
  gap: 10px;
}

.player-match-item .match-title > div {
  min-width: 0;
}

.player-match-item h3,
.player-match-result {
  overflow-wrap: anywhere;
}

.player-match-result {
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 750;
}

.standings-table {
  min-width: 0;
  table-layout: fixed;
}

.standings-table th,
.standings-table td {
  padding: 10px 8px;
  font-size: 0.84rem;
}

.standings-player-cell {
  font-weight: 600;
}

.standings-table th:nth-child(1),
.standings-table td:nth-child(1) {
  width: 42px;
  text-align: center;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  width: 96px;
}

.standings-table th:nth-child(3),
.standings-table td:nth-child(3),
.standings-table th:nth-child(4),
.standings-table td:nth-child(4),
.standings-table th:nth-child(5),
.standings-table td:nth-child(5) {
  width: 36px;
  text-align: center;
}

.standings-table th:nth-child(6),
.standings-table td:nth-child(6),
.standings-table th:nth-child(7),
.standings-table td:nth-child(7) {
  width: 60px;
}

.standings-table th:nth-child(8),
.standings-table td:nth-child(8) {
  width: 46px;
}

.standings-table th:nth-child(9),
.standings-table td:nth-child(9) {
  width: 54px;
  text-align: center;
}

.standings-table .status-pill--compact {
  min-width: 22px;
  justify-content: center;
  padding: 0 6px;
  gap: 0;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}

.sort-indicator {
  display: inline-block;
  min-width: 10px;
  font-size: 0.75em;
  opacity: 0.6;
}

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

.qualified-row {
  background: rgba(26, 102, 71, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  border-radius: var(--r-full);
  padding: 0 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill--out {
  background: var(--surface-muted);
  color: var(--muted);
}

.status-pill--withdrawn {
  background: #fef3e2;
  color: #a05a00;
}

.status-pill--success {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-pill--warning {
  background: #fef3e2;
  color: #8a5200;
}

.status-pill--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill--info {
  background: #e4eef8;
  color: #24567d;
}

.status-pill--neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.withdrawn-row {
  opacity: 0.65;
}

.user-status-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.user-nickname-input {
  width: var(--nickname-col-width, 120px);
  min-width: 60px;
  max-width: 100%;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-lg);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--ok {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge--off {
  background: var(--surface-muted);
  color: var(--muted);
}

.badge--alert {
  background: #fef3e2;
  color: #a05a00;
}

.badge--round {
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
  background: #555;
  color: #fff;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn--compact {
  padding: 4px 9px;
  font-size: 0.78rem;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.message-list {
  display: grid;
  gap: 9px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.message-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: -4px;
}

.message-folders {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 4px;
}

.message-folders button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
}

.message-folders button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent-strong);
}

.message-toolbar label {
  display: grid;
  gap: 5px;
  min-width: min(100%, 180px);
}

.message-toolbar span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.message-toolbar select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
}

.message-toolbar-icons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
  min-width: 0;
}

.message-filter-buttons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.message-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.message-filter-button span {
  line-height: 1;
}

.message-filter-button:hover,
.message-filter-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.message-toolbar-icon {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--accent);
  padding: 0;
}

.message-toolbar-icon[hidden] {
  display: none;
}

.message-toolbar-icon::-webkit-details-marker {
  display: none;
}

.message-toolbar-icon:hover,
.message-toolbar-icon.active {
  background: var(--accent-soft);
  border-color: var(--line);
  color: var(--accent-strong);
}

.message-toolbar-icon--danger {
  color: var(--danger);
}

.message-toolbar-icon--danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.message-toolbar-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.message-card-aside {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  min-width: fit-content;
  white-space: nowrap;
}

.message-card-mobile-action {
  display: none;
}

.message-select {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.message-card .status-pill {
  min-height: 22px;
  padding: 0 8px;
  font-size: 0.72rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.message-card.unread .message-meta::before {
  content: "●";
  color: var(--danger);
  font-size: 0.55rem;
  vertical-align: middle;
  margin-right: 5px;
}

.message-previous-result {
  color: var(--muted);
  font-size: 0.88rem;
}

.message-card.unread h3 {
  font-weight: 900;
}

.calendar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.calendar-tools label {
  display: grid;
  gap: 5px;
  min-width: min(100%, 220px);
}

.calendar-tools span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-tools select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
}

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

.calendar-day {
  display: grid;
  gap: 8px;
}

.calendar-day h3 {
  margin-bottom: 0;
  color: var(--accent-strong);
}

.calendar-event {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.calendar-event header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.calendar-event strong {
  overflow-wrap: anywhere;
}

.calendar-event p {
  margin-bottom: 0;
  color: var(--muted);
}

.calendar-jump-btn {
  font-size: 0.82rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.calendar-jump-btn:hover {
  color: var(--accent-strong);
}

.message-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.message-card.unread {
  border-color: var(--accent);
  background: var(--accent-xsoft);
}

.message-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
}

.message-card h3 {
  margin-bottom: 0;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  font-size: 0.96rem;
  line-height: 1.2;
}

.message-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.roster-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.roster-editor:empty {
  display: none;
}

.roster-head h3 {
  margin-bottom: 4px;
}

.roster-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.roster-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.7fr);
  gap: 10px;
}

.contact-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 16px;
  transition: box-shadow var(--tx);
}

.contact-item:hover {
  box-shadow: var(--shadow-md);
}

.contact-empty {
  color: var(--muted);
  background: var(--surface-muted);
}

.contact-item strong {
  overflow-wrap: anywhere;
}

.contact-item a {
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: none;
}

.wa-contact-link {
  color: #25d366;
  font-weight: 750;
  font-size: 0.875rem;
  text-decoration: none;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.rule-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.rule-card span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rule-card strong {
  font-size: 1.02rem;
}

.rule-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.55);
  padding: 18px;
  color: var(--muted);
}

.invite-message-dialog {
  width: min(92vw, 560px);
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  position: fixed;
  inset: 0;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
}

.invite-message-dialog::backdrop {
  background: rgba(23, 32, 24, 0.4);
}

.help-dialog {
  width: min(94vw, 760px);
  max-width: calc(100vw - 12px);
  max-height: min(88vh, 780px);
  overflow-y: auto;
  position: fixed;
  inset: 0;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.help-dialog::backdrop {
  background: rgba(23, 32, 24, 0.4);
}

.help-panel {
  display: grid;
  max-height: min(88vh, 780px);
}

.help-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
}

.help-header h2 {
  line-height: 1.15;
}

.help-body {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 12px 14px 16px;
  -webkit-overflow-scrolling: touch;
}

.help-section {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
}

.help-section summary {
  cursor: pointer;
  padding: 12px;
  color: var(--accent-strong);
  font-weight: 850;
  list-style: none;
}

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

.help-section summary::after {
  content: "Anzeigen";
  float: right;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.help-section[open] summary::after {
  content: "Ausblenden";
}

.help-section-content {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 0 12px 12px;
}

.help-section-content p,
.help-section-content ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.help-section-content ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.invite-message-form {
  display: grid;
  gap: 10px;
  max-height: min(84vh, 720px);
  overflow: auto;
  padding: 14px;
}

.invite-message-slot {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
  padding: 10px;
}

.invite-message-slot p {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#app-dialog-message {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.invite-message-form label {
  display: grid;
  gap: 5px;
}

.invite-message-form label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invite-message-form textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px 10px;
  resize: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.invite-message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 8px;
}

@media (min-width: 701px) {
  :root {
    --desktop-topbar-height: calc(clamp(44px, 7vw, 64px) + 41px);
    --desktop-header-nav-gap: 24px;
    --desktop-sticky-offset: calc(var(--desktop-topbar-height) + var(--desktop-header-nav-gap));
  }

  .topbar,
  .group-header {
    align-items: center;
    flex-direction: row;
  }

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

  .layout {
    grid-template-columns: minmax(185px, 230px) minmax(0, 1fr);
    padding-top: var(--desktop-header-nav-gap);
  }

  .sidebar {
    position: sticky;
    top: var(--desktop-sticky-offset);
    max-width: 230px;
  }

  .sidebar-head {
    width: clamp(152px, 16vw, 168px);
    max-width: 100%;
    gap: 12px;
  }

  .group-list,
  .other-groups {
    justify-items: start;
  }

  .group-button {
    width: clamp(152px, 16vw, 168px);
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: start;
  }

  .content {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .tabs {
    display: none;
  }

  .mobile-priority-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: var(--desktop-sticky-offset);
    z-index: 8;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow-sm);
    order: 1;
  }

  .mobile-scroll-row {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
  }

  .mobile-priority-nav .tab-button {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 110px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 1rem;
    text-align: center;
    white-space: nowrap;
    border-color: transparent;
    background: transparent;
  }

  .mobile-priority-nav .tab-button .nav-icon {
    margin-right: 5px;
  }

  .mobile-priority-nav .tab-button.active {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
  }

  .mobile-scroll-row [data-view="messages"][data-unread-count]:not([data-unread-count=""]) {
    position: relative;
  }

  .mobile-scroll-row [data-view="messages"][data-unread-count]:not([data-unread-count=""])::after {
    content: attr(data-unread-count);
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    border-radius: var(--r-full);
    border: 2px solid var(--surface);
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 0 3px;
    line-height: 1;
  }

  .mobile-scroll-row [data-view="registrations"][data-registration-open="1"] {
    position: relative;
  }

  .mobile-scroll-row [data-view="registrations"][data-registration-open="1"]::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: var(--r-full);
    border: 2px solid var(--surface);
    background: #1a84d7;
  }

  .mobile-more-menu:empty,
  .mobile-more-menu.desktop-empty {
    display: none;
  }

  .group-header {
    order: 2;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface-muted);
    box-shadow: var(--shadow-sm);
  }

  .view {
    order: 3;
  }
}

@media (max-width: 700px) {
  :root {
    --mobile-topbar-height: 57px;
    --mobile-header-nav-gap: 8px;
    --mobile-nav-height: 56px;
  }

  .content {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .group-header {
    align-items: stretch;
    flex-direction: column;
    order: 2;
    margin: 0;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface-muted);
    box-shadow: var(--shadow-sm);
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    height: var(--mobile-topbar-height);
    gap: 4px;
    padding: 8px 8px;
  }

  .topbar .kicker {
    display: none;
  }

  .actions {
    justify-content: flex-end;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    width: auto;
    gap: 4px;
  }

  .context-switcher {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  #context-switcher .user-menu {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
  }

  #current-user.user-menu {
    flex: 0 0 auto;
    width: auto;
  }

  .ctx-label-full {
    display: none;
  }

  .ctx-label-short {
    display: inline;
  }

  .brand {
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: var(--mobile-header-nav-gap);
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-priority-nav {
    order: 1;
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + var(--mobile-topbar-height) + var(--mobile-header-nav-gap));
    z-index: 9;
    height: var(--mobile-nav-height);
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow-sm);
  }

  .view {
    order: 3;
  }

  .tabs {
    display: none;
  }

  .mobile-scroll-row {
    gap: 3px;
  }

  .mobile-priority-nav .mobile-priority-button {
    min-height: 42px;
    gap: 1px;
    padding: 5px 3px;
    font-size: 0.67rem;
  }

  .mobile-more-menu summary {
    min-height: 34px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    left: auto;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: min(calc(100vw - 20px), 360px);
    transform: none;
    z-index: 40;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    padding: 5px;
    backdrop-filter: blur(8px);
  }

  .group-list {
    grid-template-columns: auto;
    gap: 6px;
    align-items: stretch;
    position: relative;
  }

  .brand img {
    width: 40px;
    flex-shrink: 0;
  }

  .brand > div {
    min-width: 0;
  }

  .brand h1 {
    display: block;
    font-size: clamp(0.72rem, 3.6vw, 0.95rem);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    letter-spacing: 0;
    min-width: 0;
  }

  .brand h1 span {
    display: inline;
  }

  .brand h1 span + span {
    margin-left: 0.3ch;
  }

  .user-chip {
    width: auto;
    min-height: 40px;
    min-width: 0;
    align-items: center;
    gap: 2px;
    padding: 6px 6px;
  }

  #current-user .user-chip-full,
  #current-user .user-chip-caret {
    display: none;
  }

  #current-user .user-chip-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #current-user .user-chip {
    width: 42px;
    height: 42px;
    min-height: 42px;
    min-width: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.95rem;
  }

  .roster-grid {
    grid-template-columns: 1fr;
  }

  .score-area {
    grid-template-columns: minmax(88px, 1fr) repeat(3, minmax(44px, 1fr));
    column-gap: 6px;
  }
  .score-grid {
    row-gap: 6px;
  }
  .wo-buttons {
    gap: 6px;
  }

  .match-card {
    padding: 14px;
  }

  .player-search-panel,
  .player-profile,
  .player-side-panel {
    padding: 12px;
    margin-bottom: 12px;
  }

  .player-search-layout {
    gap: 10px;
  }

  .player-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .player-profile .availability-calendar {
    overflow-x: visible;
  }

  .player-profile .availability-calendar-grid,
  .player-profile .availability-day-list {
    grid-template-columns: 1fr;
  }

  .player-match-item .match-title {
    flex-wrap: wrap;
  }

  .player-match-item .match-state {
    white-space: normal;
  }

  .invite-row {
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .invite-row > button,
  .invite-row > a,
  .invite-row .invite-actions > button,
  .invite-row .invite-actions > a {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  .match-footer > button {
    width: 100%;
    min-height: 44px;
  }

  .match-card--planned .match-footer > button {
    width: auto;
    min-height: 36px;
  }

  .match-card--planned .cancel-reservation {
    min-height: 36px;
  }

  .danger-button {
    flex: 1 1 128px;
  }

  .action-tile-button {
    flex: 1 1 128px;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  .icon-button,
  .danger-button,
  .tab-button,
  .accept-invite,
  .message-jump,
  .message-reject,
  .message-resolve,
  .check-availability,
  .invite-match,
  .cancel-reservation,
  .tennis04-reserve {
    min-height: 44px;
  }

  .message-card {
    padding: 12px;
    gap: 6px;
  }

  .message-card header {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-card-aside {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    flex-wrap: wrap;
    white-space: normal;
  }

  .message-card .status-pill {
    max-width: 100%;
    white-space: normal;
  }

  .message-jump-desktop {
    display: none;
  }

  .message-card-mobile-action {
    display: block;
  }

  .message-jump-mobile {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .message-meta {
    gap: 4px;
  }

  .message-card h3 {
    white-space: normal;
  }

  .calendar-tools label,
  .message-toolbar label {
    min-width: 100%;
  }

  .message-actions,
  .calendar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .message-actions > button,
  .message-actions > a,
  .calendar-actions > button,
  .calendar-actions > a {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }

  .calendar-event {
    padding: 10px 12px;
    gap: 4px;
  }

  .calendar-event p,
  .message-card p,
  .result-hint {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .role-menu {
    right: 0;
    left: auto;
    width: auto;
    overflow: visible;
    padding: 6px;
    gap: 4px;
  }

  .role-menu > button,
  .role-menu-section > button {
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0 14px;
    font-size: 0.875rem;
    font-weight: 400;
  }

  .role-menu button.active {
    border-color: var(--accent);
    color: var(--text);
  }

  .role-menu-section {
    border-bottom: 0;
    gap: 4px;
  }

  .invite-message-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .help-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .help-panel {
    max-height: 84vh;
  }

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

  .help-header button {
    width: 100%;
  }

  .invite-message-form {
    max-height: 82vh;
    padding: 12px;
  }

  .invite-message-actions button,
  .invite-message-actions a {
    flex: 1 1 120px;
  }

  .sidebar-head {
    display: none;
  }

  #group-kicker {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .group-progress {
    display: none;
  }

  .group-button {
    display: flex;
    min-height: 34px;
    justify-content: center;
    padding: 5px 10px;
    font-size: 0.82rem;
    border-radius: var(--r-full);
    background: transparent;
    text-align: center;
  }

  .group-label-full,
  .group-button small,
  .group-toggle-full,
  .group-label-compact,
  .group-accordion-toggle,
  .other-groups {
    display: none;
  }

  .group-label-pill {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .group-button.active {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
  }

  .group-accordion-toggle {
    min-height: 34px;
    border-radius: var(--r-full);
    text-align: center;
    white-space: nowrap;
    padding: 0 12px;
    font-size: 0.82rem;
    background: var(--surface-muted);
  }

  .sidebar.mobile-groups-expanded {
    left: 50%;
    right: auto;
    width: min(calc(100vw - 20px), 360px);
    transform: translateX(-50%);
  }

  .sidebar.mobile-groups-expanded .group-list {
    grid-template-columns: 1fr auto;
  }

  .sidebar.mobile-groups-expanded .group-label-pill {
    display: none;
  }

  .sidebar.mobile-groups-expanded .group-label-compact,
  .sidebar.mobile-groups-expanded .group-toggle-compact {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar.mobile-groups-expanded .group-accordion-toggle {
    display: block;
  }

  .sidebar.mobile-groups-expanded .other-groups.expanded {
    display: grid;
  }

  .group-header {
    margin-bottom: 8px;
    gap: 2px;
  }

  #group-title {
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 769px) {
  .other-groups {
    display: grid;
  }
}

@media (max-width: 768px) {
  .sidebar.mobile-groups-expanded .group-accordion-toggle {
    display: block;
  }

  .sidebar.mobile-groups-expanded .other-groups {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 41;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 8px;
  }

  .sidebar.mobile-groups-expanded .other-groups.expanded {
    display: grid;
  }
}

/* ─── Runden-Verwaltung ───────────────────────────────────────────────────── */
.rounds-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.rounds-toolbar__action {
  min-height: 34px;
  min-width: 34px;
  gap: 4px;
}

.rounds-round {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  margin-bottom: 10px;
}

.rounds-round--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.rounds-round__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.rounds-round__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rounds-round__head h3 {
  margin: 0;
  font-size: 1rem;
}

.rounds-round__subline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}

.rounds-round__end {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.rounds-round__registration-summary {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.rounds-round__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.rounds-round__reg-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px 6px 3px 4px;
  border-radius: 6px;
  background: var(--bg-subtle, #f4f4f5);
}

.rounds-reg-badge-wrap {
  position: relative;
}

.rounds-reg-badge-btn {
  cursor: pointer;
  border: 1px solid #e9c94d;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  line-height: 1.4;
  background: #fff7d6;
  color: #735300;
  white-space: nowrap;
}

.rounds-reg-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 150px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.rounds-reg-dropdown__item {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text, #1a1a1a);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  padding: 8px 12px;
  text-align: left;
  transition: border-color var(--tx-fast), background var(--tx-fast), color var(--tx-fast);
}

.membership-directory { display: grid; gap: 14px; margin-top: 24px; min-width: 0; }
.membership-directory > header { display: flex; gap: 18px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.membership-directory > header h3, .membership-directory > header p { margin-block: 0; }
.membership-directory > header .section-hint { margin-top: 4px; }
.membership-directory__filters { display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(2, minmax(145px, 1fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); }
.membership-directory__field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: .78rem; font-weight: 750; }
.membership-directory__field input, .membership-directory__field select { width: 100%; min-width: 0; background: var(--surface); }
.membership-directory__count { margin: -2px 2px 0; }
.membership-directory__table { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.membership-directory__head, .membership-directory__member { display: grid; grid-template-columns: minmax(120px, 1.55fr) minmax(76px, .85fr) minmax(72px, .8fr) minmax(88px, 1fr) minmax(90px, 1fr) minmax(96px, 1fr) minmax(82px, .9fr) 24px; gap: 8px; min-width: 0; align-items: center; padding: 11px 12px; text-align: left; }
.membership-directory__head { font-size: .72rem; color: var(--muted); font-weight: 800; background: var(--surface-muted); }
.membership-directory__member { width: 100%; min-height: 58px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: .82rem; transition: background var(--tx-fast), box-shadow var(--tx-fast); }
.membership-directory__member > span, .membership-directory__member > strong { min-width: 0; overflow-wrap: anywhere; }
.membership-directory__member:hover { background: var(--accent-xsoft); }
.membership-directory__member:focus-visible, .membership-directory__card:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.membership-directory__name { color: var(--text); font-size: .9rem; }
.membership-directory__member .status-pill { max-width: 100%; min-height: 23px; padding-inline: 7px; white-space: normal; line-height: 1.15; }
.membership-directory__group { display: grid; gap: 4px; }
.membership-directory__group .status-pill { justify-self: start; }
.membership-directory__chevron { color: var(--accent); font-size: 1.35rem; font-weight: 850; text-align: center; }
.membership-directory__cards { display: none; }
.membership-directory__detail { display: grid; gap: 14px; min-width: 0; }
.membership-directory__back { justify-self: start; min-height: 44px; padding-inline: 0; }
.membership-directory__detail-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.membership-directory__detail-head h3, .membership-directory__detail-head p { margin: 0; }
.membership-directory__detail-head h3 { margin-top: 3px; font-size: clamp(1.4rem, 2.4vw, 2rem); }
.membership-directory__detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.membership-directory__detail-grid > section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.membership-directory__detail-grid > .membership-directory__finance-summary { grid-column: 1 / -1; }
.membership-directory__detail h4 { margin: 0 0 12px; }
.membership-directory__facts { display: grid; gap: 9px; margin: 0; }
.membership-directory__facts > div { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); gap: 10px; align-items: start; }
.membership-directory__facts dt { color: var(--muted); font-size: .78rem; font-weight: 750; }
.membership-directory__facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.membership-directory__group-list { display: grid; gap: 8px; }
.membership-directory__group-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.membership-directory__group-list > div:first-child { padding-top: 0; border-top: 0; }
.membership-directory__group-list > div > span { display: grid; gap: 3px; }
.membership-directory__group-list > div > span:last-child { justify-items: end; color: var(--muted); font-size: .8rem; }
.membership-directory__empty-value { margin: 0; color: var(--muted); }
.membership-directory__finance-summary > button, .membership-directory__detail-grid > section > button { margin-top: 14px; }
.membership-directory__edit {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #d9d9d9);
}
.membership-directory__edit label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: .86rem;
  color: var(--muted);
}
.membership-directory__edit select { width: 100%; }
.membership-directory__edit .registration-actions { margin-top: 2px; }
.membership-seasons { display: grid; gap: 12px; margin-top: 24px; }
.membership-seasons > header { display: flex; align-items: end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.membership-season-table { overflow-x: auto; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.membership-season-head, .membership-season-row { display: grid; grid-template-columns: 1.3fr .8fr 1.6fr 1.25fr .8fr auto; gap: 10px; min-width: 760px; align-items: center; padding: 10px 12px; }
.membership-season-head { font-size: .78rem; color: var(--muted); font-weight: 750; background: var(--surface-muted, #f5f5f5); }
.membership-season-row { border-top: 1px solid var(--border, #e7e7e7); }
.membership-season-cards { display: none; }
.membership-season-form { display: grid; gap: 12px; margin-top: 12px; padding: 14px; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.membership-season-form h4 { margin: 0; }
.membership-season-form__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.membership-season-form__fields label { display: grid; gap: 4px; min-width: 0; }
.membership-plans { display: grid; gap: 12px; margin-top: 24px; }
.membership-plans > header, .membership-plan-filters { display: flex; align-items: end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.membership-plan-table { overflow-x: auto; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.membership-plan-head, .membership-plan-card { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(100px, 1fr)); gap: 10px; min-width: 680px; align-items: center; padding: 10px 12px; text-align: left; }
.membership-plan-head { font-size: .78rem; color: var(--muted); font-weight: 750; background: var(--surface-muted, #f5f5f5); }
.membership-plan-card { width: 100%; border: 0; border-top: 1px solid var(--border, #e7e7e7); background: transparent; color: inherit; cursor: pointer; font: inherit; }
.membership-plan-card:hover { background: var(--surface-muted, #f5f5f5); }
.membership-plan-cards { display: none; }
.membership-plan-form { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.membership-plan-form h4 { margin: 0; }
.membership-plan-form__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.membership-plan-form__fields label { display: grid; gap: 4px; }
.membership-plan-form__wide { grid-column: 1 / -1; }
.membership-plan-form textarea { min-height: 70px; resize: vertical; }
.membership-groups { display: grid; gap: 12px; margin-top: 24px; }
.membership-groups > header, .membership-group-detail header { display: flex; align-items: end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.membership-group-table { overflow-x: auto; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.membership-group-head, .membership-group-card { display: grid; grid-template-columns: 1.2fr repeat(4, minmax(110px, 1fr)); gap: 10px; min-width: 700px; align-items: center; padding: 10px 12px; text-align: left; }
.membership-group-head { font-size: .78rem; color: var(--muted); font-weight: 750; background: var(--surface-muted, #f5f5f5); }
.membership-group-card { width: 100%; border: 0; border-top: 1px solid var(--border, #e7e7e7); background: transparent; color: inherit; cursor: pointer; font: inherit; }
.membership-group-card:hover { background: var(--surface-muted, #f5f5f5); }
.membership-group-cards { display: none; }
.membership-group-detail { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.membership-group-detail label { display: grid; gap: 4px; }
.membership-group-members { display: grid; gap: 7px; }
.membership-group-member { display: flex !important; align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--border, #e7e7e7); border-radius: 8px; }
.membership-group-member select { margin-left: auto; }
.membership-finance { display: grid; gap: 12px; margin-top: 24px; }
.membership-finance > header, .finance-filters, .finance-detail header { display: flex; align-items: end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.finance-charge-table { overflow-x: auto; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.finance-charge-head, .finance-charge-card { display: grid; grid-template-columns: 1.15fr repeat(5, minmax(110px, 1fr)); gap: 10px; min-width: 850px; align-items: center; padding: 10px 12px; text-align: left; }
.finance-charge-head { font-size: .78rem; color: var(--muted); font-weight: 750; background: var(--surface-muted, #f5f5f5); }
.finance-charge-card { width: 100%; border: 0; border-top: 1px solid var(--border, #e7e7e7); background: transparent; color: inherit; cursor: pointer; font: inherit; }
.finance-charge-card:hover { background: var(--surface-muted, #f5f5f5); }
.finance-charge-cards { display: none; }
.finance-detail { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
.finance-detail h4 { margin: 6px 0 0; }
.finance-items, .finance-transactions { display: grid; gap: 8px; }
.finance-items article, .finance-transaction { display: grid; gap: 3px; padding: 9px; border: 1px solid var(--border, #e7e7e7); border-radius: 8px; }
@media (max-width: 700px) {
  .membership-season-table { display: none; }
  .membership-season-cards { display: grid; gap: 9px; }
  .membership-season-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; background: var(--surface, #fff); }
  .membership-season-card__main, .membership-season-card__dates { display: grid; gap: 3px; }
  .membership-season-card__dates { grid-template-columns: 1fr 1fr; }
  .membership-season-card__dates span { display: grid; gap: 2px; color: var(--muted); font-size: .82rem; }
  .membership-season-card__dates b { font-size: .72rem; color: var(--muted); }
  .membership-season-form__fields { grid-template-columns: 1fr; }
  .membership-directory__table { display: none; }
  .membership-directory__cards { display: grid; gap: 9px; }
  .membership-directory > header { align-items: stretch; }
  .membership-directory > header > div, .membership-directory > header > label { width: 100%; }
  .membership-directory__filters { grid-template-columns: 1fr 1fr; padding: 10px; }
  .membership-directory__field--search { grid-column: 1 / -1; }
  .membership-directory__card { display: grid; gap: 12px; width: 100%; min-width: 0; min-height: 44px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; cursor: pointer; font: inherit; text-align: left; transition: border-color var(--tx-fast), box-shadow var(--tx-fast), transform var(--tx-fast); }
  .membership-directory__card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
  .membership-directory__card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 8px; align-items: center; }
  .membership-directory__card-head strong { min-width: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
  .membership-directory__card-head .status-pill { white-space: nowrap; }
  .membership-directory__card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; }
  .membership-directory__card-grid > span { display: grid; align-content: start; gap: 3px; min-width: 0; }
  .membership-directory__card-grid small { color: var(--muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
  .membership-directory__card-grid b, .membership-directory__card-grid > span > span:not(.status-pill) { min-width: 0; overflow-wrap: anywhere; }
  .membership-directory__card-grid .status-pill { justify-self: start; margin-top: 2px; }
  .membership-directory__card-action { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--accent-strong); font-size: .82rem; font-weight: 800; }
  .membership-directory__detail-grid { grid-template-columns: 1fr; }
  .membership-directory__detail-grid > .membership-directory__finance-summary { grid-column: auto; }
  .membership-directory__detail-head { align-items: flex-start; }
  .membership-directory__facts > div { grid-template-columns: minmax(96px, .8fr) minmax(0, 1.2fr); }
  .membership-directory__group-list > div { align-items: flex-start; }
  .membership-plan-table { display: none; }
  .membership-plan-cards { display: grid; gap: 9px; }
  .membership-plan-cards .membership-plan-card { min-width: 0; grid-template-columns: 1fr 1fr; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
  .membership-plan-cards .membership-plan-card strong { grid-column: 1 / -1; font-size: 1rem; }
  .membership-plan-cards .membership-plan-card span::before { color: var(--muted); font-size: .72rem; display: block; }
  .membership-plan-cards .membership-plan-card span:nth-child(2)::before { content: "Code"; }
  .membership-plan-cards .membership-plan-card span:nth-child(3)::before { content: "Kategorie"; }
  .membership-plan-cards .membership-plan-card span:nth-child(4)::before { content: "Preis"; }
  .membership-plan-cards .membership-plan-card span:nth-child(5)::before { content: "Status"; }
  .membership-plan-form__fields { grid-template-columns: 1fr; }
  .membership-plan-form__wide { grid-column: auto; }
  .membership-group-table { display: none; }
  .membership-group-cards { display: grid; gap: 9px; }
  .membership-group-cards .membership-group-card { min-width: 0; grid-template-columns: 1fr 1fr; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
  .membership-group-cards .membership-group-card strong { grid-column: 1 / -1; font-size: 1rem; }
  .membership-group-cards .membership-group-card span::before { color: var(--muted); font-size: .72rem; display: block; }
  .membership-group-cards .membership-group-card span:nth-child(2)::before { content: "Typ"; }
  .membership-group-cards .membership-group-card span:nth-child(3)::before { content: "Saison"; }
  .membership-group-cards .membership-group-card span:nth-child(4)::before { content: "Tarif"; }
  .membership-group-cards .membership-group-card span:nth-child(5)::before { content: "Mitglieder / Status"; }
  .finance-charge-table { display: none; }
  .finance-charge-cards { display: grid; gap: 9px; }
  .finance-charge-cards .finance-charge-card { min-width: 0; grid-template-columns: 1fr 1fr; border: 1px solid var(--border, #d9d9d9); border-radius: 10px; }
  .finance-charge-cards .finance-charge-card strong { grid-column: 1 / -1; font-size: 1rem; }
  .finance-charge-cards .finance-charge-card span::before { color: var(--muted); font-size: .72rem; display: block; }
  .finance-charge-cards .finance-charge-card span:nth-child(2)::before { content: "Bezug"; }
  .finance-charge-cards .finance-charge-card span:nth-child(3)::before { content: "Saison"; }
  .finance-charge-cards .finance-charge-card span:nth-child(4)::before { content: "Forderung"; }
  .finance-charge-cards .finance-charge-card span:nth-child(5)::before { content: "Bezahlt / offen"; }
  .finance-charge-cards .finance-charge-card span:nth-child(6)::before { content: "Status"; }
}

.rounds-reg-dropdown__item:hover {
  border-color: var(--accent);
  background: var(--accent-xsoft);
  color: var(--accent-strong);
}

.rounds-reg-dropdown__item:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.rounds-action-btn {
  min-width: 38px;
  min-height: 38px;
  padding: 4px 6px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.rounds-action-label {
  display: inline-block;
  font-size: 0.62rem;
  line-height: 1;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.rounds-round__groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.rounds-group {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px;
}

.rounds-group__head {
  margin-bottom: 6px;
}

.rounds-group__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.rounds-group__meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.rounds-group__head h4 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
}

.rounds-group__count {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.2;
}

.rounds-group__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.rounds-slot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.rounds-slot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 7px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rounds-slot__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rounds-slot__index {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.rounds-slot__name {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rounds-slot__name--free {
  color: var(--muted);
  font-style: italic;
}

.rounds-slot__name--withdrawn {
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.7;
}

/* Freilos-Slot: dezent grün, gestrichelter Rand */
.rounds-slot--bye {
  background: #f0faf4;
  border-color: #a3d9b5;
  border-style: dashed;
}

/* Ausgeschiedener Spieler: grau abgeblendet */
.rounds-slot--withdrawn {
  background: #f7f7f7;
  opacity: 0.75;
}

/* Draggable Slot: Greif-Cursor */
.rounds-slot--draggable {
  cursor: grab;
}
.rounds-slot--draggable:active {
  cursor: grabbing;
}

/* Slot wird gerade gezogen */
.rounds-slot--dragging {
  opacity: 0.4;
}

/* Gültiges Drop-Ziel beim Hover */
.rounds-slot--drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: #eaf6f0;
}

.rounds-panel {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}

.rounds-panel__field {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.rounds-panel__field select {
  width: 100%;
}

.rounds-panel__out {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.rounds-panel__actions {
  display: flex;
  gap: 8px;
}

.player-registration-card__actions {
  display: grid;
  gap: 8px;
}

.player-registration-card__actions .primary-button,
.player-registration-card__actions .icon-button,
.player-registration-card__actions .danger-button {
  width: 100%;
}

#registration-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: 9;
  border-bottom: 3px solid #f2a33a;
  box-shadow: 0 4px 12px rgba(7, 43, 32, 0.24);
}

#registration-banner.registration-banner--visible {
  display: block;
}

/* Reine Vereinsmeisterschafts-Teilnehmer erhalten keine Sommercup-Navigation.
   Die bestehende Spieler-Anmeldung wird als eigener, schlanker Startbereich genutzt. */
.app-shell--club-championship-only .sidebar,
.app-shell--club-championship-only .group-header,
.app-shell--club-championship-only .mobile-priority-nav,
.app-shell--club-championship-only .tabs {
  display: none !important;
}

.app-shell--club-championship-only .layout {
  display: block;
  max-width: 680px;
  margin: 0 auto;
}

.app-shell--vm-context .sidebar {
  display: none;
}

.app-shell--vm-context .layout {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell--club-championship-only .content {
  min-width: 0;
}

.registration-banner__button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 13px 16px;
  background: linear-gradient(105deg, #073d2d, #117051 72%, #16835f);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.registration-banner__icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f2a33a;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.26);
  font-size: 1.25rem;
}

.registration-banner__content {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.registration-banner__title {
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.15;
}

.registration-banner__text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  line-height: 1.25;
}

.registration-banner__arrow {
  flex-shrink: 0;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
}

@media (max-width: 520px) {
  .registration-banner__button {
    gap: 9px;
    padding: 12px 14px;
  }

  .registration-banner__icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }

}

.rounds-panel__actions--stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rounds-panel__actions--stack button {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  line-height: 1.2;
  text-align: center;
}

.rounds-panel__actions--stack [data-rounds-action="panel-cancel"] {
  grid-column: 1 / -1;
}

.rounds-panel__actions--icon-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.rounds-mini-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
}

.rounds-mini-action svg {
  width: 15px;
  height: 15px;
}

.rounds-mini-action--close {
  margin-left: auto;
}

.rounds-panel__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

/* Icon-button label: shown alongside icon in round header, hidden on narrow screens */
.btn-label {
  font-size: 0.8rem;
}

/* Square touch-target for icon-only slot actions */
.rounds-slot__action {
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 36px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rounds-slot__action--text {
  min-width: auto;
  padding: 0 12px;
}

.rounds-slot__action--minimal {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
}

.rounds-slot__action--minimal svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 480px) {
  #standings-view .table-wrap {
    overflow-x: hidden;
  }

  .standings-table th,
  .standings-table td {
    padding: 7px 3px;
    font-size: 0.74rem;
  }

  .standings-table {
    width: calc(100% - 2px);
  }

  .standings-table th {
    font-size: 0.68rem;
  }

  .standings-table th:nth-child(1),
  .standings-table td:nth-child(1) {
    width: 28px;
  }

  .standings-table th:nth-child(2),
  .standings-table td:nth-child(2) {
    width: 66px;
  }

  .standings-table th:nth-child(3),
  .standings-table td:nth-child(3),
  .standings-table th:nth-child(4),
  .standings-table td:nth-child(4),
  .standings-table th:nth-child(5),
  .standings-table td:nth-child(5) {
    width: 24px;
  }

  .standings-table th:nth-child(6),
  .standings-table td:nth-child(6),
  .standings-table th:nth-child(7),
  .standings-table td:nth-child(7) {
    width: 41px;
  }

  .standings-table th:nth-child(8),
  .standings-table td:nth-child(8) {
    width: 29px;
  }

  .standings-table th:nth-child(9),
  .standings-table td:nth-child(9) {
    width: 32px;
  }

  .standings-table .status-pill {
    min-height: 20px;
    padding: 0 4px;
    gap: 3px;
    font-size: 0.64rem;
    line-height: 1.2;
  }

  .standings-table .status-pill svg {
    width: 10px;
    height: 10px;
  }

  .rounds-toolbar {
    margin-bottom: 8px;
    justify-content: flex-start;
  }

  .rounds-round {
    padding: 8px;
    margin-bottom: 8px;
  }

  .rounds-round__head {
    gap: 5px;
    margin-bottom: 6px;
  }

  .rounds-round__subline {
    gap: 5px;
  }

  .rounds-round__registration-summary {
    width: 100%;
    margin-left: 0;
  }

  .rounds-round__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .rounds-round__actions .rounds-action-btn {
    width: 100%;
    min-width: 0;
  }

  /* keep labels visible on mobile (master), no override needed */

  .rounds-slot__row {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .rounds-slot__name {
    flex: 1 1 calc(100% - 30px);
  }

  .rounds-panel__actions--stack {
    grid-template-columns: 1fr 1fr;
  }

  .rounds-group__head {
    margin-bottom: 5px;
  }

  .rounds-group {
    padding: 7px;
  }
}

.rounds-notice {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.rounds-notice--warn {
  color: #a05a00;
}

.promo-slot {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: var(--surface-muted);
  border-radius: var(--r-sm);
}

.promo-slot--empty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.promo-slot__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.promo-slot__name {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}

.rounds-preview {
  background: var(--accent-xsoft);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 0.85rem;
}

.rounds-preview__head {
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--text);
}

.rounds-preview__from {
  margin: 0 0 6px;
  color: var(--muted);
}

.rounds-preview ul {
  margin: 0 0 6px;
  padding-left: 18px;
}

.rounds-preview__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.standings-note td {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
  background: var(--surface-raised);
}

@media print {
  .topbar,
  .sidebar,
  .tabs,
  .mobile-priority-nav,
  .actions,
  .match-options,
  .match-date,
  .invite-row,
  .clear-match {
    display: none !important;
  }

  body {
    background: white;
  }

  .layout {
    display: block;
    padding: 0;
  }

  .view {
    display: block;
    margin-bottom: 24px;
  }

  .match-card,
  .table-wrap,
  .contact-item {
    box-shadow: none;
  }

  .auth-card {
    width: min(100%, 440px);
    padding: 26px 20px 24px;
    gap: 16px;
  }

  .onboarding-step {
    gap: 16px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-phone-field {
    padding: 16px;
    border-radius: 18px;
  }

  .onboarding-phone-field input,
  .onboarding-phone-field select {
    min-height: 56px;
    font-size: 1rem;
  }

  .onboarding-actions {
    margin-top: 4px;
  }

  .onboarding-actions .primary-button {
    width: min(176px, 100%);
  }

  .onboarding-footer {
    align-items: flex-start;
    flex-wrap: wrap;
    row-gap: 10px;
    padding-top: 10px;
  }
}

/* ─── Spielleiter-Dashboard ───────────────────────────────────────────────── */

.dashboard-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.dashboard-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dashboard-summary-head h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 1.15rem;
  white-space: nowrap;
}

.dashboard-summary-stat {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
  white-space: normal;
}

.dashboard-summary-stat-line {
  display: inline;
}

.dashboard-summary-stat-line + .dashboard-summary-stat-line::before {
  content: " \00b7 ";
}

.dashboard-progress-bar {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 99px;
  overflow: hidden;
}

.dashboard-progress-bar--total {
  height: 10px;
}

.dashboard-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.dashboard-history { margin-top: 2rem; }
.dashboard-history > h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.dashboard-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
.dashboard-history-row button { white-space: nowrap; }
.dashboard-history-row button.is-active {
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
}

@media (max-width: 640px) {
  .dashboard-history-row { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 520px) {
  .dashboard-summary {
    padding: 14px;
  }

  .dashboard-summary-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: 18px;
    row-gap: 4px;
  }

  .dashboard-summary-stat {
    justify-self: end;
    max-width: 100%;
    font-size: 0.82rem;
    text-align: right;
  }

  .dashboard-summary-stat-line {
    display: block;
  }

  .dashboard-summary-stat-line + .dashboard-summary-stat-line::before {
    content: none;
  }
}

.dashboard-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-group--done {
  border-color: #68c48e;
  background: #f2fbf5;
}

.dashboard-group--mid {
  border-color: #f0c040;
  background: #fffdf0;
}

.dashboard-group--behind {
  border-color: #e07050;
  background: #fff5f2;
}

.dashboard-group-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-group-score {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.dashboard-open-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.dashboard-open-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-open-list li {
  font-size: 0.82rem;
  color: var(--muted);
  padding-left: 10px;
  position: relative;
}

.dashboard-open-list li::before {
  content: "·";
  position: absolute;
  left: 2px;
}

.dashboard-match-counts {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  align-items: baseline;
}

.dashboard-count-planned { color: #b07a00; }
.dashboard-count-pending-result { color: var(--danger); }
.dashboard-count-open { color: var(--text); }
.dashboard-counts-sep { color: var(--muted); font-weight: 400; }

.dashboard-open-none {
  margin: 0;
  font-size: 0.82rem;
  color: #68c48e;
  font-weight: 600;
}

.dashboard-group-head {
  display: flex;
  align-items: center;
}

.dashboard-group-title {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
}

.dashboard-group-title:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.dashboard-mini-standings {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dashboard-standing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.dashboard-standing-row.is-qualified {
  font-weight: 750;
}

.dashboard-standing-rank {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.dashboard-standing-row.is-qualified .dashboard-standing-rank {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dashboard-standing-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-standing-wl {
  flex-shrink: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dashboard-open-matches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-open-match-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.dashboard-open-match {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 8px);
  background: var(--surface);
  color: var(--text);
  padding: 6px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tx-fast), border-color var(--tx-fast);
}

.dashboard-open-match--overdue {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.dashboard-match-title {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.dashboard-player-name {
  white-space: nowrap;
}

.dashboard-match-cal {
  flex-shrink: 0;
  color: #b07a00;
  display: flex;
  align-items: center;
  opacity: 0.85;
}

.dashboard-match-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.dashboard-match-status--overdue {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}

.dashboard-match-status--pending-result {
  color: var(--danger);
}

.dashboard-reminder-btn {
  flex: 0 0 32px;
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: #128c7e;
  border-color: rgba(18, 140, 126, 0.35);
  background: #ecf8f6;
}

.dashboard-reminder-btn svg {
  width: 14px;
  height: 14px;
}

.dashboard-reminder-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 8px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-reminder-menu button {
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 8px);
  background: var(--surface-muted);
  color: var(--text);
  min-height: 32px;
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.dashboard-reminder-menu button:hover {
  border-color: var(--accent);
  background: var(--accent-xsoft);
  color: var(--accent-strong);
}

.dashboard-open-match:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.dashboard-open-match .dashboard-vs {
  color: var(--muted);
  font-weight: 500;
  margin: 0 2px;
}

.dashboard-matches-more {
  margin-top: 4px;
}

.dashboard-matches-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-strong);
  padding: 3px 0;
  user-select: none;
}

.dashboard-matches-more > summary::-webkit-details-marker { display: none; }

.dashboard-toggle-open { display: none; }
.dashboard-matches-more[open] .dashboard-toggle-closed { display: none; }
.dashboard-matches-more[open] .dashboard-toggle-open { display: inline; }

.dashboard-matches-more > ul {
  margin-top: 4px;
}

/* Danger-Button (Löschen) */
.btn--danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn--danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* Klickbarer BETA-Badge */
.badge--clickable {
  cursor: pointer;
}

.beta-mode-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.beta-mode-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  flex-basis: 100%;
}
.badge--clickable:hover {
  opacity: 0.8;
}

/* Neuen Benutzer anlegen */
.new-user-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.new-user-panel__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
}

.new-user-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.new-user-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.new-user-form__field input,
.new-user-form__field select {
  min-width: 150px;
}

.new-user-form__checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  padding-bottom: 4px;
}

.new-user-preview {
  font-size: 0.82rem;
  color: var(--muted);
  align-self: flex-end;
  padding-bottom: 6px;
  white-space: nowrap;
}

.new-user-preview__username {
  font-weight: 700;
  color: var(--text);
  font-family: monospace;
}

.new-user-feedback {
  margin-top: 10px;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.new-user-feedback--ok {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-soft);
}

.new-user-feedback--err {
  background: #fef3e2;
  color: #8f2a2a;
  border-color: #f5cba7;
}
/* Turniere / KO-Raster */

.tournament-club-create,
.tournament-doubles-pairing__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tournament-club-create {
  justify-content: space-between;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line, #d7dce3);
  border-radius: 10px;
  background: var(--surface-soft, #f7f9fb);
}

.tournament-club-create > div {
  display: grid;
  gap: 3px;
}

.tournament-club-create span,
.tournament-club-create small {
  color: var(--text-muted, #667085);
}

.tournament-club-create .tournament-club-create__warning {
  color: #9a4c00;
  font-weight: 700;
}

.tournament-club-create .primary-button {
  white-space: nowrap;
}

.tournament-club-create__cohorts {
  display: grid;
  gap: 6px;
}

.tournament-club-create__cohort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tournament-club-create__cohort select {
  min-width: 140px;
}

.tournament-club-create__hint {
  color: var(--text-muted, #667085);
  flex-basis: 100%;
}

.tournament-doubles-pairing__list {
  display: grid;
  gap: 8px;
}

.tournament-doubles-pairing__row {
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line, #d7dce3);
}

.tournament-doubles-pairing__row select {
  min-width: 220px;
}

.tournament-seeded-draw {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.tournament-seeded-draw header h4,
.tournament-seeded-draw header p {
  margin: 0;
}

.tournament-seeded-draw header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tournament-seeded-draw ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 26px;
}

.tournament-seeded-draw__status {
  display: flex;
  align-items: center;
}

.tournament-seeded-draw li label {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

@media (max-width: 640px) {
  .tournament-club-create,
  .tournament-doubles-pairing__row {
    align-items: stretch;
    flex-direction: column;
  }

  .tournament-doubles-pairing__row select {
    min-width: 0;
  }

  .tournament-club-create .primary-button {
    width: 100%;
  }
}
.tournament-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (min-width: 761px) {
  .tournament-layout--vm-player {
    grid-template-columns: minmax(180px, 240px) minmax(640px, 920px);
  }

  .tournament-layout--vm-player .vm-planning {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.tournament-overview,
.tournament-detail,
.tournament-create {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tournament-overview,
.tournament-detail {
  padding: 14px;
}

.tournament-toolbar,
.tournament-detail__head,
.tournament-actions,
.ko-match__footer,
.ko-match__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tournament-toolbar h2,
.tournament-detail h3,
.ko-round h4 {
  margin: 0;
}

.tournament-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tournament-row-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tournament-row-wrap .tournament-row {
  flex: 1;
  min-width: 0;
}

.tournament-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.tournament-row.active,
.tournament-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tournament-row__name {
  font-weight: 700;
}

.vm-player-tournament__title-compact,
.vm-player-tournament__meta-compact {
  display: none;
}

.tournament-create {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  max-width: 100%;
  overflow: hidden;
}

.tournament-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.tournament-create label,
.tournament-player-picker,
.tournament-start-picker {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tournament-player-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tournament-player-picker__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tournament-create input,
.tournament-create select {
  min-width: 0;
  width: 100%;
}

.tournament-player-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

.tournament-player-option {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  column-gap: 8px !important;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.tournament-player-option input {
  margin: 0;
  justify-self: end;
  align-self: center;
}

.tournament-player-option__name {
  flex: 1 1 auto;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.tournament-player-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tournament-start-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tournament-start-slot.is-source {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26, 102, 71, 0.15);
}

.tournament-start-preview {
  align-self: start;
  position: sticky;
  top: var(--desktop-sticky-offset);
}

.tournament-start-preview__head {
  margin-bottom: 10px;
  align-items: flex-start;
}

.tournament-start-preview__head span:not(.badge) {
  color: var(--muted);
  font-size: 0.9rem;
}

.tournament-start-preview__head > div {
  display: grid;
  gap: 2px;
}

.tournament-start-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tournament-start-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
}

.tournament-start-match__label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.tournament-start-slot {
  display: grid;
  gap: 2px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px 7px;
  cursor: grab;
  user-select: none;
}

.tournament-start-slot:active {
  cursor: grabbing;
}

.tournament-start-slot small {
  color: var(--muted);
  font-size: 0.78rem;
}

.tournament-start-slot.is-bye {
  border-style: dashed;
  color: var(--muted);
  background: var(--surface-muted);
}

.tournament-start-slot.is-dragging {
  opacity: 0.55;
}

.tournament-start-slot.is-drop-target {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.unassigned-entrants-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.unassigned-entrants-panel header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.unassigned-entrants-panel header h4 {
  margin: 0;
}

.unassigned-entrants-panel header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.unassigned-entrants-panel__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.unassigned-entrant {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 12px;
  font-size: 0.86rem;
  cursor: grab;
  user-select: none;
}

.unassigned-entrant:active {
  cursor: grabbing;
}

.unassigned-entrant.is-dragging {
  opacity: 0.55;
}

.ko-bracket {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ko-bracket--single {
  grid-template-columns: minmax(0, 1fr);
}

.ko-bracket--tree {
  --ko-tree-card-h: 70px;
  --ko-tree-link-len: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: start;
  position: relative;
}

.ko-round {
  display: grid;
  align-content: start;
  gap: 10px;
}

.ko-round--tree {
  gap: 4px;
}

.ko-round__matches {
  display: grid;
  gap: 10px;
}

.ko-round--tree .ko-round__matches {
  gap: 10px;
  padding-right: calc(var(--ko-tree-link-len) + 8px);
}

.ko-bracket--geometric .ko-round__matches {
  position: relative;
}

.ko-bracket--geometric .ko-mini-match {
  position: absolute;
  left: 0;
  width: calc(100% - var(--ko-tree-link-len) - 8px);
  z-index: 2;
}

.ko-match {
  gap: 10px;
}

.ko-match--complete {
  border-color: var(--accent);
}

.ko-match--disabled {
  border-color: var(--border);
  background: var(--surface-muted);
}

.ko-match--disabled .match-state {
  color: var(--muted);
}

.double-ko-split-winners {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 10px 0;
  font-size: 0.88rem;
}

.double-ko-split-winners p {
  margin: 0;
}

.ko-match__head span,
.ko-match__head strong {
  font-size: 0.82rem;
  color: var(--muted);
}

.ko-match .player-name.is-winner {
  font-weight: 800;
  color: var(--accent-strong);
}

.ko-match .player-name.is-final-winner {
  font-size: 1.02rem;
  font-weight: 900;
  color: #0e553a;
}

.ko-match .result-hint.complete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ko-match__winner-trophy {
  display: inline-flex;
  flex: 0 0 auto;
  color: #c99818;
}

.ko-match__winner-trophy svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 0 rgba(123, 88, 0, 0.22));
}

.ko-match .player-name.is-loser {
  color: color-mix(in srgb, var(--text) 62%, var(--muted) 38%);
  text-decoration: line-through;
}

.ko-match .score-grid input.is-set-winner-score {
  font-weight: 800;
}

.ko-match__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tournament-actions {
  margin-top: 10px;
}

.tournament-result-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.tournament-result-setting__control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.tournament-result-setting__state {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.ko-view-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.ko-view-toggle__btn,
.ko-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.84rem;
  cursor: pointer;
}

.ko-view-toggle__btn.is-active,
.ko-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.ko-round-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ko-mini-match {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  padding: 4px;
  display: grid;
  gap: 3px;
  font-size: 0.72rem;
  min-height: var(--ko-tree-card-h);
  position: relative;
}

.ko-mini-match--complete {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line) 35%);
}

.ko-mini-match__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.1;
  min-width: 0;
}

.ko-mini-match__schedule {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ko-mini-match__meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  flex: 0 1 auto;
}

.ko-tree-availability {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 16px;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

button.ko-tree-availability {
  cursor: pointer;
}

.ko-tree-availability > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ko-tree-availability--ready {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.ko-tree-availability--partial {
  border-color: #efd384;
  background: #fdf3d8;
  color: #8a6d1a;
}

.ko-tree-availability--missing {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
}

.ko-tree-availability--disabled {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: var(--danger);
}

.ko-tree-availability--waiting,
.ko-tree-availability--no-window {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--muted);
}

.ko-tree-availability--scheduled {
  border-color: color-mix(in srgb, #2f6fb2 34%, var(--line));
  background: color-mix(in srgb, #2f6fb2 10%, var(--surface));
  color: #235c96;
}

.ko-tree-availability--bye {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--muted);
}

.ko-tree-availability--bye > span {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  font-size: 0.68rem;
  line-height: 1;
}

.ko-tree-availability--played {
  border-color: color-mix(in srgb, #3f5968 40%, var(--line));
  background: color-mix(in srgb, #3f5968 12%, var(--surface));
  color: #304957;
}

.ko-tree-availability--played > span {
  position: relative;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.ko-tree-availability--played > span::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 3px;
  height: 1px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
}

.ko-mini-match__grid {
  display: grid;
  grid-template-columns: minmax(60px, 1fr) 22px 22px 22px;
  gap: 1px 3px;
  align-items: center;
}

.ko-mini-match__grid > div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.15;
  min-height: 16px;
  display: flex;
  align-items: center;
}

.ko-mini-match__grid > div:nth-child(-n + 4) {
  justify-content: center;
  font-size: 0.62rem;
  color: var(--muted);
  background: var(--surface-muted);
}

.ko-mini-match__grid > div.is-set-winner {
  font-weight: 800;
}

.ko-mini-match__player.is-winner {
  font-weight: 800;
  color: var(--accent-strong);
}

.ko-seed-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  margin-left: 3px;
  padding: 0 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface) 84%);
  color: var(--accent-strong);
  font-size: 0.68em;
  font-weight: 900;
  line-height: 1.2;
}

.ko-mini-match__player.is-final-winner {
  font-weight: 900;
  color: #0e553a;
}

.ko-mini-match__player.is-loser {
  color: color-mix(in srgb, var(--text) 62%, var(--muted) 38%);
  text-decoration: line-through;
}

.ko-mini-match__player.is-draft-slot {
  border-style: dashed;
}

.ko-mini-match__player.is-draft-slot[draggable="true"] {
  cursor: grab;
}

.ko-mini-match__player.is-draft-slot.is-fixed-seed {
  cursor: default;
  border-style: solid;
}

.ko-mini-match__player.is-draft-slot.is-draft-bye {
  color: var(--muted);
  background: var(--surface-muted);
}

.ko-mini-match__player.is-draft-slot.is-dragging {
  cursor: grabbing;
  opacity: 0.45;
}

.ko-mini-match__player.is-draft-slot.is-drop-target {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface) 85%);
}

.ko-mini-match.has-next::after {
  content: "";
  position: absolute;
  right: calc(-1 * var(--ko-tree-link-len));
  top: 50%;
  width: var(--ko-tree-link-len);
  border-top: 1px solid var(--line);
}

.ko-mini-match.has-next::before {
  content: "";
  position: absolute;
  right: calc(-1 * var(--ko-tree-link-len));
  width: 0;
  border-right: 1px solid var(--line);
}

.ko-mini-match.has-next.pair-top::before {
  top: 50%;
  height: 0;
}

.ko-mini-match.has-next.pair-bottom::before {
  bottom: 50%;
  height: 0;
}

.ko-bracket--geometric .ko-mini-match.has-next::before,
.ko-bracket--geometric .ko-mini-match.has-next::after {
  content: none;
}

.ko-tree-connectors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.ko-tree-connector {
  position: absolute;
  display: block;
}

.ko-tree-connector--h {
  border-top: 1px solid var(--line);
}

.ko-tree-connector--v {
  border-left: 1px solid var(--line);
}

.ko-match .wo-buttons .wo-active {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.double-ko-bracket {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.double-ko-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.double-ko-section > h4 {
  margin: 0;
  font-size: 0.9rem;
}

.double-ko-section--losers {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line) 55%);
}

.double-ko-section--placement {
  border-color: color-mix(in srgb, #b46d00 48%, var(--line) 52%);
}

.double-ko-section--final {
  border-color: var(--accent);
}

.double-ko-section__matches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 10px;
}

.double-ko-section__matches .match-card {
  min-width: 0;
  padding: 14px;
}

.double-ko-section__matches .match-title {
  align-items: flex-start;
  gap: 8px;
}

.double-ko-section__matches .score-area {
  grid-template-columns: minmax(88px, 1fr) repeat(3, minmax(46px, 60px));
  column-gap: 6px;
}

.double-ko-section__matches .score-grid {
  font-size: 0.8rem;
}

.double-ko-section__matches .score-grid input {
  min-height: 40px;
}

.double-ko-section__matches .wo-buttons {
  min-width: 0;
}

.double-ko-section__matches .wo-buttons button {
  min-width: 0;
  padding-inline: 8px;
}

.double-ko-bracket--tree .double-ko-section__matches {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.double-ko-tree {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.double-ko-tree__section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.double-ko-tree__section > h4 {
  margin: 0;
  font-size: 0.9rem;
}

.double-ko-tree__section--losers {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line) 55%);
}

.double-ko-tree__section--placement {
  border-color: color-mix(in srgb, #b46d00 48%, var(--line) 52%);
}

.double-ko-tree__section--final {
  border-color: var(--accent);
}

.double-ko-tree__scroll {
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.double-ko-tree__bracket {
  margin-top: 0;
}

.double-ko-tree-match .ko-mini-match__player.is-placeholder,
.double-ko-overview-match .ko-mini-match__player.is-placeholder {
  color: var(--muted);
  border-style: dashed;
  font-weight: 600;
}

.double-ko-tree-match .ko-mini-match__player.has-origin,
.double-ko-overview-match .ko-mini-match__player.has-origin {
  cursor: pointer;
}

.double-ko-tree-match .ko-mini-match__player.has-origin:hover,
.double-ko-tree-match .ko-mini-match__player.has-origin:focus-visible,
.double-ko-overview-match .ko-mini-match__player.has-origin:hover,
.double-ko-overview-match .ko-mini-match__player.has-origin:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.double-ko-tree-match.is-jump-target,
.double-ko-overview-match.is-jump-target {
  animation: ko-source-focus 1.3s ease-out;
  border-color: var(--accent);
}

.double-ko-tree-match.can-open-detail {
  cursor: pointer;
}

.double-ko-tree-match.can-open-detail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.double-ko-tree-match.can-open-score .ko-mini-match__player.has-origin {
  cursor: pointer;
}

.ko-score-dialog-backdrop {
  position: fixed;
  top: var(--ko-score-dialog-viewport-top, 0px);
  right: 0;
  left: 0;
  height: var(--ko-score-dialog-viewport-height, 100dvh);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 24, 0.32);
}

.ko-score-dialog {
  position: relative;
  width: min(94vw, 560px);
  max-height: calc(var(--ko-score-dialog-viewport-height, 100dvh) - 36px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

html.ko-score-dialog-keyboard-open .ko-score-dialog-backdrop {
  place-items: start center;
  overflow-y: auto;
}

html.ko-score-dialog-keyboard-open .ko-score-dialog {
  margin-block: 12px;
}

@media (max-width: 700px) {
  .invite-message-dialog--score-confirm {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    inset: auto 12px max(12px, env(safe-area-inset-bottom));
    margin: 0;
  }
}

.ko-score-dialog__close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
}

.ko-score-dialog .ko-match__head {
  padding-right: 38px;
}

.ko-match__teams {
  display: grid;
  gap: 2px;
  margin: 0;
  line-height: 1.22;
}

.ko-match__team {
  overflow-wrap: anywhere;
}

.ko-match__versus {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.1;
}

.ko-score-dialog header,
.ko-score-dialog footer,
.ko-score-dialog__wo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ko-score-dialog header {
  justify-content: space-between;
}

.ko-score-dialog header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ko-score-dialog header span {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.ko-score-dialog__grid {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) repeat(3, 48px);
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.ko-score-dialog__grid > div {
  text-align: center;
}

.ko-score-dialog__grid label {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ko-score-dialog__grid input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  text-align: center;
  font-weight: 850;
}

.ko-score-dialog__grid input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(26, 102, 71, 0.18);
}

.ko-score-dialog__wo {
  flex-wrap: wrap;
}

.ko-score-dialog__wo span {
  color: var(--muted);
  font-weight: 800;
}

.ko-score-dialog__wo button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 6px 9px;
  color: var(--text);
  font-weight: 750;
}

.ko-score-dialog__wo button.is-active {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

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

@keyframes ko-source-focus {
  0% {
    background: color-mix(in srgb, var(--accent) 18%, var(--surface-raised) 82%);
    box-shadow: 0 0 0 3px rgba(26, 102, 71, 0.2);
  }
  100% {
    background: var(--surface-raised);
    box-shadow: none;
  }
}

@media (max-width: 760px) {
  .tournament-layout,
  .tournament-create-grid {
    grid-template-columns: 1fr;
  }

  .double-ko-section__matches {
    grid-template-columns: 1fr;
  }

  .tournament-start-grid {
    grid-template-columns: 1fr;
  }

  .tournament-start-preview {
    position: static;
  }

  .tournament-start-head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .tournament-start-head-actions > button {
    flex: 1 1 auto;
  }

  .tournament-player-picker__actions {
    width: 100%;
  }

  .tournament-player-picker__actions .icon-button {
    flex: 1 1 auto;
  }

  .ko-bracket {
    grid-template-columns: 1fr;
  }

  .ko-view-toggle {
    display: flex;
    width: 100%;
  }

  .ko-view-toggle__btn {
    flex: 1 1 auto;
  }

  .tournament-layout--vm-player {
    gap: 10px;
  }

  .tournament-layout--vm-player .tournament-overview {
    padding: 10px;
  }

  .tournament-layout--vm-player .tournament-toolbar {
    align-items: center;
  }

  .tournament-layout--vm-player .tournament-toolbar h2 {
    font-size: 0.95rem;
  }

  .tournament-layout--vm-player .tournament-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .tournament-layout--vm-player .tournament-row {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 6px;
    text-align: center;
  }

  .tournament-layout--vm-player .tournament-row__detail {
    display: none;
  }

  .tournament-layout--vm-player .tournament-row__name {
    font-size: 0.82rem;
  }

  .tournament-layout--vm-player .tournament-detail {
    padding: 12px;
  }

  .tournament-layout--vm-player .tournament-detail__head > div {
    min-width: 0;
  }

  .tournament-layout--vm-player .tournament-detail__head h3 {
    font-size: 1rem;
  }

  .tournament-layout--vm-player .tournament-detail__head > div > span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.78rem;
  }

  .tournament-layout--vm-player .vm-player-tournament__title-full,
  .tournament-layout--vm-player .vm-player-tournament__meta-full {
    display: none;
  }

  .tournament-layout--vm-player .vm-player-tournament__title-compact,
  .tournament-layout--vm-player .vm-player-tournament__meta-compact {
    display: inline;
  }
}

/* Vereinsmeisterschaft: interne Platz-/Zeitplanung */

.vm-schedule {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}

.vm-schedule__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.vm-schedule__position {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.vm-schedule__day,
.vm-schedule__slot,
.vm-schedule__slot-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vm-schedule__day label {
  color: var(--muted);
  font-size: 0.82rem;
}

.vm-planning {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.vm-planning__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vm-planning__head h4 {
  margin: 0;
}

.vm-planning__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-planning__action-button {
  min-height: 40px;
  padding: 8px 11px;
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  transition: border-color var(--tx-fast), background var(--tx-fast), color var(--tx-fast);
}

.vm-planning__action-button:hover,
.vm-planning__action-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-xsoft);
  color: var(--accent-strong);
}

.vm-planning__action-button:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.vm-planning__controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.vm-planning__my-match {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.vm-planning__selected-match {
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line) 66%);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface) 93%);
}

.vm-planning__selected-kicker,
.vm-planning__selected-context,
.vm-planning__selected-versus {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.vm-planning__selected-kicker {
  color: var(--accent-strong);
}

.vm-planning__selected-window {
  margin-top: 3px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 850;
}

.vm-planning__selected-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-planning__selected-player strong {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  line-height: 1.25;
}

.vm-planning__contact {
  display: inline-grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--accent-strong);
}

.vm-planning__contact:disabled {
  opacity: 0.55;
}

.vm-planning__match-picker,
.vm-planning__date-picker {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.vm-planning__date-picker select {
  min-height: 40px;
  color: var(--text);
  font-weight: 750;
}

.vm-planning-day-strip {
  display: grid;
  gap: 6px;
  width: 100%;
}

.vm-planning-day-strip__week {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.vm-planning-day-strip__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.vm-planning-day-strip__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 4px;
}

.vm-planning-day-strip__day {
  min-height: 38px;
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 0;
  cursor: pointer;
  transition: border-color var(--tx-fast), background var(--tx-fast), color var(--tx-fast), box-shadow var(--tx-fast);
}

.vm-planning-day-strip__day span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
}

.vm-planning-day-strip__day strong {
  color: inherit;
  font-size: 1rem;
  line-height: 1.05;
}

.vm-planning-day-strip__day:hover,
.vm-planning-day-strip__day:focus-visible {
  border-color: var(--accent);
  background: var(--accent-xsoft);
  color: var(--accent-strong);
}

.vm-planning-day-strip__day:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.vm-planning-day-strip__day.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 26%, transparent);
}

.vm-planning-day-strip__day.is-active span {
  color: rgba(255, 255, 255, 0.78);
}

.vm-planning-day-strip__day.is-disabled,
.vm-planning-day-strip__day:disabled {
  cursor: not-allowed;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--surface-muted);
  color: color-mix(in srgb, var(--muted) 72%, var(--surface) 28%);
  opacity: 0.58;
}

.vm-planning-day-strip__day.is-active.is-disabled,
.vm-planning-day-strip__day.is-active:disabled {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-muted) 84%);
  color: var(--accent-strong);
  opacity: 0.78;
}

.vm-planning-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}

.vm-planning-matrix th,
.vm-planning-matrix td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.vm-planning-matrix__time-head,
.vm-planning-matrix__time {
  width: 92px;
  min-width: 92px;
}

.vm-planning-matrix__time {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  white-space: normal;
  line-height: 1.15;
}

.vm-planning-matrix thead .vm-planning-matrix__time-head {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
}

.vm-planning-matrix__time-line,
.vm-planning-matrix__time-sep {
  display: block;
}

.vm-planning-matrix__time-sep {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vm-planning-matrix__court-short {
  display: none;
}

.vm-planning-matrix__cell--free {
  background: var(--surface);
}

.vm-planning-matrix__cell--blocked {
  background: var(--surface-muted);
  color: var(--muted);
  text-align: center;
}

.vm-planning-matrix__cell--bookable {
  cursor: pointer;
  background: #eaf6f0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.vm-planning-matrix__cell--bookable:hover {
  background: var(--accent-soft);
}

.vm-planning-matrix__cell--all-available {
  background: #eaf6f0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.vm-planning-matrix__availability {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
}

.vm-planning-matrix__availability--full {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.vm-planning-matrix__availability--partial {
  background: #fdf3d8;
  color: #8a6d1a;
}

.vm-planning-matrix__cell--busy {
  background: var(--accent-soft);
  white-space: normal;
}

.vm-planning-matrix__cell--external {
  background: #f3e8e8;
}

.vm-planning-matrix__cell--continued {
  background: var(--accent-soft);
  opacity: 0.55;
}

.vm-planning-matrix__label {
  font-size: 0.78rem;
  line-height: 1.3;
  display: grid;
  gap: 2px;
  white-space: normal;
}

.vm-planning-matrix__external-entry {
  display: grid;
  gap: 1px;
}

.vm-planning-matrix__external-entry + .vm-planning-matrix__external-entry {
  border-top: 1px solid rgba(138, 54, 54, 0.18);
  margin-top: 3px;
  padding-top: 3px;
}

.vm-planning-matrix__meta,
.vm-planning-matrix__players {
  display: block;
}

.vm-planning-matrix__meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1.2;
}

.vm-planning-matrix__players {
  overflow-wrap: anywhere;
}

/* Drag & Drop: ziehbare Matrixzelle (belegter Start eines Matches) */
.vm-planning-matrix__cell--draggable {
  cursor: grab;
}
.vm-planning-matrix__cell--draggable:active {
  cursor: grabbing;
}

.vm-planning-matrix__cell--dragging {
  opacity: 0.4;
}

.vm-planning-matrix__cell--drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: #eaf6f0;
}

.vm-planning-matrix__cell--draggable {
  position: relative;
}

.vm-planning-matrix__clear {
  position: absolute;
  top: 2px;
  right: 2px;
  line-height: 1;
  padding: 2px 4px;
}

.vm-round-schedule {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.vm-round-schedule__row {
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}

.vm-round-schedule__row:first-child {
  border-top: none;
}

.vm-round-schedule__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-round-schedule__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vm-round-schedule__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 8px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
}

.vm-round-schedule__chip .icon-button {
  padding: 0 4px;
}

.vm-round-schedule__add,
.vm-round-schedule__deadline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vm-round-schedule__deadline label {
  color: var(--muted);
  font-size: 0.82rem;
}

.vm-planning-list__list {
  list-style: none;
  margin: 6px 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 8px;
}

.vm-planning-list__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 0.85rem;
  min-width: 0;
}

.vm-planning-list__content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.vm-planning-list__meta,
.vm-planning-list__players {
  overflow-wrap: anywhere;
}

.vm-planning-list__meta {
  color: var(--muted);
  font-weight: 600;
}

.vm-planning-list__item--dragging {
  opacity: 0.4;
}

.vm-planning-list__drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.vm-planning-list__drag-handle:active {
  cursor: grabbing;
}

.vm-planning-list h5 {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.vm-planning-list__hint {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.vm-round-schedule__capacity {
  align-items: center;
  flex-wrap: wrap;
}

.vm-round-schedule__capacity label {
  display: grid;
  gap: 2px;
  font-size: 0.72rem;
}

.vm-round-schedule__capacity input {
  width: 94px;
  min-height: 30px;
}

.vm-round-schedule__bulk {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-muted);
}

.vm-round-schedule__bulk-head,
.vm-round-schedule__bulk-footer,
.vm-round-schedule__bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vm-round-schedule__bulk-head {
  justify-content: space-between;
}

.vm-round-schedule__bulk-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}

.vm-round-schedule__bulk-target {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 0.82rem;
}

.vm-round-schedule__bulk-target span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.vm-round-schedule__bulk-target em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.74rem;
}

.vm-round-schedule__bulk-overwrite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.vm-round-schedule__bulk-preview {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-xsoft);
  font-size: 0.82rem;
}

.vm-control {
  display: grid;
  gap: 14px;
  margin: 14px 0;
  min-width: 0;
}

.vm-control__head,
.vm-control-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.vm-control__head {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--surface) 0%, var(--accent-xsoft) 100%);
  box-shadow: var(--shadow-sm);
}

.vm-control__head h3,
.vm-control-panel h4,
.vm-control__head p {
  margin: 0;
}

.vm-control__head h3 {
  margin: 2px 0 3px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.vm-control__head > div > p:last-child,
.vm-control-panel small {
  color: var(--muted);
}

.vm-control__eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vm-control__metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.vm-control-metric,
.vm-control-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.vm-control-metric {
  display: grid;
  gap: 2px;
  padding: 12px 13px;
}

.vm-control-metric > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.vm-control-metric strong {
  color: var(--accent-strong);
  font-size: 1.6rem;
  line-height: 1.05;
}

.vm-control-metric small {
  color: var(--muted);
  font-size: 0.68rem;
}

.vm-control__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 12px;
  align-items: start;
}

.vm-control-panel {
  display: grid;
  gap: 11px;
  padding: 14px;
}

.vm-control-panel--wide {
  grid-column: 1 / -1;
}

.vm-control-panel__head h4 {
  font-size: 1rem;
}

.vm-control-panel__head > span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.auth-form .secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  transition: background var(--tx-fast), border-color var(--tx-fast), color var(--tx-fast);
}

.auth-form .secondary-button:hover {
  border-color: var(--accent);
  background: var(--accent-xsoft);
  color: var(--accent-strong);
}

.remember-device {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px !important;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
}

.remember-device input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.remember-device span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

.remember-device-note {
  margin: -6px 0 0 26px;
  color: var(--muted);
  font-size: 0.78rem;
}

.google-button {
  gap: 10px;
}

.google-mark {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

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

.vm-control__action-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 40px;
  padding: 8px 11px;
  font-size: 0.82rem;
  font-weight: 750;
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: none;
}

.vm-control__action-button:hover,
.vm-control__action-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-xsoft);
}

.vm-control__action-button:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.vm-control__progress {
  height: 7px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--surface-muted);
}

.vm-control__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.vm-control__link-list,
.vm-control__reason-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vm-control__link-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-raised);
  color: var(--text);
  text-align: left;
  font-size: 0.82rem;
  font-weight: 750;
  box-shadow: none;
}

.vm-control__link-list button:hover,
.vm-control__link-list button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-xsoft);
}

.vm-control__link-list button:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.vm-control__link-list button > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.vm-control__link-list strong,
.vm-control__link-list small {
  overflow-wrap: anywhere;
}

.vm-control__link-list strong {
  font-size: 0.82rem;
}

.vm-control__link-list small {
  font-size: 0.74rem;
  line-height: 1.3;
}

.vm-control__reason-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--surface-muted);
  color: var(--muted);
  font-size: 0.76rem;
}

.vm-control__reason-list strong {
  color: var(--text);
}

.vm-control__ok {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.vm-control-availability__summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.vm-control-availability__hint {
  margin: -2px 0 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
  line-height: 1.35;
}

.vm-control-availability__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.vm-control-availability__segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.vm-control-availability__segmented button {
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.vm-control-availability__segmented button:hover,
.vm-control-availability__segmented button:focus-visible,
.vm-control-availability__segmented button.is-active {
  background: var(--surface);
  color: var(--accent-strong);
}

.vm-control-availability__segmented button:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: 1px;
}

.vm-control-availability__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.vm-control-availability__table th,
.vm-control-availability__table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.vm-control-availability__table th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.vm-control-availability__row {
  cursor: pointer;
}

.vm-control-availability__row:hover,
.vm-control-availability__row:focus-visible {
  background: var(--accent-xsoft);
}

.vm-control-availability__row:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.18);
  outline-offset: -3px;
}

.vm-control-availability__status {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  color: var(--muted);
}

.vm-control-availability__status strong {
  color: var(--text);
}

.vm-control-availability__status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.vm-control-availability__status--partial::before {
  background: #c98912;
}

.vm-control-availability__status--complete::before {
  background: var(--accent);
}

.vm-control-availability__missing-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
}

.vm-control-availability__missing-player {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.vm-control-availability__contact {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 7px;
}

.vm-control-availability__contact svg {
  width: 14px;
  height: 14px;
}

.vm-control-availability__detail {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.vm-control-availability__detail svg {
  width: 14px;
  height: 14px;
}

.vm-control-availability-detail {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.vm-control-availability-detail__head,
.vm-control-availability-detail__tournament summary,
.vm-control-availability-detail__entry-head,
.vm-control-availability-detail__player-head,
.vm-control-availability-detail__matchup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tournament-actions label {
  min-width: min(100%, 220px);
}

.vm-control-availability-detail__head h5,
.vm-control-availability-detail__entry-head h6 {
  margin: 0;
  font-size: 0.92rem;
}

.vm-control-availability-detail__head span,
.vm-control-availability-detail__tournament summary span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.vm-control-availability-detail__tournament {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.vm-control-availability-detail__tournament summary {
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.vm-control-availability-detail__tournament summary::-webkit-details-marker {
  display: none;
}

.vm-control-availability-detail__tournament summary small,
.vm-control-availability-detail__entry-head p {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.vm-control-availability-detail__entries {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.vm-control-availability-detail__entry {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.vm-control-availability-detail__players {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.vm-control-availability-detail__player {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-muted);
}

.vm-control-availability-detail__player-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.74rem;
  font-weight: 800;
}

.vm-control-availability-detail__player-state.is-complete {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-strong);
}

.vm-control-availability-detail__empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.vm-control-availability-detail__matchup {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.vm-control-availability-detail__matches {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.vm-control-availability-detail__matches h6 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.vm-control-availability-detail__matchup-head small,
.vm-control-availability-detail__schedule {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.vm-control-availability-detail__matchup .availability-pills {
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .vm-control__metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .vm-control__head {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .vm-control__head .btn,
  .vm-control__action-button {
    width: 100%;
  }

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

  .vm-control__workspace,
  .vm-control__actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .vm-control-availability-detail__head,
  .vm-control-availability-detail__tournament summary,
  .vm-control-availability-detail__entry-head,
  .vm-control-availability-detail__player-head,
  .vm-control-availability-detail__matchup-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .vm-control__action-button,
  .vm-control__link-list button {
    min-height: 44px;
  }

  .vm-control-metric {
    padding: 10px;
  }

  .vm-control-metric strong {
    font-size: 1.35rem;
  }

  .vm-planning {
    padding: 12px 10px;
  }

  .vm-planning__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .vm-planning__actions,
  .vm-planning__actions .btn {
    width: 100%;
  }

  .vm-planning__controls {
    display: grid;
    gap: 8px;
    align-items: stretch;
  }

  .vm-planning__controls label,
  .vm-planning__controls select,
  .vm-planning__controls input,
  .vm-planning__my-match {
    width: 100%;
    min-width: 0;
  }

  .vm-planning__my-match {
    font-size: 0.85rem;
  }

  .vm-planning-day-strip__week {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .vm-planning-day-strip__label {
    font-size: 0.7rem;
  }

  .vm-planning-day-strip__days {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 3px;
  }

  .vm-planning-day-strip__day {
    min-height: 34px;
    padding: 3px 4px;
  }

  .vm-planning-day-strip__day strong {
    font-size: 0.92rem;
  }

  .vm-planning-list__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .vm-planning-matrix {
    min-width: 448px;
    font-size: 0.76rem;
  }

  .vm-planning-matrix th,
  .vm-planning-matrix td {
    padding: 6px 6px;
  }

  .vm-planning-matrix__time-head,
  .vm-planning-matrix__time {
    width: 86px;
    min-width: 86px;
  }

  .vm-planning-matrix__court-full {
    display: none;
  }

  .vm-planning-matrix__court-short {
    display: inline;
  }

  .vm-planning-matrix__label {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .vm-planning-matrix__meta {
    font-size: 0.68rem;
  }

  .vm-planning-matrix__players {
    line-height: 1.15;
  }
}

/* Öffentlicher Spielplan (ohne Login) */

.public-schedule-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.public-schedule-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.public-schedule-list {
  display: grid;
  gap: 12px;
}

.public-schedule-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.public-schedule-card__time {
  font-weight: 750;
  color: var(--accent-strong, var(--accent));
}

.public-schedule-card__meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 2px 0 4px;
}

.public-schedule-matrix {
  display: none;
}

@media (min-width: 701px) {
  .public-schedule-matrix {
    display: block;
    margin-top: 24px;
  }
}

.public-club-championship-page {
  min-height: 100vh;
  background: var(--bg);
}

.public-club-championship-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 14px 36px;
}

.public-club-championship-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.public-club-championship-logo {
  display: block;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
}

.public-club-championship-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.public-club-championship-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.public-club-championship-header h1,
.public-club-championship-header p {
  margin: 0;
}

.public-club-championship-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.public-vm-days {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}

.public-vm-day {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
}

.public-vm-day h2 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
}

.public-vm-day-list {
  display: grid;
  gap: 10px;
}

.public-vm-day-match {
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.public-vm-day-match:first-child {
  padding-top: 0;
  border-top: 0;
}

.public-vm-day-match__slot {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
}

.public-vm-day-match__event {
  margin-top: 3px;
  font-size: 0.84rem;
  font-weight: 760;
  line-height: 1.25;
}

.public-vm-day-match__players {
  display: grid;
  gap: 1px;
  margin-top: 5px;
  font-size: 0.9rem;
  line-height: 1.25;
}

.public-vm-day-match__players span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.public-vm-day-match__players small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.public-vm-day-match__result {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.25;
}

.public-vm-day-match__result strong {
  font-weight: 820;
}

.public-vm-day-match__status {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.public-vm-day-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

@media (min-width: 701px) {
  .public-club-championship-header {
    gap: 16px;
  }

  .public-club-championship-logo {
    width: 84px;
    height: 84px;
  }

  .public-vm-days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .public-club-championship-header {
    gap: 10px;
  }

  .public-club-championship-logo {
    width: 62px;
    height: 62px;
  }
}

.vm-empty-hint {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.vm-overview {
  display: grid;
  gap: 16px;
}

.vm-overview-section {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.vm-overview-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.vm-overview-registration {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.vm-overview-registration:first-child {
  border-top: none;
  padding-top: 0;
}

.vm-overview-registration__title {
  font-weight: 750;
}

.vm-overview-registration__status {
  color: var(--muted);
  font-size: 0.85rem;
}

.vm-overview-next-match__title {
  font-weight: 750;
  margin-bottom: 4px;
}

.vm-my-matches__participation {
  padding: 11px 14px;
  box-shadow: none;
}

.vm-my-matches__participation h3 {
  margin-bottom: 5px;
}

.vm-my-matches__participation .vm-overview-registration {
  padding: 0;
}

.vm-availability-section__hint {
  margin-bottom: 12px;
}

.vm-match-bucket {
  margin-bottom: 20px;
}

.vm-match-bucket:last-child {
  margin-bottom: 0;
}

.vm-match-bucket h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.my-matches-filter {
  max-width: 860px;
  margin-bottom: 14px;
}

.my-matches-filter label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.my-matches-filter select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 750;
}

.my-matches-filter__context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.my-matches-filter__context button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
}

.player-match-list {
  display: grid;
  gap: 20px;
  max-width: 860px;
}

.player-match-list--loading .empty-state {
  min-height: 92px;
  display: grid;
  place-items: center;
}

.player-match-section h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.player-match-card {
  margin-bottom: 9px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.player-match-card--openable {
  cursor: pointer;
}

.player-match-card--openable:hover {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface) 94%);
}

.player-match-card--openable:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.24);
  outline-offset: 2px;
}

.player-match-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.player-match-card__context {
  min-width: 0;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.3;
}

.player-match-card__status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
}

.player-match-card__status--scheduled {
  background: color-mix(in srgb, #2474b8 14%, var(--surface) 86%);
  color: #1e5b91;
}

.player-match-card__status--ready {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface) 86%);
  color: var(--accent-strong);
}

.player-match-card__status--waiting {
  background: color-mix(in srgb, #9a6d00 14%, var(--surface) 86%);
  color: #765300;
}

.player-match-card__status--completed {
  background: color-mix(in srgb, #5f6870 12%, var(--surface) 88%);
}

.player-match-card__pairing {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.player-match-card__appointment,
.player-match-card__result {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  font-size: 0.87rem;
  line-height: 1.35;
}

.player-match-card__appointment {
  color: var(--accent-strong);
  font-weight: 750;
}

.player-match-card__result {
  color: var(--text);
  font-weight: 700;
}

.player-match-card__action {
  min-height: 38px;
  width: 100%;
  margin-top: 11px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
}

.player-match-card__action--danger {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface) 90%);
  color: var(--danger);
}

@media (min-width: 760px) {
  .player-match-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .player-match-section {
    min-width: 0;
  }
}

.player-tournaments {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.player-tournament-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.player-tournament-list {
  display: grid;
  gap: 9px;
}

.player-tournament-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 13px 14px;
  color: inherit;
  text-align: left;
  font: inherit;
}

.player-tournament-card__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.player-tournament-card__main strong,
.player-tournament-card__main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-tournament-card__main span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.player-tournament-card__state {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
}

.player-tournament-detail {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.player-tournament-back {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 11px;
  font: inherit;
  font-weight: 800;
}

.player-tournament-back--inline {
  margin-top: 4px;
}

.player-tournament-detail__body {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.player-tournament-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.player-tournament-detail__head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.player-tournament-detail__head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.player-tournament-detail__head--compact {
  margin: 12px 0 10px;
}

.player-tournament-detail__head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.player-tournament-competitions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.player-tournament-competition {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  padding: 11px 12px;
  text-align: left;
  font: inherit;
}

.player-tournament-competition.is-selected {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line) 52%);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface) 93%);
}

.player-tournament-competition__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.player-tournament-competition__main strong,
.player-tournament-competition__main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-tournament-competition__main span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.player-tournament-competition-detail {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.player-tournament-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
}

.player-tournament-action {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 850;
}

.player-tournament-action.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  color: var(--accent-strong);
}

.player-tournament-embedded {
  min-width: 0;
  margin-top: 4px;
}

.player-tournament-embedded .tournament-layout {
  gap: 12px;
}

.player-tournament-detail__hint {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.vm-match-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.vm-match-card__tournament {
  font-size: 0.8rem;
  color: var(--muted);
}

.vm-match-card__players {
  font-weight: 750;
  margin: 2px 0;
}

.vm-match-card__status {
  font-size: 0.85rem;
  color: var(--muted);
}

.vm-match-card--pending {
  padding: 10px 12px;
}

.vm-match-card--schedule-ready {
  cursor: pointer;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line) 58%);
}

.vm-match-card--schedule-ready:focus-visible {
  outline: 3px solid rgba(26, 102, 71, 0.24);
  outline-offset: 2px;
}

.vm-match-card--schedule-ready:hover {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface) 93%);
}

.vm-match-card__schedule-window {
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.3;
}

.vm-match-card__schedule-action {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  margin-top: 9px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
}

.vm-match-card__schedule-action:active {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface) 80%);
}

.vm-match-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vm-match-card__availability-action {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.vm-pending-card__context {
  margin-top: 3px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
}

.vm-pending-card__teams {
  display: grid;
  gap: 2px;
  margin: 8px 0 7px;
}

.vm-pending-card__opponent {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-pending-card__opponent .vm-pending-card__team {
  flex: 1 1 auto;
}

.vm-pending-card__contact {
  display: inline-grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--accent-strong);
}

.vm-pending-card__contact:disabled {
  opacity: 0.55;
}

.vm-pending-card__team {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
}

.vm-pending-card__versus {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

.vm-contact-dialog {
  width: min(92vw, 390px);
  max-width: calc(100vw - 20px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.vm-contact-dialog::backdrop {
  background: rgba(23, 32, 24, 0.42);
}

.vm-contact-dialog__panel {
  padding: 16px;
}

.vm-contact-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.vm-contact-dialog__head h3 {
  margin: 0;
  font-size: 1rem;
}

.vm-contact-dialog__body {
  display: grid;
  gap: 10px;
}

.vm-contact-dialog__contact {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.vm-contact-dialog__contact strong {
  display: block;
  margin-bottom: 8px;
}

.vm-contact-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.vm-contact-dialog__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.vm-contact-dialog__action--whatsapp {
  color: #177a4b;
}

.vm-contact-dialog__empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.vm-match-availability-dialog {
  width: min(96vw, 760px);
  max-width: calc(100vw - 16px);
  max-height: min(90vh, 760px);
  overflow: hidden;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.vm-match-availability-dialog[open] {
  display: flex;
  flex-direction: column;
}

.vm-match-availability-dialog::backdrop {
  background: rgba(23, 32, 24, 0.42);
}

.vm-match-availability-dialog__panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
}

.vm-match-availability-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.vm-match-availability-dialog__head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.vm-match-availability-dialog__head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.vm-match-availability-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.vm-match-availability__day h4 {
  margin: 0 0 7px;
  font-size: 0.9rem;
}

.vm-match-availability__table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.75rem;
}

.vm-match-availability__table th,
.vm-match-availability__table td {
  box-sizing: border-box;
  height: 40px;
  padding: 3px;
  vertical-align: middle;
}

.vm-match-availability__table th:first-child,
.vm-match-availability__table td:first-child {
  width: 46px;
}

.vm-match-availability__table th {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.68rem;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.15;
}

.vm-match-availability__table th:first-child {
  text-align: left;
}

.vm-match-availability__table th.is-current-user {
  color: var(--accent-strong);
}

.vm-match-availability__table tr.is-common td,
.vm-match-availability__table tr.is-common th {
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}

.vm-match-availability__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.vm-match-availability__cell.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.vm-match-availability__cell.is-own {
  cursor: pointer;
}

.vm-match-availability__legend {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.vm-match-availability__legend span {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.vm-match-availability__you {
  color: var(--muted);
  font-weight: 700;
}

.vm-match-availability__badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  vertical-align: middle;
}

.vm-match-availability__table tr.is-no-court td,
.vm-match-availability__table tr.is-no-court th {
  background: var(--surface-muted);
}

.vm-match-availability__no-court {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.vm-match-availability-dialog .table-wrap {
  overflow-x: hidden;
}

@media (max-width: 520px) {
  .vm-match-availability-dialog__panel {
    padding: 12px;
  }

  .vm-match-availability-dialog__head {
    gap: 8px;
    margin-bottom: 10px;
  }

  .vm-match-availability-dialog__body {
    gap: 10px;
  }

  .vm-match-availability__day h4 {
    margin: 0 0 5px;
    font-size: 0.84rem;
  }

  .vm-match-availability__badge {
    font-size: 0.6rem;
  }
}

@media (max-width: 700px) {
  .vm-match-availability-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto;
  }
}

.vm-match-card--complete {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line) 52%);
  padding: 0;
}

.vm-result-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 9px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, var(--surface) 90%), var(--surface));
}

.vm-result-card__context {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.vm-result-card__state {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.vm-result-card__grid {
  display: grid;
  grid-template-columns: minmax(144px, 1fr) repeat(3, 46px);
  gap: 4px;
  align-items: stretch;
  padding: 0 14px 10px;
}

.vm-result-card__set-label,
.vm-result-card__score,
.vm-result-card__player {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.vm-result-card__set-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.vm-result-card__player {
  display: flex;
  align-items: center;
  padding: 5px 7px;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.22;
}

.vm-result-card__score {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  font-size: 0.95rem;
}

.vm-result-card__score.is-set-winner {
  font-weight: 850;
}

.vm-result-card__winner {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 14px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 850;
}

.vm-result-card__winner svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #c99818;
  filter: drop-shadow(0 1px 0 rgba(123, 88, 0, 0.22));
}

.vm-result-card__schedule,
.vm-result-card__walkover {
  margin: 0 14px 12px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface) 84%);
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.vm-result-card__walkover {
  margin-top: 0;
  margin-bottom: 10px;
}

@media (max-width: 420px) {
  .vm-result-card__grid {
    grid-template-columns: minmax(102px, 1fr) repeat(3, 40px);
    gap: 3px;
    padding-inline: 10px;
  }

  .vm-result-card__player {
    padding-inline: 5px;
    font-size: 0.78rem;
  }

  .vm-result-card__set-label {
    font-size: 0.64rem;
  }
}

.vm-schedule-list {
  display: grid;
  gap: 8px;
}

.vm-schedule-row {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 10px 14px;
}

.vm-schedule-row--own {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.vm-schedule-row__when {
  font-size: 0.8rem;
  color: var(--muted);
}

.vm-schedule-row__match {
  font-weight: 750;
  margin-top: 2px;
}

.ko-slot-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-strong);
  padding: 0;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.ko-slot-change__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.ko-slot-change__icon svg {
  width: 11px;
  height: 11px;
}

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

.ko-slot-change--fill-bye {
  border-color: color-mix(in srgb, #2f6fb2 30%, var(--line));
  background: color-mix(in srgb, #2f6fb2 9%, var(--surface));
  color: #235c96;
}

.ko-active-change-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  background: rgba(20, 26, 32, 0.38);
  padding: 16px;
}

.ko-active-change-dialog {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(20, 26, 32, 0.22);
  padding: 14px;
}

.ko-active-change-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ko-active-change-dialog h4,
.ko-active-change-dialog p {
  margin: 0;
}

.ko-active-change-dialog header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.ko-active-change-dialog__select {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 0.86rem;
  font-weight: 800;
}

.ko-active-change-dialog__select select {
  width: 100%;
}

.booking-form {
  display: grid;
  gap: 10px;
  margin: 14px 0 20px;
}

.booking-date-navigation {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}

.booking-date-arrow {
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 3rem;
  font-weight: 350;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: color 160ms ease, transform 160ms ease;
}

.booking-date-arrow:active,
.booking-date-arrow--long-press {
  color: var(--accent);
  transform: scale(1.08);
}

.booking-date-current {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #ef4f4f;
  font-weight: 650;
  text-align: center;
  text-transform: capitalize;
}

.booking-date-current input {
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  cursor: pointer;
}

.booking-date-current input::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

.booking-form label {
  display: grid;
  gap: 5px;
  font-weight: 750;
}

.booking-form input,
.booking-form select {
  min-height: 42px;
  width: 100%;
}

.booking-court-list,
.booking-own-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.booking-court-card,
.booking-own-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.booking-court-card h4 {
  margin: 0 0 8px;
}

.booking-allocation,
.booking-own-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.booking-allocation--own {
  color: var(--accent, #176b4d);
}

@media (min-width: 700px) {
  .booking-form {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
  }
}

.booking-grid {
  display: grid;
  grid-template-columns: 54px repeat(var(--booking-court-count), minmax(92px, 1fr));
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin: 12px 0 24px;
}

.booking-grid-corner,
.booking-grid-head,
.booking-grid-time,
.booking-grid-cell {
  min-height: 52px;
  border-right: 1px solid var(--line);
  border-bottom: 1px dotted var(--line);
}

.booking-grid-head {
  display: grid;
  place-items: center;
  padding: 6px;
  background: #eef0f4;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.booking-grid-time {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 5px 7px 0 0;
  color: #a0a7ad;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface, #fff);
}

.booking-grid-time--hour {
  color: var(--text);
  font-weight: 750;
}

.booking-grid-time--half {
  font-size: 0.68rem;
  padding-top: 7px;
}

.booking-grid-cell {
  display: grid;
  place-items: center;
  padding: 0;
  background: #fff;
  color: #4b9f69;
  cursor: pointer;
}

.booking-grid-cell--free:hover {
  background: #e9faed;
}

.booking-grid-cell--free span {
  width: 9px;
  height: 9px;
  overflow: hidden;
  color: transparent;
  background: #9be4b2;
}

.booking-grid-cell--past {
  background: #f7f8f9;
  color: #c3c8cc;
  cursor: not-allowed;
}

.booking-grid-cell--past span {
  width: auto;
  height: auto;
  background: transparent;
  color: #c3c8cc;
  font-size: 0.85rem;
}

.booking-grid-cell--occupied {
  background: #f1f3f5;
  color: var(--muted);
  cursor: default;
  font-size: 0.72rem;
  min-height: 104px;
}

.booking-grid-cell--own {
  background: #e3f9e7;
  color: #237442;
  cursor: grab;
}

.booking-grid-cell--own:active,
.booking-grid-cell--dragging {
  cursor: grabbing;
  opacity: 0.65;
}

.booking-grid-cell--covered {
  visibility: hidden;
}

.booking-composer-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 12px;
  background: rgb(20 31 28 / 0.48);
}

.booking-composer {
  width: min(100%, 680px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 18px;
  border-radius: 18px 18px 12px 12px;
  background: var(--surface, #fff);
  box-shadow: 0 -8px 30px rgb(0 0 0 / 0.2);
}

.booking-composer > header,
.booking-composer__selected,
.booking-composer__owner,
.booking-composer__submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.booking-composer header h3,
.booking-composer h4,
.booking-composer h5 {
  margin: 0;
}

.booking-composer__kind-buttons,
.booking-composer__actions,
.booking-composer__search-results {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.booking-composer__kind-buttons .primary-button {
  min-height: 64px;
  display: grid;
  justify-items: start;
}

.booking-composer__kind-buttons small { font-weight: 500; }
.booking-composer__summary,
.booking-composer__final,
.booking-composer__position,
.booking-composer__search {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.booking-composer__summary { color: var(--muted); font-size: 0.92rem; }
.booking-composer__participants { margin-top: 18px; }
.booking-composer__owner { margin-top: 10px; padding: 10px 0; font-size: 0.95rem; }
.booking-composer__position h5 { font-size: 0.92rem; }
.booking-composer__guest { display: grid; gap: 5px; font-weight: 700; }
.booking-composer__guest input,
.booking-composer__search input { min-height: 46px; width: 100%; }
.booking-composer__submit { margin-top: 18px; }
.booking-composer__submit button { min-height: 48px; }

@media (min-width: 700px) {
  .booking-composer-backdrop { align-items: center; }
  .booking-composer { border-radius: 16px; }
  .booking-composer__kind-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-composer__actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.booking-court-list {
  display: none;
}
/* Phase 8: Vereinsnews */
.news-list { display: grid; gap: 16px; }
.news-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.news-card__media { display: grid; width: 100%; height: clamp(150px, 28vw, 240px); place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.news-card__image { display: block; width: 100%; height: 100%; object-fit: contain; }
.news-card__content { padding: 16px; }
.news-card__content h2, .news-card__content h3 { margin: 4px 0 8px; line-height: 1.25; }
.news-card__content p { white-space: normal; line-height: 1.5; }
.news-card__meta { margin-bottom: 0; }
.news-card__summary { margin-bottom: 0; overflow-wrap: anywhere; }
.news-card__actions { display: flex; gap: 8px; margin-top: 12px; }
.news-editor { margin-bottom: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.news-editor form { display: grid; gap: 12px; }
.news-editor label { display: grid; gap: 5px; }
.news-editor textarea { resize: vertical; }
.public-news-page { max-width: 720px; margin: 0 auto; padding: 28px 16px; }
@media (min-width: 800px) { .news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .news-editor { max-width: 720px; } }

/* App shell 2.0: feste Mitglieder-Navigation und kontextbezogene Turnier-Navigation */
.layout.layout--without-groups {
  grid-template-columns: minmax(0, 1fr);
}

.content--without-groups {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.desktop-shell-nav,
.tournament-context-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.desktop-shell-nav {
  position: sticky;
  top: var(--desktop-sticky-offset, 88px);
  z-index: 8;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-sm);
}

.shell-nav-button,
.tournament-context-nav__button,
.mobile-member-nav__button,
.mobile-shell-more__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 750;
  white-space: nowrap;
}

.shell-nav-button:hover,
.tournament-context-nav__button:hover,
.mobile-shell-more__button:hover {
  background: var(--surface-muted);
}

.shell-nav-button.active,
.tournament-context-nav__button.active,
.mobile-member-nav__button.active,
.mobile-shell-more__button.active {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.shell-nav-icon {
  display: inline-flex;
  min-width: 18px;
  justify-content: center;
  font-weight: 900;
}

[data-unread-count]:not([data-unread-count=""])::after {
  content: attr(data-unread-count);
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding-inline: 3px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
  line-height: 1;
}

.tournament-context-nav {
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--line);
}

.tournament-context-nav__button {
  min-height: 36px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.shell-landing {
  display: grid;
  gap: 20px;
  padding: clamp(4px, 1vw, 12px) 0;
}

.shell-landing__hero {
  padding: clamp(14px, 2.5vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-xsoft) 100%);
  box-shadow: var(--shadow-sm);
}

.shell-landing__hero h2,
.shell-landing__hero p {
  margin: 0;
}

.shell-landing__hero h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.home-section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.section-heading {
  display: flex;
  min-height: 44px;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-heading .kicker,
.section-heading h2 {
  margin: 0;
}

.section-heading h2 {
  margin-top: 2px;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.section-heading__action {
  min-height: 44px;
  padding-inline: 8px;
  color: var(--accent-strong);
  font-weight: 750;
}

.news-list--home {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-card--preview .news-card__media {
  height: clamp(140px, 19vw, 210px);
}

.news-card--preview .news-card__content {
  padding: 14px;
}

.news-card--preview .news-card__summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.shell-quick-actions,
.administration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shell-quick-actions button,
.administration-grid button {
  display: grid;
  min-height: 76px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.shell-quick-actions button:hover,
.administration-grid button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.shell-quick-actions__icon {
  color: var(--accent-strong);
  font-size: 1.2rem;
  line-height: 1;
}

.administration-grid span {
  color: var(--muted);
  font-weight: 600;
}

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

.administration-grid button {
  min-height: 126px;
  align-content: start;
  justify-items: start;
  gap: 7px;
  padding: 18px;
  text-align: left;
}

.administration-mode-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #d9b86c;
  border-radius: 14px;
  background: #fff8e8;
}

.administration-mode-hint p {
  margin: 4px 0 0;
}

/* Verwaltungs-Shell: Bestehende fachliche Views bleiben unverändert und werden
   auf Desktop in einen klar abgegrenzten Arbeitsbereich eingebettet. */
.content--administration {
  display: grid;
  grid-template-columns: minmax(206px, 244px) minmax(0, 1fr);
  column-gap: clamp(20px, 3vw, 40px);
  row-gap: 16px;
  width: min(100%, 1540px);
}

.content--administration > .desktop-shell-nav,
.content--administration > .tournament-context-nav {
  grid-column: 1 / -1;
}

.administration-sidebar {
  grid-column: 1;
  grid-row: span 20;
  align-self: start;
  position: sticky;
  top: calc(var(--desktop-sticky-offset, 88px) + 56px);
  display: grid;
  gap: 14px;
  padding: 14px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.administration-sidebar__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 6px;
  color: var(--accent-strong);
  font-size: 1.05rem;
  font-weight: 850;
}

.administration-sidebar__toggle {
  display: none;
}

.administration-sidebar__nav,
.administration-sidebar__section,
.administration-sidebar__children {
  display: grid;
  gap: 3px;
}

.administration-sidebar__button,
.administration-sidebar__return {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 720;
  text-align: left;
}

.administration-sidebar__button:hover,
.administration-sidebar__return:hover {
  background: var(--surface-muted);
}

.administration-sidebar__button.active {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.administration-sidebar__button--child {
  padding-block: 6px;
  padding-left: 21px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.administration-sidebar__return {
  margin-top: 4px;
  padding-top: 13px;
  border-top-color: var(--line);
  color: var(--muted);
}

.administration-workspace-head {
  grid-column: 2;
  align-self: end;
  padding: 4px 0 0;
}

.administration-workspace-head .administration-breadcrumb,
.administration-workspace-head h2,
.administration-workspace-head p {
  margin: 0;
}

.administration-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.administration-breadcrumb span + span::before {
  content: "/";
  margin-right: 4px;
  color: var(--line-strong, var(--line));
}

.administration-workspace-head h2 {
  margin-top: 3px;
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
}

.administration-workspace-head p:not(.kicker) {
  margin-top: 4px;
  color: var(--muted);
}

.content--administration > .view {
  grid-column: 2;
  min-width: 0;
}

.administration-overview {
  display: grid;
  gap: 18px;
  padding: 6px 0;
}

.administration-overview > p {
  margin: 0;
  color: var(--muted);
}

.mobile-member-nav,
.mobile-shell-more {
  display: none;
}

.app-shell--club-championship-only .layout.layout--without-groups {
  display: grid;
  max-width: none;
  margin: 0;
}

@media (max-width: 700px) {
  .layout.layout--without-groups {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .context-switcher:not(.context-switcher--tournament) {
    display: none;
  }

  .desktop-shell-nav {
    display: none;
  }

  .tournament-context-nav {
    order: 1;
    margin-inline: -2px;
    padding: 2px 2px 8px;
  }

  .group-header {
    order: 2;
  }

  .view {
    order: 3;
  }

  .mobile-member-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 24px rgba(21, 47, 38, 0.12);
  }

  .mobile-member-nav__button {
    display: grid;
    min-width: 0;
    min-height: 54px;
    align-content: center;
    justify-items: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 0.68rem;
    line-height: 1.08;
    white-space: normal;
  }

  .mobile-member-nav__button .shell-nav-icon {
    font-size: 1.05rem;
  }

  .mobile-shell-more {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: block;
  }

  .mobile-shell-more__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 31, 25, 0.42);
  }

  .mobile-shell-more__panel {
    position: absolute;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    left: 0;
    max-height: min(70dvh, 560px);
    overflow-y: auto;
    padding: 14px 14px 18px;
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    box-shadow: 0 -12px 32px rgba(15, 31, 25, 0.2);
  }

  .mobile-shell-more__panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .mobile-shell-more__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-shell-more__button {
    justify-content: flex-start;
    min-width: 0;
    min-height: 48px;
    white-space: normal;
    text-align: left;
  }

  .shell-landing {
    gap: 16px;
    padding-top: 0;
  }

  .shell-landing__hero {
    padding: 12px 14px;
  }

  .news-list--home,
  .administration-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .administration-grid button {
    min-height: 104px;
  }

  .news-card--preview .news-card__media {
    height: min(42vw, 170px);
  }

  .news-card--preview .news-card__content {
    padding: 12px 14px 14px;
  }

  .shell-quick-actions {
    gap: 8px;
  }

  .shell-quick-actions button {
    min-height: 76px;
    padding: 9px 5px;
    font-size: 0.78rem;
  }

  .administration-mode-hint {
    align-items: stretch;
    flex-direction: column;
  }

  .content--administration {
    display: block;
    width: 100%;
  }

  .administration-sidebar {
    position: static;
    display: block;
    margin: 0 0 12px;
    padding: 10px;
  }

  .administration-sidebar__toggle {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
  }

  .administration-sidebar__nav,
  .administration-sidebar__return {
    display: none;
  }

  .administration-sidebar--open .administration-sidebar__nav {
    display: grid;
    margin-top: 8px;
  }

  .administration-sidebar--open .administration-sidebar__return {
    display: block;
  }

  .administration-workspace-head {
    padding: 4px 0 14px;
  }
}

@media print {
  .desktop-shell-nav,
  .tournament-context-nav,
  .mobile-member-nav,
  .mobile-shell-more {
    display: none !important;
  }
}

/* UI-Folgepaket: klare mobile Hierarchie innerhalb des Turnierbereichs. */
.tournament-navigation-shell {
  display: contents;
}

.tournament-navigation-shell__header,
.tournament-context-nav__mobile,
.mobile-group-filter {
  display: none;
}

.tournament-context-nav__desktop {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 700px) {
  .topbar #context-switcher {
    display: none;
  }

  .tournament-navigation-shell {
    display: grid;
    order: 1;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .tournament-navigation-shell__header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .tournament-navigation-shell__header .kicker,
  .tournament-navigation-shell__header h2 {
    margin: 0;
  }

  .tournament-navigation-shell__header h2 {
    margin-top: 2px;
    font-size: 1.15rem;
  }

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

  .tournament-context-switcher .user-chip {
    min-height: 44px;
    max-width: 176px;
    padding-inline: 11px;
  }

  .tournament-context-switcher .role-menu {
    right: 0;
    left: auto;
    min-width: min(278px, calc(100vw - 44px));
  }

  .tournament-context-nav {
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
  }

  .tournament-context-nav__desktop {
    display: none;
  }

  .tournament-context-nav__mobile {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 6px;
    width: 100%;
  }

  .tournament-context-nav__button {
    min-width: 0;
    min-height: 44px;
    padding: 7px 5px;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  .tournament-context-nav__more {
    gap: 4px;
  }

  .tournament-more .mobile-shell-more__panel {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .tournament-more .mobile-shell-more__panel > header > div {
    display: grid;
    gap: 2px;
  }

  .tournament-more .mobile-shell-more__panel > header small {
    color: var(--muted);
    font-weight: 700;
  }

  .mobile-group-filter {
    order: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface-muted);
  }

  .mobile-group-filter label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-group-filter select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    margin: 0;
    border-color: var(--line);
    background: var(--surface);
    font-weight: 750;
  }

  .sidebar {
    display: none;
  }

  .group-header {
    order: 3;
  }

  .view {
    order: 4;
  }
}
