@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ============================================================
   Sports Meetup Platform — App Shell CSS
   Theme tokens follow the design doc theme preference values:
     dark_pitch (default) | light | amber
   ============================================================ */

/* ─────────────────────────────────────────────
   CSS Custom Properties (Design Tokens)
   ───────────────────────────────────────────── */
:root {
  --color-bg: #0f1f14;
  --color-surface: #1a2f1f;
  --color-surface-alt: #213826;
  --color-primary: #3dba5e;
  --color-primary-hover: #2e8c46;
  --color-primary-text: #0f1f14;
  --color-text: #e8f5e9;
  --color-text-muted: #80b890;
  --color-border: #2d4a33;
  --color-error: #f44336;
  --color-warning: #ff9800;
  --color-success: #4caf50;
  --color-info: #2196f3;
  --color-danger: #e53935;
  --color-badge-public: #4caf50;
  --color-badge-invite-only: #ff9800;
  --color-badge-group: #2196f3;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --color-accent-legacy: #C2481F;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(27, 25, 24, 0.06);
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-base: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nav-height: 60px;
  --install-banner-height: 60px;
  /* Fixed CTA rule (2026-09-25, architect-directed): blue is exclusively for
     primary action buttons (Edit, Create, Save, Join, Add, Accept, RSVP...)
     across every screen and every theme. --color-primary stays reserved for
     status labels, tags, and links and remains theme-dependent; --color-cta
     is deliberately NOT overridden per-theme, since the CTA color is a fixed
     rule, not a theme choice. */
  --color-cta: #1D5FA3;
  --color-cta-text: #ffffff;
  /* Sign in with Apple (HIG): white button on dark backgrounds. */
  --color-apple-btn-bg: #ffffff;
  --color-apple-btn-fg: #000000;
  --color-apple-btn-border: #000000;
  /* AD-16: Bottom nav bar height token used for sticky footer clearance on mobile */
  --bottom-nav-height: calc(66px + env(safe-area-inset-bottom));
}

[data-theme="light"] {
  --color-bg: #FAF6F0;
  --color-surface: #ffffff;
  --color-surface-alt: #F4EFEB;
  --color-primary: #14406E;
  --color-primary-hover: #0d2a4a;
  --color-primary-text: #ffffff;
  --color-accent-gold: #FBC819;
  --color-text: #1B1918;
  --color-text-muted: #716B67;
  --color-border: #E8E2D9;
  --color-error: #c62828;
  --color-success: #1F7A73;
  /* Sign in with Apple (HIG): black button on light backgrounds. */
  --color-apple-btn-bg: #000000;
  --color-apple-btn-fg: #ffffff;
  --color-apple-btn-border: #000000;
}

[data-theme="amber"] {
  --color-bg: #1c1400;
  --color-surface: #2d2200;
  --color-surface-alt: #3a2c00;
  --color-primary: #ffb300;
  --color-primary-hover: #e6a100;
  --color-primary-text: #1c1400;
  --color-text: #fff8e1;
  --color-text-muted: #c8a850;
  --color-border: #4a3900;
}

/* ─────────────────────────────────────────────
   Reset & Base
   ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; font-family: inherit; }

/* ─────────────────────────────────────────────
   Utility
   ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─────────────────────────────────────────────
   Install Banner (R-026 — persistent, every page)
   ───────────────────────────────────────────── */
#install-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-cta);
  color: var(--color-cta-text);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.install-banner-icon { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; }
.si { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; vertical-align: middle; line-height: 0; }
.si svg { display: block; }

.install-banner-text { flex: 1; }
.install-banner-title { font-weight: 700; font-size: 0.9rem; }
.install-banner-subtitle { font-size: 0.78rem; opacity: 0.9; margin-top: 2px; }

.install-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

#btn-install {
  background: var(--color-cta-text);
  color: var(--color-cta);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.2s;
}
#btn-install:hover { opacity: 0.85; }

#btn-install-dismiss {
  background: transparent;
  border: 1.5px solid var(--color-primary-text);
  color: var(--color-cta-text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.82rem;
  transition: opacity 0.2s;
}
#btn-install-dismiss:hover { opacity: 0.75; }

/* ─────────────────────────────────────────────
   Push Permission Banner (DES-MEETUP-001 §4.11, R-026)
   Shares the install banner's visual language — same slot in the
   layout, mutually exclusive with it (never shown at the same time).
   ───────────────────────────────────────────── */
#push-permission-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-cta);
  color: var(--color-cta-text);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

#btn-enable-push {
  background: var(--color-cta-text);
  color: var(--color-cta);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.2s;
}
#btn-enable-push:hover { opacity: 0.85; }

#btn-push-dismiss {
  background: transparent;
  border: 1.5px solid var(--color-cta-text);
  color: var(--color-cta-text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.82rem;
  transition: opacity 0.2s;
}
#btn-push-dismiss:hover { opacity: 0.75; }

/* ─────────────────────────────────────────────
   iOS Install Modal
   ───────────────────────────────────────────── */
#ios-install-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ios-modal-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ios-modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.ios-modal-steps { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.7; margin-bottom: 20px; }
.ios-modal-steps strong { color: var(--color-text); }

#btn-ios-modal-close {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: var(--color-cta-text);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   Navigation
   games-groups-fold Scope §4: #app-nav renamed to #app-topbar and
   stripped down to brand (mobile) + notifications only — the rest of
   its former contents (category dropdowns, Settings/Admin/Sign Out)
   moved to the Profile screen or were retired as redundant with the
   primary nav. Selector renamed (not just restyled) so "confirm #app-nav
   is fully removed" is verifiable in the rendered DOM, not just visually.
   ───────────────────────────────────────────── */
#app-topbar {
  height: var(--nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.nav-right { display: flex; align-items: center; gap: 12px; }

/* ─────────────────────────────────────────────
   Notification Centre (in-app fallback)
   ───────────────────────────────────────────── */
.notif-wrapper { position: relative; }

#btn-notif-bell {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--color-text-muted);
  padding: 4px;
  position: relative;
  transition: color 0.2s;
}
#btn-notif-bell:hover { color: var(--color-text); }

#notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--color-error);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

#notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-height: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow-y: auto;
  z-index: 300;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
}

#btn-mark-all-read {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 600;
}

#notif-list { padding: 8px 0; }

.notif-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}
.notif-item:hover { background: var(--color-surface-alt); }
.notif-item.unread { border-left: 3px solid var(--color-primary); }
.notif-item.read { opacity: 0.7; }
.notif-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 2px; }
.notif-body { font-size: 0.82rem; color: var(--color-text-muted); }
.notif-time { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--color-text-muted); font-size: 0.88rem; }

#notif-fallback-hint {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--color-warning);
  color: #1c1400;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  width: 240px;
  box-shadow: var(--shadow-sm);
  z-index: 300;
}

/* ─────────────────────────────────────────────
   Main Content Area
   ───────────────────────────────────────────── */
#app-main {
  flex: 1;
  padding: 20px 16px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* Dashboard page overrides 800px cap (AD-10): this page only, other pages unchanged */
#app-main.app-main-dashboard,
#app-main:has(.dashboard-page) {
  max-width: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* ─────────────────────────────────────────────
   Pages
   ───────────────────────────────────────────── */
.page { animation: fadeIn 0.2s ease; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 { font-size: 1.4rem; font-weight: 800; }

h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 16px; }
h3 { font-size: 1rem; font-weight: 700; margin: 20px 0 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.subtitle { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 4px; }

/* ─────────────────────────────────────────────
   Auth Page
   ───────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--nav-height) - 60px);
  padding: 24px 16px;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.auth-logo { width: 48px; height: 48px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; }

/* Header wordmark: 40px CSS height, 1x asset is 107x40. White plate keeps the
   transparent artwork readable on the blue banner and install bar. */
.brand-wordmark {
  width: 107px;
  height: 40px;
  object-fit: contain;
  display: block;
  flex: none;
  background: var(--hv2-surface);
  border-radius: 8px;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}
.brand-tagline {
  display: block;
  height: 12px;
  margin: 0;
  padding: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 12px;
  color: var(--hv2-ink);
  white-space: nowrap;
  text-align: center;
}
.brand-logo-full {
  width: 260px;
  height: 125px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
}
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 48px 16px;
  gap: 16px;
}
.hv2-fallback-art .brand-wordmark { position: relative; }
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 28px; }

.auth-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: transform 0.15s, opacity 0.15s;
}
.btn-oauth:hover { transform: translateY(-1px); opacity: 0.9; }

/* The auth card background is pure white in the light theme, so the
   Google button's official white/light style (#fff bg) needs a visible
   border + shadow of its own to read as a button rather than blending
   into the card — a faint #dadce0 border alone isn't enough on a white
   card (it's meant for Google's own light-grey page background). Uses
   Google's own documented shadow values for the light button variant. */
.btn-google {
  background: #fff;
  color: #3c4043;
  border-color: #747775;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}
.btn-google:hover {
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
}
.btn-facebook { background: #1877f2; color: #fff; }

/* Fixed height and icon box (Apple HIG). Colors come from theme tokens only. */
.btn-apple {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 16px;
  background: var(--color-apple-btn-bg);
  color: var(--color-apple-btn-fg);
  border-color: var(--color-apple-btn-border);
  gap: 8px;
  overflow: hidden;
}
.oauth-icon-apple {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
  overflow: hidden;
}
.oauth-icon-apple svg {
  width: 18px;
  height: 18px;
  display: block;
}

.oauth-icon { font-weight: 800; font-size: 1.1rem; }
.oauth-icon-google { flex-shrink: 0; }

.auth-legal-notice {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 18px;
  color: var(--color-text-muted);
  text-align: center;
}
.auth-legal-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}
.auth-note { font-size: 0.78rem; color: var(--color-text-muted); }

/* ─────────────────────────────────────────────
   Home Page Tabs
   ───────────────────────────────────────────── */
.home-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin: 16px 0 20px;
}
.home-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.home-tab-btn:hover { color: var(--color-text); }
.home-tab-btn.active.nav-pair-blue { color: var(--color-info); border-bottom-color: var(--color-info); }
.home-tab-btn.active.nav-pair-gold { color: var(--color-warning); border-bottom-color: var(--color-warning); }

/* ─────────────────────────────────────────────
   Card Grid (Home)
   ───────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card-action {
  cursor: pointer;
  text-align: center;
}
.card-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.card-icon { font-size: 2rem; margin-bottom: 10px; }
.card-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.card-desc { font-size: 0.78rem; color: var(--color-text-muted); }

/* ─────────────────────────────────────────────
   Event Cards
   ───────────────────────────────────────────── */
.event-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.event-header { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.event-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; overflow-wrap: anywhere; }
/* BUG: card tiles (.event-card) must clamp long/generated-string titles to
   2 lines instead of overflowing the card; the full detail-page header
   (.event-detail-card .event-title) is intentionally left unclamped so the
   full title is always readable there. */
.event-card .event-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  max-width: 100%;
}
.event-meta span { overflow-wrap: anywhere; max-width: 100%; }

/* Event Detail */
.event-detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.event-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.event-detail-meta strong { color: var(--color-text); }

.event-desc { font-size: 0.9rem; color: var(--color-text-muted); margin: 8px 0; line-height: 1.5; }

.event-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ─────────────────────────────────────────────
   Group Cards
   ───────────────────────────────────────────── */
.group-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.group-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.group-desc { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 6px; }
.group-meta { font-size: 0.78rem; color: var(--color-text-muted); }

/* ─────────────────────────────────────────────
   Badges
   ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.badge-public { background: var(--color-badge-public); color: #fff; border-color: transparent; }
.badge-invite_only { background: var(--color-badge-invite-only); color: #fff; border-color: transparent; }
.badge-group { background: var(--color-badge-group); color: #fff; border-color: transparent; }
.badge-status { background: var(--color-surface-alt); }

/* games-groups-fold: type badges distinguishing tournament entries from
   adhoc ones in the merged Games/Groups lists. Reuses the app's existing
   blue=Games/Groups, gold=Tournaments/Teams token pairing (--color-info /
   --color-warning) so the distinction reads consistently in every theme. */
.badge-tournament-type { background: var(--color-warning); color: #1c1400; border-color: transparent; }
.badge-group-type { background: var(--color-info); color: #fff; border-color: transparent; }

/* ─────────────────────────────────────────────
   Kind toggle — R-264/R-265 segmented control (Create Game / Create
   Group), shared by both create-flow toggles.
   ───────────────────────────────────────────── */
.kind-toggle {
  display: flex;
  gap: 4px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  max-width: fit-content;
}
.kind-toggle-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.kind-toggle-btn:hover { color: var(--color-text); }
.kind-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────────
   Games | Tournaments segmented switch (AD-16)
   Theme tokens only — no hex/rgba.
   ───────────────────────────────────────────── */
.games-tournaments-switch {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}
.games-tournaments-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-base);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.games-tournaments-switch-btn:hover {
  color: var(--color-text);
}
.games-tournaments-switch-btn.active,
.games-tournaments-switch-btn[aria-current="page"] {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}


/* NE-05: Pending section on Groups > Tournament teams (invitations to me, join requests on teams I captain) and its count badge. Tokens only. */
.team-pending-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 20px;
  background: var(--color-cta);
  color: var(--color-cta-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.team-pending-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.team-pending-heading {
  margin: 12px 0 6px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.team-pending-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}
.team-pending-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.team-pending-sub {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.team-pending-actions {
  display: flex;
  gap: 8px;
}

/* Active | All list toggle. Selected segment is filled. Not persisted. */
.view-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}
.view-toggle-btn {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-base);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.view-toggle-btn.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 700;
}
.status-label-pill.status-life-active { background: color-mix(in srgb, var(--color-primary) 18%, transparent); color: var(--color-primary); }
.status-label-pill.status-life-past { background: color-mix(in srgb, var(--color-warning) 22%, transparent); color: var(--color-warning); }
.status-label-pill.status-life-cancelled { background: color-mix(in srgb, var(--color-danger) 16%, transparent); color: var(--color-danger); }
.status-label-pill.status-life-closed { background: color-mix(in srgb, var(--color-primary) 18%, transparent); color: var(--color-primary); }
.datetime-field.is-invalid input,
.datetime-field.is-invalid select,
input.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 1px var(--color-danger);
}
.time-past-msg { color: var(--color-danger); font-size: 0.82rem; margin: 6px 0 0; }

/* Stack Gotchas: Emoji glyphs render taller than plain text at the same font-size — explicit fixed height */
.emoji-box, .emoji-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.25em;
  width: 1.25em;
  line-height: 1;
  vertical-align: -0.15em;
  overflow: hidden;
}

/* ─────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: transform 0.12s, opacity 0.2s, box-shadow 0.12s;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); opacity: 0.9; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-cta); color: var(--color-cta-text); }
.btn-secondary { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-full { width: 100%; }

/* Sticky submit footer — pins the form submit button at the bottom of the
   viewport on short mobile screens while staying in-flow on tall screens. */
.form-sticky-footer {
  position: sticky;
  bottom: 0;
  background: var(--color-bg);
  padding: 12px 0 0;
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
  z-index: 95; /* above .bottom-nav's z-index: 90 */
}
/* On mobile, .bottom-nav (position:fixed, ~66px tall + safe-area-inset-bottom,
   see .bottom-nav-inner) occupies the bottom strip of the viewport.
   AD-16: .form-sticky-footer (and any sticky action footer) sits strictly above
   the bottom bar and never overlaps it. */
@media (max-width: 768px) {
  .form-sticky-footer {
    bottom: var(--bottom-nav-height, calc(66px + env(safe-area-inset-bottom)));
  }
}
.btn-back { margin-bottom: 16px; }

/* Create Game form — "new field system" (chip pickers for Sport/Skill/
   Visibility + restyled fields), 2026-09-25 CreateGameForm mockup.
   Scoped to .cg-form / .cg-chip so the shared .form-group input styling
   other forms (edit modals, tournament create, auth, etc.) still use is
   untouched. Direct-child combinator deliberately excludes the nested
   date/time inputs inside .datetime-row, which keep their own icon-
   padded styling further down this file. */
.cg-form .form-group > input,
.cg-form .form-group > select,
.cg-form .form-group > textarea {
  background: #ffffff;
  color: #1B1918;
  border: 1px solid #E7E0D6;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}
.cg-form .form-group > input:focus,
.cg-form .form-group > select:focus,
.cg-form .form-group > textarea:focus {
  border-color: var(--color-cta);
}
.cg-form .form-group > label {
  font-size: 13px;
  font-weight: 600;
  color: #4A453F;
}
.cg-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cg-chip {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, opacity 0.15s;
}
.cg-chip:hover { opacity: 0.85; }

/* ─────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 480px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--color-surface-alt);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* .settings-grid is referenced across ~11 places in app.js (edit-event
   modal, tournament create/edit forms, team detail, now the Create Game
   cost/currency row) but had no CSS definition anywhere in this file --
   every inline `style="grid-template-columns: 1fr 1fr; gap: 15px;"` on it
   was a silent no-op without `display: grid` to activate it, so all of
   those rows have always rendered as plain stacked blocks instead of a
   2-column grid. Fixing the missing base rule here (not narrowly scoping
   it to the Create Game page) so every existing call site starts
   rendering as originally intended. */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* Date/Time picker enhancements */
.date-quick-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chip {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-surface);
}

.chip.chip-active {
  background: var(--color-primary);
  color: var(--color-cta-text);
  border-color: var(--color-primary);
}

.datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.datetime-field {
  position: relative;
  display: flex;
  align-items: center;
}

