/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
    --cbc-accent:        #c45c26;
    --cbc-accent-hover:  #a84d20;
    --cbc-accent-soft:   #fef4ef;
    --cbc-blue:          #2d7dd2;
    --cbc-green:         #2a9d6e;
    --cbc-purple:        #8b5cf6;

    --cbc-bg:            #ffffff;
    --cbc-surface:       #fafafa;
    --cbc-surface-raised:#ffffff;
    --cbc-surface-hover: #f5f5f5;
    --cbc-border:        #e8e8e8;
    --cbc-border-soft:   #f0f0f0;

    --cbc-text:          #1a1a1a;
    --cbc-text-muted:    #6b7280;
    --cbc-text-xmuted:   #9ca3af;

    --cbc-link:          #1f4f96;
    --cbc-focus:         #8ab4ff;
    --cbc-on-accent:     #ffffff;

    --cbc-success:       #177245;
    --cbc-success-bg:    #eaf8ef;
    --cbc-success-border:#b9dfc7;
    --cbc-warning:       #7a4b00;
    --cbc-warning-bg:    #fff4d6;
    --cbc-warning-border:#f0d49a;
    --cbc-danger:        #991b1b;
    --cbc-danger-bg:     #fee2e2;
    --cbc-danger-border: #fca5a5;
    --cbc-info:          #124f83;
    --cbc-info-bg:       #eaf4ff;
    --cbc-info-border:   #b8d7f4;

    --cbc-radius-sm:     6px;
    --cbc-radius:        12px;
    --cbc-radius-lg:     16px;

    --cbc-shadow-sm:     0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --cbc-shadow:        0 4px 16px rgba(15,23,42,.08);
    --cbc-shadow-lg:     0 12px 40px rgba(15,23,42,.12);

    --cbc-header-h:      72px;
    --cbc-container-max: 1160px;

    color-scheme: light;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* PR A: physical location hierarchy and editorial workflow */
.loc-hero,
.loc-filter,
.loc-card-header,
.loc-map-heading,
.loc-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.loc-hero {
  padding: clamp(1.5rem, 4vw, 3.25rem);
  border-radius: 1.5rem;
  color: #f8faf7;
  background:
    radial-gradient(circle at 85% 20%, rgba(246, 196, 70, 0.34), transparent 24rem),
    linear-gradient(135deg, #123b36, #17675a);
  box-shadow: 0 1.4rem 3.5rem rgba(18, 59, 54, 0.18);
}

.loc-hero h1,
.loc-map-heading h2,
.loc-results-heading h2,
.form-page-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.025em;
}

.loc-hero h1 { margin: 0.15rem 0 0.5rem; color: inherit; }
.loc-hero p { max-width: 48rem; margin-bottom: 0; color: rgba(248, 250, 247, 0.86); }
.loc-eyebrow { margin: 0; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }

.loc-filter {
  margin: 1.5rem 0 0.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--cbc-border);
  border-radius: 1rem;
  background: linear-gradient(120deg, var(--cbc-surface-raised), var(--cbc-success-bg));
}
.loc-filter h2, .loc-filter p { margin: 0; }
.loc-filter label { min-width: 11rem; margin: 0; }
.loc-filter select { margin-bottom: 0; }
.loc-filter-summary { color: var(--cbc-text-muted); font-size: 0.9rem; }

.loc-layout {
  margin: 1.25rem 0 2.5rem;
}
.loc-layout--map-only { display: block; }
.loc-map-panel {
  border: 1px solid var(--cbc-border);
  border-radius: 1.25rem;
  background: var(--cbc-surface-raised);
  box-shadow: var(--cbc-shadow);
}
.loc-map-panel { overflow: hidden; }
.loc-map-heading { padding: 1rem 1.2rem; }
.loc-map-heading h2 { margin: 0; }
.loc-layout--map-only .loc-map { min-height: clamp(24rem, 48vw, 34rem); background: var(--cbc-surface); }
.loc-map-marker-wrap { overflow: visible; border: 0; background: transparent; }
.loc-map-marker {
  position: absolute;
  top: 2px;
  left: 3px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--cbc-accent);
  color: var(--cbc-on-accent);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 0.45rem 0.8rem rgba(15, 23, 42, 0.28);
}
.loc-map-marker::after {
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  background: var(--cbc-accent);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}
.loc-map-marker > span { position: relative; z-index: 1; }
.loc-map .leaflet-popup-content-wrapper,
.loc-map .leaflet-popup-tip {
  background: var(--cbc-surface-raised);
  color: var(--cbc-text);
}
.loc-map .leaflet-popup-content,
.loc-map .leaflet-popup-content p,
.loc-map .leaflet-popup-content strong {
  color: var(--cbc-text);
}
.loc-map .loc-map-details-link {
  display: inline-block;
  width: auto;
  min-height: 0;
  margin-top: 0.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--cbc-link);
  font-weight: 750;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}
.loc-map .loc-map-details-link:disabled {
  opacity: 1;
  cursor: default;
}
.loc-map .leaflet-control-zoom a {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  line-height: 1;
}

.loc-results { display: grid; gap: 1rem; }
.loc-results-heading { margin-bottom: 0.25rem; }
.loc-results-heading h2 { margin: 0.2rem 0 0; }
.loc-card-header h3 { margin: 0.1rem 0; font-size: 1.45rem; }
.loc-card-header p { margin: 0; }
.loc-card-place { color: var(--cbc-success); font-size: 0.78rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; }
.loc-table-shell {
  overflow-x: auto;
  border: 1px solid var(--cbc-border);
  border-radius: var(--cbc-radius-lg);
  background: var(--cbc-surface-raised);
  box-shadow: var(--cbc-shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.loc-table-shell:focus-visible { outline: 3px solid var(--cbc-focus); outline-offset: 3px; }
.loc-facilities-table {
  min-width: 54rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}
.loc-facilities-table th,
.loc-facilities-table td { padding: 0.55rem 0.65rem; vertical-align: middle; border-color: var(--cbc-border-soft); }
.loc-facilities-table thead th {
  color: var(--cbc-text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.loc-table-sticky-header {
  position: fixed;
  z-index: 90;
  display: none;
  overflow: hidden;
  border: 1px solid var(--cbc-border);
  background: var(--cbc-surface-raised);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12);
  pointer-events: none;
}
.loc-table-sticky-header.is-visible { display: block; }
.loc-table-sticky-header .loc-facilities-table { margin: 0; }
@media (max-width: 760px) {
  .loc-table-sticky-header { display: none !important; }
}
.loc-table-location {
  scroll-margin-top: var(--location-anchor-offset, calc(var(--cbc-header-h) + 3.5rem));
}
.loc-table-location--selected .loc-facility-row > *,
.loc-table-location--selected .loc-facility-detail-row > td {
  animation: loc-location-selected 1.6s ease-out;
}
@keyframes loc-location-selected {
  0%, 35% { background: color-mix(in srgb, var(--cbc-accent) 18%, var(--cbc-surface-raised)); }
  100% { background: var(--cbc-surface-raised); }
}
.loc-table-location:nth-of-type(even) .loc-facility-row > * { background: color-mix(in srgb, var(--cbc-surface) 62%, transparent); }
.loc-facility-row:hover > * { background: var(--cbc-surface-hover); }
.loc-table-facility { min-width: 14rem; background: var(--cbc-surface-raised); }
.loc-table-facility > strong,
.loc-table-facility > span { display: block; }
.loc-table-facility > span { margin-top: 0.1rem; color: var(--cbc-text-muted); font-size: 0.72rem; font-weight: 500; }
.loc-table-number { text-align: center; }
.loc-table-overall { color: var(--cbc-warning); white-space: nowrap; }
.loc-table-overall strong { color: inherit; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.loc-table-overall small { color: var(--cbc-text-muted); font-size: 0.68rem; }
.loc-table-value { white-space: nowrap; }
.loc-table-boolean { display: inline-block; min-width: 1.2rem; text-align: center; font-size: 0.95rem; font-weight: 800; }
.loc-table-links { min-width: 8rem; }
.loc-table-links a { display: inline-block; margin: 0.1rem 0.45rem 0.1rem 0; white-space: nowrap; }
.loc-community.loc-table-community {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.45rem 0 0;
  padding: 0.4rem 0.5rem;
  border-radius: 0.65rem;
  background: var(--cbc-success-bg);
  box-shadow: none;
  font-weight: 500;
}
.loc-table-presence { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--cbc-text); font-size: 0.72rem; white-space: nowrap; }
.loc-table-presence strong { font-variant-numeric: tabular-nums; }
.loc-table-checkin-actions { display: flex; gap: 0.3rem; }
.loc-table-checkin-actions form { margin: 0; }
.loc-table-checkin-actions button {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
}
.loc-table-login { font-size: 0.7rem; line-height: 1.25; }
.loc-table-community .loc-community-feedback { flex-basis: 100%; min-height: 0; font-size: 0.7rem; line-height: 1.3; }
.loc-table-community .loc-community-feedback:empty { display: none; }
.loc-facility-detail-row > td { padding: 0; background: var(--cbc-surface-raised); }
.loc-facility-details > summary { padding: 0.45rem 0.65rem; color: var(--cbc-link); cursor: pointer; font-size: 0.76rem; font-weight: 700; }
.loc-facility-details__content { padding: 0 0.9rem 0.9rem; border-top: 1px solid var(--cbc-border-soft); }
.loc-facility-address { margin: 0.8rem 0 0; color: var(--cbc-text-muted); font-size: 0.8rem; }
.loc-component-ratings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; margin: 0.8rem 0; }
.loc-component-ratings > div { padding: 0.65rem; border: 1px solid var(--cbc-border-soft); border-radius: 0.7rem; background: var(--cbc-surface); }
.loc-component-ratings dt { color: var(--cbc-text-muted); font-size: 0.7rem; font-weight: 750; text-transform: uppercase; }
.loc-component-ratings dd { margin: 0.2rem 0 0; color: var(--cbc-warning); font-size: 0.8rem; font-weight: 750; letter-spacing: 0.02em; }
.loc-table-facility sup { margin-left: 0.12rem; color: var(--cbc-accent); }
.loc-rating-legend {
  border: 1px solid var(--cbc-border);
  border-radius: var(--cbc-radius);
  background: var(--cbc-surface-raised);
}
.loc-rating-legend > summary { padding: 0.7rem 0.9rem; color: var(--cbc-link); cursor: pointer; font-weight: 750; }
.loc-rating-legend__content { padding: 0 0.9rem 0.9rem; border-top: 1px solid var(--cbc-border-soft); }
.loc-rating-legend__content > p { margin: 0.75rem 0; color: var(--cbc-text-muted); font-size: 0.82rem; }
.loc-rating-legend__table { overflow-x: auto; border: 1px solid var(--cbc-border-soft); border-radius: var(--cbc-radius-sm); -webkit-overflow-scrolling: touch; }
.loc-rating-legend__table:focus-visible { outline: 3px solid var(--cbc-focus); outline-offset: 2px; }
.loc-rating-legend table { min-width: 58rem; font-size: 0.76rem; }
.loc-rating-legend th,
.loc-rating-legend td { padding: 0.45rem 0.55rem; vertical-align: top; border-color: var(--cbc-border-soft); }
.loc-rating-legend tbody tr:last-child > * { border-bottom: 0; }
.loc-legend-stars { color: var(--cbc-warning); letter-spacing: 0.04em; white-space: nowrap; }
.loc-disclaimer { margin: 0; color: var(--cbc-text-muted); font-size: 0.78rem; }
.loc-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; margin: 1.1rem 0; }
.loc-card-grid > div { padding: 0.8rem; border-radius: 0.85rem; background: var(--cbc-surface); }
.loc-card-grid dt { color: var(--cbc-text-muted); font-size: 0.76rem; font-weight: 800; text-transform: uppercase; }
.loc-card-grid dd { margin: 0.25rem 0 0; }
.loc-card-links { display: flex; flex-wrap: wrap; gap: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--cbc-border); }
.loc-community { margin: 1rem 0; padding: 1rem; border: 1px solid var(--cbc-success-border); border-radius: 1rem; background: linear-gradient(135deg, var(--cbc-success-bg), var(--cbc-surface-raised)); }
.loc-presence-count { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0.45rem 0.7rem; border-radius: 999px; background: var(--cbc-surface-raised); box-shadow: var(--cbc-shadow-sm); }
.loc-busy__dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--cbc-green); box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--cbc-green) 18%, transparent); }
.loc-community--details { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.loc-community--details details { flex: 1 1 100%; }
.loc-problem-form summary { width: fit-content; cursor: pointer; color: var(--cbc-link); font-weight: 750; }
.loc-problem-form form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--cbc-border); }
.loc-problem-form label:last-of-type, .loc-problem-form .loc-community-feedback { grid-column: 1 / -1; }
.loc-community-feedback { flex: 1 1 100%; min-height: 1.25rem; margin: 0; font-weight: 700; }
.loc-community-feedback[data-state="success"] { color: var(--cbc-success); }
.loc-community-feedback[data-state="error"] { color: var(--cbc-danger); }
.loc-community-feedback[data-state="loading"] { color: var(--cbc-text-muted); }
.loc-community--details form[aria-busy="true"] { opacity: 0.72; }
.loc-report-list { display: grid; gap: 1rem; margin-top: 1rem; }
.loc-report-card h2 { margin: 0.1rem 0; }
.loc-problem-filters, .loc-problem-editor-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.loc-problem-filters button, .loc-problem-editor-form button { align-self: end; justify-self: start; }
.loc-problem-history { display: grid; gap: 0.35rem; padding-left: 1.25rem; }
.loc-empty { padding: 2rem; text-align: center; }

