/* ============================================================
   Double Tee Tournaments — base stylesheet
   No Tailwind, no build step. Plain CSS served from public/.
   Dynamic per-club branding via CSS custom properties that the
   Blade layout overrides in a <style>:root{…}</style> block.
   ============================================================ */

:root {
  /* Brand tokens — overridden at runtime from the resolved branding_profile */
  --brand-primary: #166534;
  --brand-secondary: #14532d;
  --brand-accent: #16a34a;
  --brand-on-primary: #ffffff;
  --heading-subtitle: #14532d;

  /* Neutral palette (golfspot contract) */
  --text: #404040;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --bg: #f7f8fa;
  --shell-bar-height: 72px;

  /* Dropdown chevron for native selects */
  --icon-dropdown: url(/img/dropdown_arrow.svg);
  --icon-dropdown-w: 14px;
  --icon-dropdown-h: 14px;
  /* Magnifying glass for opt-in wide search fields (matches the topbar icon) */
  --icon-search: url(/img/search.svg);
}

* { box-sizing: border-box; }

/* The `hidden` attribute must win over layout utilities like .form-grid
   (display:grid) and .form-row (display:flex), which otherwise re-show an
   element the UA stylesheet would have hidden. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 25px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: none; }

h1 { font-size: 1.6rem; font-weight: 600; margin: 0; }
h2 { color: var(--heading-subtitle); font-size: 1.2rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { color: var(--heading-subtitle); font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }

select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--icon-dropdown);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  padding-right: calc(14px + var(--icon-dropdown-w) + 4px);
}

/* ── Admin shell: sidebar + content ───────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 316px;
  flex: 0 0 316px;
  background:
    linear-gradient(180deg, rgba(31, 74, 55, .28), transparent 34%),
    #0d2525;
  border-right: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 1400;
  height: 100vh;
  overflow: hidden;
  transition: width .18s ease, flex-basis .18s ease;
}
.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: var(--shell-bar-height);
  padding: .8rem 1rem .8rem 1.25rem;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  flex: 1;
  gap: .6rem;
  min-width: 0;
}
.sidebar-brand img { object-fit: contain; }
.sidebar-logo-long { display: block; max-height: 42px; max-width: 184px; }
.sidebar-logo-mark { display: none; max-height: 38px; max-width: 36px; }
.sidebar-logo-mark-inline {
  display: block;
  width: 30px;
  height: 36px;
  opacity: .94;
}
.sidebar-brand-wordmark {
  overflow: hidden;
  color: rgba(250, 247, 242, .9);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-brand .brand-name { font-weight: 700; font-size: 1.15rem; color: #faf7f2; }

.sidebar nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: .9rem .85rem .65rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 247, 242, .18) transparent;
}

.nav-group { padding: .5rem 0; }
.nav-group-label,
.nav-section-label {
  padding: .5rem 1.1rem .25rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: 0;
  color: rgba(250, 247, 242, .5);
}
.nav-section-label {
  padding: .7rem .75rem .35rem;
}
.nav-section-label:first-child {
  padding-top: .15rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 48px;
  padding: .6rem .9rem;
  border: 0;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: rgba(250, 247, 242, .84);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, padding .18s ease;
}
.nav-item:focus {
  outline: none;
}
.nav-item:focus-visible {
  background: rgba(250, 247, 242, .09);
}
.nav-item:hover {
  background: rgba(250, 247, 242, .07);
  color: #fff;
  text-decoration: none;
}
.nav-item.active {
  background: linear-gradient(135deg, #176b3b, #11532f);
  color: #fff;
  font-weight: 500;
}

.nav-main {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.nav-accordion { display: block; }
.nav-parent {
  position: relative;
}
.nav-item-icon,
.topbar-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nav-item-icon {
  width: 22px;
  height: 22px;
  color: rgba(250, 247, 242, .72);
}
.nav-item-icon svg,
.topbar-pill-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-parent.active .nav-item-icon,
.nav-parent:hover .nav-item-icon {
  color: #faf7f2;
}
.nav-item-label {
  flex: 1;
  min-width: 0;
}
.nav-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-left: auto;
  color: rgba(250, 247, 242, .55);
  transform: rotate(-90deg);
  transition: transform .16s ease, color .14s ease;
}
.nav-chevron svg,
.sidebar-profile-arrow svg,
.context-switcher-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-accordion.is-open .nav-chevron {
  transform: rotate(0);
  color: rgba(250, 247, 242, .82);
}
.nav-submenu {
  margin: .3rem 0 .55rem 3.1rem;
  padding: .2rem 0 .25rem;
}
.nav-submenu[hidden] {
  display: none;
}
.nav-submenu-list {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.nav-submenu-link {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 36px;
  padding: .42rem .7rem;
  color: rgba(250, 247, 242, .72);
  font-size: .94rem;
  font-weight: 500;
}
.nav-submenu-link:hover:not(.active) {
  background: rgba(250, 247, 242, .06);
  color: #fff;
  text-decoration: none;
}
.nav-submenu-link.active {
  color: #8fd19e;
  font-weight: 500;
  text-decoration: none;
}
.nav-submenu-link.active:hover {
  color: #8fd19e;
  text-decoration: none;
}
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-size: .72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: .85rem;
}
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(250, 247, 242, .05);
  color: rgba(250, 247, 242, .86);
  font-family: inherit;
  cursor: pointer;
}
.sidebar-toggle:hover {
  background: rgba(250, 247, 242, .11);
  color: #fff;
}
.sidebar-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: rgba(250, 247, 242, .76);
  transition: color .14s ease;
}
.sidebar-toggle:hover .sidebar-toggle-icon {
  color: #faf7f2;
}
.sidebar-toggle-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-profile-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 50px;
  padding: .55rem;
  border: 0;
  border-radius: 8px;
  background: rgba(250, 247, 242, .06);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.sidebar-profile-card:focus-visible {
  outline: 2px solid rgba(250, 247, 242, .45);
  outline-offset: 2px;
}
.sidebar-profile-card:hover {
  background: rgba(250, 247, 242, .09);
  text-decoration: none;
}
.sidebar-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: #dff7e7;
  color: #0d3b25;
  font-size: .78rem;
  font-weight: 800;
}
.sidebar-profile-avatar img,
.profile-avatar img,
.profile-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-profile-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.sidebar-profile-name,
.sidebar-profile-role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-profile-name {
  color: #fff;
  font-size: .96rem;
  font-weight: 500;
  line-height: 1.25;
}
.sidebar-profile-role {
  color: rgba(250, 247, 242, .58);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.25;
}
.sidebar-profile-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-left: auto;
  color: rgba(250, 247, 242, .52);
}
.sidebar-profile-card:hover .sidebar-profile-arrow {
  color: rgba(250, 247, 242, .86);
}
.sidebar-profile-logout {
  margin: 0;
  flex: 0 0 auto;
}
.sidebar-profile-logout button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(250, 247, 242, .56);
  cursor: pointer;
}
.sidebar-profile-logout button:hover {
  background: rgba(250, 247, 242, .08);
  color: #fff;
}
.sidebar-profile-logout-icon,
.context-switcher-icon,
.context-switcher-current-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-profile-logout-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-is-collapsed .sidebar.sidebar-collapsible {
  width: 84px;
  flex-basis: 84px;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand-row {
  flex-direction: column;
  justify-content: center;
  gap: .55rem;
  padding: .8rem .55rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand {
  flex: 0 0 auto;
  justify-content: center;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-long,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand-wordmark,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand .brand-name {
  display: none;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-mark {
  display: block;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible nav {
  padding: 1rem .55rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-main {
  gap: .35rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-section-label,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-submenu {
  display: none !important;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item {
  justify-content: center;
  gap: 0;
  min-height: 48px;
  padding: .65rem;
  box-shadow: none;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-label,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-chevron {
  display: none;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-icon {
  width: 24px;
  height: 24px;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-icon svg {
  width: 19px;
  height: 19px;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-footer {
  padding: .75rem .55rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-card {
  justify-content: center;
  min-height: 48px;
  padding: .45rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-copy,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-arrow,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-logout {
  display: none;
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  background: var(--surface);
  min-height: var(--shell-bar-height);
  position: sticky;
  top: 0;
  z-index: 1200;
}
.topbar .topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar .topbar-right { display: flex; align-items: center; gap: .55rem; }
.topbar.topbar-has-search {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr) auto;
  grid-template-areas: "search left right";
}
.topbar.topbar-has-search .topbar-left { grid-area: left; justify-self: start; }
.topbar.topbar-has-search .topbar-search { grid-area: search; justify-self: stretch; }
.topbar.topbar-has-search .topbar-right { grid-area: right; justify-self: end; }
.topbar-actions {
  min-width: 0;
  flex-wrap: wrap;
  gap: .5rem;
}
.topbar-menu-wrap,
.profile-menu {
  position: relative;
}
.topbar-pill,
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.topbar-pill {
  position: relative;
  padding: 0 .45rem;
  border-radius: 8px;
}
.topbar-pill-compact {
  padding: 0 .55rem;
}
.topbar-icon-button {
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}
.topbar-pill:hover,
.topbar-menu-wrap.is-open .topbar-pill {
  background: #f8fafc;
}
.topbar-pill-icon {
  width: 22px;
  height: 22px;
  color: var(--text);
}
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 .3rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
}
.topbar-icon-button .count-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 .25rem;
  font-size: .61rem;
  box-shadow: 0 0 0 2px var(--surface);
}
.count-badge-green {
  background: color-mix(in srgb, var(--brand-primary) 14%, #fff);
  color: var(--brand-primary);
}
.count-badge-gold {
  background: #fff7ed;
  color: #b45309;
}
.count-badge-red {
  background: #fee2e2;
  color: #b91c1c;
}
/* Top-bar credits pill. Reuses .topbar-pill; the count-badge colour signals the
   level (green plenty, gold low, red empty); unlimited shows an infinity glyph. */
.topbar-credits {
  text-decoration: none;
  gap: .4rem;
}
.topbar-credits .topbar-credits-label {
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.topbar-credits .credits-infinity {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: var(--brand-primary);
}
.topbar-credits.is-low {
  border-color: #fcd9b6;
  background: #fffaf3;
}
.topbar-credits.is-low .topbar-credits-label {
  color: #b45309;
}
.topbar-credits.is-empty {
  border-color: #f5c2c2;
  background: #fff5f5;
}
.topbar-credits.is-empty .topbar-credits-label {
  color: #b91c1c;
}
.topbar-credit-panel {
  width: 320px;
}
.credit-panel-hero {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem;
  border-radius: 8px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.22), transparent 34%),
    linear-gradient(135deg, var(--brand-primary), #0f766e 56%, #164e63);
  color: #fff;
}
.credit-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,.14);
}
.credit-panel-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.credit-panel-copy {
  display: grid;
  gap: .1rem;
  min-width: 0;
}
.credit-panel-copy > span,
.credit-panel-copy small {
  color: rgba(255,255,255,.78);
  font-size: .78rem;
  line-height: 1.3;
}
.credit-panel-copy strong {
  font-size: 2rem;
  line-height: 1;
}
.credit-panel-facts {
  display: grid;
  gap: .5rem;
  margin-top: .65rem;
}
.credit-panel-facts > div {
  display: grid;
  gap: .15rem;
  padding: .65rem .7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
}
.credit-panel-facts span {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
}
.credit-panel-facts strong {
  font-size: .9rem;
}
.credit-panel-action {
  width: 100%;
  margin-top: .75rem;
}
.topbar-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 2700;
  width: 340px;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}
.topbar-right .topbar-menu {
  right: 0;
  left: auto;
}
.topbar-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .25rem .35rem .6rem;
  font-size: .9rem;
}
.topbar-menu-head a {
  font-size: .78rem;
  font-weight: 700;
}
.topbar-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .6rem;
  border-radius: 6px;
  color: var(--text);
}
.topbar-menu-row:hover {
  background: #f8fafc;
  text-decoration: none;
}
.topbar-menu-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar-menu-title,
.topbar-menu-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-menu-title {
  font-weight: 700;
  line-height: 1.3;
}
.topbar-menu-sub,
.topbar-menu-time {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}
.topbar-menu-time {
  flex: 0 0 auto;
}
.topbar-menu-empty {
  padding: .75rem .6rem;
  color: var(--muted);
  font-size: .9rem;
}
.context-switcher-trigger {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 38px;
  max-width: 190px;
  padding: 0 .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.context-switcher-trigger:hover,
.context-switcher.is-open .context-switcher-trigger {
  border-color: color-mix(in srgb, var(--brand-primary) 24%, var(--border));
  background: #f8fafc;
}
.context-switcher-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  color: var(--brand-primary);
}
.context-switcher-icon svg,
.context-switcher-current-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.context-switcher-copy {
  display: block;
  min-width: 0;
}
.context-switcher-label,
.context-switcher-subtitle {
  max-width: 138px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-switcher-label {
  color: var(--text);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1;
}
.context-switcher-subtitle {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
}
.context-switcher-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--muted);
}
.context-switcher-menu {
  width: 300px;
}
.context-switcher-current {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 .25rem .45rem;
  padding: .55rem .6rem .7rem;
  border-bottom: 1px solid var(--border);
}
.context-switcher-current-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  color: var(--brand-primary);
}
.context-switcher-current span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.context-switcher-current strong,
.context-switcher-current small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-switcher-current small {
  color: var(--muted);
  font-size: .78rem;
}
.profile-trigger {
  padding: .15rem .25rem .15rem .15rem;
  border-radius: 10px;
}
.profile-trigger:hover,
.profile-menu.is-open .profile-trigger {
  background: #f8fafc;
}
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary);
  font-size: .82rem;
  font-weight: 800;
}
.profile-avatar-lg {
  width: 44px;
  height: 44px;
}
.profile-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.profile-name,
.profile-role {
  max-width: 180px;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-name {
  font-size: .9rem;
  font-weight: 800;
}
.profile-role {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
}
.profile-chevron {
  color: var(--muted);
  font-size: 1rem;
}
.profile-dropdown {
  right: 0;
  left: auto;
  width: 280px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem .45rem .7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .35rem;
}
.profile-card span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.profile-card strong,
.profile-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-card small {
  color: var(--muted);
  font-size: .78rem;
}
.profile-link {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  padding: .45rem .55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  text-align: left;
  cursor: pointer;
}
.profile-link:hover {
  background: #f8fafc;
  text-decoration: none;
}
.profile-logout {
  color: #b91c1c;
}

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

.global-search {
  position: relative;
  width: 100%;
}
.global-search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  z-index: 1;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  color: #667085;
  pointer-events: none;
  transform: translateY(-50%);
}
.global-search-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.global-search input[type=search] {
  width: 100%;
  height: 42px;
  padding: 0 1rem 0 2.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
}
.global-search input[type=search]:focus {
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.global-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 2500;
  max-height: min(520px, calc(100vh - 96px));
  overflow-y: auto;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}