.datetime-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.datetime-field input[type="date"],
.datetime-field select {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px 36px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.datetime-field input[type="date"]:focus,
.datetime-field select:focus {
  border-color: var(--color-primary);
}



/* ─────────────────────────────────────────────
   Nav User Area
   ───────────────────────────────────────────── */
#nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

/* ─────────────────────────────────────────────
   Loading Spinner
   ───────────────────────────────────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   Toast Notifications
   ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.25s ease;
  pointer-events: auto;
  max-width: 300px;
}

.toast-success { background: var(--color-success); color: #fff; }
.toast-error { background: var(--color-error); color: #fff; }
.toast-info { background: var(--color-info); color: #fff; }
.toast-warning { background: var(--color-warning); color: #1c1400; }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-fade-out {
  animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(120%); }
}

/* ─────────────────────────────────────────────
   Empty States & Errors
   ───────────────────────────────────────────── */
.empty-state {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 16px 0;
  text-align: center;
}

.error {
  color: var(--color-error);
  padding: 16px 0;
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────── */
@media (max-width: 480px) {
  #app-main { padding: 16px 12px; }
  .auth-card { padding: 28px 20px; }
  .event-detail-card { padding: 16px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  #notif-panel { width: calc(100vw - 24px); right: -8px; }
  .install-banner-subtitle { display: none; }
}

/* ─────────────────────────────────────────────
   PWA Standalone mode adjustments
   ───────────────────────────────────────────── */
@media (display-mode: standalone) {
  /* Ensure content doesn't overlap status bar on iOS */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* Install banner never shows in standalone mode — it's removed by JS,
     but we add a CSS safety net */
  #install-banner { display: none !important; }
}

/* ─────────────────────────────────────────────
   Notification Preferences (DES-MEETUP-001 §4.11, R-026)
   ───────────────────────────────────────────── */
.notif-prefs-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.notif-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.notif-pref-row:last-child { border-bottom: none; }
.notif-pref-row-global { font-weight: 700; }
.notif-pref-label { font-size: 0.9rem; color: var(--color-text); }
.notif-prefs-loading, .notif-prefs-error { font-size: 0.85rem; color: var(--color-text-muted); }

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: background 0.15s ease;
  pointer-events: none;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: var(--color-surface);
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ─────────────────────────────────────────────
   Settings Dashboard Layout
   ───────────────────────────────────────────── */
.theme-settings-card {
  margin-bottom: 24px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}
.dashboard-col {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.section-title-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}
.section-title-wrapper h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.badge-count {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
}
.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─────────────────────────────────────────────
   Responsive — mobile/desktop visibility toggle
   games-groups-fold Scope §4: the nav-links-desktop / mobile drawer /
   desktop dropdown / nav-pair-dot rules that used to live in this
   section were all specific to the retired #app-nav bar and NAV_MENU
   dropdowns/mobile drawer — removed along with their markup. .mobile-only
   itself stays: #app-topbar's brand still uses it (shown on mobile,
   hidden on desktop where the sidebar already shows the brand).
   ───────────────────────────────────────────── */
.mobile-only {
  display: none !important;
}

@media (max-width: 1023px) {
  .mobile-only {
    display: block !important;
  }
  #app-topbar {
    gap: 8px;
  }
}

/* ─────────────────────────────────────────────
   Home page — consolidated menu (Games, Tournaments, Groups, Teams)
   ───────────────────────────────────────────── */
.menu-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 8px;
}

/* Give the 4-column menu more room than the default reading-width
   container other pages use, without affecting them. */
#app-main:has(.page-home) {
  max-width: 1100px;
}

@media (max-width: 900px) {
  .menu-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}
.menu-column {
  padding: 18px;
  border-top: 3px solid transparent;
  display: flex;
  flex-direction: column;
}
.menu-column.nav-pair-blue { border-top-color: var(--color-info); }
.menu-column.nav-pair-gold { border-top-color: var(--color-warning); }
.menu-column-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  min-height: 2.6em;
  margin: 0 0 4px;
}
.menu-column-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  /* Reserve space for 2 lines regardless of how many this particular
     description actually wraps to, so the divider below (and the item
     list that follows) lines up at the same height across every column
     — otherwise a 1-line vs 2-line description shifts everything below
     it out of alignment card to card. */
  min-height: calc(2 * 1.4em + 10px);
}
.menu-column-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-column-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.menu-column-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .menu-columns {
    grid-template-columns: 1fr;
  }
}

.rsvp-status-badge {
  margin-bottom: 12px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-going {
  background: var(--color-success) !important;
  color: white !important;
}
.badge-waitlisted {
  background: var(--color-warning) !important;
  color: white !important;
}
.badge-registration_open {
  background: var(--color-success) !important;
  color: white !important;
}
.badge-registration_closed,
.badge-schedule_draft {
  background: var(--color-warning) !important;
  color: white !important;
}
.badge-published,
.badge-in_progress,
.badge-registered {
  background: var(--color-info) !important;
  color: white !important;
}
.badge-completed {
  background: var(--color-text-muted) !important;
  color: white !important;
}

.autocomplete-container {
  position: relative;
  width: 100%;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  margin-top: 4px;
}
.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
  text-align: left;
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover {
  background: var(--color-surface-alt);
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.autocomplete-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Shared person avatar (userAvatarHtml): fixed size so rows align regardless of content. */
.user-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 32px;
}
.user-avatar img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  display: block;
}
.autocomplete-title {
  height: 32px;
  line-height: 32px;
  padding: 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}
.autocomplete-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.autocomplete-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-sizing: border-box;
}
.autocomplete-dot-group { background: var(--color-cta); }
.autocomplete-dot-other { background: transparent; border: 1.5px solid var(--color-text-muted); }
.autocomplete-item-group {
  background: color-mix(in srgb, var(--color-cta) 8%, var(--color-surface));
}
.autocomplete-item-other .user-avatar {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}
.autocomplete-chip {
  flex: 0 0 auto;
  max-width: 45%;
  height: 20px;
  line-height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-cta);
  border: 1px solid var(--color-cta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.autocomplete-clear {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  line-height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}
.autocomplete-item-pending {
  cursor: default;
  opacity: 0.6;
}
.autocomplete-item-pending:hover {
  background: transparent;
}

/* ============================================================
   Task: frontend-landing-discover-profile-signup
   Home / Discover / Profile / Signup + shared nav shell
   Visual/layout/interaction source: docs/meetup-prototype.html
   (client-approved mockup). Colors reuse the EXISTING [data-theme]
   custom properties above (they already match the mockup's hardcoded
   palette value-for-value in the light theme) -- nothing here
   hardcodes a hex value. Breakpoint (768px) matches the convention
   already used elsewhere in this file (Responsive Navigation Menu,
   above).
   ============================================================ */

/* ── App shell: sidebar (desktop) + bottom nav (mobile) ── */
.app-shell-v2 {
  display: flex;
  min-height: 100vh;
}

.side-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--install-banner-h, 0px);
  left: 0;
  height: calc(100dvh - var(--install-banner-h, 0px));
  z-index: 90;
  padding-bottom: 20px;
}
/* Applied by renderAppShellNav(): the padding the logo used to get from an inline style. */
.side-nav-logo.side-nav-logo-js { padding: 0; border-bottom: none; display: block; }
/* AD-16: the brand header exists in the markup but only shows at 1024px and up. */
.brand-header { display: none; }
/* AD-19 narrow-rail brand block (769-1023px): as wide as the rail (220px, covering its 1px border), 72px tall,
   brand blue, the header icon variant 40x40 with a 12px radius, centred; no wordmark, no white tile. */
.side-nav-logo .side-nav-brand-tablet {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 220px; height: 72px; margin-right: -1px;
  background-color: var(--hv2-surface); text-decoration: none; color: inherit;
}
.side-nav-brand-tablet:focus-visible { outline: 3px solid var(--db-brand-accent); outline-offset: -5px; }
.side-nav-brand-tablet-icon { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; display: block; }
.side-nav-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-nav-items {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.side-nav-item:hover { background: var(--color-surface-alt); }
.side-nav-item.active { background: color-mix(in srgb, var(--color-primary) 10%, transparent); color: var(--color-primary); }
.side-nav-item .sni-icon { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.side-nav-fab {
  margin: 4px 12px 0;
  background: var(--color-cta);
  color: var(--color-cta-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 0;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.side-nav-fab:hover { background: color-mix(in srgb, var(--color-cta) 85%, black); }
.side-nav-secondary {
  padding: 10px 10px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-main-v2 {
  margin-left: 220px;
  flex: 1;
  min-width: 0; /* flex items default to min-width:auto, which lets
    intrinsic content width (e.g. .cards-row's children) prevent this
    from shrinking below their combined width, causing horizontal page
    overflow on mobile -- this is the standard fix. */
  background: var(--color-surface-alt);
  min-height: 100vh;
}
/* Logged-out state (login/signup): primary nav shell is hidden (see
   UI.updateNav() in app.js), so the content area shouldn't reserve
   space for it. */
.app-main-v2.app-main-v2-full { margin-left: 0; }
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

.mob-page-header {
  display: none;
  background: var(--color-primary);
  padding: 20px 16px 16px;
}

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  box-sizing: border-box;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 90;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
}
.bottom-nav-inner { display: flex; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); position: relative; }
.bottom-nav-item {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
}
.bottom-nav-item .bni-icon { font-size: 1.25rem; line-height: 1; }
.bottom-nav-item .bni-label { font-size: 0.62rem; color: var(--color-text-muted); font-weight: 400; }
.bottom-nav-item.active .bni-label { color: var(--color-primary); font-weight: 700; }
.bottom-nav-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--color-primary); }
.bottom-nav-fab-wrap { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); }
.bottom-nav-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-cta);
  border: 3px solid var(--color-surface-alt);
  color: var(--color-cta-text);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}

/* ── Create action sheet (mobile FAB "+" → choose Game or Group) ── */
.create-action-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.create-action-sheet {
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 32px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-md);
}
.create-action-sheet h3 {
  text-align: center; font-size: 0.85rem;
  color: var(--color-text-muted); margin-bottom: 16px;
  padding-top: 4px;
}
.create-action-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 16px; margin-bottom: 10px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text); font-size: 1rem; font-weight: 500;
  cursor: pointer; text-align: left;
}
.create-action-btn:hover { background: var(--color-border); }
.create-action-btn .cab-icon { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.create-action-cancel {
  display: block; width: 100%; padding: 12px;
  background: none; border: none;
  color: var(--color-text-muted); font-size: 0.95rem;
  cursor: pointer; margin-top: 4px;
}

@media (max-width: 768px) {
  .side-nav { display: none !important; }
  .app-main-v2 { margin-left: 0; }
  .page-content { padding: 0 0 100px; }
  .bottom-nav { display: block; }
  .mob-page-header { display: block; }
  .desktop-only { display: none !important; }
}
@media (min-width: 769px) {
  .mobile-page-only { display: none !important; }
  .bottom-nav { display: none !important; }
}

/* ── Filter chips (sport filter, Home + Discover) ── */
/* Scrollbars are hidden at rest on swipeable rows; they reappear while the
   user is actively scrolling (a JS scroll-listener adds .is-scrolling for
   300 ms, see app.js initScrollbarVisibility). */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { height: 0; }
.chips-row.is-scrolling { scrollbar-width: thin; }
.chips-row.is-scrolling::-webkit-scrollbar { height: 4px; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--color-primary); color: var(--color-cta-text); border-color: var(--color-primary); }
/* On the mobile header (primary-colored background) chips need inverted
   default styling for contrast -- same interaction, different palette. */
.mob-page-header .chips-row { padding-bottom: 0; }
.mob-page-header .chip {
  background: color-mix(in srgb, var(--color-primary-text) 18%, transparent);
  color: var(--color-primary-text);
  border: none;
}
.mob-page-header .chip.active { background: var(--color-primary-text); color: var(--color-primary); }

@media (min-width: 769px) {
  .chips-row { flex-wrap: wrap; }
  .chips-row:has(.stat-tile) {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    width: 100%;
  }
  .chips-row > .stat-tile {
    flex: 1;
    min-width: 0;
    width: 100%;
  }
}

/* ── Cards row: swipeable one-per-viewport on mobile, grid on desktop ── */
.cards-row {
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.cards-row::-webkit-scrollbar { height: 0; }
.cards-row.is-scrolling { scrollbar-width: thin; }
.cards-row.is-scrolling::-webkit-scrollbar { height: 4px; }
.cards-row > * {
  min-width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  margin-right: 0;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    overflow-x: visible;
    padding-bottom: 0;
    width: 100%;
  }
  .cards-row:has(.quick-tile),
  .cards-row:has(.result-card) {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .cards-row > * { min-width: unset; max-width: unset; margin-right: 0; scroll-snap-align: unset; }
}

.section-pad { padding: 0 16px; }
.section-gap { margin-bottom: 24px; }
@media (min-width: 769px) {
  .section-pad { padding: 0; }
  .section-gap { margin-bottom: 28px; }
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.section-head-title { color: var(--color-text); font-size: 1.05rem; font-weight: 700; margin: 0; }
.section-head-sub { color: var(--color-text-muted); font-size: 0.78rem; margin: 2px 0 0; }
.section-head-action {
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* ── Game card ── */
.game-card {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  width: 100%;
}
.game-card.game-card-today { border: 1.5px solid var(--color-primary); }
.game-card-today-flag { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; color: var(--color-primary); font-size: 0.68rem; font-weight: 700; letter-spacing: 1px; }
.game-card-today-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.game-card-badge {
  position: absolute; top: 12px; right: 12px;
  border-radius: 6px; padding: 2px 7px;
  font-size: 0.62rem; font-weight: 700;
}
.game-card-badge-tournament { background: color-mix(in srgb, var(--color-warning) 15%, transparent); border: 1px solid var(--color-warning); color: var(--color-warning); }
.game-card-sport { width: 28px; height: 28px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; }
/* BUG: raw programmatic/test titles (e.g. long ALL_CAPS_UNDERSCORE ids with
   no spaces) don't wrap on their own and blow out the card width; clamp to
   2 lines and force mid-word wrapping as a fallback for unbroken tokens. */
.game-card-title {
  color: var(--color-text); font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.game-card-meta {
  color: var(--color-text-muted); font-size: 0.72rem; margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.game-card-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; gap: 8px; }
.game-card-spots { font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); flex-shrink: 0; }
.game-card-spots.full { color: var(--color-danger); }
.game-card-spots.low { color: var(--color-warning); }
.game-card-via {
  font-size: 0.68rem; color: var(--color-text-muted); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.game-card-btn {
  width: 100%; border-radius: 8px; padding: 9px 0;
  font-size: 0.78rem; font-weight: 700; cursor: pointer; border: none;
}
.game-card-btn-join { background: var(--color-cta); color: var(--color-cta-text); }
.game-card-btn-full { background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.game-card-btn-registered { background: color-mix(in srgb, var(--color-primary) 8%, transparent); color: var(--color-primary-hover); border: 1.5px solid color-mix(in srgb, var(--color-primary) 33%, transparent); }

.pill {
  display: inline-block;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
}
/* Skill-level pills — real skill_level_requirement enum values
   (all_levels/beginner/intermediate/expert), not the mockup's
   placeholder Casual/Beginner/Intermediate/Advanced labels. */
.pill-skill-all_levels { background: color-mix(in srgb, var(--color-text-muted) 15%, transparent); color: var(--color-text-muted); border-color: color-mix(in srgb, var(--color-text-muted) 40%, transparent); }
.pill-skill-beginner { background: color-mix(in srgb, var(--color-info) 15%, transparent); color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 40%, transparent); }
.pill-skill-intermediate { background: color-mix(in srgb, var(--color-warning) 15%, transparent); color: var(--color-warning); border-color: color-mix(in srgb, var(--color-warning) 40%, transparent); }
.pill-skill-expert { background: color-mix(in srgb, var(--color-danger) 15%, transparent); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 40%, transparent); }
.pill-role-organiser { background: color-mix(in srgb, var(--color-primary) 15%, transparent); color: var(--color-primary); border-color: color-mix(in srgb, var(--color-primary) 40%, transparent); }
.pill-role-player { background: color-mix(in srgb, var(--color-info) 15%, transparent); color: var(--color-info); border-color: color-mix(in srgb, var(--color-info) 40%, transparent); }

/* ── Stats tiles ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 769px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-tile {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.stat-tile-icon { width: 24px; height: 24px; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; }
.stat-tile-value { color: var(--color-text); font-size: 1.35rem; font-weight: 800; }
.stat-tile-label { color: var(--color-text-muted); font-size: 0.72rem; margin-top: 2px; }
/* Compact horizontal variant used at the bottom of Home (sport-filtered) */
.stat-tile-compact { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.stat-tile-compact .stat-tile-value { font-size: 1.15rem; line-height: 1; }

/* ── Result rows (Recent Results, Match History) ── */
.result-row {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.result-row-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.result-won .result-row-icon { background: color-mix(in srgb, var(--color-primary) 15%, transparent); }
.result-lost .result-row-icon { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.result-won { border-color: color-mix(in srgb, var(--color-primary) 33%, var(--color-border)); }
.result-lost { border-color: color-mix(in srgb, var(--color-danger) 33%, var(--color-border)); }
.result-row-outcome { font-weight: 700; font-size: 0.78rem; }
.result-won .result-row-outcome { color: var(--color-primary); }
.result-lost .result-row-outcome { color: var(--color-danger); }

/* Recent Results card variant used on Home (bigger, card layout) */
.result-card {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

/* ── Search panel (Home inline search + Discover page) ── */
.search-panel {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.search-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 769px) { .search-grid { grid-template-columns: 1fr 1fr; } }
.search-field {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.88rem;
}
.search-field-wrap { position: relative; }
.search-field-gps {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--color-primary); font-size: 0.72rem; font-weight: 700; padding: 0;
}

/* ── Quick-access tiles (My Games & Groups) ── */
.quick-tile {
  background: var(--color-surface);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.quick-tile-icon { font-size: 1.75rem; margin-bottom: 8px; }
.quick-tile-title { color: var(--color-text); font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.quick-tile-sub { color: var(--color-text-muted); font-size: 0.8rem; }

/* ── Profile page ── */
.profile-hero {
  background: var(--color-primary);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-hero-name { color: var(--color-cta-text); font-size: 1.25rem; font-weight: 800; }
.profile-hero-sports { color: color-mix(in srgb, var(--color-primary-text) 85%, transparent); font-size: 0.8rem; }
.profile-hero-badge {
  background: color-mix(in srgb, var(--color-primary-text) 20%, transparent);
  color: var(--color-cta-text);
  border-radius: 20px; padding: 2px 10px; font-size: 0.68rem; font-weight: 700;
  display: inline-block; margin-top: 6px;
}
.profile-avatar { border-radius: 50%; display: block; flex-shrink: 0; object-fit: cover; }
.profile-winrate-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  margin-bottom: 24px;
}
.profile-winrate-bar-track { background: var(--color-bg); border-radius: 6px; height: 8px; }
.profile-winrate-bar-fill { background: var(--color-primary); border-radius: 6px; height: 8px; }

/* ── Signup: email form + OTP screens ── */
.signup-field {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 0.94rem;
  width: 100%;
}
.signup-back-link {
  background: none; border: none; color: var(--color-text-muted);
  font-size: 0.82rem; cursor: pointer; padding: 0; text-align: left;
}
/* Reset-password views (DES-MEETUP-ADDENDUM-email-auth fix round 2): 44px tap
   targets, theme tokens only. Used by the reset views' markup only. */
.reset-btn { min-height: 44px; }
.reset-link-btn {
  display: flex; align-items: center;
  min-height: 44px; min-width: 44px; padding: 0 8px;
  background: none; border: none; cursor: pointer;
  color: var(--color-text-muted); font-size: 0.9rem; text-align: left;
}
.reset-error { color: var(--color-error); font-size: 0.85rem; min-height: 1.2em; margin-top: 8px; }
.otp-row { display: flex; gap: 8px; justify-content: center; }
.otp-box {
  width: 44px; height: 52px;
  text-align: center; font-size: 1.25rem; font-weight: 700;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.otp-box.filled { border: 2px solid var(--color-primary); }
.signup-divider { display: flex; align-items: center; gap: 12px; }
.signup-divider-line { flex: 1; height: 1px; background: var(--color-border); }
.signup-divider-text { color: var(--color-text-muted); font-size: 0.8rem; }

.two-col { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 769px) { .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } }

/* ═════════════════════════════════════════════════════════════
   GAMES LIST & EVENT DETAIL REDESIGN (DES-MEETUP-001 Visual System)
   Ivory background (#FAF6F0), Ink text (#1B1918), Space Grotesk / Manrope,
   20px radius cards with soft shadow, no left-border cards.
   Primary accent: var(--color-primary).
   Sport palettes (core 4 per design spec): Badminton #1F7A73, Football #8A5A1E,
   Basketball #6B4FA0, Tennis #B23A62.
   Extended (same lightness/saturation family): Volleyball #1E5E8A, Swimming #1B6E94,
   Cricket #7A4B1F, Rugby #4E6A9F, Hockey #1E7A5A, Running #4A7A1F,
   Cycling #1F5E8A, Squash #9B4F1E, Golf #4A6B1F, Others #52606D.
   ═════════════════════════════════════════════════════════════ */

/* ── Typography & Display Headings ── */
.games-heading {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: #1B1918;
  margin: 0;
  letter-spacing: -0.02em;
}

/* ── Filter Chips ── */
.filter-chips-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 20px 0 24px 0;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid #EAE4DC;
  background: #FFFFFF;
  color: #1B1918;
  font-family: var(--font-base, 'Manrope', sans-serif);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(27, 25, 24, 0.03);
}
.filter-chip:hover {
  border-color: #1B1918;
  transform: translateY(-1px);
}
.filter-chip.active {
  background: #1B1918;
  color: #FAF6F0;
  border-color: #1B1918;
  box-shadow: 0 4px 12px rgba(27, 25, 24, 0.15);
}
.filter-chip .chip-count {
  font-size: 0.76rem;
  opacity: 0.8;
  margin-left: 2px;
}

/* ── Games Card Grid ── */
.games-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* ── Game Card (No left border, 20px radius, soft shadow) ── */
.game-card-v2 {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 22px;
  border: 1px solid rgba(27, 25, 24, 0.06);
  box-shadow: 0 4px 20px rgba(27, 25, 24, 0.05);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  text-decoration: none;
  color: #1B1918;
}
.game-card-v2:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(27, 25, 24, 0.1);
}

/* ── Sport Tag Pills ── */
.sport-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-base, 'Manrope', sans-serif);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* ── Status Label Pills ── */
.status-label-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-base, 'Manrope', sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-label-pill.status-hosting {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
}
.status-label-pill.status-joined {
  background: rgba(31, 122, 115, 0.12);
  color: #1F7A73;
  border: 1px solid rgba(31, 122, 115, 0.25);
}
.status-label-pill.status-waitlisted {
  background: rgba(138, 90, 30, 0.12);
  color: #8A5A1E;
  border: 1px solid rgba(138, 90, 30, 0.25);
}
.status-label-pill.status-cancelled {
  background: rgba(178, 58, 98, 0.12);
  color: #B23A62;
  border: 1px solid rgba(178, 58, 98, 0.25);
}
.status-label-pill.status-open {
  background: rgba(27, 25, 24, 0.06);
  color: #1B1918;
}
.status-label-pill.status-full {
  background: rgba(178, 58, 98, 0.12);
  color: #B23A62;
}
.status-label-pill.status-neutral { background: var(--color-surface-alt); color: var(--color-text); }
/* Tournament card count row: icon+text boxes keep a fixed height so avatars and text align (fixed-size row). */
.game-card-count-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; font-size: 0.8rem; color: var(--color-text-muted); }
.game-card-count-main { display: flex; align-items: center; min-width: 0; }
.game-card-count-n { font-weight: 600; color: var(--color-text); overflow-wrap: anywhere; }
.game-card-count-left { flex: 0 0 auto; }
.tournament-card-reg { color: var(--color-text-muted); }


/* ── Card Body & Meta ── */
.game-card-title-v2 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #1B1918;
  margin: 12px 0 10px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #716B67;
  margin-bottom: 6px;
}
.game-card-meta-row svg {
  flex-shrink: 0;
  stroke: #716B67;
}

/* ── Avatar Stack & Progress ── */
.avatar-stack {
  display: flex;
  align-items: center;
  margin-right: 8px;
}
.avatar-bubble {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #EAE4DC;
  border: 2px solid #FFFFFF;
  margin-left: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #716B67;
}
.avatar-bubble:first-child {
  margin-left: 0;
}
.avatar-bubble svg {
  width: 13px;
  height: 13px;
  stroke: #716B67;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #EAE4DC;
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 12px 0;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.game-card-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  transition: gap 0.15s ease;
}
.game-card-v2:hover .game-card-action-link {
  gap: 9px;
}

/* ── Event Detail Two-Column Layout ── */
.event-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}
@media (max-width: 860px) {
  .event-detail-layout {
    grid-template-columns: 1fr;
  }
}

.event-detail-card-v2 {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(27, 25, 24, 0.05);
  border: 1px solid rgba(27, 25, 24, 0.06);
}

.key-value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.key-value-item {
  background: #FAF6F0;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(27, 25, 24, 0.04);
}
.key-value-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #716B67;
  font-weight: 700;
  margin-bottom: 4px;
}
.key-value-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1B1918;
}