.form-page-header { margin-bottom: 1.2rem; }
.notice, .error { padding: 0.8rem 1rem; border-radius: 0.75rem; }
.notice { border: 1px solid var(--cbc-success-border); background: var(--cbc-success-bg); color: var(--cbc-success); }
.error, .loc-duplicate-warning { border: 1px solid var(--cbc-warning-border); background: var(--cbc-warning-bg); color: var(--cbc-warning); }
.loc-suggestion-form, .loc-editor-form { display: grid; gap: 1rem; }
.loc-editor-ratings { margin: 1rem 0; padding: 0.9rem; border: 1px solid var(--cbc-border); border-radius: var(--cbc-radius); }
.loc-editor-ratings > p { margin-top: 0; color: var(--cbc-text-muted); font-size: 0.82rem; }
.loc-published-ratings { margin-top: 1rem; }
.loc-published-rating-form { display: grid; grid-template-columns: repeat(4, minmax(5rem, 1fr)) auto; align-items: end; gap: 0.5rem; margin: 0; }
.loc-published-rating-form label { margin: 0; color: var(--cbc-text-muted); font-size: 0.7rem; }
.loc-published-rating-form input { min-width: 0; margin: 0.15rem 0 0; }
.loc-published-rating-form button { margin: 0; white-space: nowrap; }
.loc-translation-tools { display: flex; align-items: end; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.loc-translation-tools > div { flex: 1 1 14rem; max-width: 24rem; }
.loc-translation-tools label { margin: 0; }
.loc-translation-tools select,
.loc-translation-tools button { margin: 0.25rem 0 0; }
.loc-translation-help,
.loc-translation-unavailable { margin: 0.35rem 0 1rem; color: var(--cbc-text-muted); font-size: 0.82rem; }
.loc-translation-unavailable { color: var(--cbc-danger); }
.loc-translation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.loc-translation-grid fieldset { margin: 0; padding: 1rem; border: 1px solid var(--cbc-border); border-radius: 0.9rem; }
.loc-editor-actions { justify-content: flex-start; flex-wrap: wrap; }

.loc-facilities-table a:focus-visible,
.loc-facility-details > summary:focus-visible {
  outline: 3px solid var(--cbc-focus);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .loc-hero, .loc-filter, .loc-card-header, .loc-map-heading { align-items: stretch; flex-direction: column; }
  .loc-filter label { width: 100%; }
  .loc-layout { margin-top: 0; }
  .loc-layout--map-only .loc-map { min-height: 19rem; }
  .loc-facilities-table { min-width: 52rem; }
  .loc-card-grid, .loc-component-ratings, .loc-translation-grid { grid-template-columns: 1fr; }
  .loc-published-rating-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loc-published-rating-form button { grid-column: 1 / -1; justify-self: start; }
  .loc-problem-form form, .loc-problem-filters, .loc-problem-editor-form { grid-template-columns: 1fr; }
  .loc-problem-form label:last-of-type, .loc-problem-form .loc-community-feedback { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .loc-table-location--selected .loc-facility-row > *,
  .loc-table-location--selected .loc-facility-detail-row > td {
    animation: none;
    background: color-mix(in srgb, var(--cbc-accent) 12%, var(--cbc-surface-raised));
  }
}

/* =========================================================
   BASE RESET
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    line-height: 1.6;
    background: var(--cbc-bg);
    color: var(--cbc-text);
}

/* =========================================================
   SITE LAYOUT  (flexbox column, full viewport height)
   ========================================================= */
.site-layout {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    padding: 0.5rem 1rem;
}

body.nav-scrolled .site-header {
    background: rgba(255,255,255,0.96);
    border-bottom-color: var(--cbc-border);
    box-shadow: var(--cbc-shadow-sm);
}

.site-main {
    flex: 1 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.site-footer {
    padding: 1.25rem 1rem;
    border-top: 1px solid var(--cbc-border);
    background: var(--cbc-surface);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: var(--cbc-container-max);
    margin: 0 auto;
}

.site-footer__brand {
    font-size: 0.875rem;
    color: var(--cbc-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.site-footer__year {
    color: var(--cbc-text-xmuted);
}

.site-footer__links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.site-footer__link {
    font-size: 0.8125rem;
    color: var(--cbc-text-muted);
    text-decoration: none;
}

.site-footer__link:hover {
    color: var(--cbc-accent);
    text-decoration: underline;
}

/* =========================================================
   CONTAINER
   ========================================================= */
.container {
    max-width: var(--cbc-container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

/* =========================================================
   PAGE TRANSITIONS  (CSS View Transitions API)
   ========================================================= */
@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-fade-in {
    animation: page-fade-in 0.22s ease-out both;
}

@keyframes view-transition-fade-out {
    to { opacity: 0; transform: translateY(-4px); }
}

@keyframes view-transition-fade-in {
    from { opacity: 0; transform: translateY(6px); }
}

::view-transition-old(root) {
    animation: 180ms ease-in both view-transition-fade-out;
}

::view-transition-new(root) {
    animation: 260ms ease-out both view-transition-fade-in;
}

/* =========================================================
   DARK MODE TOKENS
   ========================================================= */
[data-theme="dark"] {
    --cbc-bg:           #0f172a;
    --cbc-surface:      #1e293b;
    --cbc-surface-raised:#162033;
    --cbc-surface-hover:#263449;
    --cbc-border:       #334155;
    --cbc-border-soft:  #1e293b;
    --cbc-text:         #f1f5f9;
    --cbc-text-muted:   #94a3b8;
    --cbc-text-xmuted:  #64748b;
    --cbc-accent:       #f97316;
    --cbc-accent-hover: #ea6f0c;
    --cbc-accent-soft:  #1c1008;
    --cbc-link:         #93c5fd;
    --cbc-focus:        #60a5fa;
    --cbc-on-accent:    #ffffff;
    --cbc-success:      #6ee7b7;
    --cbc-success-bg:   rgba(6,95,70,.22);
    --cbc-success-border:#065f46;
    --cbc-warning:      #fbbf24;
    --cbc-warning-bg:   rgba(146,64,14,.24);
    --cbc-warning-border:#92400e;
    --cbc-danger:       #fca5a5;
    --cbc-danger-bg:    rgba(153,27,27,.22);
    --cbc-danger-border:#7f1d1d;
    --cbc-info:         #93c5fd;
    --cbc-info-bg:      rgba(30,64,175,.24);
    --cbc-info-border:  #1d4ed8;
    --cbc-shadow-sm:    0 1px 3px rgba(0,0,0,.4);
    --cbc-shadow:       0 4px 16px rgba(0,0,0,.5);
    --cbc-shadow-lg:    0 12px 40px rgba(0,0,0,.6);
    color-scheme: dark;
}

/* Header in dark mode */
[data-theme="dark"] .site-header {
    background: rgba(15,23,42,.88);
}
body.nav-scrolled [data-theme="dark"] .site-header,
[data-theme="dark"] body.nav-scrolled .site-header {
    background: rgba(15,23,42,.97);
    border-bottom-color: #334155;
}

/* Nav in dark mode — blend into the header, no boxed background */
[data-theme="dark"] .topnav {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

/* Nav link colors in dark mode */
[data-theme="dark"] .topnav-links a {
    color: #f1f5f9;
}
[data-theme="dark"] .topnav-links a:hover {
    background: rgba(51,65,85,.6);
    color: #fff;
}
[data-theme="dark"] .topnav-links a[aria-current="page"],
[data-theme="dark"] .topnav-links .active {
    background: rgba(249,115,22,.18);
    color: var(--cbc-accent) !important;
}
/* Site title / brand text in dark mode */
[data-theme="dark"] .topnav-brand .topnav-title strong,
[data-theme="dark"] .topnav-title {
    color: #f1f5f9;
}

/* Cards */
[data-theme="dark"] .home-card,
[data-theme="dark"] .card {
    background: var(--cbc-surface);
    border-color: var(--cbc-border);
}

[data-theme="dark"] .home-card__header {
    background: #1a2744;
    border-bottom-color: var(--cbc-border);
}

[data-theme="dark"] .home-hero {
    background: linear-gradient(135deg, #1c1008 0%, #0f1a2e 40%, #0f172a 70%);
    border-color: rgba(249,115,22,.15);
}

[data-theme="dark"] .home-card__item:hover:not(.home-card__item--empty) {
    background: #1a2744;
}

/* Footer */
[data-theme="dark"] .site-footer {
    background: var(--cbc-surface);
    border-top-color: var(--cbc-border);
}

/* Tables and inputs */
[data-theme="dark"] table {
    color: var(--cbc-text);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--cbc-surface);
    color: var(--cbc-text);
    border-color: var(--cbc-border);
}

/* =========================================================
   THEME TOGGLE BUTTON
   ========================================================= */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--cbc-border);
    background: transparent;
    color: var(--cbc-text-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--cbc-surface);
    color: var(--cbc-text);
    border-color: var(--cbc-accent);
}

.theme-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Show sun in dark mode, moon in light mode */
.theme-icon--sun  { display: none; }
.theme-icon--moon { display: block; }

[data-theme="dark"] .theme-icon--sun  { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }

/* =========================================================
   CHATBOT FLOATING ACTION BUTTON
   ========================================================= */
.chat-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

/* Mode switch bar (Q&A / Agent) — slides in above the FAB button */
.chat-fab__mode-bar {
    display: flex;
    gap: 0.375rem;
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    padding: 0.35rem;
    box-shadow: var(--cbc-shadow);
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-fab__mode-bar--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-fab__mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.35rem 0.75rem;
    border-radius: var(--cbc-radius-sm);
    border: none;
    box-shadow: none;
    background: transparent;
    color: var(--cbc-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.chat-fab__mode-btn svg {
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
}

.chat-fab__mode-btn:hover {
    background: var(--cbc-surface);
    color: var(--cbc-text);
}

.chat-fab__mode-btn--active {
    background: var(--cbc-accent-soft);
    color: var(--cbc-accent);
}

[data-theme="dark"] .chat-fab__mode-btn--active {
    background: rgba(249,115,22,.15);
    color: var(--cbc-accent);
}

.chat-fab__btn {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--cbc-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(196,92,38,.45);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    position: relative;
}

.chat-fab__btn:hover {
    background: var(--cbc-accent-hover);
    box-shadow: 0 6px 24px rgba(196,92,38,.55);
    transform: scale(1.06);
}

.chat-fab__btn:active {
    transform: scale(0.96);
}

.chat-fab__icon {
    width: 1.375rem;
    height: 1.375rem;
    position: absolute;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.chat-fab__icon--close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.chat-fab__btn--open .chat-fab__icon--open {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.chat-fab__btn--open .chat-fab__icon--close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.chat-fab__tooltip {
    background: var(--cbc-text);
    color: var(--cbc-bg);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: var(--cbc-radius-sm);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: var(--cbc-shadow);
}

.chat-fab__tooltip--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (max-width: 480px) {
    .chat-fab {
        bottom: 1rem;
        right: 1rem;
    }
    .chat-fab__btn {
        width: 3rem;
        height: 3rem;
    }
}

/* =========================================================
   IN-HOUSE CHAT PANEL
   ========================================================= */
.chat-panel {
    width: 22rem;
    max-width: calc(100vw - 2rem);
    height: 32rem;
    max-height: calc(100vh - 7rem);
    display: flex;
    flex-direction: column;
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    box-shadow: var(--cbc-shadow);
    overflow: hidden;
    animation: chat-panel-in 0.18s ease;
}

@keyframes chat-panel-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    border-bottom: 1px solid var(--cbc-border);
    background: var(--cbc-surface);
}

/* Mode bar inside the panel is always visible (overrides the FAB pop-in state) */
.chat-fab__mode-bar--inpanel {
    width: 100%;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: 1px solid var(--cbc-border);
    transition: none;
}

.chat-fab__mode-bar--inpanel .chat-fab__mode-btn {
    flex: 1 1 0;
    justify-content: center;
}

.chat-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chat-msg {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.chat-msg--user { align-self: flex-end; align-items: flex-end; }
.chat-msg--bot  { align-self: flex-start; align-items: flex-start; }

.chat-msg__text {
    padding: 0.55rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-msg--user .chat-msg__text {
    background: var(--cbc-accent);
    color: #fff;
    border-bottom-right-radius: 0.3rem;
}

.chat-msg--bot .chat-msg__text {
    background: var(--cbc-surface);
    color: var(--cbc-text);
    border-bottom-left-radius: 0.3rem;
}

.chat-msg--typing .chat-msg__text {
    color: var(--cbc-text-muted);
    font-style: italic;
}

.chat-msg__media {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.chat-msg__media img {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--cbc-border);
}

.chat-panel__attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem 0;
}

.chat-attach-chip {
    position: relative;
    width: 3rem;
    height: 3rem;
}

.chat-attach-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.4rem;
    border: 1px solid var(--cbc-border);
}

.chat-attach-chip__rm {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: none;
    background: var(--cbc-text);
    color: var(--cbc-bg);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-panel__composer {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    padding: 0.5rem;
    margin: 0;
    border-top: 1px solid var(--cbc-border);
    background: var(--cbc-bg);
}

.chat-panel__input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    resize: none;
    max-height: 120px;
    min-height: 2.4rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--cbc-border);
    border-radius: 1.2rem;
    background: var(--cbc-surface);
    color: var(--cbc-text);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: none;
}

.chat-panel__input:focus {
    outline: none;
    border-color: var(--cbc-accent);
}

.chat-panel__icon-btn,
.chat-panel__send {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    min-width: 2.4rem;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.chat-panel__icon-btn {
    background: transparent;
    color: var(--cbc-text-muted);
}

.chat-panel__icon-btn:hover {
    background: var(--cbc-surface);
    color: var(--cbc-text);
}

.chat-panel__icon-btn--active {
    background: var(--cbc-accent-soft);
    color: var(--cbc-accent);
}

.chat-panel__icon-btn svg,
.chat-panel__send svg {
    width: 1.1rem;
    height: 1.1rem;
}

.chat-panel__send {
    background: var(--cbc-accent);
    color: #fff;
}

.chat-panel__send:hover { background: var(--cbc-accent-hover); }
.chat-panel__send:disabled { opacity: 0.6; cursor: default; }

/* Higher-specificity guard: Pico v2 targets button[type=submit] with width:100%
   and margins. Scope these to the composer to keep the controls sized correctly. */
.chat-panel__composer .chat-panel__icon-btn,
.chat-panel__composer .chat-panel__send {
    flex: 0 0 2.4rem;
    width: 2.4rem;
    max-width: 2.4rem;
    height: 2.4rem;
    margin: 0;
}

.chat-panel__composer .chat-panel__input {
    flex: 1 1 auto;
    width: auto;
    margin: 0;
}

@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 1.5rem);
        height: calc(100vh - 6rem);
    }
}

/* =========================================================
   LEGACY STUBS  (kept for backward-compat with older pages)
   ========================================================= */
.nav {
    border-bottom: 1px solid var(--cbc-border);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--cbc-text);
}
.links a {
    margin-left: 12px;
    text-decoration: none;
    color: var(--cbc-text);
}
.links a:hover {
    text-decoration: underline;
}
.footer {
    margin-top: 48px;
    color: var(--cbc-text-muted);
}
.muted {
    color: var(--cbc-text-muted);
}

/* Auth card request-link utility */
.auth-card__request-link {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
}

/* Centered auth-card variant */
.auth-card--centered {
    text-align: center;
}

/* Muted note inside auth-card */
.auth-card__muted-note {
    color: var(--cbc-text-muted);
    margin-bottom: 1.25rem;
}

/* Full-width button */
.btn--full {
    width: 100%;
    justify-content: center;
    display: flex;
}

/* Narrow content card (max 560px) */
.content-card--narrow {
    max-width: 560px;
}

/* Form helper tip text */
.form-tip {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--cbc-text-muted);
}



.map-placeholder {
    border: 1px dashed var(--cbc-border);
    border-radius: 12px;
    height: 220px;
    display: grid;
    place-items: center;
    margin-top: 12px;
    color: var(--cbc-text-muted);
}

.locations-split {
    display: grid;
    grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.locations-list-panel,
.locations-map-panel {
    margin: 0;
    border: 1px solid var(--cbc-border);
    border-radius: 12px;
    background: var(--cbc-surface-raised);
    padding: 0.85rem 1rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
}

.locations-list-panel h2,
.locations-map-panel h2 {
    margin-top: 0;
}

.locations-list-panel .list {
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 0.25rem;
}

/* ── Standorte header + register CTA ─────────────────────────── */
.loc-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.loc-header-text h1 {
    margin-bottom: 0.15rem;
}

.loc-header-text p {
    margin: 0;
    color: #566;
}

.loc-register-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.05rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #1f4f96, #2c6fd1);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(31, 79, 150, 0.25);
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.loc-register-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31, 79, 150, 0.32);
    color: #fff;
}

/* ── Region filter bar ──────────────────────────────────────── */
.loc-filter-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0.6rem 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e7eaee;
    border-radius: 12px;
    background: #fbfcfe;
}

.loc-filter-controls {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.loc-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #46505c;
}

.loc-filter-field select {
    min-width: 190px;
    margin: 0;
}

.loc-filter-reset {
    background: #fff;
    border: 1px solid #d5dbe3;
    color: #46505c;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

.loc-filter-reset:hover {
    background: #eef2f7;
}

.loc-filter-summary {
    margin: 0;
    font-size: 0.85rem;
    align-self: center;
}

/* ── Hierarchical location tree (Kanton → Gemeinde → Club) ───── */
.loc-canton {
    margin-bottom: 0.85rem;
}

.loc-canton-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0.15rem;
    border-bottom: 2px solid #e7eaee;
    margin-bottom: 0.35rem;
}

.loc-canton-name {
    font-weight: 800;
    font-size: 0.98rem;
    color: #1f2a37;
    letter-spacing: 0.01em;
}

.loc-canton-badge {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1f4f96;
    background: #e8f0fb;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
}

.loc-muni {
    margin: 0 0 0.4rem 0.25rem;
    padding-left: 0.55rem;
    border-left: 2px solid #eef1f5;
}

.loc-muni-head {
    font-weight: 700;
    font-size: 0.85rem;
    color: #c45c26;
    margin: 0.25rem 0 0.15rem;
}

.loc-item {
    cursor: default;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.12s ease;
}

.loc-item:hover {
    background: var(--cbc-surface-hover);
}

.loc-item-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.loc-item-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7683;
    background: #eef1f5;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.loc-item-links {
    margin-top: 0.1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #98a2b3;
}

.loc-item-action {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cbc-accent);
    text-decoration: none;
}

.loc-item-action:hover {
    text-decoration: underline;
}

.loc-item-map-all {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cbc-link);
    text-decoration: none;
}

.loc-item-map-all:hover {
    text-decoration: underline;
}

/* ── Club / Feldinfos card header ───────────────────────────── */
.home-courts-club-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.15rem 0.55rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid #eef1f5;
}

.home-courts-club-name {
    margin: 0 0 0.3rem;
    font-size: 1.12rem;
    color: #1f2a37;
}

.home-courts-club-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.loc-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.14rem 0.55rem;
    border-radius: 999px;
    background: #eef1f5;
    color: #46505c;
}

.loc-chip--canton {
    background: #e8f0fb;
    color: #1f4f96;
}

.loc-chip--muni {
    background: #fdeee5;
    color: #c45c26;
}

.loc-chip--count {
    background: #eaf6ec;
    color: #2f7a3f;
}