.global-search-status {
  padding: .55rem .65rem;
  color: var(--muted);
  font-size: .86rem;
}
.global-search-group + .global-search-group { margin-top: .35rem; }
.global-search-group-label {
  padding: .45rem .55rem .25rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 0;
}
.global-search-result {
  display: block;
  padding: .55rem .65rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.global-search-result:hover,
.global-search-result.active {
  background: color-mix(in srgb, var(--brand-primary) 9%, #fff);
  color: var(--text);
  text-decoration: none;
}
.global-search-result-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-search-result-description {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .topbar.topbar-has-search {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "left right"
      "search search";
  }
  .topbar.topbar-has-search .topbar-left { grid-area: left; }
  .topbar.topbar-has-search .topbar-search { grid-area: search; }
  .topbar.topbar-has-search .topbar-right { grid-area: right; }
}
@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: relative;
    width: 100%;
    flex-basis: auto;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 0;
    box-shadow: none;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible {
    width: 100%;
    flex-basis: auto;
  }
  .sidebar-brand-row,
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand-row {
    flex-direction: row;
    justify-content: flex-start;
    padding: .95rem 1.35rem .75rem;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand {
    flex: 1;
    justify-content: flex-start;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-long {
    display: block;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand-wordmark {
    display: block;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-mark {
    display: none;
  }
  .sidebar nav {
    display: block;
    overflow: visible;
    padding: .75rem;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible nav {
    padding: .75rem;
  }
  .nav-main {
    flex-direction: column;
    min-width: 0;
  }
  .nav-parent {
    min-width: 0;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-section-label {
    display: block !important;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-submenu:not([hidden]) {
    display: block !important;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item {
    justify-content: flex-start;
    gap: .6rem;
    min-height: 44px;
    padding: .55rem 1.1rem;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-label,
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-chevron {
    display: inline-flex;
  }
  .sidebar-footer,
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-footer {
    display: block;
    padding: .75rem;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-card {
    justify-content: flex-start;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-copy {
    display: flex;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-arrow {
    display: inline-flex;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-profile-logout {
    display: block;
  }
  .topbar {
    padding: .75rem 1rem;
  }
  .topbar .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .topbar-menu {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 132px;
    width: auto;
  }
  .profile-dropdown {
    left: 1rem;
    right: 1rem;
  }
  .context-switcher-trigger {
    max-width: 210px;
  }
  .context-switcher-label {
    max-width: 128px;
  }
}

.content-body {
  width: 100%;
  max-width: none;
  padding: clamp(1rem, 1.5vw, 1.5rem);
  padding-top: .75rem;
}
.page-subtitle {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

/* ── Product switcher ─────────────────────────────────────── */
.product-switcher { position: relative; }
.product-switcher select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  padding: 0 calc(14px + var(--icon-dropdown-w) + 8px) 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff var(--icon-dropdown) no-repeat right 12px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--brand-primary); color: var(--brand-on-primary); }
.btn-primary:hover { background: var(--brand-secondary); text-decoration: none; color: var(--brand-on-primary); }
.btn-add {
  height: 44px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}
.btn-add:hover,
.btn-add:focus-visible {
  background: var(--brand-secondary);
  color: var(--brand-on-primary);
  text-decoration: none;
}
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: #fafafa; text-decoration: none; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-sm { height: 32px; padding: 0 .7rem; font-size: .85rem; }

/* ── Breadcrumbs ──────────────────────────────────────────── */
.breadcrumbs {
  margin-bottom: .75rem;
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .85rem;
}
.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.breadcrumb-link,
.breadcrumb-current {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.breadcrumb-link {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb-link:hover {
  color: var(--brand-primary);
  text-decoration: none;
}
.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}
.breadcrumb-icon svg,
.breadcrumb-sep svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.breadcrumb-sep {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  opacity: .55;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  margin-bottom: 1.25rem;
}
.page-header > h1,
.page-header > h2 {
  margin: 0;
}
.tournament-header-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}
.tournament-registration-window {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
}
/* Stack a small subtitle (e.g. last-synced) under the page title; button stays right. */
.page-header-titles {
  min-width: 0;
}
.page-header-titles h1,
.page-header-titles h2 {
  margin: 0;
}
/* Price breakdown in the contract-upgrade confirm modal. */
.billing-upgrade-summary {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
}
.billing-upgrade-summary li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .4rem 0;
  color: var(--text);
}
.billing-upgrade-summary li span {
  color: var(--muted);
}
.billing-upgrade-summary li.is-total {
  margin-top: .25rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
  font-size: 1.05rem;
}
/* Group several action buttons on the right of a page header. */
.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.org-count {
  display: inline-block;
  margin-left: .4rem;
  padding: 0 .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary);
  font-size: .9rem;
  font-weight: 600;
  vertical-align: middle;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

/* ── Filters (golfspot-filters contract) ──────────────────── */
.filters {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filters input,
.filters select {
  height: 44px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 400;
  color: var(--text);
}
.filters select {
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  padding-right: calc(14px + var(--icon-dropdown-w) + 4px);
}
.filters label { font-weight: 400; color: var(--text); }

/* Opt-in compact search field with a leading magnifying glass. */
.filters--search-wide {
  align-items: flex-start;
}

/* Clubleden toolbar: search bar left, superadmin "vullen" action far right, in line. */
.members-toolbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.members-toolbar .filters { flex: 1 1 auto; margin-bottom: 0; }
.members-toolbar__action { margin: 0; flex: 0 0 auto; }

/* Toggle switch used as a filter (e.g. "alleen wedstrijdleider"). */
/* "Mijn wedstrijden" filter row: search + leader switch side by side. */
.my-tournaments-filter { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.my-tournaments-filter > * { margin-bottom: 0; }
.my-tournaments-filter .table-tools { flex: 1 1 260px; }
.filter-switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .95rem; color: var(--text); }
.filter-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter-switch-track {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  background: var(--border);
  border-radius: 9999px;
  transition: background-color .15s ease;
}
.filter-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .15s ease;
}
.filter-switch input:checked + .filter-switch-track { background: var(--brand-accent); }
.filter-switch input:checked + .filter-switch-track::after { transform: translateX(16px); }
.filter-switch input:focus-visible + .filter-switch-track { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.filters input[type="search"] {
  flex: 0 0 260px;
  width: 260px;
  max-width: 100%;
  background: #fff var(--icon-search) no-repeat left 12px center;
  background-size: 16px 16px;
  padding: 0 .75rem 0 calc(12px + 16px + 8px);
}
.filters input[type="search"]:disabled {
  background-color: #f8fafc;
  color: var(--muted);
  cursor: not-allowed;
  opacity: .72;
}
.table-tools {
  margin-top: -.25rem;
}

/* ── Searchable multi-select dropdown ─────────────────────── */
.multiselect {
  position: relative;
  display: inline-block;
  min-width: 260px;
}
.multiselect-toggle {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 0 calc(14px + var(--icon-dropdown-w) + 4px) 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  cursor: pointer;
}
.multiselect.is-open .multiselect-toggle {
  border-color: var(--brand-primary);
}
.multiselect-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multiselect-label.is-placeholder {
  color: var(--muted);
}
.multiselect-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  padding: .5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.multiselect-search {
  margin-bottom: .4rem;
}
.multiselect-search input {
  width: 100%;
  height: 38px;
  padding: 0 .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: .9rem;
  color: var(--text);
}
.multiselect-options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}
.multiselect-option label {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .35rem;
  border-radius: 6px;
  font-weight: 400;
  cursor: pointer;
}
.multiselect-option label:hover {
  background: #fafafa;
}
.multiselect-option input {
  margin: 0;
  accent-color: var(--brand-primary);
}
.multiselect-empty {
  padding: .5rem .35rem;
  color: var(--muted);
  font-size: .9rem;
}

.active-filters { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  color: var(--brand-secondary);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--border));
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.active-filter-chip:hover { background: color-mix(in srgb, var(--brand-primary) 14%, #fff); text-decoration: none; }
.active-filter-chip span[aria-hidden] { font-size: 14px; line-height: 1; }

/* ── Tables (golfspot-tables contract) ────────────────────── */
.table-container {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.table-container table {
  width: 100%;
  min-width: 800px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-family: inherit;
}
.table-container th,
.table-container td {
  height: 60px;
  padding: 1rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
}
.table-container thead th {
  height: 52px;
  min-height: 52px;
  padding-top: .85rem;
  padding-bottom: .85rem;
  background: #fff;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border);
}
.table-container {
  --table-header-hover-bg: color-mix(in srgb, var(--brand-primary) 8%, #fff);
}
.table-container thead th:has(+ th.actions-cell) {
  position: relative;
  overflow: visible;
}
.table-container thead th:has(+ th.actions-cell):hover {
  z-index: 4;
}
/* Click-to-sort headers: the whole cell is one clickable link/button (no sort glyph). */
.table-container thead th .th-sort {
  display: block;
  min-height: 52px;
  margin: -.85rem -1rem;
  padding: .85rem 1rem;
  width: calc(100% + 2rem);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
  text-decoration: none;
  cursor: pointer;
}
/* Very light green block behind the header on hover/keyboard focus (no underline). */
.table-container thead th .th-sort:is(:hover, :focus-visible) {
  background: var(--table-header-hover-bg);
}
.table-container thead th:has(+ th.actions-cell) .th-sort:is(:hover, :focus-visible)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 220px;
  background: var(--table-header-hover-bg);
  pointer-events: none;
}
.table-container thead th:has(.th-sort:is(:hover, :focus-visible)) + th.actions-cell {
  background: var(--table-header-hover-bg);
}
.table-container tbody tr:last-child td { border-bottom: 0; }
.table-container tbody tr:hover td { background: #fafafa; }
.table-container tbody tr.clickable,
.table-container tbody tr.has-actions { position: relative; cursor: pointer; }

.table-container td.actions-cell,
.table-container th.actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: inherit;
}
.table-container th.actions-cell { z-index: 3; }

.table-container .row-actions {
  position: absolute;
  top: 4px;
  bottom: 0;
  right: 1rem;
  display: flex;
  gap: .4rem;
  align-items: center;
  padding: .2rem 1rem;
  border-radius: 4px;
  background: rgba(245, 245, 245, .8);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  z-index: 1500;
}
.table-container tbody tr:hover .row-actions,
.table-container tbody tr:focus-within .row-actions { opacity: 1; visibility: visible; }
/* Touch devices have no hover: keep the row actions in the flow so they stay reachable. */
@media (hover: none) {
  .table-container .row-actions {
    position: static;
    opacity: 1;
    visibility: visible;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
.table-container .row-actions button,
.table-container .row-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: .4rem .8rem;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 100%;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
/* Inline single-action forms sit flush in the hover menu (no extra box). */
.table-container .row-actions form { display: contents; }

/* Solid hover state instead of underlined action links. */
.table-container .row-actions button,
.table-container .row-actions a { transition: background-color .15s ease, color .15s ease; }
.table-container .row-actions a:hover,
.table-container .row-actions button:hover { background: var(--brand-secondary); color: var(--brand-on-primary); }
.table-container .row-actions .action-danger:hover { background: #dc2626; color: #fff; }
.table-container .row-actions .action-warning:hover { background: #d97706; color: #fff; }
.table-empty { color: var(--muted); text-align: center; }

/* ── Multi-round (Meerronde) leaderboard states ───────────── */
.lb-muted { color: var(--muted); }
.lb-dropped { color: var(--muted); text-decoration: line-through; }
.lb-unranked td { color: var(--muted); }
.lb-rule-note { color: var(--muted); }

/* ── Read-only tournament detail (committee view) ──────────── */
.detail-readonly {
  display: grid;
}
.detail-value {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: .95rem;
  line-height: 1.35;
}
.detail-tabbar {
  --detail-action-btn-width: 168px;
  position: fixed;
  left: 316px;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  min-height: 80px;
  margin-top: 0;
  padding: .6rem clamp(1rem, 1.5vw, 1.5rem);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}
.sidebar-is-collapsed .detail-tabbar { left: 84px; }
.detail-tab {
  flex: 0 0 var(--detail-action-btn-width);
  width: var(--detail-action-btn-width);
  max-width: 100%;
  height: 44px;
  padding: 0 .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: .86rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.detail-tab:hover { background: #fafafa; }
.detail-tab:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}
.detail-tab.is-current {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}
.content-body:has(.detail-tabbar) {
  --actionbar-space: 96px;
  padding-bottom: var(--actionbar-space);
}
@media (max-width: 1100px) {
  .content-body:has(.detail-tabbar) { --actionbar-space: 140px; }
}
@media (max-width: 720px) {
  .detail-tabbar {
    left: 0;
    gap: .5rem;
  }
  .content-body:has(.detail-tabbar) { --actionbar-space: 190px; }
}

.scroll-more-indicator {
  position: fixed;
  left: calc(316px + (100vw - 316px) / 2);
  bottom: calc(var(--scroll-more-bottom, 80px) + .75rem);
  z-index: 901;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .16s ease, transform .16s ease;
}

.scroll-more-indicator.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.scroll-more-indicator img {
  display: block;
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .12));
}

body:has(.score-actionbar) .scroll-more-indicator {
  left: calc(316px + 1.5rem + 340px + 1.1rem + (100vw - 316px - 340px - 4.1rem) / 2);
  width: 27px;
  height: 27px;
}

body:has(.score-actionbar) .scroll-more-indicator img {
  width: 27px;
  height: 27px;
}

.sidebar-is-collapsed .scroll-more-indicator {
  left: calc(84px + (100vw - 84px) / 2);
}

.sidebar-is-collapsed body:has(.score-actionbar) .scroll-more-indicator {
  left: calc(84px + 1.5rem + 340px + 1.1rem + (100vw - 84px - 340px - 4.1rem) / 2);
}

@media (max-width: 720px) {
  .scroll-more-indicator { left: 50%; }
}

@media print {
  .scroll-more-indicator { display: none !important; }

  @page {
    margin: 14mm;
  }

  body:has(.leaderboard-print-header) {
    background: #fff;
    color: #111827;
    font-size: 10pt;
    line-height: 1.35;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body:has(.leaderboard-print-header) .sidebar,
  body:has(.leaderboard-print-header) .topbar,
  body:has(.leaderboard-print-header) .breadcrumbs,
  body:has(.leaderboard-print-header) .page-header > div,
  body:has(.leaderboard-print-header) .tournament-step-toolbar,
  body:has(.leaderboard-print-header) .toast-stack {
    display: none !important;
  }

  body:has(.leaderboard-print-header) .app-shell,
  body:has(.leaderboard-print-header) .content,
  body:has(.leaderboard-print-header) .content-body {
    display: block;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body:has(.leaderboard-print-header) .print-only {
    display: flex !important;
  }

  body:has(.leaderboard-print-header) .leaderboard-print-header {
    align-items: center;
    justify-content: space-between;
    gap: 14mm;
    margin-bottom: 9mm;
    padding-bottom: 6mm;
    border-bottom: 2px solid var(--brand-primary);
    page-break-inside: avoid;
  }

  body:has(.leaderboard-print-header) .leaderboard-print-brand {
    display: flex;
    align-items: center;
    gap: 5mm;
    min-width: 0;
  }

  body:has(.leaderboard-print-header) .leaderboard-print-brand img {
    max-width: 54mm;
    max-height: 22mm;
    object-fit: contain;
  }

  body:has(.leaderboard-print-header) .leaderboard-print-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17mm;
    height: 17mm;
    border-radius: 50%;
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    font-size: 18pt;
    font-weight: 700;
  }

  body:has(.leaderboard-print-header) .leaderboard-print-brand span {
    display: block;
    color: #6b7280;
    font-size: 8.5pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
  }

  body:has(.leaderboard-print-header) .leaderboard-print-brand strong {
    display: block;
    margin-top: 1mm;
    color: #111827;
    font-size: 13pt;
    line-height: 1.2;
  }

  body:has(.leaderboard-print-header) .leaderboard-print-generated {
    flex: 0 0 auto;
    color: #6b7280;
    font-size: 9pt;
    text-align: right;
  }

  body:has(.leaderboard-print-header) .page-header {
    display: block;
    min-height: 0;
    margin: 0 0 3.5mm;
  }

  body:has(.leaderboard-print-header) .page-header h1 {
    color: #111827;
    font-size: 21pt;
    line-height: 1.12;
    font-weight: 700;
  }

  body:has(.leaderboard-print-header) .leaderboard-meta,
  body:has(.leaderboard-print-header) .lb-rule-note {
    margin: 0 0 2.5mm !important;
    color: #4b5563 !important;
    font-size: 10pt !important;
    line-height: 1.45;
  }

  body:has(.leaderboard-print-header) [data-leaderboard-poll] {
    margin-top: 7mm;
  }

  body:has(.leaderboard-print-header) .table-container {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  body:has(.leaderboard-print-header) .table-container table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    border-spacing: 0;
  }

  body:has(.leaderboard-print-header) .table-container thead {
    display: table-header-group;
  }

  body:has(.leaderboard-print-header) .table-container tr {
    page-break-inside: avoid;
  }

  body:has(.leaderboard-print-header) .table-container th,
  body:has(.leaderboard-print-header) .table-container td {
    height: auto;
    padding: 3.4mm 3mm;
    border-bottom: 1px solid #d8dde3;
    color: #111827;
    font-size: 9.5pt;
    line-height: 1.3;
    white-space: normal;
  }

  body:has(.leaderboard-print-header) .table-container thead th {
    background: #f3f6f4;
    color: #111827;
    font-weight: 700;
  }

  body:has(.leaderboard-print-header) .table-container tbody tr:nth-child(even) td {
    background: #fafafa;
  }

  body:has(.leaderboard-print-header) .table-empty {
    padding: 10mm 0;
    color: #6b7280;
  }

  body:has(.leaderboard-print-header) a[href]::after {
    content: "" !important;
  }
}

/* ── Bulk-select column + action bar ──────────────────────── */
.table-container th.bulk-cell,
.table-container td.bulk-cell {
  width: 1%;
  text-align: center;
  padding-right: .25rem;
}
.table-container .bulk-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.bulk-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: .35rem .45rem .35rem .75rem;
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 26%, var(--border));
  border-radius: 6px;
}
.bulk-bar-count {
  color: var(--brand-primary);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}
.bulk-bar-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.bulk-bar-actions .btn {
  height: 36px;
  padding: .35rem .55rem;
  background: #fff;
  border-color: color-mix(in srgb, var(--brand-primary) 24%, var(--border));
  color: var(--brand-secondary);
  font-size: .86rem;
}
.bulk-bar-actions .btn:hover {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
  color: var(--brand-on-primary);
}
.bulk-bar-actions .action-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.bulk-bar-actions .action-warning:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

/* Template-propagation confirmation list */
.propagate-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.propagate-list li {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.propagate-list .propagate-date { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Chips (golfspot-tables palette) ──────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.chip-status-draft, .chip-priority-laag                         { background: #f3f4f6; color: #374151; }
.chip-status-published, .chip-status-afgerond,
.chip-status-released, .chip-visibility-public,
.chip-status-gepubliceerd, .chip-status-active                  { background: #dcfce7; color: #166534; }
.chip-type-bug, .chip-priority-hoog, .chip-status-archived,
.chip-status-archief, .chip-status-failed                       { background: #fee2e2; color: #b91c1c; }
.chip-type-improvement, .chip-priority-medium,
.chip-status-in_progress, .chip-status-gesloten,
.chip-status-provisioning                                       { background: #fef3c7; color: #92400e; }
.chip-type-request, .chip-status-ingepland,
.chip-visibility-anonymized, .chip-status-concept               { background: #dbeafe; color: #1e40af; }
.chip-product                                                   { background: #eef2ff; color: #4338ca; }
.chip-ai {
  margin-left: .5rem;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, #fff);
}
.chip-ai::before {
  content: "✦";
  margin-right: .25rem;
  font-size: 10px;
}
.page-title-with-chip {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
  min-width: 0;
}
.page-title-with-chip h1 {
  margin: 0;
}
.page-title-with-chip .chip-ai {
  margin-left: .25rem;
  align-self: center;
}
.chip-list { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ── Forms ────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 1rem; max-width: 640px; }

/* Multi-column field grid: opt-in. Each field claims its own width via a
   .col-* helper so a form uses the full panel width instead of one tall column.
   Base unit is a quarter (1 of 4); fields collapse on narrow screens. */
.form-grid--cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  max-width: none;
  align-items: start;
}
/* A checkbox sharing a row with a labelled input: drop it to the input's height. */
.form-grid--cols > .wizard-check-row { justify-content: center; padding-top: 1.65rem; }
.form-grid--cols > * { grid-column: 1 / -1; }            /* default: full row */
.form-grid--cols > .col-full { grid-column: 1 / -1; }
.form-grid--cols > .col-three-quarter { grid-column: span 3; }
.form-grid--cols > .col-half { grid-column: span 2; }
.form-grid--cols > .col-quarter { grid-column: span 1; }
/* Invisible cell that fills the rest of a row so the next field starts fresh. */
.form-grid--cols > .col-spacer { padding: 0; }
@media (max-width: 760px) {
  .form-grid--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--cols > .col-half,
  .form-grid--cols > .col-three-quarter { grid-column: 1 / -1; }
  .form-grid--cols > .col-quarter { grid-column: span 1; }
  .form-grid--cols > .col-spacer { display: none; }
}
@media (max-width: 460px) {
  .form-grid--cols { grid-template-columns: 1fr; }
  .form-grid--cols > * { grid-column: 1 / -1; }
}

.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row:is(fieldset) { margin: 0; padding: 0; border: 0; }
.form-row label { font-size: .9rem; font-weight: 500; color: var(--text); }
/* Required-field marker: a red asterisk after the label of any form-row that
   contains a required control. Auto-applies everywhere, so new forms get it for
   free as long as the input carries the `required` attribute. */
.form-row:has(:required) > label::after,
.form-row:has(:required) > legend::after,
/* Manual marker for required selection groups (checkbox arrays / multiselect /
   radio tables) that can't carry a single HTML `required` control. */
.required-mark::after {
  content: ' *';
  color: #dc2626;
  font-weight: 600;
}
.form-row legend {
  margin-bottom: .35rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
}
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=number],
.form-row input[type=date],
.form-row input[type=time],
.form-row input[type=color],
.form-row textarea {
  height: 44px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
}
.form-row select {
  height: 44px;
  padding: 0 calc(14px + var(--icon-dropdown-w) + 4px) 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
}
.form-row textarea { height: auto; padding: .6rem .75rem; min-height: 96px; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .5rem;
}
.checkbox-tile {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .7rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f9fafb;
  color: var(--text);
  font-weight: 400;
}
.checkbox-tile input {
  flex: 0 0 auto;
  margin-top: .15rem;
}
.permission-picker {
  display: grid;
  gap: 1rem;
}
.permission-group {
  margin: 0;
  min-width: 0;
  padding: .85rem .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.permission-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .6rem;
}
.permission-group-title {
  font-weight: 600;
  color: var(--heading-subtitle);
}
.permission-group-all {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.permission-group-all input {
  margin: 0;
}
.permission-group-hint {
  margin: -.2rem 0 .65rem;
  font-size: .8rem;
  color: var(--muted);
}
.checkbox-tile.is-implied-hidden {
  display: none;
}
.form-row input[type=text]:focus,
.form-row input[type=email]:focus,
.form-row input[type=password]:focus,
.form-row input[type=number]:focus,
.form-row input[type=date]:focus,
.form-row input[type=time]:focus,
.form-row input[type=color]:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}
input[type="checkbox"] {
  accent-color: var(--brand-primary);
}
input[type="checkbox"]:focus {
  outline: 2px solid color-mix(in srgb, var(--brand-primary) 24%, transparent);
  outline-offset: 2px;
}
.form-error { color: #b91c1c; font-size: .85rem; }
.form-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.print-only { display: none !important; }

.score-status-select {
  display: block;
  width: min(190px, 100%);
  height: 40px;
  margin-top: .35rem;
  padding: 0 calc(12px + var(--icon-dropdown-w) + 4px) 0 .65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: #fff var(--icon-dropdown) no-repeat right 12px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
}

.score-status-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}

.score-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.score-player-panel,
.score-card-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.score-player-panel {
  position: sticky;
  top: 88px;
  overflow: hidden;
}

.score-panel-head,
.score-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
}

.score-panel-head {
  align-items: baseline;
  border-bottom: 1px solid var(--border);
}

.score-panel-titleline {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  min-width: 0;
}

.score-panel-head h2,
.score-card-titleline h2 {
  margin: 0;
  color: var(--heading-subtitle);
  font-size: 1rem;
}

.score-panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.score-panel-count {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-player-list {
  display: grid;
  max-height: 25rem;
  overflow-y: auto;
}

.score-player-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 4.6rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}

.score-player-scroll-hint[hidden] {
  display: none;
}

.score-player-scroll-hint.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.score-player-scroll-hint img {
  display: block;
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .12));
}

.score-player-list-head {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 96px 78px;
  gap: .5rem;
  align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.score-player-list-head span {
  white-space: nowrap;
}

.score-player-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 96px 78px;
  align-items: center;
  gap: .5rem;
  width: 100%;
  min-height: 3rem;
  padding: .45rem 1rem;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.score-player-row:hover {
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff);
}

.score-player-row.is-active {
  border-left-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 9%, #fff);
}

.score-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 14%, #fff);
  color: var(--brand-primary);
  font-size: .82rem;
  font-weight: 700;
}

.score-avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 1rem;
}

.score-player-main,
.score-card-player {
  min-width: 0;
}

.score-player-main {
  display: grid;
  gap: .16rem;
}

.score-player-identity {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.score-player-name {
  display: block;
  overflow: hidden;
  color: var(--heading-subtitle);
  font-size: .9rem;
  font-weight: 500;
  text-transform: lowercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .85rem;
}

.score-player-time {
  display: grid;
  gap: .08rem;
  min-width: 0;
  color: var(--muted);
  font-size: .78rem;
}

.score-player-time strong {
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-player-time span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-player-progress {
  display: grid;
  gap: .25rem;
  min-width: 86px;
}

.score-progress-count {
  color: var(--heading-subtitle);
  font-size: .7rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.score-progress-track {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #d6dbe3;
}

.score-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-primary);
  transition: width .16s ease;
}

.score-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: .45rem;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 400;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-status::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid #9aa3af;
  border-radius: 999px;
  box-sizing: border-box;
}

.score-status-progress {
  color: var(--brand-primary);
}

.score-status-progress::before {
  border-color: var(--brand-primary);
}

.score-status-complete {
  color: var(--brand-primary);
}

.score-status-complete::before {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
}

.score-status-complete::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 6px;
  height: 4px;
  border-left: 1px solid var(--brand-on-primary);
  border-bottom: 1px solid var(--brand-on-primary);
  transform: translateY(-70%) rotate(-45deg);
}

.score-player-row .score-status {
  gap: .35rem;
  font-size: .78rem;
}

.score-player-row .score-status::before {
  width: 13px;
  height: 13px;
}

.score-player-row .score-status-complete::after {
  left: 3px;
  width: 5px;
  height: 3px;
}

.score-status-special {
  color: #b45309;
}

.score-status-special::before {
  border-color: #d97706;
}

.score-panel-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
}

.score-card-panel {
  min-width: 0;
  position: sticky;
  top: 88px;
}

.score-card-editor {
  --score-card-head-height: 10rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--actionbar-space, 96px) - 5.5rem);
  min-height: 0;
}

.score-card-head {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: grid;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.score-card-titleline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 46px;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.score-card-titleline .score-status {
  justify-self: end;
  text-align: right;
}

.score-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.score-card-player {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.score-card-player h3 {
  margin: 0;
  color: var(--heading-subtitle);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.2;
}

.scorecard-sections {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 1rem;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: calc(var(--score-card-head-height) + 1rem) 1rem 2.75rem;
  box-sizing: border-box;
}

.scorecard-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.35rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}

.scorecard-scroll-hint[hidden] {
  display: none;
}

.scorecard-scroll-hint.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.scorecard-scroll-hint img {
  display: block;
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .12));
}

.score-special-modal {
  display: grid;
  gap: 1rem;
}

.score-special-player,
.score-special-current {
  display: grid;
  gap: .2rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.score-special-label,
.score-special-modal .form-row > span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.score-special-player strong {
  color: var(--heading-subtitle);
  font-size: 1rem;
  font-weight: 600;
}

.score-special-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.scorecard-nine {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.scorecard-nine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem .95rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand-primary) 7%, var(--surface));
}

.scorecard-nine-head h3 {
  margin: 0;
  color: var(--heading-subtitle);
  font-size: .96rem;
}

.scorecard-nine-head span {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.scorecard-scroll {
  overflow-x: auto;
}

.scorecard-matrix {
  width: 100%;
  min-width: 790px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
}

.scorecard-matrix th,
.scorecard-matrix td {
  min-width: 62px;
  height: 54px;
  padding: .5rem .55rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: .95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.scorecard-matrix th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 142px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.scorecard-matrix tr:first-child th,
.scorecard-matrix tr:first-child td {
  background: var(--surface);
}

.scorecard-matrix td:last-child {
  background: var(--surface);
  color: var(--heading-subtitle);
  font-weight: 600;
}

.scorecard-matrix tr:last-child th,
.scorecard-matrix tr:last-child td {
  border-bottom: 0;
}

.scorecard-matrix th:last-child,
.scorecard-matrix td:last-child {
  border-right: 0;
}

.score-input-row th,
.score-input-row td {
  background: #fff;
}

.score-input-row input {
  width: 50px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--heading-subtitle);
  font: inherit;
  font-weight: 600;
  text-align: center;
}

.score-input-row input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}

.score-played-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand-primary);
  line-height: 1;
}

.score-played-dot::before,
.score-check-ico::before {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--brand-on-primary);
  border-bottom: 2px solid var(--brand-on-primary);
  transform: translateY(-1px) rotate(-45deg);
}

.score-check-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.score-check-ico::before {
  border-color: currentColor;
}

.score-actionbar {
  --score-action-btn-width: 168px;
  --score-action-primary-width: 198px;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 316px;
  z-index: 900;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: .75rem;
  min-height: 80px;
  padding: .6rem clamp(1rem, 1.5vw, 1.5rem);
  border-top: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}

.score-actionbar .sl-action {
  flex: 0 0 var(--score-action-btn-width);
  width: var(--score-action-btn-width);
  height: 44px;
  gap: .4rem;
  font-size: .86rem;
  font-weight: inherit;
}

.score-actionbar .sl-action--primary {
  flex-basis: var(--score-action-primary-width);
  width: var(--score-action-primary-width);
  margin-left: 0;
}

.score-actionbar-note {
  flex: 1 1 360px;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  min-width: 280px;
  max-width: 760px;
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.score-info-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: .08rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
}

.sidebar-is-collapsed .score-actionbar {
  left: 84px;
}

.content-body:has(.score-actionbar) {
  --actionbar-space: 96px;
  padding-bottom: var(--actionbar-space);
}

@media (max-width: 1180px) {
  .score-workspace {
    grid-template-columns: 1fr;
  }

  body:has(.score-actionbar) .scroll-more-indicator,
  .sidebar-is-collapsed body:has(.score-actionbar) .scroll-more-indicator {
    left: calc(316px + (100vw - 316px) / 2);
  }

  .sidebar-is-collapsed body:has(.score-actionbar) .scroll-more-indicator {
    left: calc(84px + (100vw - 84px) / 2);
  }

  .score-player-panel {
    position: static;
  }

  .score-card-panel {
    position: static;
  }

  .score-card-editor {
    height: auto;
    max-height: none;
  }

  .scorecard-sections {
    height: auto;
    overflow-y: visible;
  }

  .score-actionbar {
    flex-wrap: wrap;
  }

  .score-actionbar-note {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .score-player-list-head {
    display: none;
  }

  .score-player-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .score-player-identity {
    grid-column: 1;
  }

  .score-player-time,
  .score-player-progress,
  .score-status {
    grid-column: 1;
  }

  .score-card-titleline,
  .score-card-head-row {
    display: grid;
  }

  .score-actionbar {
    left: 0;
    align-items: center;
    gap: .5rem;
  }

  .score-actionbar .sl-action,
  .score-actionbar .sl-action--primary {
    flex: 1 1 100%;
    width: 100%;
  }

  .score-actionbar-note {
    margin-left: 0;
  }

  .content-body:has(.score-actionbar) {
    --actionbar-space: 260px;
  }
}

/* ── AI calendar ──────────────────────────────────────────── */
.ai-calendar-page-header {
  align-items: flex-start;
  margin-bottom: 1rem;
}
.ai-calendar-page-header p {
  max-width: 720px;
  margin: .35rem 0 0;
  color: var(--muted);
}
.ai-calendar-generator {
  margin-bottom: 1.5rem;
}
.ai-calendar-generator-grid {
  display: grid;
  grid-template-columns: minmax(120px, .55fr) minmax(120px, .55fr) minmax(280px, 1.8fr) auto;
  gap: 1rem;
  align-items: end;
}
.ai-calendar-generator .form-row input,
.ai-calendar-generator .form-row textarea {
  width: 100%;
}
.ai-calendar-notes-field textarea {
  min-height: 44px;
  resize: vertical;
}
.ai-calendar-generator-actions {
  align-self: end;
  margin-top: 0;
}
.ai-calendar-generator-actions .btn {
  min-width: 156px;
  height: 44px;
  white-space: nowrap;
}
.ai-calendar-proposal {
  overflow: hidden;
  padding: 0;
}
.ai-calendar-proposal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.ai-calendar-proposal-title {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  min-width: 0;
}
.ai-calendar-proposal-title h2 {
  margin: 0;
}
.ai-calendar-proposal-count {
  flex: 0 0 auto;
  padding: .25rem .55rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  color: var(--brand-primary);
  font-size: .82rem;
  font-weight: 600;
}
.ai-calendar-table {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.ai-calendar-table table {
  min-width: 880px;
}
.ai-calendar-table th {
  height: 46px;
  padding: .75rem 1rem;
  background: #f9fafb;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}
.ai-calendar-table td {
  height: 74px;
  padding: .75rem 1rem;
  background: #fff;
  white-space: normal;
}
.ai-calendar-table tbody tr:hover td {
  background: #fcfcfc;
}
.ai-calendar-table input[type="text"],
.ai-calendar-table input[type="date"],
.ai-calendar-table select {
  width: 100%;
  height: 40px;
  padding: 0 .7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: #f9fafb;
  color: var(--text);
  font-family: inherit;
  font-size: .92rem;
}
.ai-calendar-table input[type="text"]:focus,
.ai-calendar-table input[type="date"]:focus,
.ai-calendar-table select:focus {
  border-color: var(--brand-primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 14%, transparent);
  outline: none;
}
.ai-calendar-table select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 132px;
  padding-right: calc(14px + var(--icon-dropdown-w) + 8px);
  background-image: var(--icon-dropdown);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
}
.ai-calendar-table input[type="date"] {
  min-width: 154px;
}
.ai-calendar-table td:nth-child(4),
.ai-calendar-table th:nth-child(4) {
  width: 110px;
}
.ai-calendar-table td:nth-child(4) select {
  min-width: 76px;
}
.ai-calendar-name-cell {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
}
.ai-calendar-row-index {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 14%, var(--border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
  color: var(--brand-primary);
  font-size: .82rem;
  font-weight: 600;
}
.ai-calendar-reason {
  display: block;
  margin: .35rem 0 0 2.7rem;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
  white-space: normal;
}
.ai-calendar-source {
  display: inline-block;
  margin: .35rem 0 0 2.7rem;
}
.ai-calendar-submit-actions {
  margin-top: 0;
  padding: 1rem 1.5rem 1.25rem;
}
@media (max-width: 1180px) {
  .ai-calendar-generator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ai-calendar-notes-field,
  .ai-calendar-generator-actions {
    grid-column: 1 / -1;
  }
  .ai-calendar-generator-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 680px) {
  .ai-calendar-generator-grid {
    grid-template-columns: 1fr;
  }
  .ai-calendar-proposal-head {
    flex-direction: column;
    padding: 1rem;
  }
  .ai-calendar-proposal-count {
    align-self: flex-start;
  }
  .ai-calendar-table table {
    min-width: 760px;
  }
  .ai-calendar-table th,
  .ai-calendar-table td {
    padding: .7rem;
  }
  .ai-calendar-submit-actions {
    padding: 1rem;
  }
}

/* ── AI calendar: review popup + per-suggestion tab editor ── */
.ai-calendar-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.ai-calendar-launch h2 {
  margin: 0 0 .15rem;
}
.ai-proposal-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.ai-proposal-count {
  margin-left: auto;
  padding: .25rem .55rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  color: var(--brand-primary);
  font-size: .82rem;
  font-weight: 600;
}
.ai-proposal-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.ai-proposal-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.ai-proposal-index {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  color: var(--brand-primary);
  font-size: .8rem;
  font-weight: 700;
}
.ai-proposal-item-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.ai-proposal-item-main strong {
  font-size: .98rem;
}
.ai-proposal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  color: var(--muted);
  font-size: .85rem;
}
.ai-proposal-source {
  align-self: flex-start;
  margin-top: .15rem;
}
.ai-proposal-item-actions {
  flex: 0 0 auto;
  display: flex;
  gap: .4rem;
  align-items: center;
}
.ai-proposal-remove {
  color: #b91c1c;
  border-color: color-mix(in srgb, #b91c1c 25%, var(--border));
}
.ai-proposal-remove:hover {
  background: #fee2e2;
}
.ai-calendar-review .ai-proposal-head h2 {
  margin: 0;
}
.ai-proposal-generate {
  padding: 1.1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fbfcfd;
  margin-bottom: 1.25rem;
}
.ai-proposal-generate h3 {
  margin: 0 0 .2rem;
  font-size: 1rem;
}
.ai-proposal-generate .ai-calendar-generator-grid {
  margin-top: .75rem;
}
.ai-proposal-actions {
  justify-content: flex-end;
}

/* The tabbed editor inside a per-suggestion modal. */
.ai-edit-tabs {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  border-bottom: 1px solid var(--border);
}
.ai-edit-tab {
  border: 0;
  background: none;
  padding: .5rem .75rem;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.ai-edit-tab:hover {
  color: var(--text);
  background: #f6f7f9;
}
.ai-edit-tab.is-current {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}
.ai-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ai-edit-actions {
  margin-top: 1.25rem;
  justify-content: flex-end;
}
.ai-edit-reason {
  margin: 0;
  font-style: italic;
}
@media (max-width: 640px) {
  .ai-edit-tabs {
    gap: .15rem;
  }
  .ai-edit-tab {
    padding: .45rem .55rem;
    font-size: .82rem;
  }
}

.user-modal-summary {
  display: grid;
  gap: .3rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f9fafb;
}
.user-modal-summary > span:not(.chip) {
  color: var(--muted);
  font-size: .9rem;
}
.user-modal-summary .chip {
  justify-self: start;
  margin-top: .25rem;
}
.modal-section {
  display: grid;
  gap: .65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.modal-section h3 {
  margin: 0;
  font-size: 1rem;
}
.modal-section .form-help {
  margin: 0;
}

/* ── Modal popups ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
  overscroll-behavior: contain;
}
.modal-overlay[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .24);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  touch-action: none;
}
.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}
.modal-dialog-wide {
  width: min(900px, 100%);
}
/* Let a modal's dropdown (e.g. multiselect) escape the dialog instead of being clipped. */
.modal-allow-overflow .modal-dialog { overflow: visible; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: .1rem 0 0;
  font-size: 1.25rem;
}
.modal-eyebrow {
  margin: 0;
  color: var(--text);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
}
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
}
.modal-close:hover {
  background: #f9fafb;
  color: var(--text);
}
.modal-body {
  padding: 1.25rem;
}
/* Thin separator between a modal's main form and a secondary (e.g. danger) action. */
.modal-divider {
  margin: 1.25rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.modal-body .form-grid {
  max-width: none;
}
.modal-body .profile-page-grid {
  grid-template-columns: minmax(0, 1fr) 260px;
}
.credit-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.credit-modal-card {
  display: grid;
  gap: .3rem;
  min-height: 118px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff, #f8fafc);
}
.credit-modal-card > span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}
.credit-modal-card strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.25;
}
.credit-modal-card small {
  color: var(--muted);
  line-height: 1.35;
}
.credit-modal-card-primary {
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border));
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.24), transparent 34%),
    linear-gradient(135deg, var(--brand-primary), #0f766e 58%, #164e63);
}
.credit-modal-card-primary > span,
.credit-modal-card-primary strong,
.credit-modal-card-primary small {
  color: #fff;
}
.credit-modal-card-primary strong {
  font-size: 2.3rem;
  line-height: 1;
}
.credit-buy-section {
  margin-top: 1rem;
}
.billing-buy-form {
  display: grid;
  gap: 1rem;
}
.addon-fixed-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .8fr));
  gap: .75rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--border));
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--brand-primary) 16%, transparent), transparent 28%),
    linear-gradient(135deg, #f0fdf4, #fff 54%, #fff7ed);
}
.addon-fixed-card > div {
  display: grid;
  gap: .25rem;
  min-width: 0;
}
.addon-fixed-label {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}
.addon-fixed-card strong {
  overflow-wrap: anywhere;
}
.fixed-select-value {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 .8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
}
.billing-buy-method {
  max-width: 360px;
}
.billing-buy-actions {
  margin-top: 0;
}

/* ── Profile ──────────────────────────────────────────────── */
.profile-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}
.profile-section {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.profile-section-head {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.1rem;
}
.profile-section h2 {
  margin: 0;
}
.profile-section p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.profile-photo-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, var(--border));
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8faf9 100%);
}
.profile-photo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 18%, var(--border));
  color: var(--brand-primary);
  font-size: 1.05rem;
  font-weight: 800;
}
.profile-photo-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: .35rem;
}
.profile-photo-copy label {
  font-size: .9rem;
  font-weight: 700;
}
.profile-photo-copy p {
  margin: 0;
}
.profile-photo-copy input[type=file] {
  width: 100%;
  max-width: 360px;
  color: var(--muted);
  font-family: inherit;
  font-size: .88rem;
}
.profile-photo-copy input[type=file]::file-selector-button {
  margin-right: .75rem;
  padding: .48rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.profile-photo-copy input[type=file]::file-selector-button:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 28%, var(--border));
  background: #f8fafc;
}
.profile-form-divider {
  height: 1px;
  margin: .15rem 0;
  background: var(--border);
}
.profile-session-section {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.profile-session-section form {
  margin: 0;
}
@media (max-width: 900px) {
  .profile-page-grid {
    grid-template-columns: 1fr;
  }
  .modal-body .profile-page-grid {
    grid-template-columns: 1fr;
  }
  .credit-modal-grid,
  .addon-fixed-card {
    grid-template-columns: 1fr;
  }
  .billing-buy-method {
    max-width: none;
  }
  .profile-photo-control {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-warning { background: #fff7ed; color: #92400e; }
.credits-alert { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ── Flash toasts ─────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 4200;
  display: grid;
  width: min(420px, calc(100vw - 2rem));
  gap: .75rem;
  pointer-events: none;
}
.toast {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  overflow: hidden;
  padding: .95rem 1rem .85rem;
  border: 1px solid var(--toast-border, rgba(22, 101, 52, .24));
  border-radius: 8px;
  background: var(--toast-bg, #ecfdf3);
  color: var(--toast-color, #14532d);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
  opacity: 0;
  pointer-events: auto;
  transform: translateX(calc(100% + 1.25rem));
  transition: opacity .22s ease, transform .28s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.toast.is-hiding {
  opacity: 0;
  transform: translateX(calc(100% + 1.25rem));
}
.toast-success {
  --toast-bg: #dcfce7;
  --toast-border: #bbf7d0;
  --toast-color: #14532d;
  --toast-progress: #166534;
}
.toast-error {
  --toast-bg: #fee2e2;
  --toast-border: #fecaca;
  --toast-color: #991b1b;
  --toast-progress: #b91c1c;
}
.toast-body {
  min-width: 0;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.45;
}
.toast-close {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -.2rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  opacity: .68;
}
.toast-close:hover,
.toast-close:focus-visible {
  background: rgba(255, 255, 255, .45);
  opacity: 1;
}
.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--toast-progress, var(--brand-primary));
  transform-origin: left center;
}
.toast.is-visible .toast-progress {
  animation: toast-progress var(--toast-duration, 5s) linear forwards;
}
.toast.is-paused .toast-progress {
  animation-play-state: paused;
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (max-width: 680px) {
  .toast-stack {
    top: .75rem;
    right: .75rem;
    left: .75rem;
    width: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-visible,
  .toast.is-hiding {
    transform: none;
    transition: opacity .1s ease;
  }
  .toast.is-visible .toast-progress {
    animation: none;
    transform: scaleX(0);
  }
}

/* ── Dashboard widgets (six equal blocks) ─────────────────── */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 1024px) { .widget-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .widget-grid { grid-template-columns: 1fr; } }
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.widget h3 { margin-bottom: .75rem; }

/* ── Reports page ─────────────────────────────────────────── */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.reports-panel {
  min-width: 0;
}
.reports-table table {
  min-width: 0;
}
.reports-month-table table {
  min-width: 720px;
}
@media (max-width: 1100px) {
  .reports-grid {
    grid-template-columns: 1fr;
  }
}
.widget .widget-foot { margin-top: auto; }
.widget .widget-foot a { font-size: .9rem; }

/* ── Club dashboard ───────────────────────────────────────── */
.club-dashboard {
  width: 100%;
}
.dashboard-page-header {
  margin-bottom: 1.35rem;
}
.dashboard-section {
  margin-bottom: 1.75rem;
}
.dashboard-section h2,
.dashboard-section-head h2 {
  margin: 0 0 .75rem;
  color: var(--heading-subtitle);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}
.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.dashboard-section-head h2 { margin: 0; }
.dashboard-section-head a {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.dashboard-icon,
.dashboard-task-arrow {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.dashboard-hero-card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: min(720px, 100%);
  min-height: 170px;
  overflow: hidden;
  padding: 1.45rem 1.65rem;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
  text-decoration: none;
}
.dashboard-hero-card:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.dashboard-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--brand-secondary) 92%, transparent),
      color-mix(in srgb, var(--brand-primary) 58%, transparent)
    ),
    var(--dashboard-hero-image, url("/img/background_login.jpeg")) center / cover no-repeat;
}
.dashboard-hero-date {
  flex: 0 0 auto;
}
.dashboard-hero-date .date-block {
  width: 88px;
  padding: .75rem 0;
  border: 0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}
.dashboard-hero-date .date-block .dow,
.dashboard-hero-date .date-block .mon {
  color: var(--brand-primary);
  font-size: .8rem;
}
.dashboard-hero-date .date-block .day {
  color: var(--brand-primary);
  font-size: 2.35rem;
}
.dashboard-hero-content {
  display: grid;
  gap: .75rem;
  min-width: 0;
}
.dashboard-hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
}
.dashboard-hero-location,
.dashboard-hero-meta,
.dashboard-hero-meta > span {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.dashboard-hero-location,
.dashboard-hero-meta {
  color: rgba(255, 255, 255, .92);
}
.dashboard-hero-meta {
  flex-wrap: wrap;
  gap: .75rem 1rem;
}
.dashboard-hero-meta > span + span {
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, .35);
}
.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.dashboard-tournament-card,
.dashboard-empty-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.dashboard-tournament-card {
  display: grid;
  gap: .7rem;
  padding: 1rem 1.1rem .85rem;
}
.dashboard-card-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.dashboard-badge {
  display: inline-flex;
  align-items: center;
  height: 1.45rem;
  padding: 0 .65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary);
  font-size: .78rem;
  font-weight: 600;
}
/* On the dark hero card the badge sits in a grid; keep it pill-sized, not stretched. */
.dashboard-hero-badge {
  justify-self: start;
}
.dashboard-tournament-card h3 {
  margin: 0;
  color: var(--heading-subtitle);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.2;
}
.dashboard-tournament-card p {
  margin: -.3rem 0 .2rem;
  color: var(--muted);
}
.dashboard-registration {
  display: grid;
  gap: .35rem;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
}
.dashboard-registration-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}
.dashboard-registration-head strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dashboard-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.dashboard-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-primary);
}
.dashboard-close {
  color: var(--muted);
  font-size: .82rem;
}
.dashboard-task-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: .2rem;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.dashboard-task-link:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 35%, var(--border));
  text-decoration: none;
}
.dashboard-task-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text);
  font-size: .85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dashboard-task-arrow {
  margin-left: auto;
}
.dashboard-empty-card {
  padding: 1rem 1.1rem;
  color: var(--muted);
}
@media (max-width: 1280px) {
  .dashboard-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 920px) {
  .dashboard-card-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .dashboard-hero-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-hero-meta > span + span {
    padding-left: 0;
    border-left: 0;
  }
}