/* ── Cancel Event Button (Outline in #B23A62) ── */
.btn-cancel-outline {
  width: 100%;
  border: 1.5px solid #B23A62 !important;
  color: #B23A62 !important;
  background: transparent !important;
  border-radius: 12px;
  font-weight: 700;
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-cancel-outline:hover {
  background: rgba(178, 58, 98, 0.08) !important;
}





/* ============================================================
   DES-MEETUP-ADDENDUM-dashboard v1.0 & profile-onboarding v1.1
   Dashboard Components, Layout (1024px desktop breakpoint),
   and Onboarding Modal Styles.
   ============================================================ */

:root {
  --db-brand: #1E5BD6;
  --db-brand-deep: #0B3FA8;
  --db-brand-light: #3B82F6;
  --db-on-brand: #FFFFFF;
  --db-brand-accent: #FDE68A;
  --db-brand-tagline: #DBEAFE;
  --db-page: #F5F8FF;
  --db-card: #FFFFFF;
  --db-card-border: #E3EAF8;
  --db-text: #0F2350;
  --db-text-muted: #5B6B8C;
  --db-nav-inactive: #64748B;
  --db-badge-red: #DC2626;
  --db-going-bg: #DCFCE7;
  --db-going-text: #166534;
}

/* ── Dashboard Page Container ── */
.dashboard-page {
  background: var(--db-page);
  min-height: 100vh;
  padding-bottom: 90px;
}

.dashboard-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

/* ── Banner (AD-1, §4) ── */
.dashboard-banner {
  background-color: var(--db-brand);
  height: 208px;
  position: relative;
  overflow: hidden;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  padding: 20px 20px 0;
  color: #FFFFFF;
}

.dashboard-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dashboard-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* AD-17 phone brand block: icon straight on the blue (no tile), two-tone wordmark, tagline.
   Strings are rendered from BRAND_HEADER (theme-tokens.js); colours are the --db-* tokens. */
.dashboard-brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dashboard-brand-icon { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; flex-shrink: 0; display: block; }
.dashboard-brand-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.dashboard-brand-wordmark { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--db-on-brand); white-space: nowrap; }
.dashboard-brand-accent { color: var(--db-brand-accent); }
.dashboard-brand-tagline { font-size: 9px; font-weight: 700; letter-spacing: 2.5px; line-height: 1.3; color: var(--db-brand-tagline); white-space: nowrap; }

.dashboard-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-bell-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #FFFFFF;
  font-size: 1.2rem;
}

.dashboard-bell-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--db-badge-red);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #FFFFFF;
}

.dashboard-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  object-fit: cover;
  cursor: pointer;
}

.dashboard-profile-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: var(--db-brand-light);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
}

.dashboard-banner-greeting {
  margin-top: 14px;
}

.dashboard-greeting-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.dashboard-greeting-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 2px;
}

/* ── Next-game Card (AD-1, AD-7) ── */
.dashboard-next-game-wrap {
  padding: 0 16px;
  margin-top: -40px;
  position: relative;
  z-index: 3;
}

.dashboard-next-game-card {
  background: var(--db-card);
  border-radius: 22px;
  border: 1px solid var(--db-card-border);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 35, 80, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-next-game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 35, 80, 0.12);
}

.dashboard-sport-tile {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-next-game-card .dashboard-sport-tile {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.dashboard-next-game-info {
  flex: 1;
  min-width: 0;
}

.dashboard-next-game-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--db-brand);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-next-game-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--db-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}

.dashboard-next-game-meta {
  font-size: 0.78rem;
  color: var(--db-text-muted);
}

.dashboard-chevron {
  color: var(--db-nav-inactive);
  font-size: 1.2rem;
  font-weight: 700;
  padding-left: 6px;
}

/* ── Sports Row (AD-9) ── */
.dashboard-sports-section {
  padding: 20px 0 12px;
}

.dashboard-sports-scroll {
  display: flex;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dashboard-sports-scroll::-webkit-scrollbar {
  display: none;
}

.dashboard-sport-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  outline: none;
  border-radius: 20px;
}

.dashboard-sport-chip-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--db-text);
  white-space: nowrap;
}

.dashboard-sport-chip.selected .dashboard-sport-tile,
.dashboard-sport-chip.active .dashboard-sport-tile {
  box-shadow: 0 0 0 2px var(--db-brand);
}

.dashboard-clear-filter-btn {
  background: none;
  border: none;
  color: var(--db-brand);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
  display: inline;
}

.dashboard-banner-count-chips {
  display: none;
}

.dashboard-banner-chip {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.dashboard-banner-chip:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dashboard-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
}

.dashboard-card-item {
  background: var(--db-card);
  border-radius: 22px;
  border: 1px solid var(--db-card-border);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(15, 35, 80, 0.04);
}

.dashboard-shortcut-section {
  display: block;
  padding: 16px;
}

.dashboard-sport-chip-tile {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 35, 80, 0.05);
  box-sizing: border-box;
}

.dashboard-sport-chip.active .dashboard-sport-chip-tile {
  border: 2px solid var(--db-brand);
}

.dashboard-sport-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--db-text);
}

.dashboard-sport-chip.active .dashboard-sport-chip-label {
  color: var(--db-brand);
  font-weight: 700;
}

/* ── Dashboard Sections (My Games, My Groups, Recommended) ── */
.dashboard-section {
  padding: 12px 16px;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dashboard-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--db-text);
  margin: 0;
}

.dashboard-section-viewall {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--db-brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

.dashboard-rows-card {
  background: var(--db-card);
  border-radius: 20px;
  border: 1px solid var(--db-card-border);
  box-shadow: 0 4px 16px rgba(15, 35, 80, 0.04);
  overflow: hidden;
}

.dashboard-row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--db-card-border);
  cursor: pointer;
  transition: background 0.1s ease;
}

.dashboard-row-item:last-child {
  border-bottom: none;
}

.dashboard-row-item:hover {
  background: rgba(245, 248, 255, 0.8);
}

.dashboard-row-icon-tile {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-row-body {
  flex: 1;
  min-width: 0;
}

.dashboard-row-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--db-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-row-meta {
  font-size: 0.78rem;
  color: var(--db-text-muted);
  margin-top: 2px;
}

.dashboard-row-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}

.dashboard-badge-going {
  background: var(--db-going-bg);
  color: var(--db-going-text);
}

/* ── Shortcut Tiles ── */
.dashboard-shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dashboard-shortcut-tile {
  background: var(--db-card);
  border-radius: 20px;
  border: 1px solid var(--db-card-border);
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 35, 80, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease;
}

.dashboard-shortcut-tile:hover {
  transform: translateY(-2px);
}

.dashboard-shortcut-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
}

.dashboard-shortcut-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--db-text);
}

.dashboard-shortcut-sub {
  font-size: 0.78rem;
  color: var(--db-text-muted);
  font-weight: 600;
}

/* ── Empty & Error States (Section 5) ── */
.dashboard-empty-msg {
  padding: 18px 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--db-text-muted);
  background: var(--db-card);
  border-radius: 20px;
  border: 1px solid var(--db-card-border);
  margin: 0;
}

.dashboard-error-box {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  border-radius: 16px;
  color: #BE123C;
  font-size: 0.85rem;
}

.dashboard-retry-btn {
  background: #BE123C;
  color: #FFFFFF;
  border: none;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* ── Skeletons ── */
.dashboard-skeleton-card {
  height: 80px;
  background: linear-gradient(90deg, #EDF2F7 25%, #E2E8F0 50%, #EDF2F7 75%);
  background-size: 200% 100%;
  animation: dbSkeleton 1.5s infinite;
  border-radius: 22px;
}

.dashboard-skeleton-row {
  height: 64px;
  background: linear-gradient(90deg, #EDF2F7 25%, #E2E8F0 50%, #EDF2F7 75%);
  background-size: 200% 100%;
  animation: dbSkeleton 1.5s infinite;
  border-bottom: 1px solid var(--db-card-border);
}

@keyframes dbSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Desktop Layout at 1024px+ (AD-10) ── */
@media (min-width: 1024px) {
  /* Home v2: the top bar (bell + profile photo) stays visible on desktop. */

  .dashboard-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 24px 32px 60px;
    width: 100%;
    box-sizing: border-box;
  }

  .dashboard-banner {
    border-radius: 28px;
    height: 180px;
  }

  .dashboard-banner-count-chips {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .dashboard-next-game-wrap {
    margin-top: 20px;
    padding: 0;
  }

  .dashboard-sports-section {
    padding: 20px 0 16px;
  }

  .dashboard-sports-scroll {
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 4px 0 8px; /* Aligns to cards left edge */
  }

  /* Three EQUAL-width, EQUAL-height cards in one row, 24px gutters */
  .dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    padding: 0;
    margin-top: 8px;
  }

  .dashboard-cards-grid > .dashboard-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    min-width: 0;
  }

  .dashboard-card-item {
    padding: 20px;
  }

  .dashboard-cards-grid > .dashboard-section .dashboard-rows-card,
  .dashboard-cards-grid > .dashboard-section .dashboard-empty-msg,
  .dashboard-cards-grid > .dashboard-section .dashboard-error-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Shortcut tiles are replaced by count chips on desktop */
  .dashboard-shortcut-section {
    display: none !important;
  }
}

/* ── Onboarding Modal Styles ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 35, 80, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.onboarding-modal {
  background: #FFFFFF;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.onboarding-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #E2E8F0;
}

.onboarding-step-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--db-brand);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.onboarding-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0F2350;
  margin: 0;
}

.onboarding-subtitle {
  font-size: 0.85rem;
  color: #5B6B8C;
  margin: 6px 0 0;
}

.onboarding-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.onboarding-actions {
  padding: 16px 24px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.onboarding-skills-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-skill-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}

.onboarding-skill-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F2350;
}

.onboarding-skill-options {
  display: flex;
  gap: 8px;
}

.skill-opt-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.skill-opt-btn.active {
  background: var(--db-brand);
  color: #FFFFFF;
  border-color: var(--db-brand);
}

.onboarding-phone-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F2350;
}

.onboarding-phone-input-row {
  display: flex;
  gap: 8px;
}

.onboarding-country-select {
  padding: 10px 8px;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  background: #FFFFFF;
  font-size: 0.85rem;
  max-width: 130px;
}

.onboarding-phone-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  font-size: 0.92rem;
}

.onboarding-consent-box {
  background: #F1F5F9;
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
}

.onboarding-consent-text {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
  margin: 0;
}

.onboarding-consent-version {
  display: block;
  font-size: 0.7rem;
  color: #94A3B8;
  margin-top: 6px;
}

/* ============================================================
   AD-16 Brand header (DES-MEETUP-ADDENDUM-dashboard v1.5), desktop web only.
   220x96 block at the top of the left menu, brand blue from the same token
   the dashboard banner uses (--db-brand). Phone and tablet widths keep the
   existing logo tile exactly as before.
   ============================================================ */
@media (min-width: 1024px) {
  .side-nav-logo.side-nav-logo-js { padding: 0; border-bottom: none; display: block; }
  .side-nav-logo .side-nav-brand-tablet { display: none; }
  .brand-header {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-sizing: border-box;
    width: 220px; height: 96px;
    margin-right: -1px;               /* cover the rail's 1px right border: the block is the full 220px menu width */
    padding: 0 12px;
    background-color: var(--hv2-surface);
    color: var(--db-on-brand);
    text-decoration: none;
    overflow: hidden;
  }
  .brand-header:focus-visible { outline: 3px solid var(--db-brand-accent); outline-offset: -5px; }
  .brand-header-icon { width: 48px; height: 48px; border-radius: 14px; object-fit: contain; flex-shrink: 0; display: block; }
  .brand-header-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
  .brand-header-wordmark { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--db-on-brand); white-space: nowrap; }
  .brand-header-accent { color: var(--db-brand-accent); }
  .brand-header-tagline { font-size: 10px; font-weight: 700; letter-spacing: 2px; line-height: 1.3; color: var(--db-brand-tagline); white-space: nowrap; }

  /* AD-10 (v1.5): the banner has no app icon on desktop; its actions stay on the right. */
  .dashboard-banner-top { justify-content: flex-end; }
}


/* ============================================================
   Home v2 (feat/home-v2): top bar, navigation drawer / left menu,
   banner carousel, tab tiles, shared card layout, WIP strip.
   Literal colours live ONLY in the token block below; every rule
   uses var(--...). The bottom menu rules above are untouched.
   ============================================================ */