.home-courts-club-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.home-courts-club-actions .home-courts-location-info,
.home-courts-club-actions .home-courts-location-map {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #d5dbe3;
    background: #fff;
    color: #1f2a37;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    white-space: nowrap;
}

.home-courts-club-actions .home-courts-location-info:hover,
.home-courts-club-actions .home-courts-location-map:hover {
    background: #eef2f7;
    border-color: #c2cbd6;
}

.home-courts-club-actions .home-courts-location-map {
    border-color: #1f4f96;
    color: #1f4f96;
}

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

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.card-head a {
    text-decoration: none;
}

.card-head a:hover {
    text-decoration: underline;
}

/* Map needs an explicit height */
.map {
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    transition: height 0.22s ease;
}

.map.map--expanded {
    height: 620px;
}

@media (max-width: 900px) {
    .map.map--expanded {
        height: 520px;
    }
}

@media (max-width: 960px) {
    .locations-split {
        grid-template-columns: 1fr;
    }

    .locations-list-panel,
    .locations-map-panel {
        height: auto;
    }

    .locations-map-panel .map {
        height: 360px;
    }

    .locations-map-panel .map.map--expanded {
        height: 460px;
    }
}

/* Reset global link/button styles inside Leaflet controls (Pico conflict). */
.map .leaflet-control-zoom {
    margin: 10px;
}

.map .leaflet-control-zoom a {
    display: block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    padding: 0;
    border: 0;
    border-radius: 0;
    text-align: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--cbc-text);
    background: var(--cbc-surface-raised);
    box-shadow: none;
}

.map .leaflet-control-zoom a:hover {
    background: var(--cbc-surface-hover);
    color: var(--cbc-text);
}

.map .leaflet-control-zoom a.leaflet-disabled {
    color: var(--cbc-text-xmuted);
    background: var(--cbc-surface);
}

/* =========================================================
   PICO.CSS OVERRIDES — full token reset for all elements
   ========================================================= */

/* Override Pico's CSS custom properties at root level */
:root {
    --card-background-color:    var(--cbc-bg);
    --card-border-color:        var(--cbc-border);
    --background-color:         var(--cbc-bg);
    --color:                    var(--cbc-text);
    --muted-color:              var(--cbc-text-muted);
    --primary:                  var(--cbc-accent);
    --form-element-background-color: var(--cbc-bg);
    --form-element-border-color:     var(--cbc-border);
    --form-element-color:            var(--cbc-text);
    --form-element-placeholder-color: var(--cbc-text-xmuted);
}

[data-theme="dark"] {
    --card-background-color:    var(--cbc-surface);
    --card-border-color:        var(--cbc-border);
    --background-color:         var(--cbc-bg);
    --color:                    var(--cbc-text);
    --muted-color:              var(--cbc-text-muted);
    --form-element-background-color: var(--cbc-surface);
    --form-element-border-color:     var(--cbc-border);
    --form-element-color:            var(--cbc-text);
    --form-element-placeholder-color: var(--cbc-text-xmuted);
}

/* Base element resets */
body {
    background: var(--cbc-bg) !important;
    color: var(--cbc-text) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--cbc-text);
}

p { color: var(--cbc-text); }
p.muted, small.muted, span.muted { color: var(--cbc-text-muted) !important; }

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

/* Override all Pico article/card elements */
article {
    background: var(--cbc-surface) !important;
    color: var(--cbc-text) !important;
    border: 1px solid var(--cbc-border) !important;
    border-radius: var(--cbc-radius-lg) !important;
    padding: 1.5rem !important;
    margin-bottom: 1.25rem !important;
    box-shadow: none !important;
}

[data-theme="dark"] article {
    background: var(--cbc-surface) !important;
    color: var(--cbc-text) !important;
    border-color: var(--cbc-border) !important;
}

article h1, article h2, article h3, article h4 {
    color: var(--cbc-text) !important;
}

/* Input, select, textarea */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
select,
textarea {
    background: var(--cbc-bg) !important;
    color: var(--cbc-text) !important;
    border: 1px solid var(--cbc-border) !important;
    border-radius: var(--cbc-radius) !important;
    padding: 0.65rem 0.85rem !important;
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--form-element-background-color) !important;
    color: var(--cbc-text) !important;
    border-color: var(--cbc-border) !important;
}

input::placeholder, textarea::placeholder {
    color: var(--cbc-text-xmuted) !important;
}

label {
    color: var(--cbc-text);
    font-size: 0.875rem;
    font-weight: 600;
}

fieldset {
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    padding: 1rem;
}

legend {
    color: var(--cbc-text);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0 0.25rem;
}

/* nav / ul lists inside articles don't need Pico bullet styling */
article nav ul, article nav li {
    padding: 0;
    margin: 0;
    list-style: none;
}

hr {
    border-color: var(--cbc-border);
}

/* Tables */
table {
    color: var(--cbc-text);
    border-collapse: collapse;
    width: 100%;
}

th, td {
    color: var(--cbc-text);
    border-bottom: 1px solid var(--cbc-border);
    padding: 0.6rem 0.75rem;
    text-align: left;
}

th {
    font-weight: 700;
    background: var(--cbc-surface);
    color: var(--cbc-text);
}

[data-theme="dark"] th {
    background: var(--cbc-surface-raised);
}

/* ─── Auth pages ────────────────────────────────────────── */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 1rem 4rem;
    min-height: 60dvh;
}

/* ── Brand / logo block above the card ─────────────────── */
.auth-page__brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-page__logo {
    width: clamp(140px, 22vw, 196px);
    height: clamp(140px, 22vw, 196px);
    object-fit: contain;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
}

.auth-page__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 0 0 0.4rem;
    color: var(--cbc-text);
}

.auth-page__sub {
    color: var(--cbc-text-muted);
    margin: 0;
    font-size: 0.9375rem;
}

/* Legacy header class (reset/register pages) */
.auth-page__header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-page__header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 0 0 0.4rem;
    color: var(--cbc-text);
}

.auth-page__header p {
    color: var(--cbc-text-muted);
    margin: 0;
    font-size: 0.9375rem;
}

.auth-card {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    box-shadow: var(--cbc-shadow);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

[data-theme="dark"] .auth-card {
    background: var(--cbc-surface);
    border-color: var(--cbc-border);
}

/* ── Alert banners inside auth card ────────────────────── */
.auth-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--cbc-radius);
    margin-bottom: 1.1rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-banner svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-banner--success {
    background: var(--cbc-success-bg);
    border: 1px solid var(--cbc-success-border);
    color: var(--cbc-success);
}

.auth-banner--error {
    background: var(--cbc-danger-bg);
    border: 1px solid var(--cbc-danger-border);
    color: var(--cbc-danger);
}

.auth-card__form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.auth-card__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.auth-card__field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cbc-text);
}

.auth-card__submit {
    width: 100%;
    margin-top: 0.5rem;
}

/* Remember me checkbox row */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
}

.auth-card__links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cbc-border);
}

.auth-card__links a {
    font-size: 0.875rem;
    color: var(--cbc-accent);
    text-decoration: none;
}

.auth-card__links a:hover {
    text-decoration: underline;
}

.auth-note {
    font-size: 0.8125rem;
    color: var(--cbc-text-muted);
    text-align: center;
    margin-top: 0.75rem;
}