/* ── Tournament type picker ───────────────────────────────── */
.modal-flow-picker .modal-dialog-wide {
  width: min(920px, 100%);
}

/* ── Shotgun schema modal ─────────────────────────────────── */
.shotgun-schema-modal .modal-dialog-wide {
  width: min(980px, calc(100vw - 2rem));
}
.shotgun-schema-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 1.25rem;
  align-items: start;
}
.shotgun-schema-form .col-full,
.shotgun-schema-form .form-actions {
  grid-column: 1 / -1;
}
.shotgun-hole-grid-row {
  grid-column: 1 / -1;
}
.shotgun-hole-grid-row .table-container {
  max-height: 360px;
  overflow: auto;
}
.shotgun-hole-grid-row table {
  min-width: 0;
  margin: 0;
  table-layout: fixed;
}
.shotgun-hole-grid-row th,
.shotgun-hole-grid-row td {
  padding: .55rem .75rem;
}
.shotgun-hole-grid-row th:first-child,
.shotgun-hole-grid-row td:first-child {
  width: 34%;
}
.shotgun-hole-grid-row th:nth-child(2),
.shotgun-hole-grid-row td:nth-child(2) {
  width: 33%;
}
.shotgun-hole-grid-row th:last-child,
.shotgun-hole-grid-row td:last-child {
  width: 33%;
  text-align: right;
}
.shotgun-hole-grid-row input[type="number"] {
  width: 86px;
  height: 40px;
  margin-left: auto;
}
.shotgun-capacity-row {
  grid-column: 1 / -1;
}
@media (max-width: 720px) {
  .shotgun-schema-form {
    grid-template-columns: 1fr;
  }
  .shotgun-hole-grid-row input[type="number"] {
    width: 74px;
  }
}