:root {
  --hv2-blue: #1D4ED8;
  --hv2-green: #0F7B4F;
  --hv2-orange: #E8772E;
  --hv2-purple: #5B4BD6;
  --hv2-gold: #FFC83D;
  --hv2-on-gold: #2F2200;
  --hv2-on-solid: #FFFFFF;
  --hv2-scrim: rgba(11, 27, 63, 0.55);
  --hv2-drawer-head: #0B3B8C;
  --hv2-wip-bg: #FFE9B8;
  --hv2-wip-text: #6B4300;
  --hv2-av-0: #C9D6F2;
  --hv2-av-1: #F0D6B4;
  --hv2-av-2: #CBE5D2;
  --hv2-av-3: #E6D0EE;
  --hv2-av-4: #D5E3FF;
  --hv2-av-5: #F6D5D5;
  --hv2-av-text: #1B2B4D;
  --hv2-dot-idle: #B9C3DB;
  /* Fixed light palette. Home v2 does not read the theme tokens: custom properties declared on
     :root resolve var() against :root's own values (the dark base tokens), so a derived token
     here would stay dark even when body[data-theme="light"] overrides --color-surface. */
  --hv2-surface: #FFFFFF;
  --hv2-page: #F6F8FD;
  --hv2-border: #DCE3F0;
  --hv2-ink: #0B1B3F;
  --hv2-muted: #4A5675;
  --hv2-hover: #EEF1F7;
  --hv2-tile: #EEF3FF;
  --hv2-sport-idle: #E6EAF0;
  --hv2-btn-bg: #E3ECFF;
  --hv2-btn-text: #1741B8;
  --hv2-shadow: 0 4px 20px rgba(11, 27, 63, 0.18);
  --hv2-drawer-head-2: #1448AE;
  --hv2-on-solid-soft: #DCE8FF;
  /* Menu section colours (fixed): active heading fill / text, sub-item bar, sub-item tint, guide line (~40%). */
  --hv2-sub-text: #5B6785;
  --hv2-g-fill: #E3F6EC;  --hv2-g-ink: #0A5A36; --hv2-g-bar: #0F7B4F; --hv2-g-sub: #F0FAF5; --hv2-g-guide: #9FCAB9;
  --hv2-o-fill: #FFF1E3;  --hv2-o-ink: #7A3500; --hv2-o-bar: #E8772E; --hv2-o-sub: #FFF8F1; --hv2-o-guide: #F6C9AB;
  --hv2-p-fill: #EEEBFF;  --hv2-p-ink: #3F3496; --hv2-p-bar: #6B5CE0; --hv2-p-sub: #F6F4FF; --hv2-p-guide: #C4BEF3;
  --hv2-blue-tint: #DFE6FA;  --hv2-blue-ink: #1741B8;
  --hv2-green-tint: #DDEDE6; --hv2-green-ink: #0A5A36; --hv2-green-soft: #E7F2ED; --hv2-green-edge: #BCDACE; --hv2-green-body: #2C5E46;
  --hv2-orange-tint: #F4E6DC; --hv2-orange-ink: #8A3F00; --hv2-orange-icon: #B34A06;
  --hv2-purple-tint: #E8E6F9; --hv2-purple-ink: #4338A8;
}

/* ── Tournament experience (te-w1): tokens ── */
:root {
  --te-teal: #0E9AA7;
  --te-teal-tint: #ECFAFB;
  --te-teal-edge: #CFE9EC;
  --te-teal-line: #E3F1F3;
  --te-pink: #D6336C;
  --te-pink-tint: #FDEBF1;
  --te-amber: #B7791F;
  --te-amber-tint: #FEF3D9;
  --te-lock-bg: #EEF1F7;
  --te-lock-ink: #7A869F;
  --te-skeleton: #E6EAF2;
  --te-tab-idle: #E9EEF8;
  --te-strip-light: #FFFFFF;
  --te-strip-dark: #0B1B3F;
  --te-ring: #FFFFFF;
  --te-badge: #DC2626;
  --te-red-tint: #FDECEC;
  --te-red-ink: #A32226;
  --te-ok-tint: #E3F6EB;
}

/* ── Top bar ── */
.topbar-menu-btn {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: none; background: none; color: var(--color-text);
  margin-left: -8px;
}
@media (max-width: 768px) {
  #app-topbar .topbar-menu-btn:not(.hidden) { display: flex; }
}
.topbar-brand {
  display: none; align-items: center; gap: 6px;
  color: var(--color-text); text-decoration: none;
}
/* Below 1024px the rail's brand block is not the full header, so the top bar carries the brand. */
@media (max-width: 1023px) { .topbar-brand { display: flex; } }
.topbar-brand:hover { text-decoration: none; }
.topbar-app-icon { width: 30px; height: 30px; object-fit: contain; display: block; flex: none; }
.topbar-wordmark { font-weight: 700; font-size: 22px; letter-spacing: -0.3px; line-height: 1; }
.topbar-wordmark-accent { color: var(--color-accent-gold, var(--hv2-gold)); }
#nav-user { display: flex; align-items: center; gap: 6px; }
#btn-notif-bell { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.topbar-profile { display: block; text-decoration: none; }
.topbar-profile:hover { text-decoration: none; }
.topbar-profile-av, .nav-drawer-av {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none;
  background: var(--hv2-av-0); color: var(--hv2-av-text);
  font-weight: 700; font-size: 13px;
}
.topbar-profile-av img, .nav-drawer-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The dashboard no longer hides the top bar on desktop: it carries the bell and profile photo. */
#app-topbar { gap: 8px; }

/* Narrow layout: the brand is centred in the space between the hamburger (left) and the bell /
   profile photo (right); those controls keep their positions. */
@media (max-width: 768px) {
  #app-topbar .topbar-brand { flex: 1; min-width: 0; justify-content: center; }
}

/* ── Navigation: drawer (mobile web) and left menu (desktop) share .menu-* ── */
body.nav-drawer-open { overflow: hidden; }
.nav-drawer { position: fixed; inset: 0; z-index: 400; display: flex; }
.nav-drawer[hidden] { display: none; }
.nav-drawer-scrim { position: absolute; inset: 0; background: var(--hv2-scrim); }
.nav-drawer-panel {
  position: relative;
  width: min(328px, 88vw); height: 100%;
  background: var(--hv2-surface); color: var(--hv2-ink);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--hv2-shadow);
}
.nav-drawer-head {
  position: relative; flex: none;
  background: var(--hv2-drawer-head); color: var(--hv2-on-solid);
  padding: 28px 18px 20px; overflow: hidden;
}
.nav-drawer-head::before, .nav-drawer-head::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.nav-drawer-head::before { right: -40px; top: -50px; width: 190px; height: 190px; background: var(--hv2-drawer-head-2); }
.nav-drawer-head::after { right: 50px; bottom: -60px; width: 100px; height: 100px; background: var(--hv2-gold); opacity: 0.9; }
.nav-drawer-close {
  position: absolute; right: 6px; top: 6px; z-index: 1;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--hv2-on-solid);
}
.nav-drawer-who { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.nav-drawer-av { width: 60px; height: 60px; font-size: 20px; border: 3px solid var(--hv2-gold); background: var(--hv2-on-solid); color: var(--hv2-drawer-head); }
.nav-drawer-hello { font-size: 12px; opacity: 0.85; }
.nav-drawer-name { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
.nav-drawer-viewprofile {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; padding: 0 16px;
  border: none; border-radius: 12px; background: var(--hv2-gold); color: var(--hv2-on-gold);
  font-size: 13px; font-weight: 700;
}
.nav-drawer-body { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }

.menu-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.menu-sec {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 0 10px; border-radius: 16px;
  border: 1.5px solid transparent; background: none; text-align: left;
  color: var(--hv2-ink); font-size: 15px; font-weight: 700;
}
.menu-sec:hover { background: var(--hv2-hover); }
.menu-sec.active { background: var(--hv2-tile); color: var(--hv2-btn-text); border-color: var(--hv2-blue); }
/* Section holding the current route: tinted heading in the section's colour, no border (the border is Home's). */
.menu-sec.sec-active, .menu-sec.sec-active:hover { background: var(--menu-fill); color: var(--menu-fill-ink); }
.menu-sec.sec-active .menu-sec-icon, .menu-sec.sec-active .menu-badge { background: var(--hv2-surface); }
.menu-sec.sec-active .menu-chev { color: var(--menu-fill-ink); }
.menu-sec-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--menu-tone); background: var(--menu-tint);
}
.menu-tone-blue { --menu-tone: var(--hv2-blue); --menu-tint: var(--hv2-blue-tint); --menu-ink: var(--hv2-blue-ink); }
.menu-tone-green { --menu-tone: var(--hv2-green); --menu-tint: var(--hv2-green-tint); --menu-ink: var(--hv2-green-ink); --menu-fill: var(--hv2-g-fill); --menu-fill-ink: var(--hv2-g-ink); --menu-bar: var(--hv2-g-bar); --menu-sub: var(--hv2-g-sub); --menu-guide: var(--hv2-g-guide); }
.menu-tone-orange { --menu-tone: var(--hv2-orange-icon); --menu-tint: var(--hv2-orange-tint); --menu-ink: var(--hv2-orange-ink); --menu-fill: var(--hv2-o-fill); --menu-fill-ink: var(--hv2-o-ink); --menu-bar: var(--hv2-o-bar); --menu-sub: var(--hv2-o-sub); --menu-guide: var(--hv2-o-guide); }
.menu-tone-purple { --menu-tone: var(--hv2-purple); --menu-tint: var(--hv2-purple-tint); --menu-ink: var(--hv2-purple-ink); --menu-fill: var(--hv2-p-fill); --menu-fill-ink: var(--hv2-p-ink); --menu-bar: var(--hv2-p-bar); --menu-sub: var(--hv2-p-sub); --menu-guide: var(--hv2-p-guide); }
.menu-sec-label { flex: 1; }
.menu-badge {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  color: var(--menu-ink); background: var(--menu-tint);
}
.menu-chev { color: var(--hv2-muted); display: flex; transition: transform 0.15s; }  /* collapsed: points down */
.menu-chev.open { transform: rotate(180deg); }              /* expanded: points up */
.menu-items { list-style: none; display: flex; flex-direction: column; gap: 0; margin: 2px 0 6px 29px; border-left: 2px solid var(--menu-guide); }
.menu-items[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 40px; padding: 0 10px 0 14px; margin-left: -2px; border-radius: 0 10px 10px 0;
  border: none; border-left: 3px solid transparent; background: none; text-align: left;
  font-size: 13px; font-weight: 400; color: var(--hv2-sub-text); text-decoration: none;
}
.menu-item:hover { background: var(--hv2-hover); text-decoration: none; }
.menu-item.active { background: var(--menu-sub); border-left-color: var(--menu-bar); color: var(--menu-fill-ink); font-weight: 700; }
.menu-item-label { flex: 1; }
.menu-wip {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--hv2-wip-bg); color: var(--hv2-wip-text);
}
.menu-sec:focus-visible, .menu-item:focus-visible, .hv2-tab:focus-visible, .hv2-card-btn:focus-visible,
.hv2-viewall:focus-visible, .hv2-sport:focus-visible, .hv2-dot:focus-visible, .nav-drawer-viewprofile:focus-visible,
.nav-drawer-close:focus-visible, .hv2-slide-link:focus-visible {
  outline: 3px solid var(--hv2-blue); outline-offset: 2px;
}
/* Desktop left menu: on the light theme the menu uses the fixed colours above. On the dark / amber
   themes the rail itself is dark, so idle text and hover follow the theme there; selected and
   active-section items keep their fixed colours (they carry their own light fill). */
body:not([data-theme="light"]) .side-nav-items .menu-sec:not(.active):not(.sec-active),
body:not([data-theme="light"]) .side-nav-items .menu-item:not(.active) { color: var(--color-text); }
body:not([data-theme="light"]) .side-nav-items .menu-sec:hover:not(.active):not(.sec-active),
body:not([data-theme="light"]) .side-nav-items .menu-item:hover:not(.active) { background: var(--color-surface-alt); }
body:not([data-theme="light"]) .side-nav-items .menu-sec:not(.sec-active) .menu-chev { color: var(--color-text-muted); }
.side-nav-items { overflow-y: auto; }
.side-nav-items .menu-sec { min-height: 48px; font-size: 14px; }
.side-nav-items .menu-sec-icon { width: 34px; height: 34px; }

/* ── WIP strip (Tournaments, Tournament teams) ── */
.wip-strip {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 12px;
  background: var(--hv2-wip-bg); color: var(--hv2-wip-text);
  font-size: 13px; font-weight: 600; line-height: 1.4;
}

/* ── Home page ── */
.hv2-page { padding-bottom: 96px; background: var(--hv2-page); }
.hv2-container { max-width: 720px; margin: 0 auto; padding: 8px 16px 0; }
.hv2-greeting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hv2-greeting { min-width: 0; }
.hv2-greeting-prefix { font-size: 14px; color: var(--hv2-muted); }
.hv2-greeting-line { font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -0.4px; overflow-wrap: anywhere; }
.hv2-greeting-name { color: var(--hv2-blue); }
.hv2-sports {
  display: flex; align-items: center; gap: 2px; flex: none; max-width: 52%;
  overflow-x: auto; scrollbar-width: none;
  background: var(--hv2-surface); border: 1px solid var(--hv2-border);
  border-radius: 18px; padding: 3px 4px; margin-top: 2px;
}
.hv2-sports::-webkit-scrollbar { height: 0; }
.hv2-sport {
  width: 30px; height: 30px; flex: none; border-radius: 50%; padding: 0;
  border: 2px solid transparent; background: var(--hv2-sport-idle);
  display: flex; align-items: center; justify-content: center;
  transition: background-color 150ms ease, border-radius 150ms ease;
}
@media (prefers-reduced-motion: reduce) { .hv2-sport { transition: none; } }
.hv2-sport svg { width: 20px; height: 20px; }
.hv2-sport.selected { border-color: var(--hv2-blue); background: var(--hv2-tile); }

.hv2-banner { margin-top: 14px; }
.hv2-carousel { position: relative; }
.hv2-viewport { position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 3 / 1; touch-action: pan-y; background: var(--hv2-drawer-head); }
.hv2-track { display: flex; height: 100%; transition: transform 0.35s ease; }
.hv2-track.hv2-no-transition { transition: none; }
@media (prefers-reduced-motion: reduce) { .hv2-track { transition: none; } }
.hv2-slide { position: relative; flex: 0 0 100%; height: 100%; display: block; color: var(--hv2-on-solid); }
.hv2-slide img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.hv2-link-icon { position: absolute; top: 10px; right: 12px; color: var(--hv2-on-solid); filter: drop-shadow(0 1px 2px var(--hv2-scrim)); }
.hv2-ad-tag {
  position: absolute; right: 12px; bottom: 10px;
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 6px;
  border: 1px solid var(--hv2-on-solid); color: var(--hv2-on-solid); background: var(--hv2-scrim);
}
.hv2-fallback-art { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--hv2-drawer-head); text-align: center; padding: 0 12px; }
.hv2-fallback-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hv2-fallback-word { position: relative; font-size: 32px; font-weight: 800; letter-spacing: -0.5px; color: var(--hv2-on-solid); }
.hv2-fallback-accent { color: var(--hv2-gold); }
.hv2-fallback-tag { position: relative; font-size: 13px; font-weight: 600; color: var(--hv2-on-solid-soft); }
.hv2-dots { display: flex; justify-content: center; align-items: center; gap: 0; height: 24px; margin-top: 2px; }
.hv2-dot { width: 24px; height: 24px; padding: 0; border: none; background: none; display: flex; align-items: center; justify-content: center; }
.hv2-dot::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--hv2-dot-idle); transition: width 0.2s; }
.hv2-dot.active::before { width: 18px; background: var(--hv2-blue); }

.hv2-tabs { display: flex; gap: 10px; margin-top: 6px; }
.hv2-tab {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px;
  border-radius: 16px; border: 1px solid var(--hv2-border); background: var(--hv2-surface);
  color: var(--hv2-ink); text-align: left;
}
.hv2-tab.selected { border: 2px solid var(--hv2-blue); background: var(--hv2-tile); color: var(--hv2-ink); }
.hv2-tab-icon {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--hv2-tab-tint);
}
.hv2-tab-icon svg { width: 40px; height: 40px; display: block; }
.hv2-tab-games { --hv2-tab-tone: var(--hv2-blue); --hv2-tab-tint: var(--hv2-blue-tint); }
.hv2-tab-groups { --hv2-tab-tone: var(--hv2-green); --hv2-tab-tint: var(--hv2-green-tint); }
.hv2-tab-text { display: flex; flex-direction: column; min-width: 0; }
.hv2-tab-title { font-size: 12px; font-weight: 600; }
.hv2-tab-sub { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.hv2-count { font-size: 22px; font-weight: 700; line-height: 1.2; min-width: 1ch; }
.hv2-tab-sublabel { font-size: 12px; color: var(--hv2-muted); }

.hv2-panel { margin-top: 4px; }
.hv2-panel-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
.hv2-panel-title { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.hv2-viewall { min-height: 44px; padding: 0 4px; border: none; background: none; font-size: 13px; font-weight: 600; color: var(--hv2-blue); }
.hv2-list { display: flex; flex-direction: column; gap: 10px; }
/* 1100px and up: game and group cards in two columns (each card keeps its own layout). */
@media (min-width: 1100px) {
  .hv2-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hv2-empty, .hv2-error {
  padding: 18px 14px; border-radius: 16px; background: var(--hv2-surface); border: 1px solid var(--hv2-border);
  color: var(--hv2-muted); font-size: 14px;
}
.hv2-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hv2-retry { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--hv2-border); background: var(--hv2-surface); color: var(--hv2-ink); font-weight: 600; }
.hv2-skeleton {
  height: 100px; border-radius: 16px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--hv2-surface) 25%, var(--hv2-hover) 50%, var(--hv2-surface) 75%);
  background-size: 200% 100%; animation: dbSkeleton 1.4s infinite linear;
}
@media (prefers-reduced-motion: reduce) { .hv2-skeleton { animation: none; } }

/* Shared card: left tile | main | count + button. */
.hv2-card { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--hv2-surface); border: 1px solid var(--hv2-border); }
.hv2-card-main { flex: 1; min-width: 0; }
.hv2-card-titlerow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hv2-card-title { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.hv2-pill { font-size: 11px; }
.hv2-card-detail { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--hv2-muted); margin-top: 3px; overflow-wrap: anywhere; }
.hv2-card-desc {
  font-size: 12px; color: var(--hv2-muted); margin-top: 3px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hv2-card-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; flex: none; }