/* ─── Dashboard grid (member home, trainer home) ─────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.dashboard-grid--member {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    align-items: stretch;
}

.dashboard-tile {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-tile--member {
    min-height: 12.25rem;
    padding: 1.25rem;
}

[data-theme="dark"] .dashboard-tile {
    background: var(--cbc-surface);
}

.dashboard-tile:hover {
    box-shadow: var(--cbc-shadow);
    transform: translateY(-2px);
}

.dashboard-tile h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--cbc-text);
    margin: 0;
}

.dashboard-tile p {
    font-size: 0.875rem;
    color: var(--cbc-text-muted);
    margin: 0;
    flex: 1;
}

.dashboard-tile .btn {
    margin-top: auto;
    align-self: flex-start;
}

.dashboard-tile__body {
    display: grid;
    gap: 0.45rem;
}

.dashboard-tile__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.dashboard-tile__actions .btn {
    margin-top: 0;
}

.training-group-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1rem;
}

.training-group-card {
    display: grid;
    gap: 1rem;
}

.training-group-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.training-group-card__header h3,
.training-group-card__header p,
.training-group-card__next {
    margin: 0;
}

.training-group-card__header p,
.training-group-card__next {
    color: var(--cbc-text-muted);
    font-size: 0.9rem;
}

.training-group-card__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.75rem;
}

.training-group-card__stats div {
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    padding: 0.65rem;
    background: var(--cbc-bg);
}

.training-group-card__stats span {
    display: block;
    color: var(--cbc-text);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.training-group-card__stats small {
    color: var(--cbc-text-muted);
    display: block;
    line-height: 1.25;
}

.member-dashboard__section {
    margin-top: 2rem;
}

.member-dashboard__section-header {
    display: grid;
    gap: 0.25rem;
}

.member-dashboard__section-header h2 {
    margin: 0;
    color: var(--cbc-text);
    font-size: 1.125rem;
    font-weight: 700;
}

.calendar-subscription-card {
    display: grid;
    gap: 0.85rem;
}

.calendar-link-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
}

.calendar-link-box input[readonly] {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.875rem;
}

.calendar-link-copy {
    min-height: 2.35rem;
    padding-inline: 0.75rem;
}

.calendar-subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calendar-subscription-actions .btn {
    margin: 0;
}

/* ─── Alert / notice banners ─────────────────────────── */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--cbc-radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert--error, [role="alert"] {
    background: var(--cbc-danger-bg);
    color: var(--cbc-danger);
    border-color: var(--cbc-danger-border);
    border-radius: var(--cbc-radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert--success, [role="status"] {
    background: var(--cbc-success-bg);
    color: var(--cbc-success);
    border-color: var(--cbc-success-border);
    border-radius: var(--cbc-radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ─── Tab-style nav (offerings filter etc.) ──────────── */
.tab-nav {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tab-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--cbc-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cbc-text-muted);
    text-decoration: none;
    background: var(--cbc-surface);
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.tab-nav a:hover,
.tab-nav a.active {
    background: var(--cbc-accent-soft);
    color: var(--cbc-accent);
    border-color: var(--cbc-accent);
}

/* ─── .grid override (Pico uses it for two-column) ───── */
.grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}



.cbc-map-pin-wrap {
    background: transparent;
    border: 0;
}

.cbc-map-pin {
    width: 28px;
    height: 28px;
    display: block;
    background: center / contain no-repeat url("/static/assets/img/Beachvolleyball-LUZU.png");
    filter:
        grayscale(1)
        sepia(1)
        saturate(780%)
        hue-rotate(176deg)
        brightness(0.52)
        contrast(1.08)
        drop-shadow(0 3px 7px rgba(15, 23, 42, 0.35));
}

.cbc-map-pin--pending {
    filter: grayscale(1) saturate(0.35) brightness(0.86) drop-shadow(0 3px 7px rgba(15, 23, 42, 0.32));
    opacity: 0.88;
}

.map-frame {
    width: 100%;
    border: 0;
    display: block;
}

/* Kleine Abstände in Listen */
.list li {
    margin: 10px 0;
}

.news-body {
    margin-top: 6px;
}

/* Pico nav: immer eine Zeile; linke Seite darf horizontal scrollen */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    padding: 0 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(225, 225, 225, 0.9);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(12px);
}

.topnav {
    position: relative; /* needed for absolute dropdown positioning */
}

.topnav,
.topnav-logo {
    transition:
        padding 0.2s ease,
        height 0.2s ease,
        width 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

body.nav-scrolled .topnav-logo {
    width: clamp(36px, 4.5vw, 50px);
    height: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

body.nav-scrolled .topnav-brand,
body.nav-scrolled .topnav-brand-link {
    min-height: clamp(40px, 5vw, 52px);
}

.topnav-brand,
.topnav-brand-link {
    display: flex;
    align-items: center;
    min-height: clamp(44px, 5.5vw, 58px);
    gap: 0.45rem;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    background: transparent;
    box-shadow: none;
}

.topnav-brand:hover,
.topnav-brand-link:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

/* Prevent Pico's .contrast styles from turning the logo link solid white */
.topnav .topnav-brand-link,
.topnav .topnav-brand-link:hover,
.topnav .topnav-brand-link:focus-visible {
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
}

.topnav-brand .topnav-title strong {
    display: block;
    line-height: 1;
    letter-spacing: -0.01em;
}

.topnav-logo {
    width: clamp(40px, 5vw, 56px);
    min-width: 40px; /* prevent grid auto-column collapse */
    max-width: none; /* override Pico img { max-width:100% } */
    height: auto;
    display: block;
    border-radius: 0;
    object-fit: contain;
    object-position: center;
}

[data-theme="dark"] .topnav-logo {
    filter: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.topnav-title {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.82rem;
    line-height: 1.2;
    height: auto;
}

.topnav-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

.topnav-links li {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
}

.topnav-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.7rem;
    height: 40px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--cbc-text);
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
}

.topnav-links a:hover {
    background: #f3f4ff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.topnav-links a[aria-current="page"],
.topnav-links .active {
    background: #fef4ef;
    color: #c45c26 !important;
    box-shadow: 0 6px 18px rgba(196, 92, 38, 0.25);
}

.topnav-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
    margin-block: 0;
    padding: 0;
}

.topnav-actions li {
    display: flex;
    align-items: center;
    margin: 0;
}

/* Mobile optimizations for topnav actions */
@media (max-width: 640px) {
    .topnav-actions {
        gap: 0.3rem;
        padding: 0 0.25rem;
    }

    .topnav-actions li {
        padding: 0.25rem 0;
    }
}

/* Public event promotion cards */
.event-promo-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

.event-promo-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    transition: box-shadow 160ms ease, transform 160ms ease;
}

.event-promo-card:has(.event-promo-card__link):hover {
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.event-promo-card__link {
    color: inherit;
    display: flex;
    flex: 1;
    flex-direction: column;
    text-decoration: none;
}

.event-promo-card__link:focus-visible {
    border-radius: var(--cbc-radius);
    outline: 3px solid var(--cbc-accent);
    outline-offset: -3px;
}

.event-promo-card__image,
.event-admin-card__image {
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    width: 100%;
}

.event-promo-card__body {
    align-items: flex-start;
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem;
}

.event-promo-card__body h3 {
    margin-top: 0;
}

.event-promo-card__meta {
    color: var(--cbc-text-muted);
    font-size: 0.9rem;
}

.event-promo-card__cta {
    color: var(--cbc-accent);
    font-weight: 700;
    margin-top: auto;
    padding-top: 0.75rem;
}

.event-list-toggle {
    border-top: 1px solid var(--cbc-border);
    color: var(--cbc-text-muted);
    margin: 2rem 0 0;
    padding-top: 1rem;
    text-align: center;
}

.event-detail__back {
    margin-bottom: 1rem;
}

.event-detail {
    padding: clamp(1.25rem, 3vw, 2.25rem);
}

.event-detail__header {
    border-bottom: 1px solid var(--cbc-border);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.event-detail__header h1 {
    margin-bottom: 0.35rem;
}

.event-detail__meta {
    color: var(--cbc-text-muted);
    margin: 0;
}

.event-detail__layout {
    align-items: start;
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    grid-template-columns: minmax(0, 1fr) auto;
}

.event-detail__description > :first-child {
    margin-top: 0;
}

.event-detail__description pre {
    max-width: 100%;
    overflow-x: auto;
}

.markdown-content {
    min-width: 0;
}

.markdown-content > :first-child {
    margin-top: 0;
}

.markdown-content > :last-child {
    margin-bottom: 0;
}

.markdown-content h1 {
    font-size: 1.35rem;
}

.markdown-content h2 {
    font-size: 1.2rem;
}

.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-size: 1.05rem;
}

.markdown-content :is(h1, h2, h3, h4, h5, h6):not(:first-child) {
    margin-top: 1.25rem;
}

.markdown-content :is(ul, ol) {
    padding-inline-start: 1.4rem;
}

.markdown-content :is(p, li, a) {
    overflow-wrap: anywhere;
}

.markdown-content pre,
.markdown-content table {
    max-width: 100%;
    overflow-x: auto;
}

.markdown-content blockquote {
    border-inline-start: 0.25rem solid var(--cbc-border);
    color: var(--cbc-text-muted);
    margin-inline: 0;
    padding-inline-start: 1rem;
}

.markdown-content--compact {
    font-size: 0.9em;
}

.markdown-content--compact :is(h1, h2, h3, h4, h5, h6) {
    font-size: 1em;
}

.markdown-content--compact :is(p, ul, ol, blockquote, pre, table) {
    margin-block: 0.35rem;
}

.event-detail__registration {
    margin-top: 1rem;
}

.event-detail__media {
    justify-self: end;
    margin: 0;
    max-width: min(40vw, 34rem);
    width: fit-content;
}

.event-detail__media img {
    border-radius: var(--cbc-radius);
    display: block;
    height: auto;
    max-height: 28rem;
    max-width: 100%;
    object-fit: contain;
    width: auto;
}

@media (max-width: 760px) {
    .event-detail__layout {
        grid-template-columns: 1fr;
    }

    .event-detail__media {
        grid-row: 1;
        justify-self: center;
        max-width: 100%;
    }

    .event-detail__media img {
        max-height: min(70vh, 32rem);
    }
}

.event-admin-list {
    display: grid;
    gap: 1.5rem;
}

.event-admin-card {
    max-width: 56rem;
}

.event-admin-card__image {
    border-radius: var(--cbc-radius);
    margin-bottom: 1rem;
    max-width: 32rem;
}

.event-admin-card__upload {
    border-top: 1px solid var(--cbc-border);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

@media (max-width: 480px) {
    .topnav-actions {
        gap: 0.2rem;
        padding: 0.25rem;
    }
}

.topnav-actions a[role="button"] {
    border-radius: 999px;
    padding-inline: 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Join / Register button in nav actions */
.topnav-btn-join {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--cbc-accent);
    color: #fff !important;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.topnav-btn-join:hover {
    background: #b34e20;
    box-shadow: 0 4px 12px rgba(196,92,38,0.3);
    transform: translateY(-1px);
}

[data-theme="dark"] .topnav-btn-join {
    background: var(--cbc-accent);
    color: #fff !important;
}

.account-menu summary {
    white-space: nowrap;
}

details.dropdown.account-menu > summary.account-trigger {
    height: auto;
    min-height: 0;
    padding: 0.2rem 0.25rem;
    min-width: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide Pico's dropdown chevron — the avatar alone is the trigger.
   Higher specificity than Pico's `details.dropdown>summary::after`. */
details.dropdown.account-menu > summary.account-trigger::after {
    display: none;
}

.account-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    object-fit: cover;
    border: 1px solid #cfcfcf;
    background: #f2f2f2;
    color: #2b2b2b;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.account-avatar-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

details.dropdown.account-menu ul {
    width: max-content;
    min-width: 16rem;
    max-width: calc(100vw - 1.5rem);
    padding: 0.4rem;
    overflow-x: hidden;
    white-space: normal;
}

.account-menu {
    /* Anchor the dropdown to the avatar button itself. The avatar lives in
       .topnav-actions (flex: 0 0 auto, margin-left:auto), which is always pinned
       inside the viewport because .topnav-links scrolls instead of pushing the
       actions off-screen. */
    position: relative;
}

details.dropdown.account-menu > summary+ul {
    /* Absolute positioning anchored to .account-menu (which is position:relative).
       Using absolute — not fixed — because .topnav has backdrop-filter, which
       creates a containing block that would trap a fixed element and push it
       off-screen. With right:0 the panel's right edge lines up with the avatar
       and the wide menu grows leftward, staying fully on-screen.
       Selector is qualified with details.dropdown.account-menu so it outranks
       Pico's `details.dropdown>summary+ul { left:0 }` rule. */
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: auto;
    inset-inline-start: auto;
    inset-inline-end: 0;
    z-index: 200;
}

body.nav-scrolled details.dropdown.account-menu > summary+ul {
    top: calc(100% + 0.35rem);
}

.account-menu-section {
    padding: 0.25rem 0.75rem 0.1rem 0.75rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
}

.account-menu-user {
    padding: 0.35rem 0.75rem 0.15rem;
    color: #666;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu-separator {
    padding: 0;
}

.account-menu-separator hr {
    margin: 0.25rem 0;
}

.account-menu-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--cbc-text);
}

.account-menu-link:hover {
    background: #f3f4ff;
}

.account-menu-link-active {
    font-weight: 700;
    background: #fef4ef;
    color: #c45c26 !important;
}

/* Language menu */
.lang-menu {
    position: relative;
}

.lang-menu summary {
    white-space: nowrap;
}

.lang-trigger {
    padding: 0.5rem 0.75rem;
    min-width: 2.8rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-trigger:hover {
    background: #f3f4ff;
    border-color: #e0e1ff;
}

.lang-trigger::after {
    display: none;
}

.lang-menu[open] .lang-trigger {
    background: #f3f4ff;
    border-color: #e0e1ff;
    font-weight: 700;
}

.lang-menu > summary+ul {
    left: auto;
    right: 0;
    inset-inline-start: auto;
    inset-inline-end: 0;
    min-width: 11rem;
    z-index: 1000;
}

.lang-menu ul {
    padding: 0.5rem 0;
}

.lang-menu li {
    list-style: none;
    margin: 0;
}

.lang-menu a {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--cbc-text);
    transition: all 0.1s ease;
}

.lang-menu a:hover {
    background: var(--cbc-surface-hover);
    color: var(--cbc-link);
    font-weight: 600;
}

.lang-menu a.active {
    font-weight: 700;
    color: var(--cbc-link);
    background: var(--cbc-info-bg);
    border-left: 3px solid var(--cbc-link);
    padding-left: calc(1rem - 3px);
}

/* Mobile optimizations for language menu */
@media (max-width: 860px) {
    .lang-trigger {
        padding: 0.6rem 0.8rem;
        min-width: 3rem;
        font-size: 0.8rem;
    }

    .lang-menu > summary+ul {
        min-width: 10rem;
        right: -0.5rem;
    }
}

@media (max-width: 640px) {
    .lang-trigger {
        padding: 0.65rem 0.9rem;
        min-width: 3.2rem;
        font-size: 0.85rem;
    }

    .lang-menu > summary+ul {
        min-width: 9.5rem;
        right: -1rem;
        max-width: calc(100vw - 1rem);
    }

    .lang-menu a {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }

    .lang-menu a.active {
        padding-left: calc(0.9rem - 3px);
    }
}

@media (max-width: 480px) {
    .lang-trigger {
        padding: 0.7rem 1rem;
        min-width: 3.5rem;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .lang-menu > summary+ul {
        position: fixed;
        top: calc(var(--cbc-header-h) + 0.5rem);
        right: 1rem;
        left: 1rem;
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: 60vh;
        transform: none;
        overflow-y: auto;
    }

    .lang-menu a {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    .lang-menu a.active {
        padding-left: calc(1rem - 3px);
    }
}

@media (max-width: 480px) {
    .topnav {
        justify-content: space-between;
    }
}

.auth-card {
    max-width: 520px;
    margin: 0 auto;
}

[role="alert"] {
    margin-bottom: 1rem;
}

.table-shell {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── Reservations (member court booking) ─────────────── */
.reservation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.reservation-grid label {
    display: block;
    margin-bottom: 0.35rem;
}

.reservation-grid select,
.reservation-grid input {
    width: 100%;
}

.reservation-courts {
    margin-bottom: 1rem;
}

.reservation-court-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: 0.5rem;
}

.reservation-court-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.reservation-name {
    margin-bottom: 1rem;
}

.reservation-name label {
    display: block;
    margin-bottom: 0.35rem;
}

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--cbc-border);
    color: var(--cbc-text-muted);
    background: var(--cbc-surface);
    white-space: nowrap;
}

.status-pill--active {
    color: var(--cbc-success);
    background: var(--cbc-success-bg);
    border-color: var(--cbc-success-border);
}

.status-pill--warning {
    color: var(--cbc-warning);
    background: var(--cbc-warning-bg);
    border-color: var(--cbc-warning-border);
}

.status-pill--danger {
    color: var(--cbc-danger);
    background: var(--cbc-danger-bg);
    border-color: var(--cbc-danger-border);
}

.status-pill--muted {
    color: var(--cbc-text-xmuted);
    background: var(--cbc-surface);
    border-color: var(--cbc-border);
}

.offerings-card-grid {
    display: grid;
    gap: 1rem;
}

.offering-card,
.offering-detail {
    display: grid;
    gap: 1rem;
}

.offering-card__header,
.offering-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.offering-card__title {
    margin: 0.1rem 0 0;
    font-size: 1.3rem;
    line-height: 1.2;
}

.offering-card__status {
    flex: 0 0 auto;
    text-align: right;
}

.offering-card__description {
    margin: 0;
}

.offering-card__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 1rem;
    margin: 0;
}

.offering-card__facts--detail {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.offering-card__facts div {
    min-width: 0;
}

.offering-card__facts dt {
    margin: 0 0 0.15rem;
    color: var(--cbc-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.offering-card__facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.offering-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
}

.offering-card__footer form {
    margin: 0;
}

.offering-card__footer button,
.offering-card__footer .btn {
    margin: 0;
}

.payment-instructions {
    display: grid;
    gap: 0.65rem;
    width: 100%;
}

.payment-instructions > strong {
    color: var(--cbc-text);
    font-size: 1rem;
    line-height: 1.25;
}

.payment-instructions__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    margin: 0;
}

.payment-instructions__facts div {
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    background: var(--cbc-bg);
}

.payment-instructions__facts dt {
    margin: 0 0 0.15rem;
    color: var(--cbc-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.payment-instructions__facts dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.payment-reference-callout {
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--cbc-border);
    border-left: 4px solid var(--cbc-accent);
    border-radius: var(--cbc-radius);
    background: var(--cbc-accent-soft);
}

.payment-reference-callout__label {
    color: var(--cbc-accent);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
}

.payment-reference-callout__hint {
    color: var(--cbc-text-muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

.payment-reference-callout__value {
    justify-self: start;
}

.payment-reference-callout .copyable__value {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-sm);
    background: var(--cbc-bg);
    color: var(--cbc-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.payment-reference-callout--compact {
    gap: 0.25rem;
    padding: 0.65rem;
}

.payment-reference-callout--compact .copyable__value {
    font-size: 0.92rem;
}

.payment-instructions__list {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding-left: 1.1rem;
}

.payment-instructions__list--plain {
    list-style: none;
    padding-left: 0;
}

.payment-instructions__list--plain li {
    display: grid;
    grid-template-columns: minmax(6rem, 0.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem 1rem;
}

.payment-instructions__list--plain li > span:first-child {
    color: var(--cbc-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.payment-recipient-box {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    background: var(--cbc-accent-soft);
}

.payment-method-section {
    display: grid;
    gap: 0.5rem;
}

.payment-method-section__title {
    color: var(--cbc-text);
    font-size: 0.95rem;
    line-height: 1.25;
}

.payment-method-section__copy {
    justify-self: start;
    margin-top: 0.1rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
}

.payment-method-divider {
    height: 1px;
    background: var(--cbc-border);
}

.payment-recipient-box__row {
    display: grid;
    grid-template-columns: minmax(8.25rem, 0.38fr) minmax(0, 1fr);
    align-items: center;
    gap: 0.4rem 0.9rem;
}

.payment-recipient-box__row--recipient {
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--cbc-border);
}

.payment-recipient-box__label {
    color: var(--cbc-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.payment-recipient-box__note {
    margin: 0.25rem 0 0;
    padding-top: 0.55rem;
    border-top: 1px solid var(--cbc-border);
    color: var(--cbc-text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.payment-recipient-box__note strong {
    color: var(--cbc-text);
}

.twint-payment-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    display: inline-flex;
    height: 58px;
    justify-content: center;
    justify-self: start;
    line-height: 0;
    padding: 0;
    text-decoration: none;
    width: auto;
}

.twint-payment-button:focus-visible {
    outline: 3px solid var(--cbc-accent);
    outline-offset: 3px;
}

.twint-payment-button img {
    display: block;
    height: 58px;
    max-width: 100%;
    width: auto;
}

.calendar-subscription-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    margin: 0.75rem 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    background: var(--cbc-surface);
}

.calendar-subscription-note--detail {
    margin: 0;
}

.calendar-subscription-note div {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.calendar-subscription-note strong {
    color: var(--cbc-text);
    font-size: 0.95rem;
    line-height: 1.25;
}

.calendar-subscription-note span {
    color: var(--cbc-text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.calendar-subscription-note__action {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}

.copyable {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
}

.copyable__value {
    overflow-wrap: anywhere;
}

.copy-button {
    width: auto !important;
    min-height: 0;
    margin: 0;
    padding: 0.2rem 0.5rem;
    border-radius: var(--cbc-radius);
    border: 1px solid var(--cbc-border);
    background: var(--cbc-surface);
    color: var(--cbc-text);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.copy-button:hover {
    border-color: var(--cbc-accent);
    color: var(--cbc-accent);
}

.payment-status-stack {
    display: grid;
    gap: 0.25rem;
    justify-items: start;
}

.payment-instructions--compact {
    gap: 0.35rem;
}

.payment-instructions--compact small {
    display: block;
}

.trainer-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.trainer-dashboard-actions .btn {
    margin: 0;
}

.trainer-offer-counts {
    display: grid;
    gap: 0.15rem;
}

.trainer-offer-counts span {
    color: var(--cbc-text);
    font-weight: 700;
    line-height: 1.2;
}

.trainer-offer-counts small {
    color: var(--cbc-text-muted);
    line-height: 1.25;
}

.offering-detail__header h1 {
    margin-bottom: 0.25rem;
}

.offering-detail__coach {
    border-top: 1px solid var(--cbc-border);
    padding-top: 1rem;
}

.offering-detail__coach p {
    margin-bottom: 0.25rem;
}

.offers-table {
    min-width: 920px;
}

.member-offers-table {
    min-width: 980px;
}

.archive-offers-table {
    min-width: 860px;
}

.offers-actions-cell {
    width: 1%;
    white-space: nowrap;
}

.offers-actions {
    min-width: 150px;
    display: grid;
    gap: 0.5rem;
}

.offers-actions form {
    margin: 0;
}

.offers-actions button {
    width: 100%;
    margin: 0;
}

@media (max-width: 1100px) {
    .offers-table {
        min-width: 820px;
    }

    .offers-actions {
        min-width: 136px;
    }

    .offers-table th:nth-child(1),
    .offers-table td:nth-child(1) {
        display: none;
    }

    .member-offers-table {
        min-width: 860px;
    }

    .archive-offers-table {
        min-width: 760px;
    }

    .archive-offers-table th:nth-child(1),
    .archive-offers-table td:nth-child(1) {
        display: none;
    }
}

@media (max-width: 760px) {
    .offering-card__header,
    .offering-detail__header,
    .offering-card__footer {
        display: grid;
        gap: 0.75rem;
    }

    .offering-card__status {
        text-align: left;
    }

    .offering-card__facts,
    .offering-card__facts--detail,
    .payment-instructions__facts {
        grid-template-columns: 1fr 1fr;
    }

    .offering-card__footer button,
    .offering-card__footer .btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .offering-card__facts,
    .offering-card__facts--detail,
    .payment-instructions__facts {
        grid-template-columns: 1fr;
    }

    .payment-instructions__list--plain li {
        grid-template-columns: 1fr;
    }

    .payment-recipient-box__row {
        grid-template-columns: 1fr;
    }

    .payment-reference-callout__value {
        display: grid;
        gap: 0.45rem;
        justify-self: stretch;
    }

    .payment-reference-callout .copy-button {
        width: 100% !important;
    }

    .payment-method-section__copy {
        width: 100% !important;
    }

    .calendar-subscription-note {
        align-items: stretch;
        display: grid;
    }

    .calendar-subscription-note__action {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 860px) {
    .offers-table {
        min-width: 700px;
    }

    .offers-table th:nth-child(5),
    .offers-table td:nth-child(5) {
        display: none;
    }

    .member-offers-table {
        min-width: 740px;
    }

    .member-offers-table th:nth-child(4),
    .member-offers-table td:nth-child(4) {
        display: none;
    }

    .archive-offers-table {
        min-width: 660px;
    }

    .archive-offers-table th:nth-child(5),
    .archive-offers-table td:nth-child(5) {
        display: none;
    }
}

.people-grid,
.admin-people-grid,
.stories-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.person-card,
.story-card,
.person-profile,
.person-inline-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 1rem;
}

.person-photo,
.story-photo {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
}

.person-photo-large {
    width: 100%;
    max-width: 460px;
    border-radius: 12px;
}

.admin-danger-zone {
    border-top: 1px solid var(--cbc-border);
    margin-top: 1.5rem;
    padding-top: 1.25rem;
}

.admin-danger-zone h3 {
    color: #991b1b;
}

.admin-danger-zone form {
    display: grid;
    gap: .75rem;
    max-width: 720px;
}

.admin-danger-zone button {
    justify-self: start;
}

[data-theme="dark"] .admin-danger-zone h3 {
    color: #fca5a5;
}

.admin-accounts-shell {
    overflow-x: auto;
}

.admin-accounts-table {
    min-width: 980px;
}

.admin-account-role-form,
.admin-account-anonymize-form {
    display: grid;
    gap: .5rem;
    min-width: 180px;
}

.admin-account-role-form label,
.admin-account-anonymize-form label {
    align-items: center;
    display: flex;
    gap: .45rem;
    margin: 0;
}

.admin-account-role-form button,
.admin-account-anonymize-form button {
    justify-self: start;
    margin-top: .25rem;
}

.badge-chip {
    display: inline-block;
    margin: 0 0.35rem 0.35rem 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #bbb;
    font-size: 0.8rem;
}

.inline-form {
    display: inline-block;
    margin-right: 0.4rem;
}

.badge-form {
    margin-top: 0.75rem;
}

/* =========================================================
   SHARED BUTTON SYSTEM
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.625rem 1.375rem;
    border-radius: var(--cbc-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                box-shadow 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
    background: var(--cbc-accent);
    color: #fff;
    border-color: var(--cbc-accent);
    box-shadow: 0 2px 8px rgba(196,92,38,.30);
}
.btn--primary:hover {
    background: var(--cbc-accent-hover);
    border-color: var(--cbc-accent-hover);
    box-shadow: 0 4px 14px rgba(196,92,38,.38);
    color: #fff;
    text-decoration: none;
}

.btn--outline {
    background: transparent;
    color: var(--cbc-accent);
    border-color: var(--cbc-accent);
}
.btn--outline:hover {
    background: var(--cbc-accent-soft);
    text-decoration: none;
}

.btn--ghost {
    background: transparent;
    color: var(--cbc-text);
    border-color: var(--cbc-border);
}
.btn--ghost:hover {
    background: var(--cbc-surface);
}

.button-danger,
button.button-danger {
    background: var(--cbc-danger-bg);
    color: var(--cbc-danger);
    border-color: var(--cbc-danger-border);
}

.button-danger:hover,
button.button-danger:hover {
    background: color-mix(in srgb, var(--cbc-danger-bg) 82%, var(--cbc-danger) 18%);
    color: var(--cbc-danger);
    border-color: var(--cbc-danger-border);
}

/* Shared card base */
.card {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    padding: 1.25rem;
    box-shadow: var(--cbc-shadow-sm);
}

/* =========================================================
   HOME PAGE
   ========================================================= */
.page-home {
    max-width: var(--cbc-container-max);
    margin: 0 auto;
}

/* Hero */
.home-hero {
    position: relative;
    border-radius: var(--cbc-radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, var(--cbc-accent-soft) 0%, #fff8f5 40%, #ffffff 70%);
    border: 1px solid rgba(196,92,38,.12);
    margin-bottom: 2.5rem;
    box-shadow: var(--cbc-shadow);
}

.home-hero__content {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 3rem 2.5rem 2.5rem;
    position: relative;
    z-index: 1;
}

.home-hero__text {
    max-width: 520px;
    animation: page-fade-in 0.4s ease-out both;
}

/* (hero logo-wrap styles removed; logo is now in the visual column) */

.home-hero__tagline {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    color: var(--cbc-accent);
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.home-hero__sub {
    font-size: 0.95rem;
    color: var(--cbc-text-muted);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.home-hero__visual {
    width: clamp(140px, 20vw, 260px);
    flex-shrink: 0;
    animation: page-fade-in 0.5s ease-out 0.1s both;
}

.home-hero__img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.12));
}

[data-theme="dark"] .home-hero__img {
    /* Invert the outline illustration to white for dark mode */
    filter: brightness(0) invert(1) drop-shadow(0 8px 20px rgba(249,115,22,.15));
    opacity: 0.7;
}

/* CBC logo displayed above the tagline in the hero text column */
.home-hero__brand-logo {
    width: clamp(220px, 30vw, 380px);
    height: auto;
    display: block;
    margin-bottom: 1rem;
    margin-left: 4.5rem;
    object-fit: contain;
}

@media (max-width: 700px) {
    .home-hero__content {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem 1.75rem;
        gap: 1.5rem;
    }
    .home-hero__visual {
        display: none;
    }
}

/* Overview label */
.home-overview {
    margin-bottom: 2rem;
}

.home-overview__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cbc-text-xmuted);
    margin: 0 0 1.25rem;
}

/* Cards grid */
.home-cards {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.home-card {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.home-card:hover {
    box-shadow: var(--cbc-shadow);
    transform: translateY(-2px);
}

.home-card--locations { border-top: 3px solid var(--cbc-blue); }
.home-card--events    { border-top: 3px solid #e89b2c; }
.home-card--news      { border-top: 3px solid var(--cbc-green); }
.home-card--teams     { border-top: 3px solid var(--cbc-purple); }

.home-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--cbc-surface);
    border-bottom: 1px solid var(--cbc-border-soft);
}

.home-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cbc-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.home-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}
.home-card__icon svg { width: 0.875rem; height: 0.875rem; }

.home-card__icon--blue   { background: #eff6ff; color: var(--cbc-blue); }
.home-card__icon--amber  { background: #fffbeb; color: #d97706; }
.home-card__icon--green  { background: #f0fdf4; color: var(--cbc-green); }
.home-card__icon--purple { background: #f5f3ff; color: var(--cbc-purple); }

.home-card__more {
    font-size: 0.8125rem;
    color: var(--cbc-accent);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.1s ease;
}
.home-card__more:hover { opacity: 0.75; }

.home-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.home-card__item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--cbc-border-soft);
    transition: background-color 0.1s ease;
}

.home-card__item:last-child { border-bottom: none; }

.home-card__item:hover:not(.home-card__item--empty) {
    background: var(--cbc-surface);
}

.home-card__item-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cbc-text);
    text-decoration: none;
    line-height: 1.35;
}
.home-card__item-link:hover { color: var(--cbc-accent); }

.home-card__item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cbc-text);
    line-height: 1.35;
}

.home-card__item-meta {
    font-size: 0.78rem;
    color: var(--cbc-text-muted);
    line-height: 1.4;
}

.home-card__item-body {
    margin: 0.3rem 0 0;
    font-size: 0.82rem;
    color: var(--cbc-text-muted);
    line-height: 1.45;
}

.home-card__item--empty {
    font-size: 0.85rem;
    color: var(--cbc-text-xmuted);
    font-style: italic;
    padding: 1.25rem;
}

/* ── Join overview / Mitmachen ─────────────────────────────────────────── */
.join-page {
    max-width: var(--cbc-container-max);
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.join-hero {
    max-width: 680px;
    margin: 0 auto 2rem;
    text-align: center;
}

.join-hero__eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cbc-text-xmuted);
}

.join-hero__title {
    margin: 0 0 0.75rem;
    color: var(--cbc-text);
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 800;
}

.join-hero__sub {
    max-width: 58ch;
    margin: 0 auto;
    color: var(--cbc-text-muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

.join-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.join-option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    min-height: 168px;
    padding: 1.25rem;
    border: 1px solid var(--cbc-border);
    border-top-width: 3px;
    border-radius: var(--cbc-radius-lg);
    background: var(--cbc-bg);
    color: var(--cbc-text);
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.join-option:hover {
    border-color: var(--cbc-accent);
    box-shadow: var(--cbc-shadow);
    transform: translateY(-2px);
}

.join-option--member { border-top-color: var(--cbc-blue); }
.join-option--training { border-top-color: var(--cbc-green); }
.join-option--trainer { border-top-color: #e89b2c; }
.join-option--partner { border-top-color: var(--cbc-purple); }

.join-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 8px;
    background: var(--cbc-accent-soft);
    color: var(--cbc-accent);
}

.join-option__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.join-option__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.join-option__title {
    margin: 0 0 0.35rem;
    font-size: 1.02rem;
    font-weight: 750;
    color: var(--cbc-text);
}

.join-option__text {
    color: var(--cbc-text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.join-option__cta {
    margin-top: auto;
    padding-top: 1rem;
    color: var(--cbc-accent);
    font-size: 0.86rem;
    font-weight: 700;
}

.home-join {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1.5rem;
    max-width: var(--cbc-container-max);
    margin: 0 auto 2rem;
    padding: 1.4rem 0;
    border-block: 1px solid var(--cbc-border-soft);
}

.home-join__header {
    max-width: 700px;
    margin-bottom: 0;
}

.home-join__cta {
    margin: 0;
    white-space: nowrap;
}

.home-join__header h2 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.2rem, 3vw, 1.55rem);
    color: var(--cbc-text);
}

.home-join__header p:last-child {
    margin: 0;
    color: var(--cbc-text-muted);
    line-height: 1.55;
}

.home-join__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.home-join__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    background: var(--cbc-bg);
    color: var(--cbc-text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.home-join__link:hover {
    border-color: var(--cbc-accent);
    background: var(--cbc-accent-soft);
    color: var(--cbc-accent);
}

@media (max-width: 700px) {
    .home-join {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 1rem;
    }

    .home-join__cta {
        justify-self: start;
        white-space: normal;
    }
}

/* Courts block (stays inside home-card, used on expanded home page) */
.home-courts-block {
    border-top: 1px solid var(--cbc-border-soft);
    padding: 1rem 1.25rem 1.1rem;
    scroll-margin-top: 88px;
}

.home-courts-block--legend { padding-top: 0.85rem; }

.home-courts-inline-title {
    margin: 0 0 0.85rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cbc-text);
}

.home-courts-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.home-courts-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.home-courts-table th,
.home-courts-table td {
    border-bottom: 1px solid var(--cbc-border-soft);
    padding: 0.55rem 0.65rem;
    text-align: left;
    vertical-align: top;
}

.home-courts-table thead th {
    background: var(--cbc-surface);
    color: var(--cbc-text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.home-courts-table tbody tr:last-child td,
.home-courts-table tbody tr:last-child th {
    border-bottom: none;
}

.home-courts-table tbody tr:nth-child(even) td,
.home-courts-table tbody tr:nth-child(even) th[scope="row"] {
    background: #fafbfc;
}

.home-courts-table tbody tr:hover td,
.home-courts-table tbody tr:hover th[scope="row"] {
    background: #f1f5fb;
}

.home-courts-block[hidden] {
    display: none !important;
}

.home-courts-col-name {
    min-width: 220px;
    white-space: nowrap;
}

.home-courts-row--pending .home-courts-col-name { font-style: italic; }

.home-courts-links { min-width: 170px; }

.home-courts-links-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.home-courts-link {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--cbc-border);
    background: var(--cbc-surface);
    color: var(--cbc-text);
    font-size: 0.75rem;
    text-decoration: none;
    padding: 0.12rem 0.5rem;
    transition: border-color 0.1s ease, background-color 0.1s ease;
}
.home-courts-link:hover {
    border-color: var(--cbc-border);
    background: var(--cbc-surface-hover);
}


.home-courts-rating {
    font-weight: 700;
    color: var(--cbc-warning);
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.home-courts-bool {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.home-courts-bool--yes {
    color: var(--cbc-success);
}

.home-courts-bool--no {
    color: var(--cbc-danger);
}

.home-courts-bool--na {
    color: var(--cbc-text-muted);
}

.home-courts-access-text {
    color: var(--cbc-text);
    line-height: 1.35;
}

.home-courts-availability {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    min-width: 190px;
}

.home-courts-avail-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--cbc-border);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.14rem 0.46rem;
    line-height: 1.1;
    white-space: nowrap;
}

.home-courts-avail--schedule {
    color: var(--cbc-warning);
    background: var(--cbc-warning-bg);
    border-color: var(--cbc-warning-border);
}

.home-courts-avail--badi {
    color: var(--cbc-info);
    background: var(--cbc-info-bg);
    border-color: var(--cbc-info-border);
}

.home-courts-avail--always {
    color: var(--cbc-success);
    background: var(--cbc-success-bg);
    border-color: var(--cbc-success-border);
}

.home-courts-avail--unknown {
    color: var(--cbc-text-muted);
    background: var(--cbc-surface);
    border-color: var(--cbc-border);
}

.home-courts-access-text--short {
    font-size: 0.76rem;
    color: var(--cbc-text-muted);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-courts-empty {
    color: var(--cbc-text-muted);
    font-style: italic;
}

.home-courts-note {
    margin: 0.8rem 0 0;
    color: var(--cbc-text-muted);
    font-size: 0.84rem;
}

/* Public feedback banners (courtfinder check-in / problem report) */
.form-feedback {
    margin: 0 0 1rem;
    padding: 0.7rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--cbc-border);
    font-size: 0.92rem;
}

.form-feedback--ok {
    border-color: #bfe3c4;
    background: #eefbf0;
    color: #1c6b2c;
}

.form-feedback--err {
    border-color: #f2c2c2;
    background: #fdeeee;
    color: #9a2c2c;
}

/* Court community actions: check-in + problem report */
.court-community {
    margin-top: 1.1rem;
    padding: 1rem 1.1rem;
    border-radius: var(--cbc-radius);
    background: var(--cbc-surface);
    border: 1px solid var(--cbc-border);
}

.court-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.9rem;
}

.court-checkin {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0;
}

.court-ico {
    width: 1.05em;
    height: 1.05em;
    flex: none;
}

.court-checkin__btn.is-loading,
.court-problem-form .btn.is-loading {
    opacity: 0.8;
    pointer-events: none;
}

.court-checkin__btn.is-loading .court-ico,
.court-problem-form .btn.is-loading .court-ico {
    animation: court-spin 0.7s linear infinite;
}

.court-checkin__btn.is-done {
    background: var(--cbc-green);
    border-color: var(--cbc-green);
    box-shadow: 0 4px 14px rgba(42,157,110,.35);
}

.court-checkin__meter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--cbc-text-muted);
    box-shadow: var(--cbc-shadow-sm);
}

.court-checkin__meter--bump {
    animation: court-bump 0.45s cubic-bezier(.34,1.56,.64,1);
}

.court-checkin__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cbc-text-xmuted);
    flex: none;
}

.court-checkin__dot.is-live {
    background: var(--cbc-green);
    box-shadow: 0 0 0 0 rgba(42,157,110,.6);
    animation: court-pulse 1.8s ease-out infinite;
}

.court-problem__toggle {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.court-problem-panel {
    margin-top: 0.9rem;
    padding: 1rem;
    border-radius: var(--cbc-radius);
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    box-shadow: var(--cbc-shadow-sm);
    animation: court-panel-in 0.22s ease;
}

.court-problem-panel[hidden] {
    display: none;
}

.court-problem-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 34rem;
    margin: 0;
}

.court-problem-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.court-problem-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}

.court-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cbc-text-muted);
}

.court-problem-form select,
.court-problem-form textarea,
.court-problem-form input[type="email"] {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: var(--cbc-radius-sm);
    border: 1px solid var(--cbc-border);
    background: var(--cbc-bg);
    color: var(--cbc-text);
    font: inherit;
    font-size: 0.9rem;
    margin: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.court-problem-form select:focus,
.court-problem-form textarea:focus,
.court-problem-form input[type="email"]:focus {
    outline: none;
    border-color: var(--cbc-accent);
    box-shadow: 0 0 0 3px var(--cbc-accent-soft);
}

.court-problem-form textarea {
    resize: vertical;
    min-height: 4.5rem;
}

.court-problem-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.court-problem-feedback {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--cbc-green);
}

.court-problem-feedback.is-ok::before {
    content: "✓ ";
}

@keyframes court-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(42,157,110,.55); }
    70%  { box-shadow: 0 0 0 7px rgba(42,157,110,0); }
    100% { box-shadow: 0 0 0 0 rgba(42,157,110,0); }
}

@keyframes court-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes court-spin {
    to { transform: rotate(360deg); }
}

@keyframes court-panel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.home-hero__supporters {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: var(--cbc-accent-soft);
    border: 1px solid var(--cbc-border);
    font-size: 0.92rem;
    color: var(--cbc-text-muted);
}

.home-hero__supporters::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cbc-green);
    box-shadow: 0 0 0 0 rgba(42,157,110,.6);
    animation: court-pulse 1.8s ease-out infinite;
}

.home-hero__supporters strong {
    color: var(--cbc-accent);
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

/* Rating legend (Bewertungslegende) on the courtfinder page */
.court-legend {
    margin: 1.25rem 0 0;
    padding: 0.85rem 1.1rem;
    border-radius: var(--cbc-radius);
    background: var(--cbc-surface);
    border: 1px solid var(--cbc-border);
}

.court-legend > summary {
    cursor: pointer;
    color: var(--cbc-accent);
    font-weight: 700;
    width: fit-content;
    list-style: none;
}

.court-legend > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.4rem;
    transition: transform 0.15s ease;
}

.court-legend[open] > summary::before {
    transform: rotate(90deg);
}

.legend-stars {
    color: #f5a623;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* "Unterstützt von" partner listing on the landing page */
.home-partners {
    margin-top: 2.5rem;
}

.home-partners__list {
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.home-partners__item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--cbc-radius);
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    box-shadow: var(--cbc-shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.home-partners__item:hover {
    transform: translateY(-2px);
    box-shadow: var(--cbc-shadow);
    border-color: var(--cbc-accent);
}

.home-partners__link {
    font-weight: 700;
    color: var(--cbc-text);
    text-decoration: none;
}

.home-partners__item:hover .home-partners__link {
    color: var(--cbc-accent);
}

.home-partners__note {
    font-size: 0.82rem;
    color: var(--cbc-text-muted);
}

@media (max-width: 560px) {
    .court-problem-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .court-checkin__dot.is-live,
    .home-hero__supporters::before,
    .court-checkin__meter--bump,
    .court-problem-panel,
    .court-checkin__btn.is-loading .court-ico {
        animation: none;
    }
}

[data-theme="dark"] .form-feedback--ok {
    border-color: #1f5130;
    background: rgba(31,107,44,.18);
    color: #86efac;
}

[data-theme="dark"] .form-feedback--err {
    border-color: #6b2222;
    background: rgba(154,44,44,.18);
    color: #fca5a5;
}

[data-theme="dark"] .home-hero__supporters {
    background: rgba(196,92,38,.14);
}

/* News / blog: card grid + article detail */
.page-content--narrow {
    max-width: 760px;
    margin-inline: auto;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
    margin-top: 1.4rem;
}

.news-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.3rem;
    border-radius: var(--cbc-radius);
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    box-shadow: var(--cbc-shadow-sm);
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--cbc-shadow);
    border-color: var(--cbc-accent);
}

.news-card__date {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cbc-accent);
}