.flow-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}
.flow-option-card {
  --flow-glow-x: 85%;
  --flow-glow-y: 20%;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 168px;
  overflow: hidden;
  gap: .95rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 42%, rgba(255,255,255,.26));
  border-radius: 8px;
  background:
    radial-gradient(circle at var(--flow-glow-x) var(--flow-glow-y), rgba(255,255,255,.22), transparent 34%),
    linear-gradient(135deg, var(--brand-primary), #0f766e 56%, #164e63);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
  color: #fff;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}
.flow-option-card:nth-child(2) { --flow-glow-x: 78%; --flow-glow-y: 22%; }
.flow-option-card:nth-child(3) { --flow-glow-x: 88%; --flow-glow-y: 18%; }
.flow-option-card:nth-child(4) { --flow-glow-x: 80%; --flow-glow-y: 28%; }
.flow-option-card:nth-child(5) { --flow-glow-x: 84%; --flow-glow-y: 24%; }
.flow-option-card:nth-child(6) { --flow-glow-x: 90%; --flow-glow-y: 22%; }
.flow-option-card:hover {
  border-color: rgba(255, 255, 255, .52);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--brand-primary) 22%, transparent),
    0 0 34px rgba(20, 184, 166, .34),
    0 18px 42px rgba(15, 23, 42, .22);
  color: #fff;
  filter: saturate(1.06);
  text-decoration: none;
  transform: translateY(-2px);
}
.flow-option-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-primary) 48%, #fff);
  outline-offset: 3px;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--brand-primary) 22%, transparent),
    0 0 34px rgba(20, 184, 166, .34),
    0 18px 42px rgba(15, 23, 42, .22);
}
.flow-option-head,
.flow-option-copy {
  position: relative;
  z-index: 1;
}
.flow-option-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.flow-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  color: #fff;
}
.flow-option-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}
.flow-option-copy {
  display: grid;
  align-self: end;
  gap: .45rem;
  max-width: 100%;
  margin-top: auto;
}
.flow-option-copy strong {
  color: #fff;
  font-size: 1rem;
  line-height: 1.25;
}
.flow-option-copy span {
  color: rgba(255, 255, 255, .82);
  font-size: .84rem;
  line-height: 1.45;
}
@media (max-width: 1024px) {
  .flow-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .flow-option-grid {
    grid-template-columns: 1fr;
  }
  .flow-option-card {
    min-height: 144px;
  }
}