.hv2-card-count { text-align: right; }
.hv2-card-count-n { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; font-size: 14px; font-weight: 700; }
/* Row icons: 16px, decorative, never shrink or drop onto their own line. */
.hv2-row-icon { display: flex; flex: none; width: 16px; height: 16px; }
.hv2-row-icon svg { width: 16px; height: 16px; display: block; }
.hv2-card-detail-text { min-width: 0; }
.hv2-card-count-l { font-size: 12px; color: var(--hv2-muted); }
.hv2-card-btn {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: none; border-radius: 12px;
  background: var(--hv2-btn-bg); color: var(--hv2-btn-text); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.hv2-datetile {
  width: 48px; height: 62px; border-radius: 12px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--hv2-green-ink); background: var(--hv2-green-tint);
}
.hv2-datetile span { font-size: 11px; font-weight: 600; }
.hv2-datetile strong { font-size: 21px; font-weight: 700; line-height: 1.1; }
.hv2-logotile {
  width: 52px; height: 52px; border-radius: 14px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--hv2-hover);
}
.hv2-logotile img { width: 100%; height: 100%; object-fit: cover; }
/* Avatars. Fixed dimensions so initials / images / "+N" align (no content-driven sizing). */
.hv2-avstack { display: flex; align-items: center; height: 24px; margin-top: 7px; }
.hv2-av {
  position: relative; width: 22px; height: 22px; border-radius: 50%; flex: none; /* no overflow:hidden: it would clip the tooltip; the photo is rounded itself */
  border: 2px solid var(--hv2-surface); margin-left: -8px;
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  color: var(--hv2-av-text); font-size: 9px; font-weight: 700;
}
.hv2-av:first-child { margin-left: 0; }
.hv2-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* Instant tooltip (hover, keyboard focus, tap-to-focus): text comes from data-tip, drawn above the avatar. */
.hv2-av[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 200px; box-sizing: border-box;
  padding: 5px 8px; border-radius: 8px;
  background: var(--hv2-ink); color: var(--hv2-on-solid);
  font-size: 12px; font-weight: 600; line-height: 1.3; text-align: center; white-space: normal; overflow-wrap: anywhere;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 30;
}
/* The first avatar sits near the card's left edge: anchor its tooltip to the left so it stays on screen. */
.hv2-av[data-tip]:first-child::after { left: 0; transform: none; }
.hv2-av[data-tip]:hover, .hv2-av[data-tip]:focus { z-index: 20; outline: none; }
.hv2-av[data-tip]:hover::after, .hv2-av[data-tip]:focus::after { opacity: 1; visibility: visible; }
.hv2-av[data-tip]:focus-visible { box-shadow: 0 0 0 2px var(--hv2-blue); }
.hv2-av-c0 { background: var(--hv2-av-0); } .hv2-av-c1 { background: var(--hv2-av-1); } .hv2-av-c2 { background: var(--hv2-av-2); }
.hv2-av-c3 { background: var(--hv2-av-3); } .hv2-av-c4 { background: var(--hv2-av-4); } .hv2-av-c5 { background: var(--hv2-av-5); }
.hv2-av-more { width: 24px; height: 24px; background: var(--hv2-surface); border: 1px solid var(--hv2-border); font-size: 10px; font-weight: 600; color: var(--hv2-ink); }

@media (min-width: 769px) {
  /* Desktop: Home fills the area right of the left menu (24px side padding). The banner is
     100% of that area, left-aligned, and no wider than 1400px so a 3:1 image stays under ~467px tall. */
  .hv2-container { max-width: none; margin: 0; padding: 16px 24px 0; }
  .hv2-banner { width: 100%; max-width: 1400px; }
  .hv2-viewport { width: 100%; height: auto; aspect-ratio: 3 / 1; }
  .hv2-slide img { object-position: center; }
  .hv2-sports { max-width: 60%; }
}

.icon-badge {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
  color: var(--color-cta);
}
.icon-badge-cta { color: var(--color-cta); }
.icon-badge-warning { color: var(--color-warning); }
.icon-badge-success { color: var(--color-success); }
.icon-badge-danger { color: var(--color-danger); }

.page-profile, .page-edit-profile, .page-settings { max-width: 560px; margin: 0 auto; }
.profile-cover { position: relative; height: 140px; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-cta); color: var(--color-cta-text); }
.profile-cover-img, .profile-cover-fallback, .profile-cover-fallback svg { width: 100%; height: 140px; object-fit: cover; display: block; }
.profile-cover-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.profile-icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--color-cta); color: var(--color-cta-text); display: inline-flex; align-items: center; justify-content: center; }
.profile-cover { z-index: 0; }
.profile-identity { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin-top: -44px; }
.profile-avatar-photo, .profile-avatar-fallback { width: 88px; height: 88px; border-radius: 999px; border: 4px solid var(--color-bg); object-fit: cover; background: var(--color-cta); color: var(--color-cta-text); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.profile-name { margin: 8px 0 0; }
.profile-nick, .profile-muted { color: var(--color-text-muted); font-size: 0.85rem; }
/* Home stats strip (moved from Profile). 3 tiles, or 4 when Won is shown: equal columns via grid, tiles
   keep a fixed height and min-width:0 so four fit at 320-375px; the label/number boxes are fixed-height. */
.hv2-stats-slot:empty { display: none; }
.hv2-stats { display: grid; gap: 8px; margin: 14px 0 6px; width: 100%; }
.hv2-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hv2-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hv2-stat { min-width: 0; height: 112px; box-sizing: border-box; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 4px; }
.hv2-stat-num { font-weight: 800; height: 24px; line-height: 24px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv2-stat-label { color: var(--color-text-muted); font-size: 0.78rem; height: 20px; line-height: 20px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 769px) { .hv2-stats { max-width: 1400px; } }
.profile-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; }
.profile-card-head, .profile-skill-row, .profile-group-row, .profile-photo-actions, .profile-photo-row, .settings-link-row, .settings-delete-row, .profile-game-row, .profile-skill-card { display: flex; align-items: center; gap: 10px; }
.profile-card-head, .profile-skill-card, .profile-game-row, .settings-link-row, .settings-delete-row { min-height: 48px; }
.profile-card h3 { margin: 0; }
.profile-view-all, .profile-group-tile { background: transparent; border: 0; color: var(--color-cta); font-weight: 700; }
.profile-skill-row, .profile-group-row { flex-wrap: wrap; margin-top: 12px; }
.profile-skill-card { background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 8px 12px; min-width: 160px; }
.profile-skill-name, .profile-game-title, .settings-link-label { font-weight: 700; height: 22px; line-height: 22px; }
.profile-skill-level, .profile-game-meta { color: var(--color-text-muted); font-size: 0.78rem; height: 18px; line-height: 18px; }
.profile-group-tile { flex-direction: column; width: 96px; color: var(--color-text); }
.profile-group-logo, .profile-group-initials { width: 48px; height: 48px; border-radius: var(--radius-md); object-fit: cover; }
.profile-group-initials { display: flex; align-items: center; justify-content: center; background: var(--color-cta); color: var(--color-cta-text); font-weight: 700; }
.profile-group-name { height: 36px; line-height: 18px; text-align: center; font-size: 0.78rem; }
.profile-game-row, .settings-link-row, .settings-delete-row { width: 100%; text-align: left; background: transparent; border: 0; color: inherit; text-decoration: none; }
.profile-game-copy, .settings-link-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.profile-logout { width: 100%; height: 48px; background: var(--color-surface); color: var(--color-danger); border: 1px solid var(--color-danger); }
.profile-admin-link { width: 100%; height: 40px; margin-top: 8px; }
.profile-photo-actions { margin-top: 12px; flex-wrap: wrap; }
.settings-kicker { font-size: 0.75rem; letter-spacing: 0.04em; color: var(--color-text-muted); margin: 16px 0 8px; }
.settings-kicker-danger { color: var(--color-danger); }
.settings-chevron { margin-left: auto; color: var(--color-text-muted); }
.settings-toggle { width: 44px; height: 24px; margin-left: auto; }
.settings-delete-row { border: 1px solid var(--color-danger); border-radius: var(--radius-md); padding: 8px 12px; color: var(--color-danger); }
.settings-link-label { flex: 1; }
.wizard-progress { display: flex; gap: 6px; margin: 8px 0; }
.wizard-seg { flex: 1; height: 8px; border-radius: 999px; background: var(--color-surface-alt); }
.wizard-seg.on { background: var(--color-cta); }
.venue-picker-search, .venue-others input { width: 100%; height: 40px; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.venue-picker-caption { color: var(--color-text-muted); }
.venue-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; text-align: left; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.venue-row-name { flex: 1; }
.venue-row-detail { color: var(--color-text-muted); }
.venue-source-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; background: var(--color-surface-alt); color: var(--color-primary); }
.venue-picker-find.hidden, .venue-selected.hidden { display: none; }
.venue-selected { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-primary); border-radius: var(--radius-md); }
.venue-selected-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.venue-selected-kicker { color: var(--color-text-muted); font-size: 12px; }
.venue-selected-name { font-weight: 700; overflow-wrap: anywhere; }
.venue-selected-address { color: var(--color-text-muted); overflow-wrap: anywhere; }
.venue-change { flex: none; min-height: 40px; }
.venue-others { display: flex; flex-direction: column; gap: 6px; }
.venue-others.hidden { display: none; }
.venue-others-address { min-height: 20px; color: var(--color-text-muted); }

/* Group member rows: photo (initials fallback), display name primary, nickname smaller underneath.
   Fixed-size avatar box so rows align whether or not there is a photo. */
.member-identity { display: flex; align-items: center; gap: 10px; flex: 1 1 140px; min-width: 0; }
.member-item { flex-wrap: wrap; gap: 8px; }
.member-item > div { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.member-identity .hv2-av { width: 36px; height: 36px; margin-left: 0; font-size: 13px; }
.member-identity-text { display: flex; flex-direction: column; min-width: 0; }
.member-display-name { font-weight: 600; line-height: 20px; height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-nickname { font-size: 0.78rem; line-height: 16px; height: 16px; color: var(--color-text-muted, var(--color-text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Game detail players: photo (initials fallback) in a fixed 32px box; overrides the stacked-avatar sizing of .hv2-av */
.participant-item .hv2-av { width: 32px; height: 32px; margin-left: 0; font-size: 12px; }

/* Game wizard: multi-select group picker. Selected groups = removable chips; tiles show a check (not colour alone). */
.group-chip-row { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; margin: 8px 0 4px; }
.group-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; box-sizing: border-box; padding: 0 4px 0 12px; border: 1px solid var(--color-primary); border-radius: 16px; background: var(--color-surface-alt); color: var(--color-text); font-size: 0.85rem; max-width: 100%; }
.group-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-chip-remove { flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--color-text); font-size: 1rem; line-height: 24px; cursor: pointer; }
.group-chip-remove:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.group-count-hint { margin: 0 0 8px; }
.profile-group-tile.is-selected { border: 2px solid var(--color-primary); }
.profile-group-check { width: 16px; height: 16px; flex: none; line-height: 16px; text-align: center; font-weight: 700; color: var(--color-primary); }

/* ── Add / remove controls (AD-19): "+" adds or invites, "-" removes a staged entry ── */
.invite-ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  min-width: 44px; min-height: 44px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface-alt); color: var(--color-text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.invite-ctl[data-state="add"] { background: var(--color-cta); border-color: var(--color-cta); color: var(--color-cta-text); }
.invite-ctl[data-state="sending"] { opacity: 0.6; cursor: progress; }
.invite-ctl:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.invite-ctl-glyph { display: inline-flex; width: 20px; height: 20px; }
.invite-ctl-glyph svg { width: 20px; height: 20px; }
.invite-ctl--entry, .invite-ctl--entry[data-state="add"] {
  background: var(--color-surface-alt); border-color: var(--color-border); color: var(--color-text);
  border-radius: 12px; padding: 10px 16px;
}
.event-detail-sidebar .invite-ctl--entry { width: 100%; }
.invite-ctl-status {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; flex: none;
  color: var(--color-text-muted); font-weight: 600; font-size: 0.85rem;
}
.invite-ctl-error { color: var(--color-error); font-size: 0.82rem; align-self: center; }
.invite-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 48px; padding: 2px 0; border-bottom: 1px solid var(--color-border);
}
.invite-row-name { min-width: 0; overflow-wrap: anywhere; }
.invite-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.invite-row-logo { width: 36px; height: 36px; border-radius: 10px; }
@media (prefers-reduced-motion: no-preference) { .invite-ctl { transition: background-color 150ms ease; } }

/* ── User menu (user-details-menu v1.4; board W1, M3, M5, M6): popover, View Details, confirmation, notice ── */
.um-menu {
  position: absolute; z-index: 1200; width: 260px; box-sizing: border-box;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: 10px; box-shadow: var(--hv2-shadow);
}
.um-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 12px 16px; box-sizing: border-box;
  background: none; border: 0; color: inherit; font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.um-item:hover, .um-item:focus-visible { background: var(--color-surface-alt); outline: none; }
.um-item:focus-visible { box-shadow: inset 0 0 0 2px var(--color-primary); }
.um-item.um-danger { color: var(--color-error); }
.um-glyph { width: 18px; text-align: center; flex: none; }
.um-actions[aria-busy="true"] { min-height: 44px; display: flex; align-items: center; padding: 0 16px; }
.um-loading { display: block; width: 60%; height: 10px; border-radius: 5px; background: var(--color-border); }
.um-scrim {
  position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center;
  background: var(--hv2-scrim); padding: 16px; box-sizing: border-box;
}
.um-dialog {
  width: 100%; max-width: 360px; box-sizing: border-box; padding: 16px 20px 20px; border-radius: 16px;
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--hv2-shadow);
}
.um-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.um-dialog-title { margin: 0; font-size: 17px; font-weight: 700; }
.um-close {
  min-height: 44px; min-width: 44px; padding: 0 8px; background: none; border: 0; cursor: pointer;
  color: var(--color-text-muted); font: inherit; font-size: 13px;
}
.um-close:focus-visible, .um-btn:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.um-details { display: flex; flex-direction: column; align-items: center; padding: 12px 0 8px; text-align: center; }
.um-details-name { margin-top: 12px; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.um-details-nick { margin-top: 4px; font-size: 14px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.um-details-nick.um-muted { font-style: italic; }
.um-avatar {
  position: relative; display: flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box;
  width: 88px; height: 88px; border-radius: 50%; color: var(--hv2-av-text); font-size: 30px; font-weight: 700;
}
.um-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.um-confirm-body { margin: 8px 0 16px; font-size: 14px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.um-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.um-btn {
  min-height: 44px; min-width: 64px; padding: 0 12px; background: none; border: 0; cursor: pointer;
  color: var(--color-text-muted); font: inherit; font-size: 15px; font-weight: 600;
}
.um-btn.um-yes { color: var(--color-primary); }
.um-btn.um-yes.um-danger { color: var(--color-error); }
.um-notice {
  position: fixed; left: 50%; bottom: 24px; z-index: 1400; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 8px; background: var(--hv2-ink); color: var(--hv2-on-solid);
  font-size: 14px; opacity: 0; visibility: hidden; pointer-events: none;
}
.um-notice.um-notice-on { opacity: 1; visibility: visible; }
.hv2-av[role="button"] { cursor: pointer; }

/* ── Closure modal overlay (uses existing theme token --hv2-scrim) ── */
.closure-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--hv2-scrim);
  z-index: 1000;
  overflow: auto;
}

/* ── Game & tournament view redesign (DES-MEETUP-ADDENDUM-game-view-redesign v1.0): theme tokens only ── */
/* GV-1: scope chips and the Active | All switch share one row; the switch sits right. */
.scope-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.scope-row .scope-chips { padding-bottom: 0; overflow: visible; }
.view-toggle.view-toggle-compact { margin-bottom: 0; padding: 3px; gap: 2px; border-radius: 999px; }
.view-toggle.view-toggle-compact .view-toggle-btn { padding: 6px 12px; font-size: 0.8rem; border-radius: 999px; min-height: 32px; }

/* GV-2 / GV-3: plain detail rows. */
.gv-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; box-sizing: border-box;
  padding: 6px 0; background: none; border: 0; border-top: 1px solid var(--color-border); color: var(--color-text);
  font: inherit; font-size: 0.9rem; text-align: left;
}
.gv-row-link { cursor: pointer; }
.gv-row-link:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.gv-row-icon { display: inline-flex; flex: none; width: 20px; height: 20px; align-items: center; justify-content: center; color: var(--color-text-muted); }
.gv-row-label { flex: none; color: var(--color-text-muted); }
.gv-row-value { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.gv-row-link .gv-row-value { color: var(--color-cta); text-align: right; }
.gv-venue-row .gv-row-value { text-align: left; }
.gv-row-value-plain { color: var(--color-text); text-align: right; }
.gv-chev { display: inline-flex; flex: none; color: var(--color-text-muted); }

/* Modals (venue, Invited, invite picker). Below the user pop-up (.um-menu, 1200) so a person row can open it. */
.gv-scrim {
  position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  background: var(--hv2-scrim); padding: 16px; box-sizing: border-box;
}
.gv-modal {
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-sizing: border-box; padding: 16px 20px 20px;
  border-radius: 16px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--hv2-shadow);
}
.gv-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gv-caption { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.gv-x {
  min-width: 44px; min-height: 44px; background: none; border: 0; cursor: pointer; color: var(--color-text-muted);
  font-size: 1.5rem; line-height: 1;
}
.gv-x:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.gv-modal-title { margin: 4px 0 6px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.gv-modal-title-sm { font-size: 1.05rem; margin: 0; }
.gv-modal-sub { margin: 0 0 12px; color: var(--color-text-muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.gv-map { width: 100%; height: 200px; border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 14px; }
.gv-modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.gv-btn { min-height: 44px; border-radius: 12px; font-weight: 600; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
a.gv-btn.btn-primary { background: var(--color-cta); border-color: var(--color-cta); color: var(--color-cta-text); }

/* Invited modal + Responses card. */
.gv-section-title { margin: 14px 0 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.gv-sub { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.gv-sub-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.gv-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; box-sizing: border-box;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--color-surface-alt); color: var(--color-text-muted);
}
.gv-count-accepted, .gv-count-registered { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); }
.gv-count-declined { background: color-mix(in srgb, var(--color-danger) 16%, transparent); color: var(--color-danger); }
.gv-person, .gv-pick-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; }
.gv-pick-row { border-bottom: 1px solid var(--color-border); min-height: 56px; }
.gv-pick-row:last-child { border-bottom: 0; }
.gv-person-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 0.95rem; font-weight: 600; }
.gv-nick { font-weight: 400; font-size: 0.82rem; color: var(--color-text-muted); }
.gv-person-right { display: flex; align-items: center; gap: 8px; flex: none; }
.gv-av { display: inline-flex; flex: none; }
.gv-av .hv2-av { width: 32px; height: 32px; font-size: 12px; margin-left: 0; }
.gv-av-email { background: var(--color-surface-alt); color: var(--color-text-muted); }
.gv-tag { font-size: 0.78rem; color: var(--color-text-muted); }
.gv-tag-pill { padding: 4px 10px; border-radius: 999px; background: var(--color-surface-alt); }
.gv-pill { padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; background: color-mix(in srgb, var(--color-warning) 28%, transparent); color: var(--color-text); }
.gv-group-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.gv-group-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; box-sizing: border-box;
  border-radius: var(--radius-md); background: color-mix(in srgb, var(--color-info) 18%, transparent); color: var(--color-info); font-size: 0.72rem; font-weight: 700;
}
.gv-group-name { font-weight: 600; overflow-wrap: anywhere; }
.gv-empty { margin: 8px 0; color: var(--color-text-muted); font-size: 0.88rem; }
.gv-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.gv-card-head h3 { margin: 0; }
.gv-joined { font-size: 0.85rem; font-weight: 700; color: var(--color-success); }
.gv-resp-section + .gv-resp-section { border-top: 1px solid var(--color-border); margin-top: 6px; }
.gv-more { display: inline-block; margin: 4px 0 4px 44px; font-size: 0.82rem; color: var(--color-text-muted); background: none; border: 0; padding: 0; }
.gv-more-btn { cursor: pointer; min-height: 32px; text-decoration: underline; }
.gv-revoke { min-height: 32px; padding: 0 8px; background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--color-error); }
.page-tournament-detail .gv-card, .page-tournament-detail .gv-fixtures-card, .page-tournament-detail .gv-invitations-card { margin-top: 24px; }
.gv-fixtures-card .event-fixtures-section { border-top: 0; margin-top: 0; padding-top: 0; }
.gv-hint { margin: 0 0 12px; color: var(--color-text-muted); font-size: 0.88rem; }
.gv-invite-entries { display: flex; flex-direction: column; gap: 10px; }
.gv-invite .invite-ctl--entry { width: 100%; }

/* GV-5 picker. */
.gv-tabs { display: flex; gap: 4px; margin: 12px 0; padding: 4px; border-radius: var(--radius-lg); background: var(--color-surface-alt); border: 1px solid var(--color-border); }
.gv-tab { flex: 1; min-height: 40px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text-muted); font: inherit; font-weight: 600; cursor: pointer; }
.gv-tab.active { background: var(--color-surface); color: var(--color-primary); font-weight: 700; box-shadow: var(--shadow-sm); }
.gv-tab:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.gv-search { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font: inherit; }
.gv-picker-body { margin-top: 8px; max-height: 45vh; overflow-y: auto; }
.gv-pick-row .invite-ctl { min-width: 44px; min-height: 44px; }
.gv-send:disabled { opacity: 0.6; cursor: not-allowed; }