.news-card__title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}

.news-card__link {
    color: var(--cbc-text);
    text-decoration: none;
}

.news-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.news-card:hover .news-card__link {
    color: var(--cbc-accent);
}

.news-card__teaser {
    margin: 0;
    color: var(--cbc-text-muted);
    font-size: 0.92rem;
}

.news-card__more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--cbc-accent);
    text-decoration: none;
    position: relative;
    z-index: 1;
    transition: gap 0.15s ease;
}

.news-card__more:hover {
    text-decoration: underline;
}

.news-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.news-filter__tab {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--cbc-border);
    background: var(--cbc-bg);
    color: var(--cbc-text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.news-filter__tab:hover {
    border-color: var(--cbc-accent);
    color: var(--cbc-accent);
}

.news-filter__tab.is-active {
    background: var(--cbc-accent);
    border-color: var(--cbc-accent);
    color: #fff;
}

.news-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--cbc-border);
    border-radius: 12px;
    background: var(--cbc-bg);
}

.news-search__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.news-search__field--keyword {
    flex: 1 1 220px;
    min-width: 200px;
}

.news-search__field label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--cbc-text-muted);
}

.news-search__field input {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--cbc-border);
    border-radius: 8px;
    background: var(--cbc-surface, #fff);
    color: var(--cbc-text);
    font-size: 0.9rem;
}