/* Stacked date block: WOE / 29 / MEI */
.date-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  padding: .35rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  line-height: 1.1;
}
.date-block .dow { font-size: .65rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.date-block .day { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.date-block .mon { font-size: .65rem; font-weight: 600; text-transform: uppercase; color: var(--brand-primary); }

.list-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row .list-row-main { flex: 1; min-width: 0; }
.list-row .list-row-title { font-weight: 500; }
.list-row .list-row-sub { font-size: .85rem; color: var(--muted); }

/* ── Tournament workflow ──────────────────────────────────── */
.workflow-card {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8faf9 100%);
}
.workflow-head,
.workflow-next,
.workflow-step,
.flow-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.workflow-head h2,
.flow-action-head h2 { margin: .15rem 0 .25rem; }
.workflow-head p,
.workflow-next p,
.workflow-step p,
.flow-action-head p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}
.workflow-head strong {
  font-size: 1.8rem;
  color: var(--brand-primary);
}
.workflow-eyebrow,
.workflow-next span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0;
}
.workflow-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.workflow-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), #d2a971);
}
.workflow-next {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, var(--border));
  border-radius: 8px;
  background: #f5fbf7;
}
.workflow-next strong {
  display: block;
  margin: .15rem 0;
}
.workflow-next form,
.workflow-step-action form { margin: 0; }
.workflow-next-complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.workflow-step {
  min-height: 112px;
  align-items: flex-start;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
/* Aligned with the creation wizard's stepper palette: neutral white for a
   to-do step, a soft green accent for a completed one, and a circular numbered
   marker identical to .wizard-tab-marker — so the detail-page flow reads the
   same as /tournaments/wizard. No amber. */
.workflow-step.is-open {
  border-color: var(--border);
  background: #fff;
}
.workflow-step.is-done {
  border-color: color-mix(in srgb, var(--brand-primary) 22%, var(--border));
  background: #f5fbf7;
}
.workflow-step-marker {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--brand-primary);
  font-size: .85rem;
  font-weight: 700;
}
.workflow-step.is-done .workflow-step-marker {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}
.workflow-step-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.workflow-step > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.workflow-step-action {
  flex: 0 0 auto;
  align-self: center;
}
.workflow-action-done {
  color: var(--muted);
  font-size: .85rem;
}
.tournament-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.tournament-manage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 96px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.tournament-manage-card:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 28%, var(--border));
  background: #f8fbf9;
  text-decoration: none;
}
.tournament-manage-card > span:first-child {
  display: grid;
  gap: .25rem;
  min-width: 0;
}
.tournament-manage-card strong {
  color: var(--heading-subtitle);
  font-size: 1.02rem;
  font-weight: 600;
}
.tournament-manage-card small {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}
.flow-action-card {
  scroll-margin-top: 96px;
}
.pairing-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.pairing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 1rem;
}
.form-help {
  align-self: center;
  color: var(--muted);
  font-size: .9rem;
}
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.spec-card {
  margin-bottom: 1.5rem;
}
.spec-grid .spec-card {
  margin-bottom: 0;
}
.spec-card h2 {
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .workflow-steps,
  .tournament-manage-grid,
  .pairing-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }
  .workflow-head,
  .workflow-next,
  .workflow-step,
  .flow-action-head {
    align-items: flex-start;
  }
  .workflow-next,
  .workflow-step {
    flex-direction: column;
  }
  .workflow-step-action {
    align-self: stretch;
  }
  .workflow-step-action .btn,
  .workflow-step-action form,
  .workflow-step-action button,
  .workflow-next .btn,
  .workflow-next form,
  .workflow-next button {
    width: 100%;
  }
}

/* ── App-settings: media fields + live login preview ──────── */
.app-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.app-settings-preview {
  position: sticky;
  top: 1rem;
}
.brand-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: .25rem;
}
.brand-color-control {
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 48px;
  padding: .35rem .45rem .35rem .4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.brand-color-control:focus-within {
  border-color: color-mix(in srgb, var(--brand-primary) 42%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.brand-color-dot {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.brand-color-dot span {
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--swatch-color, var(--brand-primary));
  box-shadow: none;
  transition: transform .16s ease;
}
.brand-color-dot:hover span,
.brand-color-dot:focus-within span {
  transform: scale(1.05);
  box-shadow: none;
}
.brand-color-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.form-row .brand-color-hex {
  width: 100%;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.brand-color-hex:focus {
  outline: none;
}
.app-range-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: .9rem;
  align-items: center;
  max-width: 560px;
}
.app-range {
  --range-progress: 0%;
  width: 100%;
  height: 32px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.app-range:focus {
  outline: none;
}
.app-range::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--border));
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--brand-primary) 0 var(--range-progress),
    #e8ece8 var(--range-progress) 100%
  );
}
.app-range::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: none;
  -webkit-appearance: none;
}
.app-range:focus::-webkit-slider-thumb {
  box-shadow: none;
}
.app-range::-moz-range-track {
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--border));
  border-radius: 999px;
  background: #e8ece8;
}
.app-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--brand-primary);
}
.app-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: none;
}
.app-range-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 34px;
  padding: 0 .6rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 16%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: .9rem;
}
.form-hint {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .85rem;
}
.media-current {
  position: relative;
  width: fit-content;
  margin: .35rem 0;
}
.media-current[hidden] {
  display: none;
}
.media-thumb {
  max-width: 120px;
  max-height: 72px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .35rem;
  background: #fff;
}
.media-thumb-wide {
  max-width: 220px;
  max-height: 120px;
  object-fit: cover;
}
.media-remove-button {
  position: absolute;
  top: -9px;
  right: -9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
  transform: scale(.9);
  transition: opacity .16s ease, transform .16s ease, background .16s ease;
}
.media-current-removable:hover .media-remove-button,
.media-current-removable:focus-within .media-remove-button {
  opacity: 1;
  transform: scale(1);
}
.media-remove-button:hover,
.media-remove-button:focus {
  background: #b91c1c;
  outline: none;
}
@media (hover: none) {
  .media-remove-button {
    opacity: 1;
    transform: scale(1);
  }
}
.media-remove {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin: .15rem 0 .4rem;
  font-weight: 400;
  font-size: .85rem;
  color: var(--muted);
}
.media-empty {
  margin: .25rem 0;
  color: var(--muted);
  font-size: .85rem;
}
.upload-input {
  display: none;
}
.upload-dropzone {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 72px;
  padding: .9rem 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--brand-primary) 34%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff 0%, #f8faf9 100%),
    color-mix(in srgb, var(--brand-primary) 5%, #fff);
  color: var(--text);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.upload-dropzone:hover,
.upload-dropzone:focus,
.upload-dropzone.is-dragging {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 9%, #fff);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
  outline: none;
}
.upload-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}
.upload-dropzone-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .15rem;
}
.upload-dropzone-copy strong {
  font-size: .94rem;
}
.upload-dropzone-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-dropzone-wide {
  min-height: 86px;
}
.club-settings-media-field {
  max-width: min(50%, 560px);
}
.club-settings-media-field .upload-dropzone {
  width: 100%;
}
@media (max-width: 900px) {
  .club-settings-media-field {
    max-width: 100%;
  }
}

/* Phone mockup of the member (player) app: login + in-app preview. */
.app-preview-tabs {
  display: flex;
  width: fit-content;
  gap: .25rem;
  margin: 0 auto 1rem;
  padding: .25rem;
  border-radius: 999px;
  background: #eef0ee;
  border: 1px solid var(--border);
}
.app-preview-tab {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: .4rem .9rem;
  border-radius: 999px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
}
.app-preview-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.app-settings-preview .app-preview-tabs.view-switch {
  display: flex;
  width: fit-content;
  margin: 0 auto 1rem;
}
.app-settings-preview .app-preview-tab.view-switch-btn {
  border: 0;
  line-height: 1;
}
.app-settings-preview .app-preview-tab.view-switch-btn.is-active {
  box-shadow: none;
}
.app-preview-phone {
  width: 320px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 38px;
  background: #0c0d0e;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
}
.app-preview-screen {
  position: relative;
  aspect-ratio: 9 / 19;
  border-radius: 28px;
  overflow: hidden;
  background: #f5f6f4;
}
.app-preview-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 38%;
  height: 18px;
  background: #0c0d0e;
  border-radius: 0 0 12px 12px;
  z-index: 5;
}
.app-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.app-screen.is-active {
  display: flex;
}
.lp-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: rgba(0, 0, 0, .45);
}
.lp-ico-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Login screen ── */
.app-login {
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.6rem 1.2rem;
  color: #fff;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--brand-primary), var(--brand-secondary));
}
.app-login-photo {
  position: absolute;
  inset: 0;
  background-image: var(--lp-bg, none);
  background-size: cover;
  background-position: center;
  opacity: .25;
  pointer-events: none;
}
.app-login > :not(.app-login-photo) {
  position: relative;
  z-index: 1;
}
.app-login-logo {
  display: grid;
  place-items: center;
}
.app-login-logo img {
  display: block;
  border-radius: 10px;
}
.app-login-logo img[hidden] {
  display: none;
}
.app-login-logo.fit-contain img {
  height: var(--logo-h, 72px);
  width: auto;
  max-width: 92%;
  object-fit: contain;
}
.app-login-logo.fit-cover img {
  height: var(--logo-h, 72px);
  width: var(--logo-h, 72px);
  object-fit: cover;
}
.app-login-mono {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  border: 2px solid var(--brand-accent);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 26px;
}
.app-login-mono[hidden] {
  display: none;
}
.app-login-name {
  margin-top: .25rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
}
.app-login-tagline {
  margin-bottom: .25rem;
  font-size: .72rem;
  opacity: .85;
}
.app-login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .9rem;
  text-align: left;
  color: var(--text);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}
.lp-input {
  display: flex;
  align-items: center;
  gap: .5rem;
  height: 34px;
  padding: 0 .55rem;
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: var(--lp-radius, 12px);
  background: #fff;
}
.lp-ph {
  flex: 1;
  font-size: .72rem;
  color: rgba(0, 0, 0, .5);
}
.lp-ico-eye {
  fill: rgba(0, 0, 0, .35);
}
.app-login-btn {
  margin-top: .15rem;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--lp-radius, 12px);
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
}
.app-login-forgot {
  margin-top: .1rem;
  font-size: .7rem;
  text-align: center;
  color: rgba(0, 0, 0, .87);
}
.app-login-sso {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border-radius: var(--lp-radius, 12px);
  border: 1px solid rgba(255, 255, 255, .55);
  font-size: .72rem;
}
.lp-sso-ico {
  width: 15px;
  height: 15px;
  fill: #fff;
}
.app-login-product {
  margin-top: .1rem;
  font-size: .62rem;
  opacity: .7;
}

/* ── In-app screen ── */
.app-inapp {
  background: #f5f6f4;
  color: #211c1d;
}
.ai-body {
  flex: 1;
  padding: 1.35rem 1rem .7rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ai-greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem;
  margin-bottom: .9rem;
}
.ai-hello {
  font-size: 1.26rem;
  font-weight: 800;
  color: #171214;
  line-height: 1.05;
}
.ai-club {
  margin-top: .22rem;
  font-size: .83rem;
  color: var(--muted);
  line-height: 1.2;
}
.ai-crest {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  opacity: .16;
}
.ai-crest img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ai-crest img[hidden],
.ai-crest-mono[hidden] {
  display: none;
}
.ai-crest-mono {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}
.ai-section {
  margin: 0 0 .48rem;
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.15;
  color: #171214;
}
.ai-next {
  padding: .95rem .95rem .85rem;
  border-radius: max(var(--lp-radius, 16px), 16px);
  background: var(--brand-primary);
  color: #fff;
}
.ai-next-name {
  font-weight: 800;
  font-size: 1.23rem;
  line-height: 1.05;
}
.ai-next-lines {
  display: grid;
  gap: .28rem;
  margin: .65rem 0 .8rem;
}
.ai-next-line {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  font-size: .83rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, .92);
}
.ai-next-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-meta-ico {
  width: 15px;
  height: 15px;
  fill: #fff;
  opacity: .75;
}
.ai-meta-ico.lp-ico-stroke {
  fill: none;
  stroke: #fff;
}
.ai-next-btn {
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: max(var(--lp-radius, 12px), 12px);
  background: #fff;
  color: var(--brand-primary);
  font-weight: 800;
  font-size: .94rem;
}
.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .85rem 0 1rem;
}
.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 32px;
  max-width: 100%;
  padding: .42rem .68rem;
  border-radius: max(var(--lp-radius, 8px), 8px);
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  color: var(--brand-primary);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1;
}
.ai-chip span {
  white-space: nowrap;
}
.ai-chip svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.ai-chip .lp-ico-stroke {
  fill: none;
  stroke: currentColor;
}
.ai-section-upcoming {
  margin-top: .05rem;
}
.ai-upcoming-list {
  display: grid;
  gap: .55rem;
}
.ai-compact-card {
  display: flex;
  align-items: center;
  gap: .72rem;
  min-height: 62px;
  padding: .56rem .68rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .045);
}
.ai-date-chip {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: max(var(--lp-radius, 12px), 12px);
  background: color-mix(in srgb, var(--brand-primary) 10%, #fff);
  color: var(--brand-primary);
  line-height: 1;
}
.ai-date-chip strong {
  display: block;
  font-size: 1.12rem;
  font-weight: 800;
}
.ai-date-chip span {
  display: block;
  margin-top: .12rem;
  font-size: .72rem;
  font-weight: 700;
}
.ai-compact-copy {
  min-width: 0;
  display: grid;
  gap: .12rem;
}
.ai-compact-copy strong,
.ai-compact-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-compact-copy strong {
  color: #171214;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.15;
}
.ai-compact-copy span {
  color: rgba(0, 0, 0, .65);
  font-size: .66rem;
  line-height: 1.15;
}
.ai-compact-chevron {
  width: 22px;
  height: 22px;
  margin-left: auto;
  fill: rgba(0, 0, 0, .72);
}
.ai-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 66px;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .05);
  background: #fff;
  padding: .38rem .4rem .5rem;
}
.ai-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .16rem;
  min-width: 0;
  font-size: .56rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(0, 0, 0, .6);
}
.ai-nav-item::before {
  content: "";
  position: absolute;
  top: .12rem;
  left: 50%;
  width: 48px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: transparent;
}
.ai-nav-item svg {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  fill: currentColor;
}
.ai-nav-item .lp-ico-stroke {
  fill: none;
  stroke: currentColor;
}
.ai-nav-item span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-nav-item.is-active {
  color: var(--brand-primary);
  font-weight: 700;
}
.ai-nav-item.is-active::before {
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
}
@media (max-width: 980px) {
  .app-settings-grid {
    grid-template-columns: 1fr;
  }
  .app-settings-preview {
    position: static;
  }
}
@media (max-width: 760px) {
  .brand-color-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .app-preview-phone {
    width: 280px;
  }
  .app-range-control {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
  .app-range-value {
    justify-self: start;
  }
}

/* ── Branded auth / login ─────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.55)),
    var(--auth-bg, linear-gradient(135deg, var(--brand-secondary), var(--brand-primary)));
  background-size: cover;
  background-position: center;
}
.auth-wrap-tenant {
  display: block;
  padding: 0;
  width: 100%;
  background: #fff;
}
.auth-split {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 52vw) minmax(420px, 1fr);
  background: #fff;
}
.auth-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(1.75rem, 4vw, 3.5rem);
  color: #fff;
  /* Club-branded: overlay + fallback gradient derive from the club's colours. */
  background-image:
    linear-gradient(90deg,
      color-mix(in srgb, var(--brand-secondary) 80%, transparent) 0%,
      color-mix(in srgb, var(--brand-secondary) 45%, transparent) 54%,
      color-mix(in srgb, var(--brand-secondary) 16%, transparent) 100%),
    var(--auth-bg, linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%));
  background-size: cover;
  background-position: center;
}
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, .16), transparent 24%),
    linear-gradient(180deg, transparent 0%, rgba(4, 19, 15, .38) 100%);
  pointer-events: none;
}
.auth-hero-top,
.auth-hero-copy {
  position: relative;
  z-index: 1;
}
.auth-hero-logo {
  max-width: 190px;
  max-height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .18));
}
.auth-hero-copy {
  max-width: min(560px, 82%);
}
.auth-eyebrow {
  display: block;
  margin-bottom: .9rem;
  color: color-mix(in srgb, var(--brand-accent, #b9ffd6) 55%, #ffffff);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
}
.auth-hero h1 {
  max-width: 680px;
  color: #fff;
  font-size: clamp(2.65rem, 4.5vw, 5.25rem);
  line-height: .98;
  font-weight: 800;
  margin: 0 0 1.2rem;
}
.auth-hero p {
  max-width: 440px;
  margin: 0;
  color: rgba(255, 255, 255, .92);
  font-size: 1.1rem;
  line-height: 1.45;
  font-weight: 500;
}
.auth-powered {
  margin-top: .35rem;
  color: rgba(255, 255, 255, .74);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 0;
}
.auth-powered strong {
  color: #fff;
}
.auth-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
  background: #fff;
}
.auth-panel-inner {
  width: min(100%, 400px);
}
.auth-panel-inner.auth-2fa-panel {
  width: min(100%, 460px);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-card .auth-logo { text-align: center; margin-bottom: 1rem; }
.auth-card .auth-logo img { max-height: 64px; max-width: 200px; object-fit: contain; }
.auth-card h1,
.auth-panel-inner h1 {
  color: #071321;
  font-size: 2.15rem;
  line-height: 1.15;
  font-weight: 800;
  text-align: left;
  margin-bottom: .55rem;
}
.auth-card h1 {
  text-align: center;
  font-size: 1.6rem;
}
.auth-card .auth-club,
.auth-panel-inner .auth-club {
  color: #7d8794;
  margin-bottom: 2.1rem;
  font-size: 1rem;
}
.auth-card .auth-club {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card .btn,
.auth-panel-inner .btn {
  width: 100%;
  height: 52px;
  border-radius: 8px;
  font-weight: 800;
}
.auth-panel-inner .btn-primary {
  background: var(--brand-primary);
}
.auth-panel-inner .btn-primary:hover {
  background: var(--brand-secondary);
}
.auth-panel-inner .form-grid {
  gap: 1.05rem;
}
.auth-panel-inner .form-row label {
  color: #071321;
  font-size: .9rem;
  font-weight: 700;
}
.auth-panel-inner input[type="email"],
.auth-panel-inner input[type="password"],
.auth-panel-inner input[type="text"] {
  height: 50px;
  border-radius: 10px;
  border-color: #d9e1eb;
  font-size: .95rem;
}
.auth-panel-inner input::placeholder {
  color: #9aa3af;
}
.auth-panel-inner input[type="email"]:focus,
.auth-panel-inner input[type="password"]:focus,
.auth-panel-inner input[type="text"]:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}
.auth-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 34px;
  color: var(--muted);
  font-size: .86rem;
}
.auth-form-meta label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}
.auth-form-meta input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}
.auth-foot { text-align: center; margin-top: 1.5rem; font-size: .75rem; color: var(--muted); }