/* GV-6: the combined user pop-up (identity on top, role actions below). */
.um-identity { display: flex; flex-direction: column; align-items: center; padding: 16px 16px 8px; text-align: center; border-bottom: 1px solid var(--color-border); }
.um-identity .um-avatar { width: 64px; height: 64px; font-size: 22px; }
.um-identity .um-details-name { margin-top: 8px; font-size: 17px; }
.um-badge { margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--color-surface-alt); color: var(--color-text); }
.um-identity { margin-bottom: 0; padding-bottom: 12px; }
.gv-card h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--color-text); }

/* ─────────────────────────────────────────────
   Tournament creation wizard (tl-c-web PR 3, AD-20). Desktop first: stepper | form | live summary rail;
   below ~900px one column that works on a phone. Theme tokens only: no literal colours.
   ───────────────────────────────────────────── */
/* the shell caps #app-main at 800px; the wizard needs the full width beside the side rail (as the dashboard and home do) */
#app-main:has(.tw-page) { max-width: 1240px; padding: 20px 0; }
.tw-page { max-width: 1240px; margin: 0 auto; padding: 4px 24px 48px; }
.tw-head { margin-bottom: 18px; }
.tw-crumb { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 4px; }
.tw-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--color-text); }
.tw-layout { display: grid; gap: 20px; align-items: start; grid-template-columns: 200px minmax(0, 1fr) 250px; grid-template-areas: "steps form rail"; }
.tw-steps { grid-area: steps; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px; }
.tw-form-card { grid-area: form; }
.tw-rail { grid-area: rail; }
.tw-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; min-width: 0; }
.tw-card-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; text-transform: none; letter-spacing: normal; color: var(--color-text); margin-bottom: 12px; }
.tw-page :focus-visible { outline: 3px solid var(--color-cta); outline-offset: 2px; }
.tw-page .tw-card-title:focus, .tw-page .tw-card-title:focus-visible, .tw-page .tw-title:focus-visible { outline: none; }
.tw-steps-title { font-weight: 800; font-size: 0.95rem; margin-bottom: 8px; color: var(--color-text); }
.tw-step-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.tw-step-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 4px; background: transparent; border: 0; border-radius: var(--radius-md); color: var(--color-text-muted); font-size: 0.9rem; font-weight: 600; text-align: left; }
.tw-step-btn:disabled { cursor: default; }
.tw-step-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--color-border); color: var(--color-text); font-size: 0.75rem; font-weight: 800; }
.tw-step.is-current .tw-step-btn { color: var(--color-text); font-weight: 800; }
.tw-step.is-current .tw-step-dot { background: var(--color-cta); color: var(--color-cta-text); }
.tw-step.is-done .tw-step-dot { background: var(--color-success); color: var(--color-cta-text); }
.tw-progress { display: none; }
.tw-progress-text { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 8px; }
.tw-segs { display: flex; gap: 4px; }
.tw-seg { flex: 1; height: 6px; border-radius: 3px; background: var(--color-border); }
.tw-seg.on { background: var(--color-cta); }
.tw-form { display: flex; flex-direction: column; gap: 14px; }
.tw-hint { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.45; }
.tw-meta { font-size: 0.9rem; font-weight: 700; color: var(--color-text); }
/* :where keeps this reset below every component rule */
:where(.tw-page) h1, :where(.tw-page) h2, :where(.tw-page) h3, :where(.tw-page) p, :where(.tw-page) dl, :where(.tw-page) dd { margin: 0; }
.tw-section-title { font-size: 0.9rem; font-weight: 800; text-transform: none; letter-spacing: normal; color: var(--color-text); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tw-legend { font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); }
.tw-count { font-size: 0.8rem; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--color-text-muted); }
.tw-fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 14px 14px; min-width: 0; }
.tw-fieldset .tw-legend { padding: 0 6px; }
.tw-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tw-error { font-size: 0.82rem; font-weight: 600; color: var(--color-error); margin-top: 6px; }
.tw-form [aria-invalid="true"] { border-color: var(--color-error); }
.tw-venue { display: flex; flex-direction: column; gap: 6px; }
.tw-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tw-choice { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 14px; border: 1.5px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); cursor: pointer; }
.tw-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tw-choice:focus-within { outline: 3px solid var(--color-cta); outline-offset: 2px; }
.tw-choice.is-selected { border-color: var(--color-cta); background: var(--color-surface-alt); }
.tw-choice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tw-choice-title { font-weight: 800; color: var(--color-text); overflow-wrap: anywhere; }
.tw-choice-desc { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.4; }
.tw-choice-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--color-border); background: var(--color-surface); }
.tw-choice.is-selected .tw-choice-mark { border-color: var(--color-cta); background: var(--color-cta); box-shadow: inset 0 0 0 4px var(--color-surface); }
/* team-size-capacity (boards W1, W2): the Who plays fields. Theme tokens only; the input and the lock boxes have fixed sizes. */
.tw-size-card { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: 14px 16px; margin-top: 12px; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.tw-size-caption { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 6px; }
.tw-size-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; min-width: 0; }
.tw-size-row + .tw-size-row, .tw-size-row + .tw-error + .tw-size-row { border-top: 1px solid var(--color-border); }
.tw-size-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-weight: 700; color: var(--color-text); text-transform: none; letter-spacing: normal; }
.tw-size-label { font-size: 0.95rem; font-weight: 700; }
.tw-size-hint { font-size: 0.78rem; font-weight: 400; color: var(--color-text-muted); line-height: 1.35; }
.tw-size-input, .tw-size-ro { flex: none; box-sizing: border-box; width: 96px; height: 44px; text-align: center; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-size: 0.95rem; padding: 0 8px; }
.tw-size-ro { display: flex; align-items: center; justify-content: space-between; width: 110px; background: var(--color-surface-alt); color: var(--color-text-muted); }
.tw-size-ro-wide { width: 100%; height: 44px; }
.tw-lock { flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--color-text-muted); }
.tw-size-card .tw-banner { margin-top: 10px; }
.tw-page .tw-banner[data-tw-err] { margin-top: 12px; }
.tw-seg { display: flex; background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 3px; gap: 3px; }
.tw-seg label { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 40px; margin: 0; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 700; text-transform: none; letter-spacing: normal; color: var(--color-text-muted); cursor: pointer; }
.tw-edit-size .tw-seg input[type="radio"] { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; cursor: pointer; }
.tw-seg label.is-on { background: var(--color-surface); color: var(--color-cta); box-shadow: 0 1px 3px var(--color-border); }
.tw-seg label:focus-within { outline: 3px solid var(--color-cta); outline-offset: 2px; }
.tw-seg.is-ro label { cursor: default; }
.tw-seg.is-ro label.is-on { color: var(--color-text-muted); }
.tw-edit-size { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tw-edit-size .tw-banner { margin: 0; }
.tw-format-detail { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.tw-bullets { margin-left: 18px; display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; color: var(--color-text); }
.tw-people { list-style: none; display: flex; flex-direction: column; }
.tw-person { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.tw-person:last-child { border-bottom: 0; }
.tw-person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tw-person-name { font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
.tw-person-sub { font-size: 0.8rem; color: var(--color-text-muted); overflow-wrap: anywhere; }
.tw-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; object-fit: cover; background: var(--color-surface-alt); color: var(--color-primary); font-size: 0.75rem; font-weight: 800; border: 1px solid var(--color-border); }
.tw-chip { flex: none; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text); font-size: 0.75rem; font-weight: 700; }
.tw-chip-active { border-color: var(--color-success); color: var(--color-success); }
.tw-person.is-pinned .tw-chip { order: 3; }
.tw-banner { border-radius: var(--radius-md); padding: 12px 14px; font-size: 0.88rem; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.tw-banner-info { background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text); }
.tw-banner-error { background: var(--color-surface); border: 1.5px solid var(--color-error); color: var(--color-error); font-weight: 600; }
.tw-search { margin-top: 4px; }
.tw-results { display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.tw-rows { display: flex; flex-direction: column; gap: 8px; }
.tw-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 0.86rem; }
.tw-row dt { color: var(--color-text-muted); flex: 0 1 auto; min-width: 0; }
.tw-row dd { color: var(--color-text); font-weight: 700; text-align: right; overflow-wrap: anywhere; min-width: 0; flex: 1 1 auto; margin: 0; }
.tw-rail .tw-row { flex-direction: column; gap: 0; }
.tw-rail .tw-row dd { text-align: left; flex: none; }
.tw-review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tw-review-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tw-review-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tw-link { background: transparent; border: 0; padding: 0 4px; min-height: 44px; color: var(--color-cta); font-weight: 700; font-size: 0.9rem; }
.tw-cancel { color: var(--color-text-muted); }
.tw-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.tw-actions-right { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.tw-actions .btn { min-height: 44px; }
.tw-actions .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.tw-done { max-width: 720px; }
.tw-done-card { display: flex; flex-direction: column; gap: 12px; }
.tw-done-icon { display: inline-flex; width: 44px; height: 44px; }
.tw-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tw-modal-backdrop { position: absolute; inset: 0; background: var(--color-text); opacity: 0.55; }
.tw-modal-card { position: relative; width: min(440px, 100%); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 10px; }
.tw-groups { display: flex; flex-direction: column; gap: 10px; }
.tw-groups-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
@media (max-width: 1199px) {
  .tw-layout { grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "steps steps" "form rail"; }
  .tw-step-list { flex-direction: row; flex-wrap: wrap; gap: 0 16px; }
  .tw-step-btn { width: auto; }
  .tw-steps-title { display: none; }
}
@media (max-width: 899px) {
  .tw-page { padding: 16px 16px calc(var(--bottom-nav-height) + 24px); }
  .tw-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "steps" "form" "rail"; }
  .tw-steps { padding: 14px; }
  .tw-step-list, .tw-steps-title { display: none; }
  .tw-progress { display: block; }
  .tw-title { font-size: 1.3rem; }
  .tw-card { padding: 16px; }
}
@media (max-width: 480px) {
  .tw-pair { grid-template-columns: minmax(0, 1fr); }
  .tw-actions { flex-direction: column-reverse; align-items: stretch; }
  .tw-actions-right { flex-direction: column-reverse; margin-left: 0; }
  .tw-actions .btn, .tw-cancel { width: 100%; justify-content: center; }
}

/* ─────────────────────────────────────────────
   Committee invitation card (tl-c-accept; board WebCommitteeAccept). Theme tokens only.
   ───────────────────────────────────────────── */
#app-main:has(.tca-page) { max-width: 880px; padding: 20px 0; }
.tca-page { max-width: 720px; margin: 0 auto; padding: 4px 24px 48px; }
.tca-card { display: flex; flex-direction: column; gap: 12px; padding: 28px; }
.tca-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--color-cta); color: var(--color-cta-text); box-shadow: var(--shadow-sm); }
.tca-heading { font-size: 1.25rem; margin-bottom: 0; }
.tca-page .tca-heading:focus, .tca-page .tca-heading:focus-visible { outline: none; }
:where(.tca-page) h1, :where(.tca-page) h2, :where(.tca-page) h3, :where(.tca-page) p, :where(.tca-page) dl, :where(.tca-page) dd { margin: 0; }
.tca-summary { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.tca-page :focus-visible { outline: 3px solid var(--color-cta); outline-offset: 2px; }
.tca-page .btn { min-height: 44px; }
.tca-page .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.tca-member { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-alt); }
.tca-member-name { font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
.tca-member-sub { font-weight: 600; font-size: 0.8rem; color: var(--color-text-muted); }
@media (max-width: 899px) {
  .tca-page { padding: 16px 16px calc(var(--bottom-nav-height) + 24px); }
  .tca-card { padding: 18px; }
}
@media (max-width: 480px) {
  .tca-page .tw-actions { flex-direction: column-reverse; align-items: stretch; }
  .tca-page .tw-actions-right { flex-direction: column-reverse; margin-left: 0; }
  .tca-page .btn, .tca-page .tw-link { width: 100%; justify-content: center; }
}

/* ── Committee console and public Fixtures / Standings (match-scoring v1.3 section 14; task ms-ui-2) ──
   Boards: WebMOverview, WebMCommittee, WebFDraft, WebRSets, WebRBracket, WebTFixtures. Theme tokens only (same set the
   tournament wizard uses): no literal colours. Desktop first; one column below 900px; usable at 390px. */
#app-main:has(.cn-page) { max-width: 1240px; padding: 20px 0; }
.cn-page { max-width: 1240px; margin: 0 auto; padding: 4px 24px 48px; }
.cn-page :focus-visible { outline: 3px solid var(--color-cta); outline-offset: 2px; }
.cn-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cn-head-text { min-width: 0; flex: 1 1 260px; }
.cn-head-text .tw-title { overflow-wrap: anywhere; }
.cn-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cn-head-btn { min-height: 44px; }
.cn-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 12px; background: var(--color-surface-alt); border: 1px solid var(--color-border); color: var(--color-text); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.cn-chip-ok { border-color: var(--color-success); color: var(--color-success); }
.cn-chip-wait, .cn-chip-warn { border-color: var(--color-warning); color: var(--color-warning); }
.cn-chip-info, .cn-chip-purple { border-color: var(--color-info); color: var(--color-info); }
.cn-chip-muted { color: var(--color-text-muted); }

.cn-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: thin; }
.cn-tab { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--color-text-muted); font: inherit; font-size: 0.92rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.cn-tab:hover { color: var(--color-text); }
.cn-tab.is-active { color: var(--color-cta); border-bottom-color: var(--color-cta); }
.cn-tab:focus-visible { outline-offset: -3px; }
.cn-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--color-error); color: var(--color-cta-text); font-size: 0.72rem; font-weight: 800; }
.cn-panel:focus-visible { outline-offset: 4px; }

.cn-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; margin-bottom: 16px; }
.cn-card-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; text-transform: none; letter-spacing: normal; color: var(--color-text); margin: 0 0 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cn-legacy { overflow-x: auto; }
.cn-meta, .cn-hint { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.45; margin: 0 0 8px; }
/* Shuffle again (tournament-edit-recurring AD-7): the group placement of the draft */
.cn-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cn-group-list ol { margin: 4px 0 0; padding-left: 18px; }
.cn-meta.is-flag { color: var(--color-warning); font-weight: 700; }
.cn-muted { color: var(--color-text-muted); }
.cn-empty { padding: 14px 4px; color: var(--color-text-muted); font-size: 0.9rem; list-style: none; }
.cn-ok { margin: 8px 0; font-size: 0.85rem; font-weight: 600; color: var(--color-success); }
.cn-error { margin: 8px 0; font-size: 0.85rem; font-weight: 600; color: var(--color-error); }
.cn-error-list { padding-left: 18px; }
.cn-errors ul { margin: 4px 0 8px 18px; padding: 0; font-size: 0.85rem; }
.cn-banner { border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 14px; font-size: 0.88rem; font-weight: 700; line-height: 1.45; border: 1px solid var(--color-border); background: var(--color-surface-alt); color: var(--color-text); }
.cn-banner-ok { border-color: var(--color-success); color: var(--color-success); }
.cn-banner-error { border-color: var(--color-error); color: var(--color-error); }
.cn-banner-info { border-color: var(--color-info); }
.cn-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.cn-btn { min-height: 44px; padding: 8px 16px; font-size: 0.9rem; }
.cn-wide { flex: 1 1 auto; }
.cn-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.cn-field label { font-size: 0.85rem; color: var(--color-text-muted); min-width: 150px; }
.cn-field select, .cn-field input[type="file"] { min-height: 44px; max-width: 100%; }
.cn-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.cn-two-overview, .cn-two-fixtures { grid-template-columns: minmax(0, 1fr) 340px; }
.cn-two-results { grid-template-columns: 330px minmax(0, 1fr); }
.cn-two { display: grid; gap: 16px; align-items: start; }
.cn-col { min-width: 0; }