.news-search__field input:focus {
    outline: none;
    border-color: var(--cbc-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cbc-accent) 25%, transparent);
}

.news-search__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.news-search__reset {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cbc-text-muted);
    text-decoration: none;
}

.news-search__reset:hover {
    color: var(--cbc-accent);
    text-decoration: underline;
}

@media (max-width: 640px) {
    .news-search__field--keyword {
        flex-basis: 100%;
    }
}

.news-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.news-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid var(--cbc-border);
    color: var(--cbc-text-muted);
    background: var(--cbc-bg-subtle, rgba(0, 0, 0, 0.03));
}

.news-badge--swiss {
    color: #b3261e;
    border-color: #f2b8b5;
    background: rgba(179, 38, 30, 0.08);
}

.news-badge--international {
    color: #1a56a8;
    border-color: #a9c7ee;
    background: rgba(26, 86, 168, 0.08);
}

.news-badge--source {
    color: var(--cbc-text-muted);
}

.news-disclaimer {
    margin-top: 1.4rem;
    color: var(--cbc-text-muted);
}

.news-back {
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--cbc-text-muted);
    text-decoration: none;
}

.news-back:hover {
    color: var(--cbc-accent);
}

.news-article {
    padding: 1.75rem 1.9rem;
    border-radius: var(--cbc-radius-lg);
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    box-shadow: var(--cbc-shadow-sm);
}

.news-article__date {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cbc-accent);
    margin-bottom: 0.4rem;
}

.news-article__title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1.2;
}

.news-article__lead {
    margin: 1rem 0 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--cbc-text);
}

.news-article__body {
    margin-top: 1.1rem;
    white-space: pre-line;
    line-height: 1.7;
    color: var(--cbc-text);
}

.news-article__footer {
    max-width: 760px;
    margin: 1.5rem auto 0;
}

/* Courtfinder explainer strip */
.courtfinder-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
    margin: 1.1rem 0 1.4rem;
}

.courtfinder-tip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: var(--cbc-radius);
    background: var(--cbc-surface);
    border: 1px solid var(--cbc-border);
}

.courtfinder-tip__ico {
    font-size: 1.4rem;
    line-height: 1;
    flex: none;
}

.courtfinder-tip__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.courtfinder-tip__text strong {
    font-size: 0.95rem;
}

.courtfinder-tip__text span {
    font-size: 0.84rem;
    color: var(--cbc-text-muted);
}

/* Live check-in "busy" badge in the location list + map popup */
.loc-busy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(42,157,110,.12);
    color: var(--cbc-green);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.loc-busy__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cbc-green);
    box-shadow: 0 0 0 0 rgba(42,157,110,.6);
    animation: court-pulse 1.8s ease-out infinite;
}

.map-popup-busy {
    display: inline-block;
    margin-top: 0.2rem;
    font-weight: 700;
    color: var(--cbc-green);
}

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

/* Mitmachen: community engagement sections */
.join-community {
    margin-top: 2.5rem;
}

.join-community__head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 1.4rem;
}

.join-community__head h2 {
    margin: 0 0 0.4rem;
}

.join-community__head p {
    margin: 0;
    color: var(--cbc-text-muted);
}

.join-community__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem;
}

.join-community__card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.4rem;
    border-radius: var(--cbc-radius);
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    box-shadow: var(--cbc-shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.join-community__card:hover {
    transform: translateY(-3px);
    box-shadow: var(--cbc-shadow);
    border-color: var(--cbc-accent);
}

.join-community__ico {
    font-size: 1.7rem;
    line-height: 1;
}

.join-community__card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.join-community__card p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--cbc-text-muted);
}

.join-community__cta {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cbc-accent);
    text-decoration: none;
}

.join-community__cta:hover {
    text-decoration: underline;
}


.home-courts-title-row {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.home-courts-location-map {
    border: 0;
    background: transparent;
    color: var(--cbc-text);
    font: inherit;
    font-weight: 700;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
}

.home-courts-location-map:hover {
    color: var(--cbc-link);
    text-decoration: underline;
}

.home-courts-location-map:focus-visible {
    outline: 2px solid var(--cbc-focus);
    outline-offset: 2px;
    border-radius: 4px;
}

.home-courts-location-info {
    width: 1.2rem;
    height: 1.2rem;
    border: 1px solid var(--cbc-border);
    border-radius: 999px;
    background: var(--cbc-surface-raised);
    color: var(--cbc-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    display: inline-grid;
    place-items: center;
    padding: 0;
    text-transform: none;
    cursor: pointer;
}

.home-courts-location-info:hover {
    background: var(--cbc-surface-hover);
    border-color: var(--cbc-border);
}

.home-courts-location-info:focus-visible {
    outline: 2px solid var(--cbc-focus);
    outline-offset: 1px;
}

.home-courts-dialog {
    border: 1px solid var(--cbc-border);
    border-radius: 14px;
    background: var(--cbc-surface-raised);
    color: var(--cbc-text);
    max-width: min(720px, 96vw);
    width: min(720px, 96vw);
    padding: 0;
}

.home-courts-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.home-courts-dialog-inner {
    padding: 0.9rem 1rem 1rem;
}

.home-courts-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.home-courts-dialog-title {
    margin: 0;
    font-size: 1rem;
}

.home-courts-dialog-close {
    border: 1px solid var(--cbc-border);
    border-radius: 10px;
    background: var(--cbc-surface-raised);
    color: var(--cbc-text);
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
}

.home-courts-dialog-close:hover {
    background: var(--cbc-surface-hover);
}

.home-courts-details-table {
    min-width: 760px;
}

.home-courts-details-table th:first-child {
    width: 220px;
    min-width: 220px;
    white-space: nowrap;
}

.home-courts-details-table td {
    min-width: 92px;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .home-courts-block {
        padding: 0.85rem 1rem 1rem;
    }

    .home-courts-table {
        font-size: 0.78rem;
    }

    .home-courts-access-text--short {
        max-width: none;
        white-space: normal;
    }
}

/* ── Generic page content system ─────────────────────────────────────── */
.page-content {
    max-width: var(--cbc-container-max);
    margin: 0 auto;
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h1 {
    margin: 0 0 0.35rem;
    color: var(--cbc-text);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
}

.page-header__sub {
    color: var(--cbc-text-muted);
    margin: 0;
    font-size: 0.9375rem;
}

/* Infomaniak's ALTCHA widget inherits these variables into its shadow DOM. */
.updates-form altcha-widget {
    --altcha-color-active: var(--cbc-accent);
    --altcha-color-base: var(--cbc-surface-raised);
    --altcha-color-border: var(--cbc-border);
    --altcha-color-border-focus: var(--cbc-accent);
    --altcha-color-error-text: var(--cbc-danger);
    --altcha-color-footer-bg: var(--cbc-surface);
    --altcha-color-text: var(--cbc-text);
}

.content-card {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--cbc-text);
}

.training-blocks-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    width: 100%;
}

.training-blocks-layout > .content-card {
    min-width: 0;
    width: 100%;
}

.training-booking-option--payment-pending {
    grid-column: 1 / -1;
    min-width: 0;
}

.training-payment-list {
    display: grid;
    gap: 1rem;
}

.training-payment-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.training-payment-card__header > div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.training-payment-card__items {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.training-payment-card__items li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--cbc-surface) 78%, var(--cbc-accent) 22%);
}

.training-payment-card__items span {
    min-width: 0;
    font-weight: 650;
}

.training-payment-card__items small {
    white-space: nowrap;
}

.training-payment-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.training-payment-card__actions .secondary {
    margin: 0;
    width: auto;
}

@media (max-width: 640px) {
    .training-payment-card__header {
        display: grid;
    }

    .training-payment-card__items li {
        display: grid;
        gap: 0.2rem;
    }

    .training-payment-card__items small {
        white-space: normal;
    }

    .training-payment-card__actions {
        display: grid;
    }

    .training-payment-card__actions .secondary {
        width: 100%;
    }
}

.training-group-readonly form {
    display: none;
}

.training-availability-form {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin: 0 0 1rem;
    border-top: 1px solid var(--cbc-border-soft);
    border-bottom: 1px solid var(--cbc-border-soft);
}

.training-availability-form__label {
    font-weight: 700;
}

.training-availability-form--compact {
    min-width: 16rem;
    padding: 0;
    margin: 0;
    border: 0;
}

.training-availability-segment {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    max-width: 32rem;
}

.training-availability-segment--compact {
    gap: 0.25rem;
    min-width: 16rem;
}

.training-availability-segment--compact .training-availability-option {
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
}

.training-availability-option {
    min-width: 0;
    margin: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--cbc-border);
    background: var(--cbc-bg);
    color: var(--cbc-text);
}

.training-availability-option.is-selected.is-available {
    border-color: var(--cbc-green);
    background: var(--cbc-success-bg);
    color: var(--cbc-success);
}

.training-availability-option.is-selected.is-maybe {
    border-color: var(--cbc-warning-border);
    background: var(--cbc-warning-bg);
    color: var(--cbc-warning);
}

.training-availability-option.is-selected.is-unavailable {
    border-color: var(--cbc-danger-border);
    background: var(--cbc-danger-bg);
    color: var(--cbc-danger);
}

.training-availability-matrix-wrap {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border: 1px solid var(--cbc-border);
}

.training-availability-matrix {
    width: max-content;
    min-width: 100%;
    margin: 0;
    font-size: 0.82rem;
}

.training-availability-matrix th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 11rem;
    background: var(--cbc-bg);
}

.training-availability-matrix thead th {
    min-width: 8rem;
    white-space: nowrap;
}

.training-availability-matrix thead small,
.training-availability-matrix__reservation {
    display: block;
    color: var(--cbc-text-muted);
}

.training-availability-matrix form {
    margin: 0;
}

.training-availability-select {
    min-width: 7rem;
    margin: 0;
    padding: 0.35rem 1.7rem 0.35rem 0.45rem;
    font-size: 0.8rem;
}

.training-availability-select.is-dirty {
    border-color: var(--cbc-accent);
    box-shadow: 0 0 0 2px var(--cbc-accent-soft);
}

.training-availability-batch-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin: -0.5rem 0 1.25rem;
}

.training-availability-batch-actions button {
    width: auto;
    margin: 0;
}

[data-theme="dark"] .content-card {
    background: var(--cbc-surface);
    border-color: var(--cbc-border);
}

.content-card--empty {
    background: var(--cbc-surface);
}

.content-card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cbc-text);
    margin: 0 0 1rem;
}

.profile-card {
    max-width: 960px;
}

.profile-form {
    display: grid;
    gap: 1.25rem;
}