/* "or" divider + SSO button on the login screen */
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--muted); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-sso { display: flex; align-items: center; justify-content: center; gap: .5rem; }

/* Two-factor challenge / enrolment */
.auth-2fa-panel .auth-club {
  margin-bottom: 1.35rem;
}
.auth-2fa-qr {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.auth-2fa-qr svg { width: 192px; height: 192px; border-radius: 8px; }
.auth-2fa-secret { text-align: center; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.auth-2fa-secret code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.auth-2fa-secret code,
.auth-2fa-recovery code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-2fa-recovery {
  background: color-mix(in srgb, var(--brand-primary) 6%, #fff);
  border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: 1.25rem;
}
.auth-2fa-recovery p { font-size: .82rem; color: #4a5563; margin-bottom: .5rem; }
.auth-2fa-recovery ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem; }
.auth-2fa-recovery li { font-size: .85rem; }

/* Login help footer — demo request (new visitors) + support/forgot (customers) */
.auth-help { margin-top: 1.5rem; text-align: center; }
.auth-help-line { margin: .3rem 0; font-size: .85rem; color: #4a5563; }
.auth-help-line.auth-help-muted { font-size: .8rem; color: var(--muted); }
.auth-help-line a { font-weight: 600; }

/* Central post-login product picker */
.auth-product-card { max-width: 460px; }
.auth-product-list { display: flex; flex-direction: column; gap: .65rem; }
.auth-product {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-product:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 4%, #fff);
}
.auth-product-body { display: flex; flex-direction: column; gap: .15rem; }
.auth-product-name { font-weight: 700; color: #071321; }
.auth-product-host { font-size: .8rem; color: var(--muted); }
.auth-product-enter { font-size: .85rem; font-weight: 700; color: var(--brand-primary); white-space: nowrap; }

/* Plain link-styled submit button (logout from picker / no-access screens) */
.auth-link-button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--brand-primary); text-decoration: underline;
}

@media (max-width: 960px) {
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    min-height: 38vh;
    padding: 1.5rem;
  }
  .auth-hero-copy {
    max-width: 92%;
  }
  .auth-hero h1 {
    font-size: clamp(2.1rem, 10vw, 3.2rem);
  }
  .auth-panel {
    min-height: 62vh;
    padding: 2rem 1.25rem 2.5rem;
  }
}

@media (max-width: 560px) {
  .auth-hero {
    min-height: 34vh;
  }
  .auth-hero-logo {
    max-width: 118px;
    max-height: 68px;
  }
  .auth-hero p {
    font-size: .98rem;
  }
  .auth-form-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: .4rem;
  }
}

/* ── Wedstrijd-aanmaak wizard ─────────────────────────────── */
.wizard { display: grid; gap: 1rem; }
.wizard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wizard-tabs li { flex: 1 1 140px; min-width: 0; }
.wizard-tab {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.wizard-tab:hover:not(.is-locked) { border-color: color-mix(in srgb, var(--brand-primary) 35%, var(--border)); }
.wizard-tab.is-current {
  border-color: var(--brand-primary);
  background: #f5fbf7;
}
.wizard-tab.is-locked { opacity: .55; cursor: not-allowed; }

/* Single-option start type (9 holes, no extras enabled) — locked, can't change. */
select.is-locked { background-color: var(--bg); color: var(--muted); pointer-events: none; }
.wizard-tab.is-disabled { opacity: .55; cursor: not-allowed; }
.wizard-tab.is-disabled:hover { border-color: var(--border); }
.wizard-tab-marker {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--brand-primary);
  font-size: .85rem;
  font-weight: 700;
}
.wizard-tab.is-current .wizard-tab-marker { background: var(--brand-primary); color: var(--brand-on-primary); }
.wizard-tab-label { display: flex; flex-direction: column; line-height: 1.2; font-weight: 500; }
.wizard-tab-label small { color: var(--muted); font-weight: 400; font-size: .7rem; }

.wizard[data-comp] .wizard-tabs li {
  flex: 0 0 auto;
}
.wizard[data-comp] .wizard-tab {
  width: auto;
  min-width: 128px;
  padding-right: 1rem;
}
.wizard[data-comp] .wizard-tab-label {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .wizard[data-comp] .wizard-tabs li {
    flex: 1 1 140px;
  }
  .wizard[data-comp] .wizard-tab {
    width: 100%;
  }
  .wizard[data-comp] .wizard-tab-label {
    white-space: normal;
  }
}

.wizard-panel-title { margin: 0 0 1rem; }
.wizard-section { padding: 1rem 0; border-top: 1px solid var(--border); }
.wizard-section:first-of-type { padding-top: 0; border-top: 0; }
.wizard-section-title {
  margin: 0 0 1rem;
  color: var(--heading-subtitle);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
}
.wizard-hint { margin: -.25rem 0 .75rem; color: var(--muted); font-size: .85rem; }
.wizard-output {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .6rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--text);
  font-weight: 600;
}
.wizard-inline { display: flex; align-items: center; gap: .5rem; }
.wizard-inline input { width: 100%; min-width: 0; }
.wizard-inline-sep { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.wizard-free-tee-list {
  display: grid;
  gap: .75rem;
}
.wizard-free-tee-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
}
.wizard-add-tee-button { margin-top: .75rem; align-self: flex-start; }
@media (max-width: 720px) {
  .wizard-free-tee-control { grid-template-columns: 1fr; }
  .wizard-free-tee-control .btn { justify-self: flex-start; }
}
.wizard-checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.wizard-checks-stacked { flex-direction: column; gap: .5rem; }
.wizard-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 400;
}
.wizard-check input { height: auto; }
.wizard-check.is-fixed { color: var(--muted); }
.wizard-leader-list {
  display: grid;
  gap: .5rem;
  margin-top: .75rem;
}
.wizard-leader-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f9fafb;
}
.wizard-leader-name { font-weight: 500; color: var(--text); }
.wizard-leader-phone { color: var(--muted); font-size: .9rem; }
@media (max-width: 720px) {
  .wizard-leader-row { grid-template-columns: 1fr; }
}

/* Challenges (per-hole side competitions) */
.wizard-challenge-list {
  display: grid;
  gap: .65rem;
  margin: .75rem 0;
  max-width: 640px;
}
.wizard-challenge-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: end;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.wizard-challenge-field {
  display: grid;
  gap: .3rem;
  min-width: 0;
}
.wizard-challenge-field span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}
.wizard-challenge-field select {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 calc(14px + var(--icon-dropdown-w) + 4px) 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
}
.wizard-challenge-field select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}
.wizard-challenge-remove {
  height: 44px;
}
[data-wizard-challenges] > .wizard-inline {
  max-width: 640px;
}
@media (max-width: 720px) {
  .wizard-challenge-row { grid-template-columns: 1fr; }
  .wizard-challenge-row [data-wizard-remove-challenge] { grid-column: 1 / -1; }
}
.wizard-locked {
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--muted);
}
.wizard-actions { align-items: center; }
.wizard-spacer { flex: 1; }

/* ── Tournament calendar (agenda + list views) ───────────────── */
.calendar-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
}
.calendar-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 .85rem;
  padding: .8rem .95rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 5%, #fff), #fff 48%),
    #fff;
}
.calendar-nav {
  display: flex;
  gap: .4rem;
}
.calendar-nav .btn {
  min-width: 38px;
  height: 34px;
  border-color: color-mix(in srgb, var(--brand-primary) 18%, var(--border));
  background: #fff;
  color: var(--brand-secondary);
  font-weight: 700;
}
.calendar-nav .calendar-nav-btn {
  width: 38px;
  padding: 0;
}
.calendar-nav .calendar-today-btn {
  min-width: 86px;
}
.calendar-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}
.calendar-nav .btn:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 36%, var(--border));
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  color: var(--brand-primary);
}
.calendar-title {
  margin: 0;
  color: var(--brand-primary);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}
.calendar-title span {
  margin-left: .35rem;
  color: #6b7280;
  font-weight: 500;
}
.calendar-meta {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  color: var(--muted);
  font-size: .82rem;
}
.calendar-meta .calendar-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .25rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}
.calendar-meta .strong {
  border-color: color-mix(in srgb, var(--brand-primary) 24%, var(--border));
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  color: var(--brand-primary);
  font-weight: 700;
}

.view-switch {
  display: inline-flex;
  gap: .2rem;
  margin: 0;
  padding: .25rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, var(--border));
  border-radius: 8px;
  background: #fff;
  height: 40px;
}
.view-switch-btn {
  min-width: 88px;
  padding: .12rem .95rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  text-align: center;
}
.view-switch-btn.is-active {
  background: var(--brand-primary);
  color: #fff;
}
.view-switch-btn:not(.is-active):hover {
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  color: var(--brand-primary);
}

.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekday {
  padding: .55rem .7rem;
  color: #6b7280;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.calendar-grid {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 11%, var(--border));
  border-radius: 8px;
  background: #fff;
}
.calendar-cell {
  min-height: 104px;
  padding: .5rem;
  background: #fff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .28rem;
  overflow: hidden;
}
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-grid > .calendar-cell:nth-last-child(-n + 7) { border-bottom: 0; }
.calendar-cell.is-outside { background: #f8faf9; }
.calendar-cell.is-outside .calendar-daynum { opacity: .45; }
.calendar-daynum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 1.45rem;
  height: 1.45rem;
  color: var(--text);
  font-size: .8rem;
  font-weight: 800;
}
.calendar-cell.is-today .calendar-daynum {
  background: var(--brand-primary);
  color: #fff;
  border-radius: 999px;
}

.calendar-event {
  display: block;
  min-height: 24px;
  padding: .22rem .45rem .22rem .55rem;
  border: 1px solid color-mix(in srgb, var(--event-color) 24%, transparent);
  border-left: 4px solid var(--event-color);
  border-radius: 6px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--event-color) 18%, #fff), color-mix(in srgb, var(--event-color) 8%, #fff));
  color: #33413c;
  font-size: .73rem;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.calendar-event:hover {
  border-color: color-mix(in srgb, var(--event-color) 44%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--event-color) 26%, #fff), color-mix(in srgb, var(--event-color) 12%, #fff));
  color: #17221e;
}
.calendar-event.is-locked { opacity: .55; cursor: default; }
.calendar-event-time { font-weight: 800; margin-right: .25rem; }

.calendar-color-dot {
  display: inline-block;
  width: .7rem;
  height: .7rem;
  border-radius: 2px;
  flex: 0 0 auto;
}
.calendar-list-month {
  margin: .5rem 0 .75rem;
  color: var(--brand-primary);
  font-size: 1.05rem;
  text-transform: capitalize;
}
.calendar-list-row {
  align-items: center;
  gap: .75rem;
  border-radius: 8px;
}
.calendar-list-row:hover {
  background: color-mix(in srgb, var(--brand-primary) 5%, #fff);
}
.calendar-list-row.is-locked { opacity: .6; }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .9rem;
  padding-top: .85rem;
  border-top: 1px solid color-mix(in srgb, var(--brand-primary) 10%, var(--border));
  font-size: .82rem;
  color: var(--text);
}
.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 28px;
  padding: .25rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}
.calendar-legend-count { color: var(--muted); }

@media (max-width: 900px) {
  .calendar-header-actions {
    justify-content: flex-start;
  }
  .calendar-toolbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .calendar-title {
    text-align: left;
  }
  .calendar-meta {
    justify-content: flex-start;
  }
}

/* Per-round date/time editor on the tournament page */
.rounds-edit-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.rounds-edit-label { font-weight: 600; min-width: 5rem; padding-bottom: .55rem; }

/* ============================================================
   Matchplay knock-out wizard (participant picker + bracket preview)
   ============================================================ */
.mpko-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .mpko-layout { grid-template-columns: 1fr; }
}
.mpko-main { min-width: 0; }

/* Filter bar: let the search grow, keep the rest compact and wrapping. */
.mpko-filters { flex-wrap: wrap; align-items: center; }
.mpko-filters input[type="search"] { flex: 1 1 200px; min-width: 160px; }
.mpko-filter-range {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: .25rem;
}
.mpko-filter-range-label {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  line-height: 1;
}
.mpko-filters .mpko-range { flex: 0 0 auto; }
.mpko-filters .mpko-range input { width: 84px; }
.mpko-filters .wizard-check { white-space: nowrap; }

.mpko-participant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.mpko-participant-title {
  display: flex;
  align-items: center;
  gap: .1rem;
  margin: 0;
}
.mpko-participant-head .mpko-csv-button {
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .mpko-participant-head {
    align-items: stretch;
    flex-direction: column;
  }
  .mpko-participant-head .mpko-csv-button {
    align-self: flex-start;
  }
}

.mpko-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: .75rem 0 .35rem;
}
.mpko-toolbar select {
  width: min(260px, 100%);
  height: 44px;
  min-width: 220px;
  padding: 0 calc(14px + var(--icon-dropdown-w) + 4px) 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  appearance: none;
}
.mpko-toolbar select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}
.mpko-toolbar-note { color: var(--muted); font-size: .85rem; margin-left: auto; }
.mpko-csv-button { position: relative; cursor: pointer; margin: 0; }
.mpko-csv-result { margin-top: 0; }