.cn-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.cn-tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); min-width: 0; }
.cn-tile-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--color-surface-alt); }
.cn-tile-text { min-width: 0; }
.cn-tile-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1.15; color: var(--color-text); }
.cn-tile-value-text { font-size: 1.1rem; }
.cn-tile-label, .cn-tile-sub { font-size: 0.82rem; color: var(--color-text-muted); overflow-wrap: anywhere; }
.cn-steps, .cn-dates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cn-step { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 700; color: var(--color-text); }
.cn-step.is-done { color: var(--color-text-muted); font-weight: 600; }
.cn-step-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--color-border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; color: var(--color-cta-text); }
.cn-step.is-done .cn-step-dot { background: var(--color-cta); border-color: var(--color-cta); }
.cn-date { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.cn-date:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--color-border); }
.cn-date-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; margin-top: 2px; background: var(--color-border); }
.cn-date.is-done .cn-date-dot { background: var(--color-success); }
.cn-date.is-now .cn-date-dot { background: var(--color-cta); }
.cn-date-label { font-weight: 700; color: var(--color-text); }
.cn-date-when { font-size: 0.82rem; color: var(--color-text-muted); }

.cn-people { list-style: none; padding: 0; overflow: hidden; }
.cn-person { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.cn-person:last-child { border-bottom: 0; }
.cn-person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cn-person-name { font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
.cn-person-sub { font-size: 0.8rem; color: var(--color-text-muted); overflow-wrap: anywhere; }

.cn-request { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.cn-request:last-child { border-bottom: 0; }
.cn-request.is-stale, .cn-request.is-rejected { opacity: 0.8; }
.cn-request-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.cn-request-text { margin: 0 0 6px; font-size: 0.9rem; color: var(--color-text); }

.cn-round-title { font-size: 0.95rem; font-weight: 800; margin: 4px 0 8px; color: var(--color-text); }
.cn-fx-list { list-style: none; padding: 4px 16px; }
.cn-fx-row { display: grid; grid-template-columns: 130px 80px 70px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; min-height: 40px; padding: 8px 0; border-bottom: 1px solid var(--color-border); font-size: 0.88rem; }
.cn-fx-row:last-child { border-bottom: 0; }
.cn-fx-when { font-weight: 700; color: var(--color-text); }
.cn-fx-court, .cn-fx-ref { color: var(--color-text-muted); }
.cn-fx-sides { overflow-wrap: anywhere; }
.cn-fx-sides .is-winner { font-weight: 800; }
.cn-fx-score { font-family: monospace; color: var(--color-text-muted); }
.cn-vs { color: var(--color-text-muted); font-weight: 600; }

.cn-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 10px; }
.cn-subtab { min-height: 44px; padding: 8px 14px; background: transparent; border: 0; border-bottom: 3px solid transparent; font: inherit; font-weight: 700; color: var(--color-text-muted); cursor: pointer; }
.cn-subtab.is-active { color: var(--color-cta); border-bottom-color: var(--color-cta); }
.cn-list-title { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin: 12px 0 6px; }
.cn-match { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; margin-bottom: 8px; padding: 10px 14px; text-align: left; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); font: inherit; color: var(--color-text); cursor: pointer; }
.cn-match.is-selected { border: 2px solid var(--color-cta); padding: 9px 13px; }
.cn-match.is-waiting { opacity: 0.75; }
.cn-match-meta { font-size: 0.78rem; color: var(--color-text-muted); }
.cn-match-sides { font-weight: 800; overflow-wrap: anywhere; }
.cn-match-score { font-size: 0.82rem; font-family: monospace; color: var(--color-text-muted); }

.cn-entry-meta { font-size: 0.82rem; color: var(--color-text-muted); }
.cn-entry-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; margin: 4px 0 14px; color: var(--color-text); overflow-wrap: anywhere; }
.cn-setrow { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.cn-setlabel { flex: none; width: 54px; font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); }
.cn-score, .cn-readscore { width: 72px; min-height: 48px; text-align: center; font-size: 1.15rem; font-weight: 800; border-radius: var(--radius-md); }
.cn-readscore { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-border); background: var(--color-surface-alt); }
.cn-dash { color: var(--color-text-muted); }
.cn-live { margin: 14px 0; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--color-success); color: var(--color-success); font-weight: 800; }
.cn-live.is-empty { border-color: var(--color-border); color: var(--color-text-muted); font-weight: 600; }
.cn-approval-ask { margin: 12px 0; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-alt); }
.cn-approval-ask textarea { width: 100%; max-width: 100%; margin: 6px 0; }
.cn-override { padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.cn-override-list { list-style: none; margin: 8px 0; padding: 0; }
.cn-override-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cn-override-item span { flex: 1 1 auto; }

.cn-bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 36px; overflow-x: auto; padding-bottom: 6px; }
.cn-bracket-col { display: flex; flex-direction: column; min-width: 190px; }
.cn-bracket-title { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 12px; }
.cn-bracket-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.cn-bm-when { font-size: 0.72rem; color: var(--color-text-muted); margin-bottom: 2px; }
.cn-bm-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface); }
.cn-bm-side { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 0.85rem; color: var(--color-text-muted); }
.cn-bm-side + .cn-bm-side { border-top: 1px solid var(--color-border); }
.cn-bm-side.is-winner { background: var(--color-surface-alt); color: var(--color-text); font-weight: 800; }
.cn-bm-side.is-tbd .cn-bm-name { color: var(--color-text-muted); font-style: normal; }
.cn-bm-name { min-width: 0; overflow-wrap: anywhere; }

.cn-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.cn-groups .cn-card { margin-bottom: 0; }
.cn-table-wrap { overflow-x: auto; }
.cn-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.cn-table th, .cn-table td { padding: 8px; text-align: left; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.cn-table th { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 800; }
.cn-table .cn-cell-name { white-space: normal; font-weight: 700; }
.cn-table tr.is-qualifier .cn-cell-name { color: var(--color-text); }
.cn-table tr.is-mine td { background: var(--color-surface-alt); }
.cn-screen-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cn-head-public { align-items: center; }

@media (max-width: 900px) {
  .cn-page { padding: 4px 16px 40px; }
  .cn-tiles, .cn-two-overview, .cn-two-fixtures, .cn-two-results { grid-template-columns: minmax(0, 1fr); }
  .cn-groups { grid-template-columns: minmax(0, 1fr); }
  .cn-fx-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cn-fx-court, .cn-fx-ref { display: inline; }
  .cn-fx-sides { grid-column: 1 / -1; }
  .cn-setlabel { width: 44px; }
  .cn-field label { min-width: 100%; }
}
@media (max-width: 480px) {
  .cn-head-actions { width: 100%; }
  .cn-head-actions .btn { flex: 1 1 auto; }
}
.cn-public .cn-hint { margin: 12px 0; }

/* Book a court block (Home and the tournament Overview) */
.te-court { margin-top: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--te-teal-edge);
  background: linear-gradient(180deg, var(--te-teal-tint), var(--hv2-surface) 55%); display: flex; flex-direction: column; gap: 6px; }
.te-court-head { display: flex; align-items: center; gap: 12px; }
.te-court-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--te-teal); color: var(--hv2-on-solid);
  display: flex; align-items: center; justify-content: center; flex: none; }
.te-court-title { font-size: 16px; font-weight: 800; color: var(--hv2-ink); }
.te-court-sub { font-size: 12px; color: var(--hv2-muted); }
.te-court-list { padding-top: 6px; display: flex; flex-direction: column; }
.te-court-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--te-teal-line); }
.te-court-row:last-child { border-bottom: 0; }
.te-court-logo { width: 44px; height: 44px; border-radius: 14px; flex: none; overflow: hidden; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 14px; color: var(--hv2-av-text); }
.te-court-logo img { width: 44px; height: 44px; object-fit: cover; display: block; }
.te-court-text { flex: 1; min-width: 0; }
.te-court-name { font-weight: 800; font-size: 14px; color: var(--hv2-ink); }
.te-court-desc { font-size: 12px; color: var(--hv2-muted); line-height: 1.4; }
.te-court-book { height: 44px; min-width: 72px; padding: 0 14px; border-radius: 12px; background: var(--color-cta); color: var(--color-cta-text);
  font-weight: 700; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; text-decoration: none; flex: none; }
.te-court-book:hover { text-decoration: none; filter: brightness(1.08); }
.te-court-book:focus-visible { outline: 3px solid var(--hv2-blue); outline-offset: 2px; }
.te-court-note { font-size: 11.5px; color: var(--hv2-muted); display: flex; gap: 6px; align-items: center; }
.te-ico { display: inline-flex; width: 14px; height: 14px; flex: none; }
.te-ico svg { width: 100%; height: 100%; }
@media (min-width: 769px) {
  .te-court-list.te-court-grid { flex-direction: row; gap: 14px; }
  .te-court-grid .te-court-row { flex: 1; flex-direction: column; align-items: stretch; border: 1px solid var(--te-teal-line);
    border-radius: 16px; padding: 16px; background: var(--hv2-surface); }
  .te-court-grid .te-court-row:last-child { border: 1px solid var(--te-teal-line); }
  .te-court-grid .te-court-book { width: 100%; }
}

/* ── Tournament page, lifecycle version 2 (te-w1; boards WebTV2Open, WebTV2Contrast, WebTV2Lock*, WebTV2Popup*) ── */
.te-page { max-width: 1240px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; color: var(--hv2-ink); }
.te-banner { position: relative; height: 212px; border-radius: 20px; overflow: hidden; flex: none;
  background: linear-gradient(115deg, var(--db-brand-deep), var(--db-brand)); }
.te-banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.te-banner-top { position: absolute; left: 16px; top: 14px; }
.te-back { height: 34px; padding: 0 14px; border-radius: 17px; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px; background: var(--te-strip-dark); color: var(--te-strip-light); }
.te-banner-bottom { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; gap: 14px; align-items: flex-end; }
/* the status strip: text colour from banner_tone, opacity from banner_scrim (both stored by the server) */
.te-strip { flex: 1; min-width: 0; border-radius: 16px; padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 9px;
  border: 1px solid var(--te-ring); }
.te-tone-light { --te-strip-base: var(--te-strip-dark); --te-strip-ink: var(--te-strip-light); }
.te-tone-dark { --te-strip-base: var(--te-strip-light); --te-strip-ink: var(--te-strip-dark); }
.te-strip { background: var(--te-strip-base); background: color-mix(in srgb, var(--te-strip-base) var(--te-scrim, 40%), transparent); color: var(--te-strip-ink); }
.te-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 12px; font-weight: 800; font-size: 12px;
  white-space: nowrap; background: var(--te-strip-ink); color: var(--te-strip-base); }
.te-pill-dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; display: inline-block; }
.te-register { height: 56px; padding: 0 28px; border-radius: 18px; background: var(--color-cta); color: var(--color-cta-text); border: 3px solid var(--te-ring);
  font-family: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; flex: none; box-shadow: var(--hv2-shadow); }
.te-register:hover { filter: brightness(1.08); }
.te-register:focus-visible { outline: 3px solid var(--te-ring); outline-offset: 3px; }
.te-register-main { font-weight: 800; font-size: 17px; display: inline-flex; align-items: center; gap: 8px; }
.te-register-sub { font-size: 11px; font-weight: 600; }
.te-registered { height: 56px; padding: 0 22px; border-radius: 18px; background: var(--hv2-green); color: var(--hv2-on-solid); border: 3px solid var(--te-ring);
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; flex: none; box-shadow: var(--hv2-shadow); }
.te-head { display: flex; gap: 20px; align-items: flex-start; padding: 0 8px; }
.te-logo { width: 96px; height: 96px; border-radius: 24px; border: 4px solid var(--hv2-surface); box-sizing: border-box; overflow: hidden; flex: none;
  background: var(--te-teal); box-shadow: var(--hv2-shadow); display: flex; align-items: center; justify-content: center; }
.te-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.te-head-text { flex: 1; min-width: 0; }
.te-title { margin: 0; font-weight: 800; font-size: 28px; line-height: 1.15; color: var(--hv2-ink); overflow-wrap: anywhere; }
.te-meta { font-size: 13.5px; color: var(--hv2-muted); margin-top: 3px; }
.te-chips { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.te-chip { appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 10px; background: var(--hv2-surface);
  border: 1.5px solid var(--hv2-border); border-radius: 14px; padding: 6px 10px 6px 6px; min-height: 48px; }
.te-chip:focus-visible { outline: 3px solid var(--hv2-blue); outline-offset: 2px; }
.te-chip-text { display: flex; flex-direction: column; min-width: 0; }
.te-chip-kicker { font-size: 10.5px; color: var(--hv2-muted); font-weight: 600; }
.te-chip-name { font-size: 12.5px; font-weight: 800; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.te-av { width: 34px; height: 34px; border-radius: 17px; box-sizing: border-box; border: 2px solid var(--hv2-surface); flex: none; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 10px; color: var(--hv2-av-text); }
.te-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.te-av-big { width: 52px; height: 52px; border-radius: 26px; font-size: 14px; }
.te-av-stack { display: inline-flex; }
.te-av-stack .te-av + .te-av { margin-left: -10px; }
.te-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--hv2-border); background: var(--hv2-surface); font-weight: 600; }
.te-notice-actions { display: inline-flex; gap: 8px; }

.te-tabs { display: flex; gap: 4px; align-items: flex-end; position: relative; z-index: 2; margin-top: 6px; overflow-x: auto; }
.te-tab { appearance: none; margin: 0; font: inherit; cursor: pointer; padding: 0 8px; flex: 1 0 auto; min-width: 0; height: 44px; box-sizing: border-box;
  border-radius: 14px 14px 0 0; background: var(--te-tab-idle); border: 1.5px solid var(--hv2-border); border-bottom: 0; color: var(--hv2-ink);
  font-weight: 800; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; position: relative; }
.te-tab.is-active { height: 52px; margin-bottom: -1.5px; z-index: 3; background: var(--te-panel-bg, var(--hv2-page)); border-top: 3px solid var(--te-tab-ink); color: var(--te-tab-ink); }
.te-tab.is-locked { background: var(--te-lock-bg); color: var(--te-lock-ink); }
.te-tab.is-locked.is-active { color: var(--te-lock-ink); border-top-color: var(--hv2-dot-idle); background: var(--te-lock-bg); }
.te-tab:focus-visible { outline: 3px solid var(--hv2-blue); outline-offset: -3px; }
.te-tab-blue { --te-tab-ink: var(--hv2-blue); --te-panel-bg: var(--hv2-page); }
.te-tab-purple { --te-tab-ink: var(--hv2-purple); --te-panel-bg: var(--hv2-purple-tint); }
.te-tab-orange { --te-tab-ink: var(--hv2-orange); --te-panel-bg: var(--hv2-orange-tint); }
.te-tab-green { --te-tab-ink: var(--hv2-green); --te-panel-bg: var(--hv2-green-tint); }
.te-tab-amber { --te-tab-ink: var(--te-amber); --te-panel-bg: var(--te-amber-tint); }
.te-tab-pink { --te-tab-ink: var(--te-pink); --te-panel-bg: var(--te-pink-tint); }
.te-badge { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--te-badge); color: var(--hv2-on-solid);
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.te-panel { border: 1.5px solid var(--hv2-border); border-radius: 0 0 20px 20px; padding: 16px; margin-top: -1.5px; min-height: 280px; background: var(--hv2-page); }
.te-panel-purple { background: var(--hv2-purple-tint); } .te-panel-orange { background: var(--hv2-orange-tint); } .te-panel-green { background: var(--hv2-green-tint); }
.te-panel-amber { background: var(--te-amber-tint); } .te-panel-pink { background: var(--te-pink-tint); } .te-panel-locked { background: var(--te-lock-bg); }

.te-ov { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.te-ov-main, .te-ov-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.te-ov-court { grid-column: 1 / -1; }
.te-ov-court .te-court { margin-top: 0; }
.te-card { background: var(--hv2-surface); border: 1px solid var(--hv2-border); border-radius: 16px; padding: 18px; }
.te-card-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; color: var(--hv2-ink); }
.te-card-note { margin: 10px 0 0; font-size: 12.5px; color: var(--hv2-muted); }
.te-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.te-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.te-fact { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.te-fact-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--hv2-tile); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.te-fact-text { display: flex; flex-direction: column; min-width: 0; }
.te-fact-title { font-weight: 800; font-size: 13.5px; overflow-wrap: anywhere; }
.te-fact-sub { font-size: 12px; color: var(--hv2-muted); overflow-wrap: anywhere; }
.te-kds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.te-kd { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; position: relative; }
.te-kd:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 30px; bottom: -8px; width: 2px; background: var(--hv2-border); }
.te-kd-dot { width: 22px; height: 22px; border-radius: 11px; box-sizing: border-box; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--hv2-dot-idle); background: var(--hv2-surface); color: var(--hv2-on-solid); }
.te-kd.is-done .te-kd-dot { background: var(--hv2-green); border-color: var(--hv2-green); }
.te-kd.is-current .te-kd-dot { border: 6px solid var(--hv2-blue); }
.te-kd-text { display: flex; flex-direction: column; }
.te-kd-label { font-weight: 800; font-size: 14px; }
.te-kd.is-upcoming .te-kd-label { color: var(--hv2-muted); }
.te-kd-value { font-size: 12.5px; color: var(--hv2-muted); }
.te-progress-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.te-progress { height: 8px; border-radius: 4px; background: var(--hv2-hover); overflow: hidden; margin-top: 8px; }
.te-progress span { display: block; height: 100%; background: var(--hv2-blue); }
.te-placeholder { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* locked tab: greyed skeleton preview and the unlock message */
.te-locked { position: relative; min-height: 260px; }
.te-skel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; opacity: .7; }
.te-skel-card { background: var(--hv2-surface); border: 1px solid var(--hv2-border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; height: 110px; box-sizing: border-box; }
.te-skel-bar { height: 12px; border-radius: 6px; background: var(--te-skeleton); display: block; }
.te-skel-bar-s { width: 30%; } .te-skel-bar-m { width: 60%; }
.te-locked-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 90%); box-sizing: border-box; text-align: center;
  background: var(--hv2-surface); border: 1px solid var(--hv2-border); border-radius: 16px; padding: 22px; box-shadow: var(--hv2-shadow); }
.te-locked-icon { width: 48px; height: 48px; border-radius: 24px; background: var(--te-lock-bg); color: var(--te-lock-ink); display: inline-flex; align-items: center; justify-content: center; }
.te-locked-title { margin: 10px 0 6px; font-size: 16px; font-weight: 800; }
.te-locked-body { margin: 0; font-size: 13.5px; color: var(--hv2-muted); }