.profile-form__grid {
    align-items: start;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.profile-section {
    border: 0;
    border-top: 1px solid var(--cbc-border);
    border-radius: 0;
    margin: 0;
    padding: 1.25rem 0 0;
}

.profile-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.profile-section legend {
    color: var(--cbc-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    padding: 0;
}

.profile-section legend + .profile-form__grid,
.profile-section legend + .profile-field,
.profile-section legend + .profile-field-group {
    margin-top: 0.9rem;
}

.profile-field {
    display: grid;
    gap: 0.4rem;
    margin: 0 0 1.1rem;
}

.profile-form__grid > .profile-field {
    margin-bottom: 0;
}

.profile-field input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
.profile-field select,
.profile-field textarea {
    margin: 0;
    width: 100%;
}

.profile-field input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
.profile-field select {
    min-height: 2.75rem;
}

.profile-field:last-child {
    margin-bottom: 0;
}

.profile-field__label {
    color: var(--cbc-text);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.profile-field__hint {
    color: var(--cbc-text-muted);
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    margin: -0.1rem 0 0;
    max-width: 58ch;
}

.profile-field-group {
    margin-bottom: 1.1rem;
}

.profile-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.55rem 0.75rem;
    margin: 0.35rem 0 1rem;
}

.profile-check {
    align-items: flex-start;
    background: var(--cbc-surface);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    color: var(--cbc-text);
    display: flex;
    gap: 0.55rem;
    line-height: 1.3;
    margin: 0;
    min-height: 2.5rem;
    padding: 0.65rem 0.75rem;
}

.profile-check input {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.profile-check > span {
    min-width: 0;
}

.profile-check__label {
    display: block;
    font-weight: 700;
}

.profile-check__hint {
    color: var(--cbc-text-muted);
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    margin-top: 0.2rem;
}

.profile-check--stacked {
    min-height: 0;
    padding: 0.75rem 0.85rem;
}

.profile-check--stacked input {
    margin-top: 0.2rem;
}

.profile-check--single {
    justify-self: start;
    min-height: 0;
    min-width: 12rem;
}

.profile-action-row {
    align-items: center;
    border-top: 1px dashed var(--cbc-border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.profile-action-row .profile-field__hint {
    margin-bottom: 0;
}

.profile-action-row .btn {
    flex: 0 0 auto;
}

.profile-form__actions {
    display: flex;
    justify-content: flex-start;
}

.profile-photo-form {
    margin-top: 1.25rem;
}

.profile-photo-preview {
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    height: auto;
    max-width: 260px;
    width: 100%;
}

.schedule-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    margin: 1rem 0 1.25rem;
}

.schedule-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 0;
    margin: 0;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    background: var(--cbc-bg);
    color: var(--cbc-text);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.2;
    text-decoration: none;
}

.schedule-tab:hover {
    border-color: var(--cbc-accent);
    color: var(--cbc-accent);
    text-decoration: none;
}

.schedule-tab--active {
    border-color: var(--cbc-accent);
    background: var(--cbc-accent);
    color: #fff;
}

.schedule-tab--active:hover {
    color: #fff;
}

.content-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-list__item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--cbc-border-soft);
}

.content-list__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.content-list__title {
    font-weight: 600;
    color: var(--cbc-text);
}

.content-list__meta {
    font-size: 0.8125rem;
    color: var(--cbc-text-muted);
}

.content-list__body {
    font-size: 0.875rem;
    color: var(--cbc-text-muted);
    margin: 0.25rem 0 0;
    line-height: 1.5;
}

.content-list__empty {
    color: var(--cbc-text-muted);
    font-size: 0.9rem;
    font-style: italic;
    padding: 0.5rem 0;
    list-style: none;
}

/* Person / Team cards */
.person-card {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    padding: 1.25rem;
    color: var(--cbc-text);
    transition: box-shadow 0.15s ease;
}

[data-theme="dark"] .person-card {
    background: var(--cbc-surface);
}

.person-card:hover {
    box-shadow: var(--cbc-shadow);
}

.person-card h3 {
    margin: 0.5rem 0 0.25rem;
    color: var(--cbc-text);
}

.person-card h3 a {
    color: var(--cbc-text);
    text-decoration: none;
}

.person-card h3 a:hover {
    color: var(--cbc-accent);
}

.person-card p {
    color: var(--cbc-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Story badges */
.story-type-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.2rem 0.65rem;
}

.story-type-badge--coach {
    background: rgba(45,125,210,.12);
    color: var(--cbc-blue);
}

.story-type-badge--player {
    background: rgba(42,157,110,.12);
    color: var(--cbc-green);
}

.story-card__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.story-card__teaser {
    font-weight: 600;
    color: var(--cbc-text);
    margin: 0.5rem 0;
}

.story-photo {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: var(--cbc-radius);
    margin: 0.75rem 0;
}

/* ── Member Lead / Mitglied werden ─────────────────────────────────────── */.page-member-lead {
    max-width: var(--cbc-container-max);
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.lead-hero {
    text-align: center;
    padding: 2.5rem 0 2rem;
}

.lead-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--cbc-text);
    margin: 0 0 0.75rem;
}

.lead-hero__sub {
    color: var(--cbc-text-muted);
    font-size: 1.0625rem;
    max-width: 48ch;
    margin: 0 auto 1.5rem;
}

.lead-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.lead-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--cbc-accent-soft);
    color: var(--cbc-accent);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
}

.lead-badge svg {
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
}

/* Layout: form + aside */
.lead-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .lead-layout {
        grid-template-columns: 1fr;
    }
    .lead-aside {
        order: -1;
    }
}

/* Central role-aware schedule */
.schedule-page-header,
.training-detail-header,
.training-attendance-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.schedule-filter-groups {
    display: grid;
    gap: 0.65rem;
    margin: 1rem 0 1.25rem;
}

.schedule-event-list {
    display: grid;
    gap: 0.85rem;
}

.schedule-event-card {
    display: grid;
    grid-template-columns: minmax(8rem, 10rem) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
}

.schedule-event-card--cancelled,
.training-cancelled-notice {
    border-color: var(--pico-del-color);
}

.schedule-event-card__when {
    display: grid;
    gap: 0.2rem;
}

.schedule-event-card__badges,
.schedule-event-card__status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.schedule-event-card__body h2 {
    margin: 0.45rem 0 0.15rem;
    font-size: 1.15rem;
}

.schedule-event-card__context,
.schedule-event-card__location {
    margin: 0.2rem 0;
}

.schedule-event-card__status {
    margin-top: 0.65rem;
}

.schedule-event-card__inline-action {
    display: flex;
    gap: 0.65rem;
    align-items: end;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.schedule-event-card__inline-action label {
    margin: 0;
    min-width: min(100%, 22rem);
}

.schedule-event-card__inline-action button {
    width: auto;
    margin: 0;
}

.training-payment-note,
.training-withdrawn-list {
    margin-top: 1rem;
}

@media (max-width: 720px) {
    .schedule-event-card {
        grid-template-columns: 1fr;
    }

    .schedule-event-card__action .btn {
        width: 100%;
        text-align: center;
    }
}

/* =========================================================
   PR C: PUBLIC NEWS, PARTNERS & COMMUNITY ENTRY
   ========================================================= */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.home-supporters {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 46rem;
    margin: clamp(1.25rem, 3vw, 2rem) auto;
    padding: 1rem 1.25rem;
    border: 1px solid color-mix(in srgb, var(--cbc-green) 36%, var(--cbc-border));
    border-radius: 999px;
    background:
        linear-gradient(110deg, color-mix(in srgb, var(--cbc-success-bg) 82%, transparent), var(--cbc-surface-raised));
    box-shadow: var(--cbc-shadow-sm);
}

.home-supporters__mark {
    display: grid;
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border-radius: 50%;
    background: var(--cbc-green);
    color: #fff;
}

.home-supporters__mark svg {
    width: 1.35rem;
    height: 1.35rem;
}

.home-supporters p {
    margin: 0;
    font-size: clamp(1rem, 2.4vw, 1.18rem);
}

.home-supporters strong {
    margin-inline-end: 0.15rem;
    font-size: 1.35em;
    color: var(--cbc-success);
    font-variant-numeric: tabular-nums;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.news-card {
    display: flex;
    min-height: 18rem;
    flex-direction: column;
    margin: 0 !important;
    padding: clamp(1.25rem, 3vw, 2rem) !important;
    border-color: color-mix(in srgb, var(--cbc-accent) 18%, var(--cbc-border)) !important;
    background:
        linear-gradient(145deg, var(--cbc-surface-raised), color-mix(in srgb, var(--cbc-accent-soft) 35%, var(--cbc-surface))) !important;
    box-shadow: var(--cbc-shadow-sm) !important;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--cbc-shadow) !important;
}

.news-card__date,
.news-detail__date {
    color: var(--cbc-accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.news-card__title {
    margin: 0.65rem 0 0.75rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    line-height: 1.12;
}

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

.news-card__summary {
    margin-bottom: 1.25rem;
    color: var(--cbc-text-muted);
}

.news-card__link {
    align-self: flex-start;
    margin-top: auto;
    font-weight: 750;
    text-decoration: none;
}

.news-grid__empty {
    grid-column: 1 / -1;
    padding: 2rem;
    border: 1px dashed var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    color: var(--cbc-text-muted);
    text-align: center;
}

.news-detail-page {
    max-width: 52rem;
}

.news-detail__back {
    display: inline-flex;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.news-detail {
    margin: 0 !important;
    padding: clamp(1.4rem, 5vw, 3.5rem) !important;
    border-color: color-mix(in srgb, var(--cbc-accent) 20%, var(--cbc-border)) !important;
    background:
        radial-gradient(circle at 95% 0, color-mix(in srgb, var(--cbc-accent) 13%, transparent), transparent 17rem),
        var(--cbc-surface-raised) !important;
    box-shadow: var(--cbc-shadow) !important;
}

.news-detail h1 {
    max-width: 42rem;
    margin: 0.7rem 0 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.news-detail__summary {
    max-width: 42rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid var(--cbc-border);
    color: var(--cbc-text-muted);
    font-size: clamp(1.05rem, 2.3vw, 1.25rem);
    line-height: 1.55;
}

.news-detail__body {
    max-width: 42rem;
    white-space: pre-line;
    line-height: 1.75;
}

.home-partners {
    margin-top: clamp(2.5rem, 7vw, 5rem);
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid var(--cbc-border);
    border-radius: calc(var(--cbc-radius-lg) + 0.5rem);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--cbc-blue) 8%, var(--cbc-surface)), var(--cbc-surface-raised));
}

.home-partners > h2 {
    margin-top: 0.15rem;
    font-family: Georgia, "Times New Roman", serif;
}

.home-partners__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.home-partner {
    margin: 0 !important;
    padding: 1.1rem !important;
    background: color-mix(in srgb, var(--cbc-surface-raised) 90%, transparent) !important;
}

.home-partner__name {
    display: inline-flex;
    gap: 0.35rem;
    color: var(--cbc-text);
    font-size: 1.05rem;
    font-weight: 800;
}

.home-partner p {
    margin: 0.45rem 0 0;
    color: var(--cbc-text-muted);
    font-size: 0.9rem;
}

.join-community {
    margin-top: clamp(3rem, 8vw, 6rem);
}

.join-community__header {
    max-width: 48rem;
    margin-bottom: 1.5rem;
}

.join-community__header h2 {
    margin: 0.2rem 0 0.65rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.join-community__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.join-community-card {
    display: flex;
    min-width: 0;
    min-height: 18rem;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.35rem;
    border: 1px solid var(--cbc-border);
    border-radius: calc(var(--cbc-radius-lg) + 0.25rem);
    background: var(--cbc-surface-raised);
    box-shadow: var(--cbc-shadow-sm);
    color: var(--cbc-text);
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.join-community-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--community-card-accent) 45%, var(--cbc-border));
    box-shadow: var(--cbc-shadow);
    color: var(--cbc-text);
}

.join-community-card--courts { --community-card-accent: var(--cbc-green); }
.join-community-card--social { --community-card-accent: var(--cbc-blue); }
.join-community-card--crowdfunding { --community-card-accent: var(--cbc-accent); }

.join-community-card__icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--community-card-accent) 14%, var(--cbc-surface));
    color: var(--community-card-accent);
}

.join-community-card__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.join-community-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.55rem;
}

.join-community-card__body strong {
    font-size: 1.18rem;
}

.join-community-card__body > span:not(.join-community-card__cta) {
    color: var(--cbc-text-muted);
    line-height: 1.55;
}

.join-community-card__cta {
    margin-top: auto;
    color: var(--community-card-accent);
    font-weight: 750;
}

@media (max-width: 760px) {
    .news-grid,
    .join-community__grid {
        grid-template-columns: 1fr;
    }

    .join-community-card {
        min-height: auto;
    }

    .home-supporters {
        align-items: flex-start;
        border-radius: var(--cbc-radius-lg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-card,
    .join-community-card {
        transition: none;
    }

    .news-card:hover,
    .join-community-card:hover {
        transform: none;
    }
}

/* Form card */
.lead-form-card {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    padding: 2rem;
    box-shadow: var(--cbc-shadow);
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Offering payment modal (inline "Zum Training anmelden" flow) */
.offering-pay-dialog {
    border: none;
    border-radius: var(--cbc-radius-lg);
    padding: 0;
    max-width: min(760px, 94vw);
    width: 100%;
    background: transparent;
    box-shadow: var(--cbc-shadow);
}

.offering-pay-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.offering-pay-dialog__card {
    margin: 0;
    padding: 1.4rem 1.5rem 1.6rem;
    border-radius: var(--cbc-radius-lg);
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
}

.offering-pay-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.offering-pay-dialog__header strong {
    font-size: 1.15rem;
}

.offering-pay-dialog__close {
    border: none;
    background: transparent;
    color: var(--cbc-text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
    margin: 0;
    width: auto;
}

.offering-pay-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0 0;
}

.offering-pay-dialog__actions .btn {
    margin: 0;
}

.offering-pay-dialog__preview {
    margin-top: 1rem;
}

.offering-pay-dialog__frame {
    width: 100%;
    height: 70vh;
    min-height: 420px;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    background: #fff;
}

.offering-pay-dialog__feedback {
    margin: 1rem 0 0;
    padding: 0.6rem 0.9rem;
    border-radius: var(--cbc-radius);
    background: #e6f6ea;
    border: 1px solid #7bc98a;
    color: #1c6b32;
    font-weight: 600;
}

/* Inline invoice preview + pay panel on the awaiting_payment offering view */
.offering-invoice-pay {
    display: grid;
    gap: 0.85rem;
    width: 100%;
}

.offering-invoice-pay__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.offering-invoice-pay__actions .btn {
    margin: 0;
}

.offering-invoice-pay__preview {
    margin: 0;
}

.offering-invoice-pay__loading {
    margin: 0;
    color: var(--cbc-text-muted);
}

/* Branded, in-page invoice document (mirrors the printed QR-bill letter) */
.invoice-doc {
    background: #fff;
    color: #1f2937;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    padding: 1.5rem 1.6rem 1.4rem;
    box-shadow: var(--cbc-shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.08));
    font-size: 0.95rem;
    line-height: 1.5;
}

.invoice-doc__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.invoice-doc__logo {
    width: 96px;
    height: auto;
    display: block;
}

.invoice-doc__place {
    color: var(--cbc-text-muted);
    font-size: 0.85rem;
    text-align: right;
    padding-top: 0.35rem;
}

.invoice-doc__addressee {
    display: grid;
    gap: 0.05rem;
    font-style: normal;
    margin-bottom: 1.2rem;
    color: #374151;
}

.invoice-doc__title {
    font-size: 1.25rem;
    margin: 0 0 0.6rem;
}

.invoice-doc__greeting {
    margin: 0 0 0.4rem;
}

.invoice-doc__lead {
    margin: 0 0 0.9rem;
    color: #374151;
}

.invoice-doc__table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 0.4rem;
}

.invoice-doc__table td {
    padding: 0.4rem 0;
    border-bottom: 1px solid #eef0f3;
    vertical-align: top;
}

.invoice-doc__amount {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.invoice-doc__qty {
    color: var(--cbc-text-muted);
    font-size: 0.85rem;
}

.invoice-doc__total td {
    border-top: 2px solid #d1d5db;
    border-bottom: none;
    padding-top: 0.55rem;
    font-weight: 700;
    font-size: 1.02rem;
}

.invoice-doc__note {
    margin: 1rem 0 0.4rem;
    color: #374151;
}

.invoice-doc__sign {
    margin: 0 0 1.1rem;
    color: #374151;
}

.invoice-doc__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem 1rem;
    margin: 0 0 1.1rem;
    padding: 0.9rem 1rem;
    background: var(--cbc-bg-subtle, #f8fafc);
    border-radius: var(--cbc-radius);
}

.invoice-doc__facts div {
    display: grid;
    gap: 0.1rem;
}

.invoice-doc__facts dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cbc-text-muted);
}

.invoice-doc__facts dd {
    margin: 0;
    font-weight: 600;
    word-break: break-word;
}

.invoice-doc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.invoice-doc__full {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--cbc-primary, #d2571d);
    text-decoration: none;
}

.invoice-doc__full:hover {
    text-decoration: underline;
}

/* Constrain the injected invoice inside the modal so it scrolls if tall */
.offering-pay-dialog__preview {
    max-height: 70vh;
    overflow: auto;
}

.offering-invoice-pay__feedback {
    margin: 0;
    padding: 0.6rem 0.9rem;
    border-radius: var(--cbc-radius);
    background: #e6f6ea;
    border: 1px solid #7bc98a;
    color: #1c6b32;
    font-weight: 600;
}

.offering-invoice-pay__feedback--error {
    background: #fdecec;
    border-color: #e0a0a0;
    color: #8a1c1c;
}

.offering-pay-more {
    width: 100%;
    margin-top: 0.4rem;
}

.offering-pay-more > summary {
    cursor: pointer;
    color: var(--cbc-text-muted);
    font-size: 0.9rem;
    padding: 0.35rem 0;
}

.offering-pay-more[open] > summary {
    margin-bottom: 0.6rem;
}


.lead-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.lead-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .lead-form__row {
        grid-template-columns: 1fr;
    }
}

.lead-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.lead-form__section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
    border: 0;
}

.lead-form__section legend {
    padding: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cbc-text);
}

.lead-form__field label,
.lead-form > label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cbc-text);
}

.lead-required {
    color: var(--cbc-accent);
}

.lead-required-note {
    font-size: 0.78rem;
    color: var(--cbc-text-muted);
    margin: 0;
}

.lead-form__hint {
    font-size: 0.78rem;
    color: var(--cbc-text-muted);
    margin: -0.75rem 0 0;
}

/* Interests grid */
.lead-interests {
    border: 0;
    padding: 0;
    margin: 0;
}

.lead-interests__legend {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cbc-text);
    padding: 0;
}

.lead-interests__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-top: 0.75rem;
}

@media (max-width: 480px) {
    .lead-interests__grid {
        grid-template-columns: 1fr;
    }
}