/* Scrollable member table so 1000+ rows stay usable. */
.mpko-table { max-height: 460px; overflow-y: auto; }
.mpko-table table { margin: 0; }
.mpko-table thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
.table-container.mpko-table tbody tr.is-selected td {
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
}
.mpko-table tbody tr { cursor: pointer; }

/* Live summary panel (sticky beside the table / settings). */
.mpko-aside { position: sticky; top: 1rem; }
.mpko-summary-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--surface, #fff);
}
.mpko-summary-selected {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}
.mpko-summary-count { font-size: 2rem; font-weight: 700; color: var(--brand-primary); line-height: 1; }
.mpko-summary-selected-label { color: var(--muted); font-size: .9rem; }
.mpko-summary-stats { display: grid; gap: .55rem; margin: 0; }
.mpko-summary-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.mpko-summary-stats dt { color: var(--muted); font-size: .9rem; }
.mpko-summary-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.mpko-summary-warning {
  margin: .85rem 0 0;
  padding: .55rem .7rem;
  border-radius: 6px;
  background: #fff7ed;
  color: #92400e;
  font-size: .85rem;
}

/* Manual seeding reorder list. */
.mpko-seed-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; max-height: 360px; overflow-y: auto; }
.mpko-seed-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .6rem;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.mpko-seed-num { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-weight: 600; }
.mpko-seed-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpko-seed-hcp { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.mpko-seed-controls { display: flex; gap: .25rem; }
.mpko-seed-controls .btn { padding: 0 .5rem; }

/* Step 1 conditional sub-fields. */
.mpko-subfield { margin: -.15rem 0 .35rem 1.65rem; }
/* Hint under a checkbox, aligned with the label text. */
.mpko-check-hint { margin: -.35rem 0 .4rem 1.65rem; }

/* Bracket preview table. */
.mpko-preview-totals {
  margin-bottom: 1rem;
  padding: .6rem .85rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  font-weight: 500;
}
.mpko-preview-table td:first-child { font-weight: 600; color: var(--muted); white-space: nowrap; vertical-align: top; }
.mpko-preview-table tr.mpko-preview-group td { border-top: 2px solid var(--border); }

/* ── Round Robin wizard — poule division (step 3) ── */
/* Reuses .mpko-layout / .mpko-filters / .mpko-table / .mpko-aside / .mpko-summary-*
   from the matchplay-knockout wizard; only the poule-specific bits are below. */
.rr-poule-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem;
  margin-bottom: .75rem;
}
.rr-poule-controls .form-row { margin: 0; }
.rr-poule-controls .wizard-checks-stacked { gap: .25rem; }
.rr-poule-controls input[type="number"] { width: 150px; }
.rr-poule-controls #rr_seeding { min-width: 360px; }

.rr-poule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
  margin-top: .75rem;
}
.rr-poule-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: .75rem .85rem;
}
.rr-poule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.rr-poule-name {
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  padding: .15rem .3rem;
  border-radius: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.rr-poule-name:hover { border-color: var(--border); }
.rr-poule-name:focus { border-color: var(--brand-primary); background: #fff; }
.rr-poule-meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.rr-poule-members { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.rr-poule-player {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name hcp" "move move";
  align-items: center;
  gap: .3rem .5rem;
}
.rr-poule-player-name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-poule-player-hcp { grid-area: hcp; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.rr-poule-move,
.rr-poule-controls select,
.rr-result-select {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 calc(14px + var(--icon-dropdown-w) + 4px) 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
}
.rr-poule-move {
  grid-area: move;
  width: 100%;
  max-width: 100%;
}
.rr-result-select {
  width: min(360px, 100%);
}
.rr-result-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.rr-poule-move:focus,
.rr-poule-controls select:focus,
.rr-result-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}

/* Ryder Cup — "bij gelijke eindstand" note under the scoreboard. */
.rc-tie-note { text-align: center; margin: -0.75rem 0 1.5rem; color: var(--muted); }
.rc-tie-note.is-tied { font-weight: 600; color: var(--text); }

/* Entrant builder (doubles/teams) — reuses .rr-poule-card / .rr-poule-grid. */
.rr-entrant-builder { margin-bottom: 1rem; }
.rr-entrant-builder > .rr-poule-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  margin-top: .5rem;
}
.rr-unassigned { border-style: dashed; background: color-mix(in srgb, var(--muted) 7%, #fff); margin-top: .75rem; }
.rr-poule-name-static { font-weight: 600; }
.rr-divider { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Schedule preview (step 4). */
.rr-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(640px, 100%), 1fr));
  gap: 1.5rem;
}
.rr-preview-poule { margin-bottom: 0; }
.rr-preview-poule h4 { margin: 0 0 .5rem; }

/* ============================================================
   Ryder Cup wizard (data-rc) — steps 3-6.
   Reuses .mpko-layout / .mpko-filters / .mpko-table / .mpko-aside /
   .mpko-summary-* for the participant step; only the team builder,
   sessions, pairings and preview bits are below.
   ============================================================ */
.rc-muted { color: var(--muted); font-size: .9rem; }

.rc-format-check span { line-height: 1.4; }

/* Step 2 — participant picker: filters span the full panel; summary aligns with the table row. */
.mpko-participant-controls,
.rc-participant-controls,
.rr-participant-controls {
  grid-column: 1 / -1;
  min-width: 0;
}
.mpko-participant-controls .mpko-filters,
.rc-participant-controls .mpko-filters,
.rr-participant-controls .mpko-filters {
  align-items: flex-end;
}

/* Step 3 — team builder */
.rc-step-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.rc-team-summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .6rem;
  margin: .75rem 0 1rem;
}
.rc-team-summary-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: .65rem .75rem;
  min-width: 0;
}
.rc-team-summary-item span,
.rc-team-summary-item small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.25;
}
.rc-team-summary-item strong {
  display: block;
  margin-top: .18rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.rc-team-summary-item[data-rc-balance-state="good"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.rc-team-summary-item[data-rc-balance-state="good"] strong,
.rc-team-summary-item[data-rc-balance-state="good"] small { color: var(--brand-primary); }
.rc-team-summary-item[data-rc-balance-state="fair"] {
  border-color: #fde68a;
  background: #fffbeb;
}
.rc-team-summary-item[data-rc-balance-state="bad"] {
  border-color: #fecaca;
  background: #fff7f7;
}
.rc-team-summary-item[data-rc-balance-state="bad"] strong,
.rc-team-summary-item[data-rc-balance-state="bad"] small { color: #b42318; }
@media (max-width: 1100px) {
  .rc-team-summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rc-team-summary-strip { grid-template-columns: 1fr 1fr; }
}
.rc-team-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem 1.25rem;
  margin-bottom: 1rem;
}
.rc-inline-field { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.rc-inline-field select { min-width: 200px; }
.rc-captain-required { margin-bottom: .45rem; }
.rc-inline-field > span {
  font-weight: 500;
  color: var(--text);
}

.rc-inline-field select,
.rc-unassigned-tools input[type="search"],
.rc-unassigned-tools select,
.rc-session-row input[type="number"],
.rc-session-row input[type="date"],
.rc-session-row input[type="time"],
.rc-session-row select,
.rc-match-side select,
.rc-match-pick,
.rc-pairings select,
.rc-result-select {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background-color: #fff;
}

.rc-inline-field select,
.rc-unassigned-tools select,
.rc-session-row select,
.rc-match-side select,
.rc-match-pick,
.rc-pairings select,
.rc-result-select {
  padding-right: calc(14px + var(--icon-dropdown-w) + 4px);
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
}

.rc-unassigned-tools input[type="search"]::placeholder {
  color: var(--muted);
}

.rc-inline-field select:focus,
.rc-unassigned-tools input[type="search"]:focus,
.rc-unassigned-tools select:focus,
.rc-session-row input[type="number"]:focus,
.rc-session-row input[type="date"]:focus,
.rc-session-row input[type="time"]:focus,
.rc-session-row select:focus,
.rc-match-side select:focus,
.rc-match-pick:focus,
.rc-pairings select:focus,
.rc-result-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}

.rc-unassigned-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, .6fr) minmax(120px, .6fr);
  gap: .5rem;
  margin: 0 0 .65rem;
}
.rc-result-form {
  display: inline-flex;
  width: 100%;
  max-width: 260px;
}
.rc-result-select {
  min-width: 180px;
}
@media (max-width: 640px) {
  .rc-unassigned-tools {
    grid-template-columns: 1fr;
  }
}