/* View Details pop-ups (organizer, committee) */
.te-modal { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; }
.te-modal-backdrop { position: absolute; inset: 0; background: var(--hv2-scrim); }
.te-modal-card { position: relative; width: min(464px, 92vw); box-sizing: border-box; background: var(--hv2-surface); border-radius: 20px; padding: 20px 22px; box-shadow: var(--hv2-shadow); }
.te-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.te-modal-title { margin: 0; font-size: 20px; font-weight: 800; }
.te-modal-close { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--hv2-hover); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.te-modal-close:focus-visible { outline: 3px solid var(--hv2-blue); }
.te-people { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.te-person { display: flex; align-items: center; gap: 14px; }
.te-person-text { display: flex; flex-direction: column; min-width: 0; }
.te-person-name { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.te-person-nick { font-size: 13px; color: var(--hv2-muted); }

@media (max-width: 900px) {
  .te-ov { grid-template-columns: minmax(0, 1fr); }
  .te-banner-bottom { flex-direction: column; align-items: stretch; }
  .te-register, .te-registered { width: 100%; justify-content: center; }
  .te-head { flex-direction: column; }
  .te-skel-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) { .te-tab, .te-register { transition: filter 150ms ease; } }

/* ── Tournament page, lifecycle version 2: status strip stepper, tab bodies (te-w2) ── */
.te-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.te-strip-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.te-pill-quiet { background: transparent; color: var(--te-strip-ink); border: 1px solid var(--te-strip-ink); }
/* Full chip (tournament-edit-recurring AD-1): the server's is_full, on a card and in the banner. Theme tokens only. */
.te-full-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--hv2-border); background: var(--hv2-tile); color: var(--hv2-ink); font-weight: 700; font-size: 12.5px; }
.te-registered.te-full-box { background: var(--hv2-surface); color: var(--hv2-ink); }
.te-stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 12px; color: var(--te-strip-ink); }
.te-step { display: flex; align-items: center; gap: 8px; flex: none; font-size: 12px; font-weight: 600; }
.te-step.is-current { font-weight: 800; }
.te-step-dot { width: 24px; height: 24px; border-radius: 12px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 3px solid transparent; background: color-mix(in srgb, var(--te-strip-ink) 30%, transparent); color: var(--te-strip-ink); }
.te-step.is-done .te-step-dot { background: var(--te-strip-ink); color: var(--te-strip-base); }
.te-step.is-current .te-step-dot { border-color: var(--te-strip-ink); }
.te-step-line { flex: 1; height: 3px; border-radius: 2px; min-width: 6px; background: color-mix(in srgb, var(--te-strip-ink) 38%, transparent); }
.te-locked-chip { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 10px; background: var(--te-lock-bg); color: var(--te-lock-ink); font-size: 11.5px; font-weight: 700; }

.te-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.te-card-head .te-card-title { margin: 0; }
.te-card-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.te-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.te-two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.te-grow { flex: 1; }
.te-self-start { align-self: flex-start; }
.te-sub { font-size: 12.5px; color: var(--hv2-muted); }
.te-empty { color: var(--hv2-muted); font-size: 13.5px; margin: 8px 0; }
.te-link { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--te-pink); font: inherit; font-weight: 700; text-align: left; }
.te-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--hv2-purple-tint); border: 1px solid var(--hv2-border);
  color: var(--hv2-purple-ink); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.te-note > span:not(.te-badge-soft) { flex: 1; min-width: 200px; }
.te-note-btn { flex: none; }
.te-badge-soft { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 10px; background: var(--hv2-blue-tint); color: var(--hv2-blue-ink); font-size: 11px; font-weight: 700; white-space: nowrap; }
.te-badge-purple { background: var(--hv2-purple-tint); color: var(--hv2-purple-ink); }
.te-badge-orange { background: var(--hv2-orange-tint); color: var(--hv2-orange-ink); }
.te-badge-green { background: var(--hv2-green-tint); color: var(--hv2-green-ink); }
.te-badge-pink { background: var(--te-pink-tint); color: var(--te-pink); }
.te-chip-soft { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 10px; background: var(--hv2-hover); color: var(--hv2-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.te-chip-teal { background: var(--te-teal-tint); color: var(--te-teal); }
.te-chip-green { background: var(--te-ok-tint); color: var(--hv2-green-ink); }
.te-chip-blue { background: var(--hv2-blue-tint); color: var(--hv2-blue-ink); }
.te-chip-purple { background: var(--hv2-purple-tint); color: var(--hv2-purple-ink); }
.te-chip-amber { background: var(--te-amber-tint); color: var(--te-amber); }
.te-chip-red { background: var(--te-red-tint); color: var(--te-red-ink); }
.te-av-sm { width: 30px; height: 30px; border-radius: 15px; font-size: 10px; border: 0; }
.te-input { width: 100%; box-sizing: border-box; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--hv2-border); background: var(--hv2-surface); color: var(--hv2-ink); font: inherit; }
.te-input:focus-visible { outline: 3px solid var(--hv2-blue); outline-offset: 1px; }
.te-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--hv2-muted); margin-top: 10px; }
.te-search { display: inline-block; width: 200px; }
.te-count { font-size: 13px; }
.te-more { margin-top: 12px; }
.te-errors { list-style: none; margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--te-red-tint); color: var(--te-red-ink); font-size: 12.5px; font-weight: 600; }
.te-warn { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--te-amber-tint); color: var(--te-amber); font-size: 12.5px; font-weight: 700; }
.te-banner-ok { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--te-ok-tint); color: var(--hv2-green-ink); font-size: 12.5px; font-weight: 700; }
.te-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.te-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--hv2-border); background: var(--hv2-surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.te-icon-btn:focus-visible, .te-btn-solid:focus-visible, .te-btn-ghost:focus-visible, .te-filter:focus-visible, .te-tool:focus-visible, .te-media-remove:focus-visible { outline: 3px solid var(--hv2-blue); outline-offset: 2px; }
.te-loading { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; opacity: .7; }
.te-card-note-first { margin-top: 0; margin-bottom: 10px; }

.te-tools { display: flex; flex-direction: column; }
.te-tool { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 10px 0; border: 0; border-bottom: 1px solid var(--hv2-border); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 48px; }
.te-tool:last-child { border-bottom: 0; }
.te-tool .te-fact-text { flex: 1; }
.te-tool-file { position: relative; }
.te-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.te-upload { position: relative; display: inline-flex; align-items: center; cursor: pointer; }

.te-table-wrap { overflow-x: auto; }
.te-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.te-table th { text-align: left; font-size: 11px; font-weight: 800; color: var(--hv2-muted); text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--hv2-border); }
.te-table td { padding: 10px; border-bottom: 1px solid var(--hv2-border); vertical-align: middle; }
.te-table-tight td, .te-table-tight th { padding: 8px 6px; }
.te-table tr.is-q td { background: var(--te-ok-tint); }
.te-table tr.is-mine td { font-weight: 800; }
.te-num { text-align: right; font-variant-numeric: tabular-nums; }
.te-cell-person { display: inline-flex; align-items: center; gap: 10px; }
.te-cell-name { font-weight: 800; }
.te-cell-end { text-align: right; width: 48px; }
.te-q { display: inline-flex; width: 18px; height: 18px; border-radius: 9px; background: var(--hv2-green); color: var(--hv2-on-solid); align-items: center; justify-content: center; }
.te-groups-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.te-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.te-filter { height: 32px; padding: 0 14px; border-radius: 16px; border: 1.5px solid var(--hv2-border); background: var(--hv2-surface); color: var(--hv2-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.te-filter.is-on { background: var(--hv2-orange); border-color: var(--hv2-orange); color: var(--hv2-on-solid); font-weight: 700; }
.te-match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.te-match { background: var(--hv2-surface); border: 1.5px solid var(--hv2-border); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.te-match-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.te-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.te-side-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.te-side.is-winner .te-side-name { font-weight: 800; }
.te-side.is-tbd .te-side-name { color: var(--hv2-muted); font-style: italic; }
.te-side-score { width: 60px; text-align: right; font-weight: 800; font-size: 15px; flex: none; }
.te-match-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--hv2-border); padding-top: 10px; }
.te-match-foot .te-sub { flex: 1; }
.te-btn-solid, .te-btn-ghost { height: 38px; padding: 0 16px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; white-space: nowrap; flex: none; }
.te-btn-solid { background: var(--hv2-orange); border: 1.5px solid var(--hv2-orange); color: var(--hv2-on-solid); }
.te-btn-ghost { background: var(--hv2-surface); border: 1.5px solid var(--hv2-border); color: var(--hv2-orange-ink); }
.te-ko-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 14px; overflow-x: auto; padding: 4px 0 8px; }
.te-ko-col { display: flex; flex-direction: column; gap: 12px; }
.te-ko-title { margin: 0; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--hv2-muted); }
.te-ko { background: var(--hv2-surface); border: 1.5px solid var(--hv2-border); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.te-ko.is-new { border-color: var(--hv2-green); }
.te-ko-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.te-approval { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--hv2-border); }
.te-approval:first-of-type { border-top: 0; }
.te-approval.is-needs { background: var(--te-amber-tint); border-radius: 12px; padding: 12px; border-top: 0; margin-bottom: 8px; }
.te-approval-title { margin: 0; font-size: 14.5px; font-weight: 800; }
.te-approval-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.te-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.te-podium-tile { border-radius: 14px; padding: 16px 10px; text-align: center; display: flex; flex-direction: column; gap: 6px; background: var(--hv2-hover); border: 1.5px solid var(--hv2-border); }
.te-podium-tile.is-first { background: var(--te-amber-tint); border-color: var(--te-amber); padding-top: 26px; padding-bottom: 26px; }
.te-podium-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--hv2-muted); }
.te-podium-tile.is-first .te-podium-kicker { color: var(--te-amber); }
.te-podium-name { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.te-star { background: var(--te-amber-tint); border-color: var(--te-amber); }
.te-comment { display: flex; gap: 12px; }
.te-comment-text { margin: 6px 0 0; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.te-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.te-summary div { display: flex; flex-direction: column; }
.te-summary strong { font-size: 18px; }
.te-summary span { font-size: 12px; color: var(--hv2-muted); }
.te-thumbs, .te-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.te-media-tile { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--hv2-hover); }
.te-media-el { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.te-media-remove { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 16px; border: 0; background: var(--te-strip-dark); color: var(--te-strip-light); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.te-media-tile figcaption { padding: 6px 8px; }

.te-modal-wide { width: min(640px, 94vw); max-height: 90vh; overflow-y: auto; }
.te-score-grid { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.te-score-row { display: grid; grid-template-columns: 30px minmax(110px, 1fr) repeat(3, 72px); gap: 10px; align-items: center; }
.te-score-headrow { grid-template-columns: 30px minmax(110px, 1fr) repeat(3, 72px); }
.te-set-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--hv2-muted); text-align: center; }
.te-score-name { font-weight: 800; overflow-wrap: anywhere; }
.te-score-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.te-score-input { width: 100%; box-sizing: border-box; height: 44px; text-align: center; font: inherit; font-weight: 800; font-size: 16px; border-radius: 10px; border: 1.5px solid var(--hv2-border); background: var(--hv2-surface); color: var(--hv2-ink); }
.te-score-input:focus-visible { outline: 3px solid var(--hv2-blue); outline-offset: 1px; }
.te-was { font-size: 10.5px; color: var(--hv2-muted); }
.te-radios { border: 0; padding: 0; margin: 10px 0 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.te-radios legend { font-size: 12.5px; font-weight: 700; color: var(--hv2-muted); padding: 0 8px 0 0; float: left; line-height: 38px; }
.te-radio { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 38px; border-radius: 19px; border: 1.5px solid var(--hv2-border); cursor: pointer; font-weight: 600; font-size: 13px; }
.te-radio.is-on { border-color: var(--hv2-orange); background: var(--hv2-orange-tint); color: var(--hv2-orange-ink); font-weight: 800; }
.te-radio input { accent-color: var(--hv2-orange); }
.te-impact { min-height: 24px; margin-top: 8px; }
.te-impact-main { margin: 0 0 6px; font-weight: 800; }
.te-impact-list { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.te-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.te-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 160px; overflow-y: auto; }
.te-attendees { border: 1px solid var(--hv2-border); border-radius: 12px; padding: 8px 12px; margin: 10px 0; }
.te-attendees legend { font-size: 12.5px; font-weight: 700; color: var(--hv2-muted); padding: 0 6px; }
.te-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.te-counter { text-align: right; font-weight: 600; }
.te-cn-host .cn-card { box-shadow: none; }
@media (max-width: 900px) {
  .te-two, .te-groups-grid, .te-match-grid, .te-three, .te-loading { grid-template-columns: minmax(0, 1fr); }
  .te-stepper { gap: 6px; flex-wrap: wrap; }
  .te-step-name { display: none; }
  .te-step.is-current .te-step-name { display: inline; }
  .te-score-row, .te-score-headrow { grid-template-columns: 30px minmax(70px, 1fr) repeat(3, 56px); gap: 6px; }
  .te-search { width: 100%; }
}

/* Create tournament wizard, te-w2: banner and logo step, date rule checklist, phase timeline */
.tw-images { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.tw-images-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tw-images-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tw-img { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tw-img-box { border: 2px dashed var(--color-border); border-radius: 14px; background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--color-text-muted); }
.tw-img-banner-box, .tw-img-banner .tw-img-box { height: 96px; }
.tw-img-logo .tw-img-box { width: 84px; height: 84px; }
.tw-img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-img-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tw-file { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.tw-img-preview { display: flex; flex-direction: column; gap: 6px; }
.tw-img-banner.te-banner, .tw-img-preview .te-banner { height: 120px; }
.tw-img-preview .te-stepper { gap: 6px; }
.tw-img-preview .te-step-name { font-size: 10.5px; }
.tw-rules { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tw-rule { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.9rem; }
.tw-rule-glyph { width: 22px; height: 22px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--hv2-dot-idle); color: var(--hv2-on-solid); }
.tw-rule.is-ok .tw-rule-glyph { background: var(--hv2-green); border-color: var(--hv2-green); }
.tw-rule.is-bad { color: var(--te-red-ink); }
.tw-rule.is-bad .tw-rule-glyph { background: var(--te-badge); border-color: var(--te-badge); }
.tw-rule.is-open { color: var(--color-text-muted); font-weight: 600; }
.tw-phases { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tw-phase { display: flex; gap: 10px; align-items: flex-start; }
.tw-phase-dot { width: 14px; height: 14px; border-radius: 7px; margin-top: 4px; flex: none; background: var(--hv2-dot-idle); }
.tw-phase:first-child .tw-phase-dot { background: var(--hv2-blue); }
@media (max-width: 700px) { .tw-images-grid { grid-template-columns: minmax(0, 1fr); } }
.te-add-results .te-person-text { flex: 1; min-width: 0; }

/* te-w3 (AD-T13): the venue block of the create wizard and the focus ring */
.tw-venue-map { margin-top: 4px; }
.tw-venue-map-frame { width: 100%; height: 200px; border: 1px solid var(--color-border); border-radius: var(--radius-md); display: block; }
.tw-focus-ring { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.tw-choice:has(input.tw-focus-ring) { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.tw-choice input.tw-focus-ring { outline: none; }


/* tournament-registration (tr-web): list-row lines (AD-7), registration dialog notes. Theme tokens only. */
.tr-list-row { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.tr-row-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; display: inline-flex; flex-direction: column; }
.tr-row-link:hover .tr-row-main { text-decoration: underline; }
.tr-row-link:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; border-radius: var(--radius-sm); }
.tr-row-main { color: var(--color-cta); font-weight: 600; }
.tr-row-sub { color: var(--color-text-muted); font-size: 0.85rem; }
.tr-row-more { color: var(--color-cta); font-weight: 600; }
.te-close { width: 34px; padding: 0; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.tw-fee-field { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.tw-fee-field input { flex: 1; min-width: 0; }
.tw-fee-symbol { color: var(--color-text-muted); font-weight: 600; }

/* ── teams-payments (AD-7, AD-9, AD-11): Payment card, payment switch, participants tiles. Theme tokens only. ── */
.pay-card { background: var(--hv2-surface); border: 1.5px solid var(--hv2-border); border-radius: 16px; padding: 16px; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.pay-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-card-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.pay-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.pay-chip-pending { background: var(--te-amber-tint); color: var(--te-amber); }
.pay-chip-paid { background: var(--te-ok-tint); color: var(--hv2-green-ink); }
.pay-box { background: var(--hv2-hover); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 8px 0; }
.pay-copy { align-self: stretch; min-height: 40px; }

.pay-switch { position: relative; display: inline-flex; align-items: center; width: 44px; height: 26px; flex: none; vertical-align: middle; }
.pay-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pay-switch-track { width: 44px; height: 26px; border-radius: 13px; background: var(--hv2-muted); position: relative; transition: background .15s ease; pointer-events: none; }
.pay-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--hv2-on-solid); transition: transform .15s ease; }
.pay-switch input:checked + .pay-switch-track { background: var(--hv2-green); }
.pay-switch input:checked + .pay-switch-track::after { transform: translateX(18px); }
.pay-switch input:focus-visible + .pay-switch-track { outline: 3px solid var(--hv2-blue); outline-offset: 2px; }
.pay-switch input:disabled { cursor: progress; }

.part-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.part-tile { background: var(--hv2-surface); border: 1.5px solid var(--hv2-border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.part-tile-label { font-size: 12px; color: var(--hv2-muted); }
.part-tile-num { font-size: 26px; font-weight: 800; color: var(--hv2-ink); }
.part-cash { color: var(--hv2-green-ink); }
.part-paying { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--hv2-surface); border: 1.5px solid var(--hv2-border); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.part-warn, .part-warn-inline { color: var(--te-amber); font-weight: 700; font-size: 13px; }
.part-err { color: var(--te-red-ink); font-size: 12px; display: block; }
.part-row-unpaid td { background: var(--te-amber-tint); }
.part-points { width: 96px; text-align: right; }
.part-team-icon { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--hv2-purple-tint); color: var(--hv2-purple-ink); flex: none; }
.part-name { font-weight: 800; color: var(--hv2-ink); }
.part-generate { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.part-detail { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.part-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.part-detail-actions { display: flex; justify-content: flex-end; }
.part-team-name { margin: 8px 0 2px 0; font-size: 18px; font-weight: 800; }
.part-roster { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.part-roster li { display: flex; align-items: center; gap: 10px; }
.um-extra { padding: 10px 12px; border-top: 1px solid var(--hv2-border); display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
@media (max-width: 720px) { .part-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Recurring games (tournament-edit-recurring AD-8): the Repeat weekly control and the series chip. Theme tokens only. */
.series-box { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); }
.series-toggle, .series-radio { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.series-toggle input, .series-radio input { width: auto; flex: none; }
.series-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.series-end { border: 0; padding: 0; margin: 8px 0; }
.series-end legend { font-weight: 700; margin-bottom: 4px; }
.series-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font-weight: 700; font-size: 0.75rem; }
.series-line { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; color: var(--color-text-muted); }
.series-scope { display: flex; flex-direction: column; gap: 10px; }
.series-note { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.45; margin: 0; }