.lead-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius);
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.lead-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lead-check:has(input:checked),
.lead-check--checked {
    border-color: var(--cbc-accent);
    background: var(--cbc-accent-soft);
    color: var(--cbc-accent);
}

.lead-check:hover {
    border-color: var(--cbc-accent);
}

.lead-check__icon {
    display: inline-flex;
    flex-shrink: 0;
}

.lead-check__icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

/* Newsletter */
.lead-newsletter {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.lead-newsletter input[type="checkbox"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* Submit */
.lead-submit {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 0.85rem 1.5rem;
}

.lead-submit svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

/* Success / Error banners */
.lead-success,
.lead-error {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--cbc-radius);
    margin-bottom: 1.25rem;
}

.lead-success svg,
.lead-error svg {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.lead-success {
    background: var(--cbc-success-bg);
    border: 1px solid var(--cbc-success-border);
    color: var(--cbc-success);
}

.lead-error {
    background: var(--cbc-danger-bg);
    border: 1px solid var(--cbc-danger-border);
    color: var(--cbc-danger);
}

/* Aside */
.lead-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lead-aside__card {
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-lg);
    padding: 1.25rem;
}

.lead-aside__card--muted {
    background: var(--cbc-surface);
}

.lead-aside__heading {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--cbc-text);
    margin: 0 0 0.85rem;
}

.lead-aside__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.lead-aside__list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--cbc-text);
}

.lead-aside__list svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--cbc-accent);
    margin-top: 0.1rem;
}

.lead-aside__note {
    font-size: 0.78rem;
    color: var(--cbc-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* =========================================================
   MOBILE NAVIGATION — hamburger menu
   ========================================================= */

/* Brand link pulled out of topnav-links (new structure) */
.topnav-brand-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.25rem 0;
    border-radius: 0;
    text-decoration: none;
    background: transparent;
    box-shadow: none;
}

.topnav-brand-link:hover {
    background: transparent;
    box-shadow: none;
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border: 1px solid var(--cbc-border);
    border-radius: var(--cbc-radius-sm);
    background: transparent;
    cursor: pointer;
    padding: 0.375rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.nav-hamburger:hover {
    background: var(--cbc-surface);
    border-color: var(--cbc-accent);
}

.nav-hamburger__bar {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--cbc-text);
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.18s ease;
    transform-origin: center;
}

/* Open state — bars animate to × */
.topnav--open .nav-hamburger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.topnav--open .nav-hamburger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.topnav--open .nav-hamburger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile-only nav items (hidden on desktop, shown in hamburger) */
.topnav-links li.topnav-links__mobile-only {
    display: none !important;
}

@media (max-width: 640px) {
    .topnav-links li.topnav-links__mobile-only {
        display: flex !important;
    }

    .topnav-links__mobile-only a {
        color: var(--cbc-accent);
        font-weight: 700;
    }
}

/* ── Mobile breakpoint ── */
@media (max-width: 640px) {
    /* Show hamburger */
    .nav-hamburger {
        display: flex;
    }

    /* Topnav layout: brand | [spacer] | actions | hamburger */
    .topnav {
        display: grid;
        grid-template-columns: clamp(40px, 5vw, 56px) 1fr auto auto;
        align-items: center;
        gap: 0.5rem;
        position: relative; /* contain absolute dropdown */
        padding: 0.4rem 0.6rem;
        flex-wrap: nowrap;
    }

    .topnav-brand-link {
        grid-column: 1;
        min-width: 0;
    }

    /* Hide nav links by default on mobile */
    .topnav-links {
        display: none;
        grid-column: 1 / -1;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow: visible;
        /* dropdown position */
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        background: var(--cbc-bg);
        border: 1px solid var(--cbc-border);
        border-radius: 0 0 var(--cbc-radius) var(--cbc-radius);
        box-shadow: var(--cbc-shadow);
        z-index: 99;
        padding: 0.5rem 0;
    }

    /* Show nav links when open */
    .topnav--open .topnav-links {
        display: flex;
    }

    .topnav-links li {
        display: flex;
        flex: none;
        margin: 0;
    }

    .topnav-links a {
        width: 100%;
        height: auto;
        min-height: 48px;
        padding: 0.8rem 1.25rem;
        border-radius: 0;
        font-size: 0.9375rem;
        font-weight: 500;
        justify-content: flex-start;
        border-bottom: 1px solid var(--cbc-border-soft);
    }

    .topnav-links li:last-child a {
        border-bottom: none;
    }

    /* Actions stay in top bar (grid col 3) */
    .topnav-actions {
        grid-column: 3;
        margin-left: 0;
        gap: 0.2rem;
    }

    /* Hide join button on mobile — already in hero/content */
    .topnav-actions .topnav-btn-join {
        display: none;
    }

    /* Compact login button on mobile */
    .topnav-actions a[role="button"] {
        padding-inline: 0.6rem;
        font-size: 0.78rem;
        min-height: 36px;
        padding-block: 0.3rem;
    }

    /* Hamburger in col 4 */
    .nav-hamburger {
        grid-column: 4;
    }
}

[data-theme="dark"] .topnav-links {
    background: var(--cbc-bg);
    border-color: var(--cbc-border);
}

[data-theme="dark"] .nav-hamburger__bar {
    background: var(--cbc-text);
}

/* =========================================================
   MOBILE — hero, layout, typography
   ========================================================= */

/* Fix hero brand logo margin on small screens */
@media (max-width: 640px) {
    .home-hero__brand-logo {
        margin-left: 0;
        width: clamp(180px, 70vw, 300px);
        margin-bottom: 0.75rem;
    }

    .home-hero__content {
        padding: 1.5rem 1.25rem;
    }

    .home-hero__actions {
        gap: 0.6rem;
    }

    .home-hero__actions .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
        min-height: 44px;
    }

    /* Tighten page padding on mobile */
    .site-main {
        padding: 1rem 0.75rem 2.5rem;
    }

    .page-header h1 {
        font-size: clamp(1.25rem, 6vw, 1.75rem);
    }

    .page-header {
        margin-bottom: 1.25rem;
    }

    /* Stack lead layout fields */
    .lead-form__row {
        grid-template-columns: 1fr;
    }

    .lead-form-card {
        padding: 1.25rem;
    }
}

/* =========================================================
   TOUCH TARGETS — minimum 44px for all interactive elements
   ========================================================= */
@media (max-width: 768px) {
    /* Buttons */
    .btn {
        min-height: 44px;
        padding: 0.6rem 1.1rem;
    }

    /* Form inputs */
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
    select,
    textarea {
        min-height: 44px !important;
        font-size: 1rem !important; /* prevent iOS zoom */
        padding: 0.65rem 0.85rem !important;
    }

    /* Pico button overrides */
    [type="submit"],
    [type="button"],
    [type="reset"],
    button:not(.nav-hamburger):not(.theme-toggle):not(.chat-fab__btn):not(.chat-fab__mode-btn):not(.home-courts-location-map):not(.home-courts-location-info):not(.home-courts-dialog-close) {
        min-height: 44px;
    }

    /* Tab nav pills — larger tap targets */
    .tab-nav a {
        padding: 0.5rem 1rem;
        min-height: 40px;
        align-items: center;
    }

    /* Dashboard tiles */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .dashboard-tile {
        padding: 1.1rem;
    }

    /* Home cards — single column on smallest screens */
    .home-cards {
        grid-template-columns: 1fr;
    }

    .join-options {
        grid-template-columns: 1fr;
    }

    .join-page {
        padding: 1.5rem 0.75rem 3rem;
    }

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

    /* Auth card full-width padding */
    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .auth-page {
        padding: 1.5rem 0.75rem 3rem;
    }
}

/* =========================================================
   TABLES — responsive overflow wrapping
   ========================================================= */
@media (max-width: 768px) {
    /* Ensure ALL tables have horizontal scroll */
    .table-scroll,
    .home-courts-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Visual hint that scroll is available */
        background:
            linear-gradient(to right, var(--cbc-bg) 30%, rgba(255,255,255,0)) left center,
            linear-gradient(to left, var(--cbc-bg) 30%, rgba(255,255,255,0)) right center;
        background-size: 40px 100%, 40px 100%;
        background-repeat: no-repeat;
        background-attachment: local, local;
    }

    /* Generic table on mobile */
    .content-card table,
    article table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    /* Reduce table cell padding on mobile */
    th, td {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }

    /* Locations split: single column */
    .locations-split {
        grid-template-columns: 1fr;
    }

    /* People/stories grid: 1–2 col */
    .people-grid,
    .admin-people-grid,
    .stories-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    /* Generic grid */
    .grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   ADMIN PAGES — mobile layout improvements
   ========================================================= */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .admin-hero h1 {
        font-size: 1.25rem;
    }

    /* Admin quick grid: 2 columns on mobile */
    .admin-quick-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Content cards: reduce padding */
    .content-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .join-option {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .join-option__icon {
        width: 2.3rem;
        height: 2.3rem;
    }

    .home-join__grid {
        grid-template-columns: 1fr;
    }

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

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

/* =========================================================
   INDIVIDUAL OFFERING SESSIONS
   ========================================================= */
.offering-occurrence-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 1.25rem 0 2rem;
    border-block: 1px solid var(--cbc-border);
}

.offering-occurrence-summary > div {
    min-width: 0;
    padding: 0.9rem 1rem;
    border-inline-start: 1px solid var(--cbc-border);
}

.offering-occurrence-summary > div:first-child {
    border-inline-start: 0;
}

.offering-occurrence-summary dt {
    margin-bottom: 0.2rem;
    color: var(--cbc-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.offering-occurrence-summary dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.offering-order-list {
    margin-bottom: 2rem;
}

.offering-order-list > h2,
#offering-occurrences-title {
    font-size: 1.25rem;
}

.offering-order-list .offering-order + .offering-order {
    margin-top: 0.75rem;
}

.offering-order__header,
.offering-occurrence-checkout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.offering-order__header > div {
    display: grid;
    min-width: 0;
}

.offering-order__header strong {
    overflow-wrap: anywhere;
}

.offering-occurrence-table {
    min-width: 720px;
}

.offering-occurrence-table th:first-child,
.offering-occurrence-table td:first-child {
    width: 5rem;
    text-align: center;
}

.offering-occurrence-table input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
}

.offering-occurrence-checkout {
    padding-top: 1rem;
}

@media (max-width: 820px) {
    .offering-occurrence-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .offering-occurrence-summary > div:nth-child(3) {
        border-inline-start: 0;
    }

    .offering-occurrence-summary > div:nth-child(n+3) {
        border-top: 1px solid var(--cbc-border);
    }
}

@media (max-width: 520px) {
    .offering-occurrence-summary {
        grid-template-columns: 1fr;
    }

    .offering-occurrence-summary > div {
        border-inline-start: 0;
        border-top: 1px solid var(--cbc-border);
    }

    .offering-occurrence-summary > div:first-child {
        border-top: 0;
    }

    .offering-order__header,
    .offering-occurrence-checkout {
        align-items: stretch;
        flex-direction: column;
    }

    .offering-occurrence-checkout button {
        width: 100%;
    }
}

/* =========================================================
   SAFE AREA INSETS — notched phones (iPhone X+)
   ========================================================= */
@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }

    .chat-fab {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
        right: calc(1.5rem + env(safe-area-inset-right));
    }

    @media (max-width: 480px) {
        .chat-fab {
            bottom: calc(1rem + env(safe-area-inset-bottom));
            right: calc(1rem + env(safe-area-inset-right));
        }
    }
}

/* =========================================================
   PROFILE & MEMBER AREA — mobile tweaks
   ========================================================= */
@media (max-width: 640px) {
    /* Stack two-column form grids */
    .lead-form__row,
    .form-row-2col,
    .profile-form__grid {
        grid-template-columns: 1fr;
    }

    .profile-card {
        padding: 1rem;
    }

    .profile-check-grid {
        grid-template-columns: 1fr;
    }

    .profile-check--single {
        width: 100%;
    }

    .profile-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-action-row .btn,
    .profile-form__actions button {
        justify-content: center;
        width: 100%;
    }

    /* Offer tables: hide less important columns */
    .offers-table th:nth-child(3),
    .offers-table td:nth-child(3) {
        display: none;
    }

    .member-offers-table th:nth-child(3),
    .member-offers-table td:nth-child(3) {
        display: none;
    }

    /* Member home action groups */
    .dashboard-tile__actions {
        flex-direction: column;
    }

    .dashboard-tile__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .calendar-link-box {
        grid-template-columns: 1fr;
    }

    .calendar-link-copy,
    .calendar-subscription-actions .btn {
        width: 100% !important;
        justify-content: center;
    }
}

/* =========================================================
   MISC MOBILE POLISH
   ========================================================= */

/* Prevent horizontal page overflow */
body {
    overflow-x: hidden;
}

/* Ensure dropdown menus don't overflow viewport on mobile */
@media (max-width: 480px) {
    details.dropdown.account-menu > summary+ul {
        position: absolute;
        top: calc(100% + 6px);
        left: auto;
        right: 0;
        inset-inline-start: auto;
        inset-inline-end: 0;
        width: max-content;
        max-width: calc(100vw - 1rem);
    }

    details.dropdown.account-menu ul {
        min-width: min(16rem, calc(100vw - 1rem));
        max-width: calc(100vw - 1rem);
    }
}

/* Sticky header — add safe area padding at top */
@supports (padding: env(safe-area-inset-top)) {
    .site-header {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }
}

/* Chat FAB — don't cover bottom nav content on mobile */
@media (max-width: 640px) {
    .site-main {
        padding-bottom: calc(2.5rem + 4rem); /* leave room for FAB */
    }
}

/* Better focus rings for touch */
@media (max-width: 768px) {
    a:focus-visible,
    button:focus-visible,
    [role="button"]:focus-visible {
        outline: 3px solid var(--cbc-accent);
        outline-offset: 2px;
    }
}

/* ============================================================
   Standorte — calmer cards + mobile polish
   ============================================================ */

/* Turn each club into a distinct, quieter card so the page feels
   less "busy" than a stack of divider-separated tables. */
.content-card .home-courts-block {
    border-top: none;
    border: 1px solid var(--cbc-border);
    border-radius: 14px;
    background: var(--cbc-surface-raised);
    padding: 1rem 1.15rem 1.15rem;
    margin: 0 0 1rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.content-card .home-courts-block:hover {
    border-color: var(--cbc-accent-soft);
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.07);
}

.content-card .home-courts-block:last-of-type {
    margin-bottom: 0;
}

/* Calmer club header hierarchy */
.home-courts-club-head {
    align-items: center;
}

.home-courts-club-name {
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

/* Softer, cooler meta chips */
.loc-chip {
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}

/* Cooler courtfinder tips with icon tile + hover lift */
.courtfinder-tip {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.courtfinder-tip:hover {
    transform: translateY(-2px);
    border-color: var(--cbc-accent-soft);
    box-shadow: 0 6px 16px rgba(16, 24, 40, 0.06);
}

.courtfinder-tip__ico {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    background: var(--cbc-bg);
    border: 1px solid var(--cbc-border);
    font-size: 1.2rem;
}

/* Rounded scroll container for the dense info table */
.content-card .home-courts-table-scroll {
    border: 1px solid var(--cbc-border-soft);
    border-radius: 10px;
}

/* ── Phones / small tablets ────────────────────────────────── */
@media (max-width: 640px) {
    .loc-header {
        flex-direction: column;
        align-items: stretch;
    }

    .loc-register-btn {
        width: 100%;
        justify-content: center;
    }

    .loc-filter-bar {
        padding: 0.75rem 0.85rem;
    }

    .loc-filter-controls {
        width: 100%;
    }

    .loc-filter-field,
    .loc-filter-field select,
    .loc-filter-reset {
        width: 100%;
        min-width: 0;
    }

    .courtfinder-tips {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        margin: 0.9rem 0 1.1rem;
    }

    .content-card .home-courts-block {
        padding: 0.85rem 0.8rem 1rem;
        border-radius: 12px;
    }

    .home-courts-club-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .home-courts-club-actions {
        width: 100%;
    }

    .home-courts-club-actions .home-courts-location-info,
    .home-courts-club-actions .home-courts-location-map {
        flex: 1 1 0;
        justify-content: center;
    }

    .court-community {
        padding: 0.85rem 0.85rem;
    }

    .court-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .court-checkin {
        justify-content: space-between;
    }

    .court-checkin__btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .court-problem__toggle {
        width: 100%;
        justify-content: center;
    }

    .home-courts-table {
        font-size: 0.8rem;
    }
}