.rc-teams {
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) repeat(2, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .rc-teams { grid-template-columns: 1fr; } }
.rc-team-col {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: .75rem .85rem;
  min-width: 0;
}
.rc-team-col--a { border-top: 3px solid var(--brand-primary); }
.rc-team-col--b { border-top: 3px solid var(--brand-secondary); }
.rc-team-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.rc-team-head h4 { margin: 0; font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-team-head p { margin: .15rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.25; }
.rc-team-count {
  flex: 0 0 auto;
  min-width: 1.6rem;
  text-align: center;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  border-radius: 999px;
  padding: .05rem .5rem;
  font-size: .8rem;
  font-weight: 600;
}
.rc-team-list {
  display: grid;
  gap: .35rem;
  min-height: 64px;
  max-height: 440px;
  overflow: auto;
  padding: .25rem;
  border-radius: 8px;
  border: 1px dashed transparent;
}
.rc-team-list.is-dragover { border-color: var(--brand-primary); background: #f5fbf7; }
.rc-team-list-empty { color: var(--muted); font-size: .85rem; padding: .75rem .25rem; text-align: center; }
.rc-player {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: .35rem .5rem;
  cursor: grab;
}
.rc-player.is-dragging { opacity: .45; }
.rc-player.is-captain { border-color: var(--brand-primary); box-shadow: inset 0 0 0 1px var(--brand-primary); }
.rc-player.is-locked { background: #f8faf9; }
.rc-player.is-excluded { background: #f8fafc; color: var(--muted); }
.rc-player-main { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .5rem; min-width: 0; padding-top: .25rem; }
.rc-player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-player-hcp { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.rc-captain-badge,
.rc-lock-badge,
.rc-excluded-badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 999px;
  padding: .05rem .35rem;
}
.rc-captain-badge {
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  background: #f0fdf4;
}
.rc-lock-badge {
  color: #475569;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}
.rc-excluded-badge {
  color: #92400e;
  border: 1px solid #fde68a;
  background: #fffbeb;
}
.rc-player-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; flex: 0 0 auto; max-width: 56%; }
.rc-action {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: .22rem .45rem;
  font-size: .73rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}
.rc-action:hover { background: #f5fbf7; border-color: var(--brand-primary); color: var(--brand-primary); }
.rc-action-captain { color: var(--brand-primary); }
.rc-player.is-captain .rc-action-captain { background: var(--brand-primary); color: var(--brand-on-primary); border-color: var(--brand-primary); }
.rc-player.is-locked .rc-action-lock { background: #e2e8f0; border-color: #cbd5e1; color: #334155; }
.rc-mini {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rc-mini:hover { background: #f5fbf7; border-color: var(--brand-primary); }
.rc-mini-captain { color: var(--brand-primary); }
.rc-player.is-captain .rc-mini-captain { background: var(--brand-primary); color: var(--brand-on-primary); }
.rc-team-stats { display: grid; gap: .3rem; margin: .6rem 0 0; padding-top: .6rem; border-top: 1px solid var(--border); }
.rc-team-stats > div { display: flex; justify-content: space-between; gap: 1rem; }
.rc-team-stats dt { color: var(--muted); font-size: .8rem; }
.rc-team-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: .85rem; }

.rc-warnings { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .4rem; }
.rc-warnings li {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  padding: .45rem .65rem;
  font-size: .85rem;
}

/* Step 4 — sessions */
.rc-sessions { display: grid; gap: .4rem; margin-bottom: .75rem; }
.rc-session-row {
  display: grid;
  grid-template-columns: 2.5rem 1.4fr 1fr 1fr 1.3fr 2.5rem;
  align-items: center;
  gap: .5rem;
}
.rc-session-head { color: var(--muted); font-size: .8rem; font-weight: 500; padding: 0 .1rem; }
.rc-session-row input, .rc-session-row select { margin: 0; }
.rc-session-seq {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
}
.rc-session-count { display: flex; flex-direction: column; gap: .1rem; }
.rc-session-max { color: var(--muted); font-size: .72rem; }
.rc-sessions-actions { margin: .25rem 0 .5rem; }
@media (max-width: 720px) {
  .rc-session-row { grid-template-columns: 2rem 1fr 1fr; grid-auto-rows: auto; }
  .rc-session-head { display: none; }
}

/* Step 5 — pairings */
.rc-pairing-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; margin-bottom: 1rem; }
.rc-pairings { display: grid; gap: 1.25rem; }
.rc-pairing-session { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: .85rem 1rem; }
.rc-pairing-session h4 { margin: 0 0 .6rem; font-size: 1rem; }
.rc-match-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  border-top: 1px solid var(--border);
}
.rc-match-row:first-of-type { border-top: 0; }
.rc-match-num { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.rc-match-vs { color: var(--muted); font-size: .8rem; text-align: center; }
.rc-match-side { display: grid; gap: .3rem; min-width: 0; }
.rc-match-side select { margin: 0; }
.rc-match-remove { justify-self: end; }
@media (max-width: 720px) { .rc-match-row { grid-template-columns: 1fr; text-align: left; } .rc-match-vs { text-align: left; } }

/* Step 6 — preview */
.rc-preview { display: grid; gap: 1.25rem; }
.rc-preview-headline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.rc-preview-stat {
  flex: 1 1 140px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: .75rem .85rem;
  text-align: center;
}
.rc-preview-stat .rc-preview-figure { font-size: 1.6rem; font-weight: 700; color: var(--brand-primary); line-height: 1; }
.rc-preview-stat .rc-preview-label { color: var(--muted); font-size: .8rem; }
.rc-preview-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .rc-preview-teams { grid-template-columns: 1fr; } }
.rc-preview-team { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: .85rem 1rem; }
.rc-preview-team h4 { margin: 0 0 .25rem; }
.rc-preview-team .rc-preview-meta { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.rc-preview-team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.rc-preview-team li { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.rc-preview-team li .rc-player-hcp { font-size: .8rem; }
.rc-preview-session { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: .85rem 1rem; }
.rc-preview-session h4 { margin: 0 0 .5rem; }
.rc-preview-session ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.rc-preview-session li { font-size: .9rem; }

/* Matchplay knock-out — Doubles "Koppels maken" step. */
.mpko-pairs-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: .75rem;
}
@media (max-width: 720px) { .mpko-pairs-cols { grid-template-columns: 1fr; } }
.mpko-pairs-heading { margin: 0 0 .35rem; font-size: .9rem; }
.mpko-pairs-pool,
.mpko-pairs-formed { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 380px; overflow-y: auto; }
.mpko-pool-item {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.mpko-pool-item:hover { border-color: color-mix(in srgb, var(--brand-primary) 35%, var(--border)); }
.mpko-pool-item.is-selected { background: color-mix(in srgb, var(--brand-primary) 12%, #fff); border-color: var(--brand-primary); }
.mpko-pool-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpko-pool-hcp { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.mpko-pair-row {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto auto; align-items: center; gap: .6rem;
  padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 6px;
}
.mpko-pair-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Matchplay knock-out — Teams builder + teamduel format. */
.mpko-teams-grid { margin-top: .75rem; }
.mpko-team-assign { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.mpko-team-assign td { padding: .3rem .5rem; border-bottom: 1px solid var(--border); }
.mpko-team-assign td:last-child { width: 150px; }
.mpko-team-assign select { width: 100%; }
.mpko-team-meta-list { display: grid; gap: .4rem; }
.mpko-team-meta-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: .5rem; }
.mpko-team-num { color: var(--muted); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.mpko-team-size { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; min-width: 1.5rem; text-align: right; }
.mpko-team-format label { font-weight: 400; }

/* ── Registrations screen (Inschrijvingen) ───────────────────── */
.page-title-date { color: var(--muted); font-weight: 600; }

/* Tournament management stepper — reuses the wizard-tab look as navigation links. */
.tournament-steps { margin: 0 0 .75rem; }
a.wizard-tab { text-decoration: none; }
.wizard-tab.is-done .wizard-tab-marker {
  position: relative;
  background: var(--brand-primary);
  color: var(--brand-on-primary, #fff);
  font-size: 0;
}

.wizard-tab.is-done .wizard-tab-marker::before {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}

/* Search bar + icon-only export button */
.reg-screen > .tournament-step-toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .5rem;
  align-items: center;
}

.reg-screen > .tournament-step-toolbar .tournament-step-heading {
  grid-column: 1 / span 2;
}

.reg-screen > .tournament-step-toolbar .reg-heading {
  display: inline-flex;
  align-items: center;
  margin: 0;
  margin-left: 1rem;
  line-height: 1.2;
  transform: translateY(-.16rem);
}

.sl-toolbar-actions.reg-toolbar-search {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  align-items: center;
  margin-left: auto;
  width: 100%;
}

.reg-toolbar-search .table-tools {
  grid-column: 1 / span 2;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.reg-toolbar-search .table-tools input[type="search"] {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #fff var(--icon-search) no-repeat left 12px center;
  background-size: 16px 16px;
  padding: 0 .75rem 0 calc(12px + 16px + 8px);
}

.reg-toolbar-search .table-tools input[type="search"]:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}

.reg-toolbar-icons {
  grid-column: 3 / span 2;
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

@media (max-width: 1100px) {
  .reg-screen > .tournament-step-toolbar {
    display: flex;
    height: auto;
  }

  .sl-toolbar-actions.reg-toolbar-search {
    display: flex;
    flex: 1 1 100%;
    margin-left: 0;
  }

  .reg-toolbar-search .table-tools {
    flex: 1 1 260px;
  }
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.btn-icon img { width: 18px; height: 18px; }
.btn-icon:hover { border-color: var(--brand-primary); }
.btn-icon.is-disabled {
  cursor: not-allowed;
  opacity: .45;
}
.btn-icon.is-disabled:hover { border-color: var(--border); }

/* Table column sizing + preference icons */
.reg-pos-col { width: 88px; text-align: left; font-variant-numeric: tabular-nums; }
.reg-fed-col { width: 120px; }
.reg-gender-col { width: 64px; text-align: center; }
.reg-whs-col { width: 86px; }
.reg-status-col { width: 130px; }
.reg-pref-col { width: 110px; }
.reg-prefs { display: inline-flex; gap: .4rem; }
.reg-pref { display: inline-flex; width: 18px; height: 18px; }
.reg-pref img { width: 18px; height: 18px; }

/* Drag-and-drop reordering */
.reg-pos-wrap {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.reg-drag-cell { width: 40px; text-align: center; }
.reg-drag-handle { display: inline-flex; align-items: center; justify-content: center; cursor: grab; padding: .25rem; border-radius: 4px; }
.reg-drag-handle:hover { background: #f0f2f1; }
.reg-drag-handle img { width: 16px; height: 16px; pointer-events: none; }
.reg-row.is-dragging { opacity: .5; background: #f5fbf7; }
.reg-row.is-dragging td { background: #f5fbf7; }
.reg-table .bulk-cell { width: 44px; text-align: center; }
.reg-edit-bulk-hint { color: var(--muted); font-size: .9rem; margin: 0 0 .25rem; }

/* Click-to-select rows drive the bottom action bar. */
.reg-row { cursor: pointer; }
.reg-row.is-selected td { background: color-mix(in srgb, var(--brand-primary) 12%, #fff); }

/* Fixed bottom action bar — the window scrolls, so position:fixed offset by the
   sidebar width; buttons are disabled until a row is clicked. */
.reg-action-bar {
  position: fixed;
  left: 316px;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem clamp(1rem, 1.5vw, 1.5rem);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
  min-height: 80px;
}
.sidebar-is-collapsed .reg-action-bar { left: 84px; }
.reg-bar-selection { color: var(--brand-primary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.reg-bar-actions {
  --reg-action-btn-width: 168px;
  display: flex;
  justify-content: flex-end;
  gap: .4rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.reg-bar-actions .btn {
  flex: 0 0 var(--reg-action-btn-width);
  justify-content: center;
  width: var(--reg-action-btn-width);
  max-width: 100%;
  height: 44px;
}
.reg-bar-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
.reg-bar-btn { white-space: nowrap; }
.action-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.content-body:has(.reg-action-bar) {
  --actionbar-space: 96px;
  padding-bottom: var(--actionbar-space);
}
@media (max-width: 1100px) {
  .content-body:has(.reg-action-bar) { --actionbar-space: 140px; }
}
@media (max-width: 720px) {
  .reg-action-bar { left: 0; flex-wrap: wrap; gap: .5rem; }
  .reg-bar-selection { max-width: none; width: 100%; }
  .reg-bar-actions { justify-content: flex-start; margin-left: 0; width: 100%; }
  .content-body:has(.reg-action-bar) { --actionbar-space: 190px; }
}

/* Add/import picker */
.reg-picker-table { max-height: 48vh; overflow-y: auto; margin-top: .5rem; }
.reg-picker-table table { min-width: 0; }
.reg-import-bar { align-items: center; }
.reg-csv-button { margin-left: auto; }
.reg-csv-result { margin: .5rem 0 0; color: var(--muted); font-size: .9rem; }
.reg-picker-actions { align-items: center; justify-content: space-between; margin-top: .75rem; }
.reg-picker-count { color: var(--muted); font-size: .9rem; }

/* Profile modal */
.reg-profile { display: grid; gap: .6rem; margin: 0; }
.reg-profile > div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.reg-profile > div:last-child { border-bottom: 0; }
.reg-profile dt { color: var(--muted); margin: 0; }
.reg-profile dd { margin: 0; font-weight: 600; text-align: right; }

/* ── Startlist board (drag-and-drop flights) ─────────────────── */
.sl-screen {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.sl-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  height: 44px;
}

.tournament-step-toolbar {
  margin-bottom: .75rem;
}

.tournament-step-heading {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
}

.tournament-step-heading .chip {
  transform: translateY(-.18rem);
}

.sl-heading,
.reg-heading {
  margin-left: 1rem;
}

/* Reserve-list table sits below the confirmed field with its own heading. */
.reg-reserve-section { margin-top: 1.75rem; }
.reg-reserve-heading {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .5rem 1rem;
  font-size: 1.05rem;
}

.sl-subhead {
  margin: .15rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.sl-toolbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.tournament-step-toolbar-actions {
  flex-wrap: wrap;
}

.tournament-step-toolbar-actions form {
  margin: 0;
}

.sl-save-status {
  font-size: .82rem;
  color: var(--muted);
  min-width: 4rem;
  text-align: right;
  transition: color .2s ease;
}

.sl-save-status.is-saved { color: var(--brand-primary); }
.sl-save-status.is-error { color: #b91c1c; }

/* Generate / settings row */
.sl-generate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .9rem 1rem;
}

.sl-generate-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.sl-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .82rem;
  color: var(--muted);
}

.sl-field select,
.sl-field input {
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: #fff;
  box-shadow: none;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
}

.sl-field select {
  padding-right: calc(14px + var(--icon-dropdown-w) + 4px);
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
}

.sl-field select:focus,
.sl-field input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}

/* Two-column board */
.sl-board {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.sl-roster {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  position: sticky;
  top: 1rem;
  overflow: hidden;
}

.sl-roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  min-height: 52px;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sl-roster-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--heading-subtitle);
}

.sl-roster-count {
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted, #6b7280);
  font-variant-numeric: tabular-nums;
}

.sl-roster-list {
  flex: 1;
  overflow-y: auto;
  padding: .6rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-height: 120px;
}

.sl-roster-list.is-dragover {
  background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
}

.sl-roster-empty {
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
  padding: 1.5rem .5rem;
}

.sl-roster-foot {
  margin: 0;
  padding: .65rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--muted);
}

/* Player card (roster + seated) */
.sl-player {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 3rem;
  padding: .45rem .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: grab;
  transition: border-color .12s ease, box-shadow .12s ease, opacity .12s ease, background .12s ease, transform .12s ease;
}

.sl-player:hover { border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border)); }
.sl-player.is-dragging { opacity: .45; }
.sl-player.is-drop-fadeout {
  animation: slDropSourceFade .16s ease forwards;
}
.sl-player.is-drop-in {
  animation: slDropIn .34s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--sl-drop-delay, 0ms);
}
.sl-player.is-drop-returned {
  animation: slReturnSettle .28s cubic-bezier(.2, .8, .2, 1) both;
}
.sl-player.is-selected {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 22%, transparent);
}

.sl-player.is-assigned {
  background: color-mix(in srgb, var(--brand-primary) 5%, var(--surface));
  border-style: dashed;
}

.sl-player.is-drag-source,
.sl-player.is-selected.is-drag-source,
.sl-player.is-assigned.is-drag-source {
  opacity: .82;
  background: #eef2ef;
  border-color: #d8e0dc;
  border-style: solid;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
  cursor: not-allowed;
}

.sl-player.is-drag-source:hover,
.sl-player.is-selected.is-drag-source:hover,
.sl-player.is-assigned.is-drag-source:hover {
  border-color: #d8e0dc;
}

.sl-player.is-drag-source > * { opacity: 0; }

.sl-drag-preview {
  position: fixed;
  top: -1000px;
  left: -1000px;
  z-index: 10000;
  width: min(320px, 72vw);
  padding: 0 20px 22px 0;
  box-sizing: content-box;
  pointer-events: none;
}

.sl-drag-preview-layer {
  position: absolute;
  top: 0;
  right: 20px;
  bottom: 22px;
  left: 0;
  min-height: 3rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--border));
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .1);
}

.sl-drag-preview-layer:nth-child(1) { transform: translate(6px, 7px); opacity: .72; }
.sl-drag-preview-layer:nth-child(2) { transform: translate(12px, 14px); opacity: .48; }
.sl-drag-preview-layer:nth-child(3) { transform: translate(18px, 21px); opacity: .28; }

.sl-drag-preview-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .55rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  padding: .45rem .6rem;
  border: 1px solid var(--brand-primary);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 20%, transparent), 0 10px 22px rgba(15, 23, 42, .14);
}

.sl-drag-preview-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 .45rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
}

.sl-return-ghost {
  position: fixed;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 3rem;
  padding: .45rem .6rem;
  border: 1px solid var(--brand-primary);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
  box-sizing: border-box;
  pointer-events: none;
  opacity: .96;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .28s ease;
}

.sl-return-ghost.is-returning {
  transform: translate(var(--sl-return-x, 0), var(--sl-return-y, 0)) scale(.98);
  opacity: .22;
}

@keyframes slDropSourceFade {
  to {
    opacity: 0;
    transform: scale(.96);
  }
}

@keyframes slDropIn {
  0% {
    opacity: 0;
    transform: translateY(9px) scale(.98);
    background: color-mix(in srgb, var(--brand-primary) 12%, var(--surface));
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-primary) 0%, transparent);
  }
  58% {
    opacity: 1;
    transform: translateY(0) scale(1);
    background: color-mix(in srgb, var(--brand-primary) 9%, var(--surface));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 20%, transparent);
  }
  100% {
    opacity: 1;
    transform: none;
    box-shadow: none;
  }
}

@keyframes slReturnSettle {
  0% {
    opacity: .5;
    transform: translateY(-5px) scale(.98);
    background: color-mix(in srgb, #f59e0b 12%, var(--surface));
  }
  70% {
    opacity: 1;
    transform: translateY(1px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.sl-player-grip {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1;
  flex: 0 0 auto;
}

.sl-player-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sl-player-name {
  font-size: .9rem;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sl-player-hcp {
  font-size: .78rem;
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
}

.sl-player-prefs {
  display: inline-flex;
  gap: .15rem;
  flex: 0 0 auto;
  /* Push the player's start/buggy preference to the right edge of the card. */
  margin-left: auto;
}

.sl-player-prefs img {
  width: 14px;
  height: 14px;
  opacity: .85;
}

/* Settings-derived start time + hole shown read-only in a flight head. */
.sl-flight-hole {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--heading-subtitle, #374151);
  font-variant-numeric: tabular-nums;
}

.sl-player-badge {
  flex: 0 0 auto;
  font-size: .68rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  border-radius: 999px;
  padding: .05rem .4rem;
}

.sl-seat-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 .15rem;
}

.sl-seat-remove:hover { color: #b91c1c; }

/* Flights grid */
.sl-flights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .9rem;
}

.sl-flights-empty {
  color: var(--muted);
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.sl-flight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sl-flight.is-dragover {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 20%, transparent);
}

.sl-flight-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: space-between;
  min-height: 52px;
  padding: .85rem 1rem;
  background: color-mix(in srgb, var(--brand-primary) 7%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.sl-flight-title {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  color: var(--heading-subtitle);
  font-size: .92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sl-flight-nr,
.sl-flight-time,
.sl-flight-title-sep {
  color: var(--heading-subtitle);
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
}

.sl-flight-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  margin-left: auto;
  text-align: right;
}

.sl-flight-meta label {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  color: var(--muted);
}

.sl-flight-meta input {
  width: 7.25rem;
  height: 36px;
  min-width: 0;
  padding: 0 .65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
  font-family: inherit;
  font-size: .85rem;
  color: var(--text);
}

.sl-flight-meta input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  outline: none;
}

.sl-flight-meta input.sl-hole-input {
  width: 4.8rem;
  text-align: center;
}

.sl-flight-meta input::-webkit-calendar-picker-indicator {
  margin-right: 0;
}

.sl-flight-meta input[type="time"] {
  padding-right: .45rem;
  font-variant-numeric: tabular-nums;
}

.sl-flight-seats {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .55rem;
  flex: 1;
  min-height: 60px;
}

.sl-seat-empty {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 3rem;
  padding: .45rem .6rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: .85rem;
}

.sl-seat-empty[data-sl-seat] { cursor: pointer; }
.sl-seat-empty[data-sl-seat]:hover { border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border)); }

.sl-seat-ghost { justify-content: space-between; }

.sl-flight-foot {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: .45rem .7rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.sl-flight-total {
  font-size: .78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sl-flight-total strong { color: var(--text); }

.sl-flight-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem;
}

.sl-flight-remove:hover { color: #b91c1c; }

/* Bottom action bar */
.sl-actionbar {
  --sl-action-btn-width: 168px;
  --sl-action-primary-width: 198px;
  position: fixed;
  left: 316px;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  min-height: 80px;
  padding: .6rem clamp(1rem, 1.5vw, 1.5rem);
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}
.sidebar-is-collapsed .sl-actionbar { left: 84px; }
.content-body:has(.sl-actionbar) {
  --actionbar-space: 96px;
  padding-bottom: var(--actionbar-space);
}

.sl-action {
  flex: 0 0 var(--sl-action-btn-width);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: var(--sl-action-btn-width);
  max-width: 100%;
  height: 40px;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}

.sl-action:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border));
  background: color-mix(in srgb, var(--brand-primary) 5%, var(--surface));
}

.sl-action:disabled { opacity: .5; cursor: not-allowed; }

.sl-action--primary {
  flex-basis: var(--sl-action-primary-width);
  width: var(--sl-action-primary-width);
  margin-left: auto;
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
}

.sl-action--primary:hover:not(:disabled) {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

/* An action armed by a selection (swap players / swap flights) goes green. */
.sl-action.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
}
.sl-action.is-active:hover:not(:disabled) {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

/* A flight armed for swapping. */
.sl-flight.is-selected {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 22%, transparent);
}

.sl-action-ico { font-size: .95rem; line-height: 1; }

@media (max-width: 900px) {
  .sl-board { grid-template-columns: 1fr; }
  .sl-roster { position: static; max-height: 320px; }
  .sl-generate-fields { grid-template-columns: repeat(2, 1fr); }
  .content-body:has(.sl-actionbar) { --actionbar-space: 150px; }
  .sl-action--primary { margin-left: 0; }
}

@media (max-width: 720px) {
  .sl-actionbar {
    left: 0;
    align-items: center;
    min-height: 80px;
    gap: .5rem;
  }
  .content-body:has(.sl-actionbar) { --actionbar-space: 220px; }
}

@media print {
  .shell-sidebar, .shell-topbar, .sl-toolbar, .sl-generate,
  .sl-actionbar, .sl-roster, .detail-tabbar, .page-header form, .tournament-steps { display: none !important; }
  .sl-board { grid-template-columns: 1fr; }
  .sl-flight { break-inside: avoid; }
}

/* ── Startlist board: add-flight tile + auto-arrange modal ───── */
.sl-add-flight-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}

.sl-add-flight-tile:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border));
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 4%, transparent);
}

.sl-add-flight-tile .sl-action-ico { font-size: 1.3rem; }

.sl-modal-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .9rem;
}

.sl-consider {
  gap: .5rem;
  margin-top: 1.35rem;
  margin-bottom: 1.25rem;
}
.sl-consider legend { font-size: .9rem; font-weight: 500; color: var(--text); padding: 0; margin-bottom: .15rem; }
.sl-consider .wizard-check { font-size: .9rem; }
