/* ==========================================================================
   RefSync UK — Design Tokens, Typography & Base Styles (Phase 3)
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* --------------------------------------------------------------------------
     1. Accent Colour System (Single Primary Brand Accent Token)
     -------------------------------------------------------------------------- */
  --color-accent: #c2410c;             /* #347: court orange at 5.2:1 on white (was #ea580c, 3.6:1) */
  --color-accent-hover: #9a3412;
  --color-accent-active: #7c2d12;
  --color-accent-contrast: #ffffff;
  --color-accent-subtle: rgba(194, 65, 12, 0.12);
  --color-accent-ring: rgba(194, 65, 12, 0.45);

  /* Legacy brand compatibility aliases */
  --brand-orange: var(--color-accent);
  --brand-orange-hover: var(--color-accent-hover);
  --court-accent: var(--color-accent);
  --accent: var(--color-accent);
  --primary: var(--color-accent);
  --accent-amber: var(--status-warning);
  --accent-green: var(--status-success);
  --accent-blue: #0284c7;
  --accent-purple: #7e22ce;

  /* --------------------------------------------------------------------------
     2. Spacing Scale (4px Base Modular Grid)
     -------------------------------------------------------------------------- */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* --------------------------------------------------------------------------
     3. Typography Scale (Fluid, Hierarchical & Balanced)
     -------------------------------------------------------------------------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --text-2xs: 0.6875rem; /* 11px */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */

  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* --------------------------------------------------------------------------
     4. Border Radii Scale
     -------------------------------------------------------------------------- */
  --radius-none: 0px;
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* --------------------------------------------------------------------------
     5. Shadows & Focus System (WCAG AA Focus Visible)
     -------------------------------------------------------------------------- */
  --focus-ring: 0 0 0 3px var(--color-accent-ring);
  --focus-outline: 2px solid var(--color-accent);
  --focus-offset: 2px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* --------------------------------------------------------------------------
     6. Light Theme Semantic Surfaces & Text (Daylight Court-Side)
     -------------------------------------------------------------------------- */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: var(--color-accent);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --status-critical: #dc2626;
  --status-critical-bg: rgba(220, 38, 38, 0.12);
  --status-danger: var(--status-critical); /* #338: used by the season report, was never defined */
  --status-warning: #b45309; /* #338: 5:1 on white (was 3.2:1) */
  --status-warning-bg: rgba(180, 83, 9, 0.12);
  --status-success: #15803d; /* #338: 5:1 on white, also white-on-green buttons (was 3.3:1) */
  --status-success-bg: rgba(21, 128, 61, 0.12);
}

/* --------------------------------------------------------------------------
   Dark Mode ("Arena Mode") — Activated via data-theme="dark" or system preference
   -------------------------------------------------------------------------- */
:root[data-theme="dark"],
html[data-theme="dark"] {
  color-scheme: dark;
  --color-accent: #f97316;
  --color-accent-hover: #fb923c;
  --color-accent-active: #fdba74;
  --color-accent-subtle: rgba(249, 115, 22, 0.18);
  --color-accent-ring: rgba(249, 115, 22, 0.55);

  --bg-app: #090d16;
  --bg-surface: #111827;
  --bg-elevated: #1f293d;
  --bg-hover: #29354d;
  --border-subtle: #28354e;
  --border-strong: #475569;
  --border-focus: var(--color-accent);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --status-critical: #f87171;
  --status-critical-bg: rgba(248, 113, 113, 0.18);
  --status-warning: #fbbf24;
  --status-warning-bg: rgba(251, 191, 36, 0.18);
  --status-success: #34d399;
  --status-success-bg: rgba(52, 211, 153, 0.18);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]),
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --color-accent: #f97316;
    --color-accent-hover: #fb923c;
    --color-accent-active: #fdba74;
    --color-accent-subtle: rgba(249, 115, 22, 0.18);
    --color-accent-ring: rgba(249, 115, 22, 0.55);

    --bg-app: #090d16;
    --bg-surface: #111827;
    --bg-elevated: #1f293d;
    --bg-hover: #29354d;
    --border-subtle: #28354e;
    --border-strong: #475569;
    --border-focus: var(--color-accent);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --status-critical: #f87171;
    --status-critical-bg: rgba(248, 113, 113, 0.18);
    --status-warning: #fbbf24;
    --status-warning-bg: rgba(251, 191, 36, 0.18);
    --status-success: #34d399;
    --status-success-bg: rgba(52, 211, 153, 0.18);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="light"],
html[data-theme="light"] {
  color-scheme: light;
  --color-accent: #c2410c;
  --color-accent-hover: #9a3412;
  --color-accent-active: #7c2d12;
  --color-accent-subtle: rgba(194, 65, 12, 0.12);
  --color-accent-ring: rgba(194, 65, 12, 0.45);

  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --status-critical: #dc2626;
  --status-critical-bg: rgba(220, 38, 38, 0.12);
  --status-warning: #b45309; /* #338: 5:1 on white (was 3.2:1) */
  --status-warning-bg: rgba(180, 83, 9, 0.12);
  --status-success: #15803d; /* #338: 5:1 on white, also white-on-green buttons (was 3.3:1) */
  --status-success-bg: rgba(21, 128, 61, 0.12);
}

/* --------------------------------------------------------------------------
   Global Accessibility & Focus Visible (WCAG 2.4.7 AA)
   -------------------------------------------------------------------------- */
*:focus-visible {
  outline: 2px solid var(--color-accent) !important;
  outline-offset: 2px !important;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: var(--space-4);
  background: var(--color-accent-solid);
  color: var(--color-accent-contrast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 10000;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: top 0.15s ease-out;
}
.skip-link:focus {
  top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Standardized SVG Icon Tokens
   -------------------------------------------------------------------------- */
.icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.15em;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  transition: stroke 0.15s ease, fill 0.15s ease;
}
.icon-sm { width: 0.9em; height: 0.9em; }
.icon-md { width: 1.15em; height: 1.15em; }
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2.25em; height: 2.25em; }

/* --------------------------------------------------------------------------
   Skeleton Loaders (Pulse & Shimmer Animation per Phase 3)
   -------------------------------------------------------------------------- */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-loading {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-hover) 37%,
    var(--bg-elevated) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-loading {
    animation: none;
    background: var(--bg-elevated);
  }
}

.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.skeleton-line {
  height: 0.95rem;
  border-radius: var(--radius-xs);
  width: 100%;
}
.skeleton-line.short { width: 35%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.heading { height: 1.35rem; width: 50%; }
.skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
}
.skeleton-btn {
  height: 2.25rem;
  width: 7.5rem;
  border-radius: var(--radius-sm);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.45;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p, blockquote, li, .subtext {
  text-wrap: pretty;
}

/* ==========================================================================
   Two-Tier Navigation: Topbar Workspaces, Subnav Strip & Compact RBAC Pill
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 0.65rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 35;
}

.workspace-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-app);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.workspace-pill {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.workspace-pill[hidden] {
  display: none !important;
}

.workspace-pill:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.workspace-pill.active {
  background: var(--color-accent-subtle);
  color: var(--text-primary);
  border-color: var(--color-accent);
}

.subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.auth-inline-pill {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.3rem;
}

.session-rbac-details {
  position: relative;
}

.session-rbac-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
  user-select: none;
}

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

.session-rbac-summary::after {
  content: "▾";
  font-size: 0.72rem;
  color: var(--text-muted);
}

.session-rbac-details[open] .session-rbac-summary::after {
  content: "▴";
}

.session-banner-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(560px, 92vw);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  z-index: 40;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Progressive Disclosure Form Drawers (<details class="form-drawer">) */
.form-drawer {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(11, 15, 23, 0.45);
  margin: 0.65rem 1.25rem;
  overflow: hidden;
}

.form-drawer-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(56, 189, 248, 0.06);
  transition: background 0.15s ease;
}

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

.form-drawer-summary::after {
  content: "Expand ▾";
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.form-drawer[open] .form-drawer-summary {
  border-bottom: 1px solid var(--border-subtle);
}

.form-drawer[open] .form-drawer-summary::after {
  content: "Collapse ▴";
}

.form-drawer:hover .form-drawer-summary {
  background: rgba(56, 189, 248, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  font-size: 1.75rem;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
}

.brand-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.68rem;
  background: var(--color-accent-solid);
  color: #fff;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.role-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-app);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.role-tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.tab-label-full {
  display: inline;
}

.role-tab[hidden] {
  display: none !important;
}

.role-tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.role-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
}

.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.assignor-dot { background: var(--color-accent-solid); }
.config-dot { background: #eab308; }
.official-dot { background: var(--accent-blue); }
.users-dot { background: var(--accent-purple); }
.rep-dot { background: var(--status-success); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-app);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.user-identity-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-app);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.session-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.select-session {
  font-weight: 600;
  border-color: transparent !important;
  background: var(--bg-elevated) !important;
}

/* RBAC Info Banner */
.session-banner {
  background: rgba(56, 189, 248, 0.07);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.55rem 1.5rem;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.35rem;
}
.role-pill-ADMIN_ASSIGNOR {
  background: rgba(249, 115, 22, 0.18);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.4);
}
.role-pill-OFFICIAL {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.role-pill-TEAM_REP {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   KPI Strip & Toolbar
   ========================================================================== */

.role-view {
  padding: 1.25rem 1.5rem;
  max-width: 1680px;
  margin: 0 auto;
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.kpi-card:hover {
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

.kpi-card.kpi-critical { border-left: 4px solid var(--status-critical); }
.kpi-card.kpi-warning { border-left: 4px solid var(--status-warning); }
.kpi-card.kpi-success { border-left: 4px solid var(--status-success); }
.kpi-card.kpi-info { border-left: 4px solid var(--accent-blue); }

.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* =========================================================================
   FIXTURE GRID FILTERS & UNIVERSAL SEARCH (TIER 1 & TIER 2)
   ========================================================================= */

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  margin-bottom: 1rem;
  background: var(--bg-surface);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.filter-tier-1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.filter-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  min-width: 240px;
}

.filter-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-search {
  width: 100%;
  padding-left: 2.25rem !important;
  padding-right: 2rem !important;
  height: 38px;
}

.btn-clear-search {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-clear-search:hover {
  color: var(--text-primary);
}

.date-preset-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.date-preset-pill {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.date-preset-pill:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.date-preset-pill.active {
  background: var(--color-accent-solid);
  color: #ffffff;
  border-color: var(--brand-orange);
  box-shadow: 0 1px 3px rgba(249, 115, 22, 0.3);
}

.filter-tier1-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.fixture-count-pill {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-toggle-advanced-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.75rem;
}

.btn-toggle-advanced-filters.has-active-filters {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.badge-filter-count {
  background: var(--color-accent-solid);
  color: #fff;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

/* Tier 2: Collapsible Drawer */
.filter-tier-2 {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-top: 0.25rem;
  width: 100%;
  animation: fadeInDown 0.2s ease-out;
}

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

.advanced-filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.filter-actions-item {
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.btn-clear-filters {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  height: 36px;
  white-space: nowrap;
}

.btn-clear-filters:hover {
  color: #ef4444;
}

/* Active Filter Chips Strip */
.active-filter-chips-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: rgba(249, 115, 22, 0.05);
  border: 1px dashed rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-sm);
  width: 100%;
}

.chips-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-orange);
  text-transform: uppercase;
}

.chips-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
}

.filter-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.filter-chip-remove:hover {
  color: #ef4444;
}

.btn-clear-chips-inline {
  background: transparent;
  border: none;
  color: var(--brand-orange);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  margin-left: auto;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 1;
}

.input, .select, textarea {
  background: var(--bg-app);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.input:focus, .select:focus, textarea:focus {
  outline: 2px solid var(--brand-orange);
  border-color: transparent;
}

.input:user-invalid, .select:user-invalid, textarea:user-invalid {
  border-color: var(--status-critical);
}

.error-msg {
  display: none;
  color: var(--status-critical);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.select:user-invalid + .error-msg,
.input:user-invalid + .error-msg {
  display: block;
}

#filter-search {
  min-width: 260px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.52rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

.btn-sm {
  padding: 0.32rem 0.65rem;
  font-size: 0.76rem;
}

.btn-primary {
  background: var(--color-accent-solid);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent-solid-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-success {
  background: var(--status-success);
  color: #fff;
}
.btn-success:hover {
  filter: brightness(0.92);
}

.btn-danger {
  background: var(--status-critical-solid);
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(0.92);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* ==========================================================================
   Workbench Split Pane: Fixture Grid + Suggestion Drawer
   ========================================================================== */

.workbench-split {
  display: grid;
  grid-template-columns: 1fr minmax(380px, 420px);
  gap: 1rem;
  align-items: start;
  transition: grid-template-columns 0.2s ease;
}

.workbench-split.drawer-collapsed {
  grid-template-columns: 1fr;
}

.workbench-split.drawer-collapsed #suggestion-drawer {
  display: none !important;
}

#suggestion-drawer {
  width: 100%;
  max-width: 420px;
  min-width: 380px;
}

@media (max-width: 1200px) {
  .workbench-split {
    grid-template-columns: 1fr;
  }
  #suggestion-drawer {
    max-width: 100%;
    min-width: 0;
  }
}

.grid-panel, .drawer-panel, .card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.table-container,
.workbench-split > *,
.portal-grid > * {
  min-width: 0;
  max-width: 100%;
}

.panel-header, .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.015);
}

.panel-header h2, .card-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

.subtext {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.table-container {
  overflow-x: auto;
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.games-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.games-table th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-app);
}

.games-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.game-row {
  transition: background 0.12s ease;
}
.game-row:hover {
  background: rgba(255, 255, 255, 0.02);
}
.game-row.row-selected {
  background: rgba(249, 115, 22, 0.08) !important;
}
.game-row.row-selected td:first-child {
  border-left: 4px solid #f97316 !important;
}

/* Row Urgency Left Borders */
.game-row.health-CRITICAL_UNASSIGNED td:first-child {
  border-left: 4px solid var(--status-critical);
}
.game-row.health-DECLINED_REPLACEMENT_NEEDED td:first-child {
  border-left: 4px solid #f43f5e;
}
.game-row.health-PARTIALLY_ASSIGNED td:first-child {
  border-left: 4px solid var(--status-warning);
}
.game-row.health-PENDING_CONFIRMATION td:first-child {
  border-left: 4px solid var(--accent-blue);
}
.game-row.health-FULLY_CONFIRMED td:first-child {
  border-left: 4px solid var(--status-success);
}

/* Status Badges */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-CRITICAL_UNASSIGNED {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulseBorder 2s infinite;
}

.badge-DECLINED_REPLACEMENT_NEEDED {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px dashed var(--status-critical);
}

.badge-PARTIALLY_ASSIGNED {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-PENDING_CONFIRMATION {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-FULLY_CONFIRMED {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

.cert-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-blue);
}

/* ==========================================================================
   FIBA Crew Position Slots (Interactive & Droppable)
   ========================================================================== */

.crew-slots-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.slot-chip {
  min-width: 158px;
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-app);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: all 0.14s ease;
  position: relative;
}

.slot-chip:hover {
  border-color: var(--brand-orange);
}

.slot-chip.slot-focused {
  outline: 2px solid var(--brand-orange);
  background: rgba(249, 115, 22, 0.12);
}

.slot-chip.drag-over {
  outline: 2px dashed var(--status-success);
  background: rgba(16, 185, 129, 0.15);
}

.slot-chip.state-OPEN {
  border-style: dashed;
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.slot-chip.state-ACCEPTED {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.slot-chip.state-PENDING {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.slot-chip.state-DECLINED {
  border-style: dashed;
  border-color: var(--status-critical);
  background: rgba(239, 68, 68, 0.12);
}

.slot-chip.category-TABLE_OFFICIAL {
  border-left: 3px solid var(--accent-purple);
}

.slot-chip.category-FLOOR_REFEREE {
  border-left: 3px solid var(--brand-orange);
}

.slot-cat-badge {
  font-size: 0.62rem;
  padding: 0.05rem 0.32rem;
  border-radius: 3px;
  font-weight: 700;
}
.slot-cat-FLOOR_REFEREE {
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
}
.slot-cat-TABLE_OFFICIAL {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}
.slot-cat-COMMISSIONER {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

.positions-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.45rem;
  background: var(--bg-app);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--bg-app);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.slot-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.slot-name {
  font-weight: 700;
  font-size: 0.81rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.slot-chip.state-OPEN .slot-name {
  color: var(--brand-orange);
}

.slot-chip.state-DECLINED .slot-name {
  color: var(--status-critical);
  text-decoration: line-through;
}

.slot-decline-note {
  font-size: 0.69rem;
  color: var(--status-critical);
  text-decoration: none;
}

.btn-unassign {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 0.2rem;
}
.btn-unassign:hover {
  color: var(--status-critical);
}

/* ==========================================================================
   Right Suggestion Drawer
   ========================================================================== */

.drawer-panel {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
}

.drawer-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand-orange);
  letter-spacing: 0.05em;
}

.drawer-header h3 {
  font-size: 0.98rem;
  margin-top: 0.1rem;
}

.drawer-game-meta {
  padding: 0.75rem 1.1rem;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.drawer-controls {
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  background: var(--bg-elevated);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.role-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-app);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.candidates-list {
  padding: 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.candidate-card {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  cursor: grab;
  transition: border-color 0.14s ease, transform 0.12s ease;
}

/* P1-2: Truncated 3-Line Compact Candidate Card */
.candidate-card.candidate-card-compact {
  padding: 0.45rem 0.65rem;
  gap: 0.2rem;
}

.candidate-card.candidate-card-compact .btn-quick-appoint {
  font-size: 0.74rem;
  padding: 0.2rem 0.5rem;
  font-weight: 600;
  width: 100%;
}

.candidate-card:hover {
  border-color: var(--text-secondary);
}

.candidate-card.eligible {
  border-left: 4px solid var(--status-success);
}

.candidate-card.conflicted {
  border-left: 4px solid var(--status-critical);
  opacity: 0.88;
}

.candidate-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.candidate-name {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.score-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.score-pill.score-zero {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border-color: rgba(239, 68, 68, 0.35);
}

.candidate-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.14rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.tag-bonus {
  background: rgba(56, 189, 248, 0.13);
  color: var(--accent-blue);
}
.tag-assignor {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.violation-code {
  font-weight: 800;
  font-size: 0.68rem;
  color: #f87171;
}

.candidate-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Official, User Mgmt & Club Secretary Portals
   ========================================================================== */

.portal-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.portal-profile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  width: 100%;
}

.persona-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.select-lg {
  font-size: 0.95rem;
  padding: 0.55rem 0.9rem;
  min-width: 280px;
}

.profile-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
  align-items: start;
}

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

.portal-side-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stack-item {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.avail-form, .game-form {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-field label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.inline-role-checks {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   Native <dialog> Modals & Toasts
   ========================================================================== */

.modal {
  margin: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  max-width: 520px;
  width: 92%;
  padding: 0;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.65);
  overscroll-behavior: contain;
}

.modal.modal-lg {
  max-width: 720px;
}

.modal.modal-xl {
  max-width: 960px;
  width: 95%;
}

.modal:modal {
  overscroll-behavior: contain;
}

.modal::backdrop {
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(3px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-box {
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-danger {
  background: var(--status-critical-bg);
  color: var(--status-critical);
}

.btn-close {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.btn-close:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

.modal-body {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-size: 0.88rem;
}

/* The body scrolls when its content is taller than the screen. Its children must never shrink to fit,
   or cards (which clip their overflow) are squashed to slivers on a phone (#124). */
.modal-body > * {
  flex-shrink: 0;
}

.violation-modal-list {
  margin-left: 1.1rem;
  color: var(--status-critical);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-orange);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  max-width: 390px;
}
.toast.toast-success { border-left-color: var(--status-success); }
.toast.toast-error { border-left-color: var(--status-critical); }
.toast.toast-with-undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-left-color: var(--brand-orange);
  min-width: 290px;
}
.btn-undo-toast {
  background: var(--color-accent-solid);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-undo-toast:hover,
.btn-undo-toast:focus {
  background: #c2410c;
  outline: 2px solid #fdba74;
}

/* ==========================================================================
   Help Tooltips & Role Duty Explanations (P1-4: Plain English & Jargon Free)
   ========================================================================== */

.help-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-elevated, #e2e8f0);
  color: var(--text-secondary, #64748b);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  margin-left: 0.25rem;
  vertical-align: middle;
  border: 1px solid var(--border-subtle, #cbd5e1);
  text-decoration: none;
}
.help-tooltip-icon:hover,
.help-tooltip-icon:focus-visible {
  background: var(--color-accent-solid);
  color: #ffffff;
  outline: 2px solid #fdba74;
}

.drawer-role-duty-card {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-left: 3px solid var(--brand-orange, #ea580c);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.76rem;
  color: var(--text-secondary, #475569);
  line-height: 1.4;
}

/* ==========================================================================
   Candidate Inspector Travel Radius Badges (P1-5: Show the Limit)
   ========================================================================== */

.badge-travel-limit {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.08rem 0.35rem;
  border-radius: var(--radius-sm, 4px);
  line-height: 1.3;
}
.badge-travel-over {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid #f59e0b;
}
.badge-travel-league {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border: 1px solid #ef4444;
}
.travel-dist-within {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

/* ==========================================================================
   WCAG AA Contrast & Readability Rules (P1-6)
   - Minimum font size 12px (0.75rem) across all text, table subtext, and tags
   - Clear focus rings on every table row interactive element
   - Secondary text contrast >= 4.5:1
   ========================================================================== */

small, .subtext, .tag, .badge, .cert-pill, .role-badge, .fixture-comp-subtext,
.venue-full-hint, .day-count-badge, .candidate-card-line-2 {
  font-size: max(12px, 0.75rem);
}

.games-table th, .games-table td {
  font-size: max(12px, 0.78rem);
}

.btn-unassign:focus-visible,
.btn-clash-warning:focus-visible,
.btn-row-menu-trigger:focus-visible,
.btn-grid-appoint:focus-visible,
.btn-grid-edit:focus-visible,
.btn-toggle-expand:focus-visible,
.btn-chase:focus-visible,
.btn-emergency-bcast:focus-visible {
  outline: 2px solid var(--brand-orange, #ea580c) !important;
  outline-offset: 2px !important;
}

.game-row:focus-visible {
  outline: 2px solid var(--brand-orange, #ea580c) !important;
  outline-offset: -2px !important;
}

.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ==========================================================================
   Google & Apple OAuth 2.0 / OpenID Connect SSO Buttons & Chooser
   ========================================================================== */

.oauth-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn-oauth:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.btn-oauth-google {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.btn-oauth-passkey {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #38bdf8;
}

.btn-oauth-passkey:hover {
  background: #1e293b;
  border-color: #7dd3fc;
}

.oauth-icon {
  flex-shrink: 0;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.35rem 0;
}

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

.oauth-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.oauth-account-item:hover {
  border-color: var(--accent-blue);
  background: var(--bg-hover);
}

/* ==========================================================================
   Wave 3: Workbench Display Modes, Visual Court Timeline, Workload Fairness,
   DBS Safeguarding Badges, 7-Day Availability Calendar & Printable Match Sheet
   ========================================================================== */

.workbench-mode-pills {
  display: inline-flex;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.2rem;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.mode-pill {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.36rem 0.72rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-pill:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.mode-pill.active {
  background: var(--color-accent-solid);
  color: #ffffff;
}

.court-timeline-wrap,
.workload-analytics-wrap {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.venue-timeline-card {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.court-lane {
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 0.85rem;
  align-items: start;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border-subtle);
}

.court-lane-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.timeline-game-block {
  flex: 1 1 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline-game-block.double-header-highlight {
  border-left-color: var(--brand-orange);
}

.dbs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.48rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 800;
}

.dbs-badge.dbs-verified {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.dbs-badge.dbs-expired {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.workload-bar-track {
  width: 100%;
  max-width: 150px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #f97316);
}

/* =========================================================================
   MODERN MONTH-BY-MONTH AVAILABILITY & SCHEDULING CALENDAR
   ========================================================================= */

.travel-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.travel-profile-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.travel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.73rem;
  padding: 0.22rem 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-main);
}

.travel-chip strong {
  color: var(--court-accent);
}

.avail-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.month-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-title {
  margin: 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  min-width: 140px;
  text-align: center;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-available {
  background: #10b981;
}

.legend-partial {
  background: #f59e0b;
}

.legend-unavailable {
  background: #ef4444;
}

.legend-fixture {
  background: var(--court-accent);
}

/* Full Month Calendar Grid (7 columns: Mon–Sun) */
.avail-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.avail-month-weekday {
  background: var(--bg-elevated);
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.avail-month-weekday.weekday-weekend {
  color: var(--court-accent);
}

.avail-month-day {
  background: var(--bg-app);
  min-height: 105px;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.avail-month-day:hover,
.avail-month-day:focus-visible {
  background: var(--bg-hover);
  outline: none;
}

.avail-month-day.day-other-month {
  background: var(--bg-elevated);
  opacity: 0.45;
}

.avail-month-day.day-today {
  box-shadow: inset 0 0 0 2px var(--court-accent);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.day-number {
  color: var(--text-main);
}

.day-badge-today {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.08rem 0.3rem;
  background: var(--court-accent);
  color: #ffffff;
  border-radius: 3px;
}

.day-add-affordance {
  opacity: 0;
  color: var(--court-accent);
  font-size: 0.85rem;
  font-weight: bold;
  transition: opacity 0.15s ease;
}

.avail-month-day:hover .day-add-affordance {
  opacity: 1;
}

/* Day Badges / Chips */
.avail-chip {
  font-size: 0.68rem;
  padding: 0.22rem 0.38rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avail-chip-full-avail {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.avail-chip-partial-avail {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.avail-chip-unavail {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.avail-chip-fixture {
  background: rgba(249, 115, 22, 0.16);
  color: var(--court-accent);
  border: 1px solid rgba(249, 115, 22, 0.4);
  font-weight: 700;
}

.avail-chip-travel-subtext {
  font-size: 0.6rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: -0.1rem;
}

.btn-chip-del {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  opacity: 0.7;
}

.btn-chip-del:hover {
  opacity: 1;
}

/* Dialog: Availability Entry Modes & Presets */
.avail-dialog-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.avail-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -2px;
  transition: all 0.15s ease;
}

.avail-tab-btn.active {
  color: var(--court-accent);
  border-bottom-color: var(--court-accent);
}

.quick-preset-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0;
}

.quick-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-preset {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-preset:hover,
.chip-preset:focus-visible {
  border-color: var(--court-accent);
  color: var(--court-accent);
}

.chip-preset.active {
  background: var(--court-accent);
  border-color: var(--court-accent);
  color: #ffffff;
}

.chip-preset.chip-preset-danger:hover {
  border-color: var(--status-critical);
  color: var(--status-critical);
}

.chip-preset.chip-preset-danger.active {
  background: var(--status-critical-solid);
  border-color: var(--status-critical-solid);
  color: #ffffff;
}

.travel-constraints-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-top: 0.85rem;
  background: var(--bg-card);
}

.travel-constraints-fieldset legend {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--court-accent);
  padding: 0 0.4rem;
}

/* Printable Match Officiating Crew Sheet */
.match-sheet-card {
  background: var(--bg-app);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.match-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--brand-orange);
  padding-bottom: 0.75rem;
}

.match-sheet-sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.match-sheet-sign-box {
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  min-height: 68px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   RefSync UK Login Gate & Security Shield
   ========================================================================== */

.login-gate-card {
  max-width: 620px;
  margin: 2.5rem auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.login-gate-header {
  padding: 1.85rem 1.75rem 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.09) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.login-logo {
  width: 58px;
  height: 58px;
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
}

.login-gate-title {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.login-gate-security-notice {
  margin-top: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.76rem;
  text-align: left;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--text-secondary);
}

.security-lock-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.login-gate-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.login-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}

.demo-personas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.btn-demo-persona {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap input {
  padding-right: 2.5rem !important;
  width: 100%;
}

.btn-pwd-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-pwd-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-pwd-toggle:focus-visible {
  outline: 2px solid var(--brand-orange);
}

.login-gate-help-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  align-items: center;
}

.login-gate-help-links button {
  font-size: 0.85rem;
  color: var(--brand-orange);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  text-decoration: underline;
}

.login-gate-footer {
  margin-top: 1rem;
  padding-top: 0.85rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.login-gate-footer a,
.login-gate-footer button {
  color: var(--text-secondary);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.78rem;
}

.login-gate-footer a:hover,
.login-gate-footer button:hover {
  color: var(--text-primary);
}

.field-error {
  font-size: 0.78rem;
  color: #ef4444;
  margin-top: 0.25rem;
  font-weight: 500;
}

.btn-demo-persona:hover {
  background: var(--bg-elevated);
  border-color: var(--brand-orange);
  transform: translateY(-1px);
}

.persona-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

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

.persona-info strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(249, 115, 22, 0.18);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.4);
  flex-shrink: 0;
}

/* ==========================================================================
   iPhone, iPad & Mobile Court-Side Responsive System
   ========================================================================== */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.select-session {
  max-width: 240px;
  text-overflow: ellipsis;
}

/* Coarse-pointer (iPhone / Android touch) target sizing per WCAG 2.5.8 & Mobile PageSpeed */
@media (pointer: coarse) {
  .btn,
  .workspace-pill,
  .role-tab,
  .mode-pill,
  .slot-chip,
  .session-rbac-summary {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
  .btn-unassign,
  .btn-chip-del,
  .btn-expand-row,
  .btn-close {
    min-block-size: 44px;
    min-inline-size: 44px;
    display: inline-grid;
    place-items: center;
    margin-left: 0.25rem;
  }
}

/* Tablet & Small Laptop (<= 1100px) */
@media (max-width: 1100px) {
  .workbench-split {
    grid-template-columns: 1fr;
  }
  .drawer-panel {
    position: static;
    max-height: none;
  }
  .court-lane {
    grid-template-columns: 1fr;
  }
}

/* iPhone & Mobile Phones (<= 980px) */
@media (max-width: 980px) {
  .demo-personas-grid {
    grid-template-columns: 1fr;
  }
  .login-gate-card {
    margin: 1rem auto;
    border-radius: var(--radius-md);
  }
  .login-gate-header,
  .login-gate-body {
    padding: 1.15rem 1rem;
  }

  /* 1. Compact multi-row header on mobile so content starts higher on screen (#222) */
  .topbar {
    position: relative;
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
    z-index: 35;
  }

  .brand {
    width: 100%;
    justify-content: space-between;
  }

  .brand-subtitle {
    display: none;
  }

  /* 3-Pillar Workspace Switcher spans full width on its own row */
  .workspace-pills {
    order: 3;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.25rem;
  }

  .workspace-pill {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.76rem;
    line-height: 1.2;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }

  /* Topbar actions wrap cleanly on iPhone */
  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem;
  }

  .session-switcher {
    flex: 1 1 100%;
    width: 100%;
    justify-content: space-between;
  }

  .select-session {
    max-width: 100%;
    flex: 1;
    min-width: 0;
  }

  #filter-search {
    min-width: 0;
    width: 100%;
  }

  /* Subnav bar: wrap view tabs cleanly without truncating labels (#222) */
  .subnav-bar {
    position: relative;
    z-index: 30;
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
    background: var(--bg-elevated);
  }

  .session-rbac-details {
    display: none;
  }

  .role-tabs {
    width: 100%;
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .role-tabs::-webkit-scrollbar {
    display: none;
  }

  .role-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.76rem;
    padding: 0.4rem 0.6rem;
    position: relative;
  }

  .avail-chip,
  .avail-chip-fixture {
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
  }

  .tab-label-full {
    display: none !important;
  }

  .tab-label-short {
    display: inline !important;
  }

  .role-tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 8px;
    right: 8px;
    height: 3px;
    background: var(--court-accent);
    border-radius: var(--radius-full);
  }

  .session-rbac-details {
    width: 100%;
  }

  .session-rbac-summary {
    width: 100%;
    justify-content: space-between;
  }

  .session-banner-popover {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: auto;
    width: auto;
    max-height: 75dvh;
    overflow-y: auto;
  }

  /* 2. View padding, KPI cards (2-column grid on iPhone) & Toolbars */
  .role-view {
    padding: 0.75rem;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }

  .kpi-card {
    padding: 0.65rem 0.75rem;
  }

  .kpi-value {
    font-size: 1.3rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.7rem;
    gap: 0.6rem;
  }

  .filter-group {
    flex-direction: column;
    width: 100%;
  }

  #filter-search,
  .filter-group .select,
  .select-lg {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Prevent iOS Safari auto-zoom on input focus by setting 16px (1rem) font-size */
  .input,
  .select,
  textarea {
    font-size: 16px;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }

  .toolbar-actions .btn {
    width: 100%;
    font-size: 0.76rem;
    padding: 0.5rem 0.45rem;
  }

  /* 3. Panel & Card Headers */
  .panel-header,
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
  }

  .workbench-mode-pills {
    width: 100%;
    display: flex;
  }

  .mode-pill {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.72rem;
    padding: 0.42rem 0.4rem;
  }

  /* 4. Transform Wide Data Tables into Native Stacked Cards on iPhone */
  .table-container {
    overflow-x: visible;
    padding: 0.55rem;
  }

  .games-table,
  .games-table tbody {
    display: block;
    width: 100%;
  }

  /* Keep <thead> in accessibility tree while hiding visually on mobile cards */
  .games-table thead {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    white-space: nowrap !important;
  }

  .games-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .games-table tbody td {
    display: block;
    width: 100%;
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.16);
  }

  .games-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .games-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
  }

  .game-row td:first-child {
    border-left: none !important;
  }

  .game-row.health-CRITICAL_UNASSIGNED { border-left: 4px solid var(--status-critical); }
  .game-row.health-DECLINED_REPLACEMENT_NEEDED { border-left: 4px solid #f43f5e; }
  .game-row.health-PARTIALLY_ASSIGNED { border-left: 4px solid var(--status-warning); }
  .game-row.health-PENDING_CONFIRMATION { border-left: 4px solid var(--accent-blue); }
  .game-row.health-FULLY_CONFIRMED { border-left: 4px solid var(--status-success); }

  /* Crew slot chips stack cleanly in a 2-column or full-width grid inside mobile card */
  .crew-slots-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 0.45rem;
    width: 100%;
  }

  .slot-chip {
    min-width: 0;
    width: 100%;
  }

  /* 5. Stack Items, Official Portal, 7-Day Calendar & Modals */
  .portal-header-card {
    padding: 0.85rem;
    flex-direction: column;
    align-items: stretch;
  }

  .persona-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .stack-list {
    padding: 0.7rem;
  }

  .stack-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .form-drawer {
    margin: 0.55rem 0.7rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .avail-month-day {
    min-height: 82px;
    padding: 0.3rem;
  }

  .avail-chip {
    font-size: 0.62rem;
    padding: 0.15rem 0.25rem;
  }

  .avail-month-weekday {
    font-size: 0.65rem;
    padding: 0.35rem 0.1rem;
  }

  .travel-profile-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .avail-month-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .month-nav-controls {
    justify-content: space-between;
    width: 100%;
  }

  .modal,
  .modal-lg {
    width: 95vw;
    max-width: 95vw;
    max-height: 90dvh;
    overflow-y: auto;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 0.85rem;
  }

  .oauth-btn-group {
    grid-template-columns: 1fr;
  }

  .match-sheet-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .toast {
    max-width: 100%;
  }
}

/* Compact iPhone SE / Mini (<= 400px) */
@media (max-width: 400px) {
  .kpi-strip,
  .toolbar-actions,
  .crew-slots-wrap {
    grid-template-columns: 1fr;
  }

  .avail-month-day {
    min-height: 64px;
    padding: 0.2rem;
  }

  .day-header {
    font-size: 0.68rem;
  }
}

@media print {
  .topbar,
  .subnav-bar,
  .role-view,
  .modal-header .btn-close,
  .modal-footer,
  .no-print {
    display: none !important;
  }
  dialog#dialog-match-sheet,
  dialog#dialog-expense-sheet {
    position: static !important;
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }
  .be-print-page {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .be-official-doc-table th,
  .be-official-doc-table td {
    border-color: #000000 !important;
  }
}

/* ==========================================================================
   Match Officials’ Expense Form (Submission & Printable)
   ========================================================================== */

.be-expense-card {
  border-top: 4px solid #d9534f;
}

.be-form-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}

.be-form-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
}

.be-appointed-as-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.be-radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.be-radio-pill:has(input:checked) {
  background: var(--color-accent-solid);
  color: #fff;
  border-color: var(--primary);
}

.be-cost-table {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.be-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.be-cost-col-desc {
  flex: 2;
}

.be-cost-col-miles {
  flex: 1;
}

.be-cost-col-amt {
  flex: 1;
  text-align: right;
  font-weight: 700;
}

.be-cost-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
}

/* Printable Official Document Replica Styles */
.be-print-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111111;
  background: #ffffff;
  padding: 1.25rem;
  max-width: 820px;
  margin: 0 auto;
}

.be-print-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000000;
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
}

.be-print-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  color: #000000;
}

.be-official-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: #000000;
}

.be-official-doc-table th,
.be-official-doc-table td {
  border: 1px solid #333333;
  padding: 0.4rem 0.55rem;
  vertical-align: middle;
}

.be-official-doc-table th.section-banner {
  background: #ebebeb;
  font-weight: 800;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.be-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: #222222;
}

.be-val {
  font-weight: 600;
}

.be-role-badge-active {
  display: inline-block;
  border: 2px solid #d9534f;
  color: #d9534f;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(217, 83, 79, 0.08);
}

.be-role-inactive {
  color: #888888;
  padding: 0.1rem 0.35rem;
}

.be-bacs-digit-boxes {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.be-bacs-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 22px;
  border: 1px solid #444444;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.82rem;
  background: #fafafa;
  color: #000000;
}

.be-cert-box {
  background: #fdfdfd;
  font-size: 0.78rem;
  line-height: 1.4;
  border: 1px solid #333333;
  padding: 0.6rem 0.75rem;
}

/* ==========================================================================
   Leaflet Interactive Venue Maps & Navigation
   ========================================================================== */

.btn-xs {
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  line-height: 1.2;
  border-radius: var(--radius-sm, 4px);
}

#venue-leaflet-map {
  width: 100%;
  height: 380px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #0f172a;
}

.leaflet-popup-content-wrapper {
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-family: inherit;
}

.leaflet-popup-tip {
  background: #ffffff;
}

.venue-map-details-card {
  background: var(--bg-surface-elevated, var(--bg-surface));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem;
}

/* ==========================================================================
   Mobile Bottom Navigation Bar (PWA Experience)
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: 70px;
  }
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
  min-width: 58px;
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
  color: var(--brand-orange);
}

.mobile-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 2px;
}

/* Availability Heatmap Table Styling */
.heatmap-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 72vh;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  position: relative;
}

.heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
  font-size: 0.85rem;
}

.heatmap-table th,
.heatmap-table td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  text-align: center;
  white-space: nowrap;
}

/* Sticky Header Rows */
.heatmap-table thead tr:first-child th {
  position: sticky;
  top: 0;
  background: var(--bg-surface-elevated, var(--bg-surface));
  z-index: 3;
  border-bottom: 2px solid var(--border-subtle);
}

.heatmap-table thead tr:nth-child(2) th {
  position: sticky;
  top: 36px;
  background: var(--bg-surface-elevated, var(--bg-surface));
  z-index: 3;
  border-bottom: 2px solid var(--border-subtle);
}

/* Sticky Left Column: Official & Grades */
.heatmap-table th:first-child,
.heatmap-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg-surface-elevated, var(--bg-surface));
  z-index: 2;
  min-width: 210px;
  max-width: 250px;
  box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.2);
}

/* Sticky Right Column: Period Totals */
.heatmap-table th:last-child,
.heatmap-table td:last-child {
  position: sticky;
  right: 0;
  background: var(--bg-surface-elevated, var(--bg-surface));
  z-index: 2;
  min-width: 140px;
  box-shadow: -3px 0 6px -2px rgba(0, 0, 0, 0.2);
}

/* Corner Header Intersections (Highest Z-Index) */
.heatmap-table thead tr:first-child th:first-child,
.heatmap-table thead tr:nth-child(2) th:first-child {
  z-index: 5;
}

.heatmap-table thead tr:first-child th:last-child,
.heatmap-table thead tr:nth-child(2) th:last-child {
  z-index: 5;
}

/* Weekend Column Styling */
.heatmap-weekend-cell {
  background: rgba(255, 255, 255, 0.025);
}

/* Matchday Header Badge */
.heatmap-matchday-tag {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.15);
  color: var(--brand-orange, #ea580c);
  border: 1px solid rgba(249, 115, 22, 0.3);
  margin-top: 2px;
}

.heatmap-unfilled-tag {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  margin-top: 2px;
}

/* Compact Density Mode */
.heatmap-table.compact-density th,
.heatmap-table.compact-density td {
  padding: 0.35rem 0.45rem;
  font-size: 0.76rem;
}

.heatmap-table.compact-density .heatmap-pill {
  padding: 0.18rem 0.35rem;
  font-size: 0.7rem;
}

/* Period Presets Buttons */
.btn-period-preset {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.btn-period-preset:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.btn-period-preset.active {
  background: var(--color-accent-solid);
  border-color: var(--brand-orange, #ea580c);
  color: #ffffff;
  font-weight: 700;
}

/* Interactive Pill Styling */
.heatmap-pill {
  display: inline-block;
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.heatmap-pill:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.heatmap-pill-ASSIGNED {
  background: rgba(249, 115, 22, 0.15);
  color: var(--brand-orange, #f97316);
  border: 1px solid var(--brand-orange, #f97316);
}

.heatmap-pill-AVAILABLE {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid #22c55e;
}

.heatmap-pill-UNAVAILABLE {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid #ef4444;
}

.heatmap-pill-OPEN {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px dashed var(--border-subtle);
}

.heatmap-summary-badge {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  margin: 1px 2px;
}

.badge-tot-assigned {
  background: rgba(249, 115, 22, 0.15);
  color: var(--brand-orange, #f97316);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-tot-avail {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-tot-blocked {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   RefSync UK — User & Role Management Directory (Clean & Uncluttered)
   ========================================================================== */

.user-mgmt-container {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.user-mgmt-header-card {
  padding: 1.25rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  background: var(--bg-surface);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.stat-pill-value {
  color: var(--text-primary);
  font-size: 0.88rem;
}

.user-mgmt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.user-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.user-search-wrap .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.85rem;
  opacity: 0.65;
}

.user-search-input {
  width: 100%;
  padding-left: 2.25rem !important;
}

.user-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.user-filter-btn {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-filter-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.user-filter-btn.active {
  background: var(--color-accent-solid);
  color: #fff;
  border-color: var(--primary);
}

/* User Directory Table Elements */
.user-directory-table td {
  padding: 0.85rem 0.95rem;
  vertical-align: middle;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-circle, .cc-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-app); border: 1px solid var(--border-subtle);
  color: var(--color-accent-solid); font-weight: 700; font-size: 0.78rem;
}
.cc-avatar-sm { width: 26px; height: 26px; font-size: 0.68rem; }
.cc-avatar-lg { width: 72px; height: 72px; font-size: 1.35rem; }
.cc-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.glass-avatar { overflow: hidden; }
.profile-avatar-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.8rem 1rem; margin: 0.5rem 0 0.85rem;
  border-radius: var(--radius-md); background: var(--bg-app); border: 1px solid var(--border-subtle);
}
.profile-avatar-controls { flex: 1; min-width: 200px; display: flex; flex-direction: column; }

.user-info-stack {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-info-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-meta-line {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.role-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Edit Modal Card Options */
.role-selection-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.role-selection-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.role-selection-card:hover {
  border-color: var(--primary);
}

.role-selection-card input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
}

.role-selection-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.role-selection-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ==========================================================================
   RefSync UK Application Footer & Changelog Modal
   ========================================================================== */

.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 1.5rem 1.75rem;
  margin-top: 3.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.footer-container {
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-subtext {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.footer-description {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0;
}

.footer-links-group h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin: 0 0 0.85rem 0;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-links-list a,
.footer-btn-link {
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s ease;
}

.footer-links-list a:hover,
.footer-btn-link:hover {
  color: var(--primary);
}

.footer-static-note,
.footer-link-text {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.footer-bottom-bar {
  max-width: 1680px;
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}

.btn-version-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-version-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(249, 115, 22, 0.08);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Changelog Timeline & Modal Styles */
.changelog-modal-box {
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.changelog-card {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: border-color 0.15s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.changelog-card:hover {
  border-color: var(--primary);
}

.changelog-card.current-release {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.3);
}

#changelog-archive-container,
#changelog-archive-container > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.changelog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.changelog-version-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.changelog-version-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.changelog-release-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.changelog-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.changelog-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-feature {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.badge-compliance {
  background: rgba(2, 132, 199, 0.14);
  color: var(--accent-blue);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.badge-finance {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-mobile {
  background: rgba(126, 34, 206, 0.14);
  color: var(--accent-purple);
  border: 1px solid rgba(126, 34, 206, 0.3);
}

.badge-latest {
  background: var(--color-accent-solid);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-fix {
  background: var(--status-critical-bg, rgba(220, 38, 38, 0.12));
  color: var(--status-critical);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge-improvement {
  background: rgba(2, 132, 199, 0.14);
  color: var(--accent-blue);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.changelog-list {
  margin: 0.5rem 0 0 1.15rem;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
  min-width: 0;
  max-width: 100%;
}

.changelog-list li {
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.changelog-list li strong {
  color: var(--text-primary);
}

.changelog-list code {
  font-size: 0.8em;
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 768px) {
  .app-footer {
    padding-bottom: 5.5rem; /* prevent overlap with mobile bottom navigation */
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* ========================================================================= */
/* COMPACT ASSIGNOR GRID & CREW PILLS (FEEDBACK SECTION 2 & 5)               */
/* ========================================================================= */

.compact-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.compact-table th {
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-muted);
}

.compact-table td {
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.compact-table td.cell-date-tipoff {
  min-width: 115px;
  width: 120px;
  white-space: nowrap;
}

/* P1-1: Sticky Day Group Headers */
.day-group-header-row {
  position: sticky;
  top: 36px;
  z-index: 3;
  background: var(--bg-surface, #ffffff);
}

[data-theme="dark"] .day-group-header-row {
  background: var(--bg-surface, #1e293b);
}

.day-group-header-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(249, 115, 22, 0.08);
}

.day-count-badge {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-left: auto;
}

[data-theme="dark"] .day-count-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* P1-1: Level / Age-Group Coloured Badges */
.pill-age-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill-age-badge.age-senior {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.pill-age-badge.age-u18 {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-age-badge.age-u16 {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.pill-age-badge.age-u14 {
  background: rgba(168, 85, 247, 0.15);
  color: #7c3aed;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.pill-age-badge.age-pro {
  background: rgba(236, 72, 153, 0.15);
  color: #db2777;
  border: 1px solid rgba(236, 72, 153, 0.35);
}

[data-theme="dark"] .pill-age-badge.age-senior { color: #fb923c; }
[data-theme="dark"] .pill-age-badge.age-u18 { color: #34d399; }
[data-theme="dark"] .pill-age-badge.age-u16 { color: #38bdf8; }
[data-theme="dark"] .pill-age-badge.age-u14 { color: #c084fc; }
[data-theme="dark"] .pill-age-badge.age-pro { color: #f472b6; }

.tag-gender {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-elevated, rgba(0, 0, 0, 0.05));
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
}

/* P1-1: Consolidated Actions Menu */
.btn-grid-appoint {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-grid-edit {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.btn-row-menu-trigger {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.row-menu-popover {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 60;
  background: var(--bg-surface-elevated, #ffffff);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  min-width: 175px;
  display: flex;
  flex-direction: column;
  padding: 4px;
}

[data-theme="dark"] .row-menu-popover {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
}

.btn-menu-option {
  background: transparent;
  border: none;
  text-align: left;
  padding: 7px 10px;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease;
}

.btn-menu-option:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .btn-menu-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.compact-row:hover td {
  background: var(--bg-hover);
}

.compact-crew-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.crew-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.crew-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.crew-pill .role-badge {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .crew-pill .role-badge {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.crew-pill.status-confirmed {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
}

.crew-pill.status-unconfirmed {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.35);
}

.crew-pill.status-declined {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.35);
}

.crew-pill.status-open {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
}

.crew-pill.status-open:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(249, 115, 22, 0.08);
}

.crew-pill.slot-focused {
  outline: 2px solid #f97316 !important;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.45), 0 2px 8px rgba(249, 115, 22, 0.25) !important;
  border-color: #f97316 !important;
  transform: translateY(-1px);
  position: relative;
  z-index: 2;
  animation: pulseOrangeRing 2.2s infinite ease-in-out;
}

@keyframes pulseOrangeRing {
  0% { box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.6); }
  50% { box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.2); }
  100% { box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.6); }
}

/* Compact Inline Webhook Toolbar Pill */
.toolbar-sync-pill-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 9999px;
  padding: 0.2rem 0.5rem 0.2rem 0.75rem;
  font-size: 0.8rem;
}

.toolbar-sync-pill-wrap .sync-status-indicator {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.toolbar-sync-pill-wrap .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  flex-shrink: 0;
}

.toolbar-sync-pill-wrap .sync-separator {
  color: var(--text-muted);
  opacity: 0.6;
}

.toolbar-sync-pill-wrap .sync-subtext {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.btn-compact-sync {
  font-size: 0.75rem !important;
  padding: 0.15rem 0.55rem !important;
  border-radius: 9999px !important;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .toolbar-sync-pill-wrap {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    padding: 0.45rem 0.65rem;
    gap: 0.45rem;
  }

  .toolbar-sync-pill-wrap .sync-status-indicator {
    flex: 1 1 180px;
    border-radius: 10px;
    padding: 0.3rem 0.55rem;
    line-height: 1.35;
    white-space: normal;
  }

  .toolbar-sync-pill-wrap .sync-subtext {
    white-space: normal;
    word-break: break-word;
  }

  .toolbar-sync-pill-wrap .btn-compact-sync {
    margin-left: auto;
    max-width: 100%;
  }
}

/* Compact Conflict Diagnostics in Candidate Drawer */
.compact-conflicts-wrap {
  margin: 0.4rem 0;
}

.conflict-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.conflict-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  line-height: 1.2;
}

.conflict-badge-soft {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.conflict-badge-hard {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.conflict-details-accordion {
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 4px);
  background: rgba(0, 0, 0, 0.12);
  padding: 0.3rem 0.5rem;
}

.conflict-details-accordion summary {
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  outline: none;
}

.conflict-details-accordion summary:hover {
  color: var(--text-primary);
}

.conflict-details-accordion .accordion-content {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pill-check {
  font-size: 0.75rem;
  font-weight: bold;
}

.btn-chase {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 0.82rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.btn-chase:hover {
  transform: scale(1.3);
}

.btn-expand-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-expand-row:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--primary);
}

.expanded-card-row td {
  background: var(--bg-hover);
  padding: 1rem;
  border-top: none;
  border-bottom: 2px solid var(--border-subtle);
}

.btn-clash-warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.btn-clash-warning:hover {
  background: #fde68a;
  transform: scale(1.03);
}

[data-theme="dark"] .btn-clash-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

.health-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

/* Colorblind-Safe WCAG 2.1 AA Geometric Indicators (Circle, Diamond, Triangle, Square, Octagon) */
.dot-FULLY_CONFIRMED {
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.dot-PENDING_CONFIRMATION {
  border-radius: 2px;
  transform: rotate(45deg);
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.dot-PARTIALLY_ASSIGNED {
  border-radius: 0;
  background: #3b82f6;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  box-shadow: none;
}

.dot-DECLINED_REPLACEMENT_NEEDED {
  border-radius: 2px;
  background: #ef4444;
  clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.dot-CRITICAL_UNASSIGNED {
  border-radius: 1px;
  background: #dc2626;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: pulse-health-critical 1.5s infinite;
}

@keyframes pulse-health-critical {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.dbs-icon-pill {
  cursor: help;
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.2rem;
}

/* #319: officials whose DBS or licence lapses before tip-off */
.badge-critical {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--status-critical-solid);
  color: #fff;
}

.crew-pill.pill-blocked,
.deck-slot-item.pill-blocked {
  border-color: var(--status-critical) !important;
  background: var(--status-critical-bg) !important;
}

.lapse-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--status-critical);
  white-space: nowrap;
}

.fit-reason-box {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  padding: 0.4rem 0.65rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.remedy-note {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  padding: 0.35rem 0.55rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* ==========================================================================
   ASSIGNOR WORKBENCH: DEDICATED CARDS DECK LAYOUT
   ========================================================================== */
.fixture-cards-grid-wrap {
  width: 100%;
}

.fixture-cards-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.15rem;
  padding: 0.5rem 0 1.5rem;
}

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

.fixture-deck-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.fixture-deck-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(249, 115, 22, 0.4);
}

.fixture-deck-card.selected-card {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
  background: rgba(249, 115, 22, 0.02);
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.card-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.card-code-badge {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.card-matchup-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-teams {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.card-teams .vs-divider {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 0.1rem;
}

.card-datetime-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.card-datetime-row strong {
  color: var(--text-primary);
}

.card-venue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--bg-hover);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.card-venue-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-venue-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-venue-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-specs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.deck-slots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.deck-slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.8rem;
}

.deck-slot-item:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.deck-slot-item.slot-focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.3);
  background: rgba(249, 115, 22, 0.05);
}

.deck-slot-item.slot-accepted {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.deck-slot-item.slot-pending {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
}

.deck-slot-item.slot-declined {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.3);
}

.deck-slot-item.slot-open {
  background: var(--bg-surface);
  border-style: dashed;
}

.deck-slot-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.deck-slot-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.card-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.65rem;
  margin-top: auto;
}

/* ==========================================================================
   Milestone 1 (R1): Tokenized Quick Accept & Decline Mobile View
   ========================================================================== */

.token-respond-container {
  max-width: 540px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.token-respond-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.token-card-header {
  padding: 1.75rem 1.5rem 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.12) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.token-logo {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.token-brand-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.token-card-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.token-direct-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.token-card-body {
  padding: 1.5rem;
}

/* Loading State */
.token-loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--brand-orange);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  margin: 2.5rem auto 1rem;
}

.token-loading-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Fixture Hero */
.token-fixture-hero {
  padding: 1.25rem;
  background: var(--bg-app);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.token-status-badge-wrap {
  margin-bottom: 0.65rem;
}

.token-fixture-matchup {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.token-fixture-competition {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Grid Details */
.token-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.token-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--bg-surface);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.token-detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.token-detail-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Two-Tap Action Buttons */
.token-action-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-token-accept {
  background: var(--status-success);
  color: #052e16;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  min-height: 52px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-token-accept:hover {
  background: #059669;
  color: #fff;
  transform: translateY(-1px);
}

.btn-token-decline {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-critical);
  border: 1.5px solid var(--status-critical);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  min-height: 52px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-token-decline:hover {
  background: var(--status-critical-solid);
  color: #fff;
  transform: translateY(-1px);
}

/* Inline Expandable Decline Box */
.token-decline-container {
  margin-top: 1.25rem;
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: fadeInSlide 0.2s ease-out;
}

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

.token-decline-header {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.token-decline-alert-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.token-decline-title {
  display: block;
  font-size: 0.92rem;
  color: var(--status-critical);
}

.token-decline-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.token-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.btn-reason-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-reason-chip:hover {
  border-color: var(--status-critical);
  color: var(--status-critical);
  background: rgba(239, 68, 68, 0.08);
}

.token-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.token-decline-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  resize: vertical;
}

.token-decline-textarea:focus {
  outline: none;
  border-color: var(--status-critical);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.token-field-error {
  color: var(--status-critical);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.token-decline-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

/* Feedback State Cards */
.token-feedback-card {
  text-align: center;
  padding: 2.25rem 1.25rem 1.75rem;
}

.token-feedback-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.token-feedback-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.token-feedback-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.token-pill-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.token-logged-reason-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--status-critical);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-align: left;
  margin-bottom: 1.5rem;
}

.token-logged-reason-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.token-logged-reason-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-style: italic;
  margin-top: 0.2rem;
}

.token-card-footer {
  padding: 0.85rem 1.5rem;
  background: var(--bg-app);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.token-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.35rem;
}

/* Mobile Breakpoints */
@media (max-width: 640px) {
  .token-respond-container {
    margin: 0.75rem auto 2rem;
    padding: 0 0.5rem;
  }
  .token-action-group {
    grid-template-columns: 1fr;
  }
  .token-details-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .btn-token-accept,
  .btn-token-decline {
    min-height: 54px;
    font-size: 1.05rem;
  }
  .token-reason-chips {
    gap: 0.5rem;
  }
  .btn-reason-chip {
    padding: 0.45rem 0.8rem;
    font-size: 0.82rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ==========================================================================
   Milestone 2 (R2): Post-Match Incident & Assessor Reporting Modals & Badges
   ========================================================================== */

/* Modal Container Specification */
.modal-dialog {
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

/* Fixture Header Context Banner */
.post-match-game-banner {
  background: var(--bg-elevated);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid var(--status-critical);
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1.15rem;
  margin: 0.85rem 1.25rem 0.5rem 1.25rem;
}

.post-match-game-banner .game-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 1rem;
}

/* Tab Navigation Bar */
.modal-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding: 0 1.25rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary, #94a3b8);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
}

.modal-tab-btn:hover {
  color: var(--text-primary, #f8fafc);
}

.modal-tab-btn.active {
  color: var(--brand-accent, #f97316);
  border-bottom-color: var(--brand-accent, #f97316);
}

.modal-tab-panel {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-tab-panel[hidden] {
  display: none !important;
}

/* Star Rating Component */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.star-btn {
  background: transparent;
  border: none;
  font-size: 1.45rem;
  line-height: 1;
  color: #475569;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  min-width: 32px;
  min-height: 32px;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.star-btn:hover,
.star-btn:focus-visible {
  color: #fbbf24;
  transform: scale(1.15);
  outline: none;
}

.star-btn.active {
  color: #f59e0b;
}

.rating-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  margin-left: 0.4rem;
  min-width: 38px;
}

/* Official Rating Card in Tab 2 */
.official-rating-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Visual Badges for Lodged Incidents */
.badge-incident-filed,
.badge-disciplinary-alert,
.incident-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge-incident-filed {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
}

/* History Card */
.post-match-history-card {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid #ef4444;
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   Milestone 3 (R3): Automated DBS & Licence Expiry Warning Badges & Daemon UI
   ========================================================================== */

.dbs-warning-60,
.dbs-warning-30,
.dbs-critical-7 {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  vertical-align: middle;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

/* 60-Day Expiry Notice (Amber / Yellow) */
.dbs-warning-60 {
  background: rgba(245, 158, 11, 0.16);
  color: light-dark(#b45309, #fbbf24);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.dbs-warning-60:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.65);
}

/* 30-Day Expiry Warning (Orange) */
.dbs-warning-30 {
  background: rgba(249, 115, 22, 0.18);
  color: light-dark(#c2410c, #fb923c);
  border: 1px solid rgba(249, 115, 22, 0.52);
}

.dbs-warning-30:hover {
  background: rgba(249, 115, 22, 0.28);
  border-color: rgba(249, 115, 22, 0.75);
}

/* 7-Day Critical Safeguard Warning (Red Pulse) */
.dbs-critical-7 {
  background: rgba(239, 68, 68, 0.22);
  color: light-dark(#dc2626, #f87171);
  border: 1px solid rgba(239, 68, 68, 0.65);
  animation: pulseBorder 1.8s infinite;
}

.dbs-critical-7:hover {
  background: rgba(239, 68, 68, 0.32);
  border-color: rgba(239, 68, 68, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  .dbs-critical-7 {
    animation: none;
  }
}

/* ==========================================================================
   Milestone 4 (R4): Interactive Club Reschedule Approval Queue & Diff Styles
   ========================================================================== */

.reschedule-queue-card {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  transition: border-color 0.15s ease-in-out;
}

.reschedule-queue-card:hover {
  border-color: var(--brand-accent, #f97316);
}

.reschedule-queue-card.card-has-clash {
  border-left: 4px solid #f59e0b;
}

.reschedule-queue-card.card-clean {
  border-left: 4px solid #10b981;
}

/* Schedule Diff Comparison Box */
.reschedule-diff-box {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  padding: 0.75rem;
  flex-wrap: wrap;
}

.reschedule-diff-col {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reschedule-diff-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
  font-size: 1.25rem;
  padding: 0 0.5rem;
}

.diff-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
}

.diff-strikethrough {
  text-decoration: line-through;
  color: #ef4444;
  font-weight: 600;
  font-size: 0.88rem;
}

.diff-highlight {
  color: #10b981;
  font-weight: 700;
  font-size: 0.92rem;
}

.reschedule-reason-box {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
  font-size: 0.84rem;
  color: var(--text-secondary, #cbd5e1);
}

/* Clash Simulation Panel */
.clash-simulation-panel {
  border-radius: var(--radius-sm, 6px);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
}

.clash-simulation-panel.has-clashes {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.06);
}

.clash-simulation-panel.is-clean {
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.clash-sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.clash-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.clash-pill.clash-conflict {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.clash-pill.clash-clean {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.clash-crew-row {
  font-size: 0.8rem;
  padding: 0.2rem 0;
  line-height: 1.4;
}

.clash-crew-row.clash-crew-conflict {
  color: var(--status-warning);
}

.clash-crew-row.clash-crew-clean {
  color: var(--text-secondary);
}

/* 1-Click Action Controls */
.reschedule-actions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.reschedule-notes-input {
  flex: 1;
  min-width: 200px;
}

.btn-approve-reschedule {
  background: var(--status-success);
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-approve-reschedule:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

.btn-reject-reschedule {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reject-reschedule:hover {
  background: var(--status-critical-solid);
  color: #ffffff;
}

/* ==========================================================================
   MILESTONE 5 (R5): LEAGUE SCHEDULE FEED WEBHOOK & AUTO-SYNC STYLES
   ========================================================================== */

/* Webhook Telemetry Panel on Assignor Workbench */
.sync-telemetry-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.25rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease;
}

.sync-telemetry-panel:hover {
  border-color: var(--text-muted);
}

.sync-panel-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.sync-status-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 260px;
}

.sync-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sync-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.sync-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.sync-indicator-wrap {
  display: flex;
  align-items: center;
  margin-top: 0.15rem;
}

.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
}

.sync-status-indicator .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sync-status-indicator.status-idle {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.sync-status-indicator.status-idle .status-dot {
  background: #10b981;
}

.sync-status-indicator.status-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.sync-status-indicator.status-success .status-dot {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 2s infinite;
}

.sync-status-indicator.status-syncing {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.sync-status-indicator.status-syncing .status-dot {
  background: #f59e0b;
  animation: pulse-amber 1.2s infinite;
}

.sync-status-indicator.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.45);
}
.sync-status-indicator.status-error .status-dot {
  background: #ef4444;
}

@keyframes pulse-amber {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Metrics Column */


/* Actions Column & Live URL Box */
.sync-actions-col {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.webhook-endpoint-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.webhook-copy-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.webhook-url-input {
  font-family: monospace, Consolas, Monaco, monospace;
  font-size: 0.78rem;
  width: 220px;
  background: var(--bg-app);
  color: var(--text-secondary);
  cursor: text;
}

/* Modal Summary Results Box */
.sync-results-box {
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.sync-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.sync-stat-card {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
}

.sync-stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.sync-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sync-stat-created {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-left: 3px solid #10b981;
}

.sync-stat-updated {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-left: 3px solid #3b82f6;
}

.sync-stat-cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-left: 3px solid #ef4444;
}

.sync-stat-total {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  border-left: 3px solid #8b5cf6;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {

  .webhook-url-input {
    width: 100%;
  }

  .sync-actions-col {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   ASSIGNOR QUICK-START LEAGUE SETUP WIZARD (MILESTONE 6 / R6)
   ========================================================================== */

.wizard-modal-box {
  max-width: 960px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.wizard-modal-body {
  max-height: calc(90vh - 170px);
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

/* Stepper Navigation Bar */
.wizard-stepper {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-surface, #1e293b);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  overflow-x: auto;
  scrollbar-width: thin;
}

.wizard-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-app, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 24px;
  color: var(--text-secondary, #94a3b8);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
}

.wizard-step-pill:hover {
  color: var(--text-primary, #f8fafc);
  border-color: var(--border-color, rgba(255, 255, 255, 0.25));
}

.wizard-step-pill.active {
  background: rgba(249, 115, 22, 0.15);
  border-color: var(--brand-accent, #f97316);
  color: var(--brand-accent, #f97316);
}

.wizard-step-pill.completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

.wizard-step-pill .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}

.wizard-step-pill.active .step-num {
  background: var(--brand-accent, #f97316);
  color: #ffffff;
}

.wizard-step-pill.completed .step-num {
  background: #10b981;
  color: #ffffff;
}

/* Step Panels */
.wizard-step-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wizard-step-panel[hidden] {
  display: none !important;
}

.wizard-panel-intro h4,
.wizard-header-toolbar h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.wizard-header-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.wizard-bulk-paste-box {
  padding: 0.85rem;
  background: var(--bg-app, #0f172a);
  border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.15));
  border-radius: var(--radius-md, 8px);
  margin-bottom: 0.75rem;
}

/* Step 5 Review Cards Grid */
.wizard-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.wizard-summary-card {
  background: var(--bg-app, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 8px);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wizard-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.wizard-summary-metric {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  line-height: 1.2;
}

.wizard-auto-appoint-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-md, 8px);
}

/* Post-Submit Success Banner */
.wizard-success-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
}

.wizard-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .wizard-stepper {
    padding: 0.5rem 0.75rem;
  }

  .wizard-step-pill .step-label {
    display: none;
  }

  .wizard-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Phase 2: Role-Based Navigation & "Needs Attention" Action Center
   ========================================================================== */

.badge-pill-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--status-critical-solid);
  color: #ffffff;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.35rem;
}

.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
}

/* Needs Attention Action Center */
.attention-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.attention-title-wrap h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.attention-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.attention-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Attention KPI Bar */
.attention-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.attention-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.attention-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-orange);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.attention-kpi-card.active {
  border-color: var(--brand-orange);
  background: light-dark(#fffaf5, #1e1915);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}

.attention-kpi-num {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.attention-kpi-label {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.kpi-declines .attention-kpi-num {
  color: #ef4444;
}

.kpi-unfilled .attention-kpi-num {
  color: #f97316;
}

.kpi-reschedules .attention-kpi-num {
  color: #0284c7;
}

.kpi-expiring .attention-kpi-num {
  color: #f59e0b;
}

/* Attention Filters Bar */
.attention-filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.attention-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attention-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.attention-tab:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.attention-tab.active {
  background: var(--color-accent-solid);
  color: #ffffff;
  border-color: var(--brand-orange);
}

.attention-search-wrap {
  min-width: 240px;
}

/* Attention Cards */
.attention-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.attention-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--brand-orange);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.attention-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

.attention-card.critical {
  border-left-color: #ef4444;
  background: light-dark(#fff5f5, #1e1315);
}

.attention-card.urgent {
  border-left-color: #f97316;
  background: light-dark(#fffaf5, #1e1713);
}

.attention-card.action_required {
  border-left-color: #0284c7;
  background: light-dark(#f0f9ff, #111a24);
}

.attention-card.warning {
  border-left-color: #f59e0b;
  background: light-dark(#fffdf7, #1f1b13);
}

.attention-card-body {
  flex: 1 1 320px;
}

.attention-card-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.attention-type-tag {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.attention-type-tag.tag-decline {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.attention-type-tag.tag-unfilled {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
}

.attention-type-tag.tag-reschedule {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
}

.attention-type-tag.tag-dbs {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.attention-severity-pill {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
}

.attention-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.attention-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.attention-card-action {
  flex-shrink: 0;
}

.attention-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

.attention-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.85rem;
}

.attention-empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 0.35rem;
}

.attention-empty-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* Needs Attention Banner in Assignor Workbench */


/* ==========================================================================
   Mobile Ergonomics & Responsive Layout (360px to 768px Viewports)
   ========================================================================== */

@media (max-width: 768px) {
  /* Tap targets meeting WCAG 2.5.5 / 2.5.8 recommendations (min 44px) */
  .btn,
  .role-tab,
  .workspace-pill,
  .select,
  .input,
  .footer-btn-link {
    min-height: 44px;
  }

  .topbar {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-subtitle {
    display: none; /* Hide subtitle on mobile to conserve header space */
  }

  .topbar-actions {
    gap: var(--space-2);
    width: 100%;
    justify-content: flex-end;
  }

  .session-switcher {
    width: 100%;
  }

  .select-session {
    width: 100%;
  }

  /* Modals on mobile: maximize readable viewport area */
  dialog.modal,
  .modal-box {
    width: calc(100vw - 1rem) !important;
    max-width: calc(100vw - 1rem) !important;
    max-height: 92vh !important;
    margin: auto !important;
    border-radius: var(--radius-md) !important;
  }

  .modal-body {
    max-height: calc(92vh - 120px) !important;
    overflow-y: auto !important;
    padding: var(--space-3) !important;
  }
}

@media (max-width: 640px) {
  .attention-kpi-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .attention-card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .attention-card-body {
    flex: 0 0 auto;
    width: 100%;
  }

  .attention-card-action {
    width: 100%;
  }

  .attention-card-action button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .attention-filter-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-1);
  }

  .attention-filter-tabs::-webkit-scrollbar {
    display: none;
  }
}

/* Small mobile devices (down to 360px viewport width) */
@media (max-width: 400px) {
  .attention-kpi-bar {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .role-tab {
    font-size: 0.75rem;
    padding: var(--space-2) var(--space-3);
  }
}

/* ==========================================================================
   Interactive System Changelog: Dual-Audience Modes (User vs. Technical)
   ========================================================================== */

.changelog-mode-toggle {
  display: flex;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
  gap: 3px;
}

.changelog-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 0.825rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.changelog-mode-btn.active {
  background: var(--bg-surface);
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.changelog-tech-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  font-size: 0.85rem;
}

.changelog-tech-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.changelog-tech-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.changelog-tech-list li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.changelog-tech-list code {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
  font-size: 0.775rem;
  color: var(--text-primary);
}

/* ==========================================================================
   Phase 4: Mobile-First Next-Fixture Hero Card & 1-Tap Confirmation
   ========================================================================== */

.next-fixture-hero-container {
  margin-bottom: var(--space-4);
}

.next-fixture-hero-card {
  background: var(--bg-surface);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.next-fixture-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent) 0%, #f59e0b 100%);
}

.hero-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.hero-label-badge {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.hero-status-pill {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-status-pill.pending {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning);
}

.hero-status-pill.confirmed {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success);
}

.hero-matchup {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.hero-vs {
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 var(--space-1);
}

.hero-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.hero-code-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.hero-comp-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* Key Fixture Details Grid */
.hero-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.hero-detail-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.hero-detail-icon {
  color: var(--color-accent);
  margin-top: 2px;
}

.hero-detail-text strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.hero-detail-text span {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.hero-financials-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.hero-role-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.hero-role-chip strong {
  color: var(--text-primary);
}

.hero-fee-chip {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
}

:root[data-theme="dark"] .hero-fee-chip {
  color: #4ade80;
}

.hero-arrive-by {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-accent);
  margin-top: 0.25rem;
  font-weight: 600;
}

.hero-directions-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--text-xs);
  color: var(--color-accent);
  text-decoration: underline;
  margin-top: 0.25rem;
}

.hero-crew-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
}

.hero-crew-label {
  font-weight: 700;
  color: var(--text-secondary);
}

.hero-partner-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.hero-partner-chip .status-confirmed {
  color: var(--status-success);
  font-weight: 700;
}

.hero-partner-chip .status-pending {
  color: var(--status-warning);
}

.hero-pending-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.hero-deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--status-warning);
  font-weight: 600;
}

.hero-deadline-badge.overdue {
  color: var(--status-error);
}

.hero-assignor-contact {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.hero-assignor-contact .assignor-link {
  color: var(--text-primary);
  text-decoration: underline;
  font-weight: 600;
}

/* 1-Tap Action Footer */
.hero-action-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.btn-hero-accept {
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
}

.btn-hero-decline {
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
}

.btn-hero-directions {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
}

.btn-hero-cal {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
}

.hero-empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

.hero-empty-icon {
  color: var(--status-success);
  margin-bottom: var(--space-2);
}

.hero-empty-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.hero-empty-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* Mobile Adjustments (Tested at 360px) */
@media (max-width: 640px) {
  .next-fixture-hero-card {
    padding: var(--space-3);
  }

  .hero-matchup {
    font-size: var(--text-xl);
  }

  .hero-details-grid {
    grid-template-columns: 1fr;
    padding: var(--space-2) var(--space-3);
  }

  .hero-action-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-action-footer > * {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================================
   PHASE 5: FLOATING FEEDBACK TRIGGER & SEASON REPORT STYLING
   ========================================================================= */

.floating-feedback-btn {
  position: fixed;
  bottom: calc(var(--space-4) + 64px);
  right: var(--space-4);
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.floating-feedback-btn:hover {
  border-color: var(--court-accent);
  color: var(--court-accent);
  transform: translateY(-2px);
}

.floating-feedback-btn:focus-visible {
  outline: 2px solid var(--court-accent);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .floating-feedback-btn {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .floating-feedback-btn {
    bottom: var(--space-4);
  }
}

.season-report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.season-report-kpi-card {
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.season-report-kpi-val {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-top: var(--space-1);
}

.season-report-kpi-lbl {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.season-report-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
}

.season-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
  text-align: left;
}

.season-report-table th,
.season-report-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.season-report-table th {
  background: var(--bg-app);
  font-weight: 700;
  color: var(--text-secondary);
}

/* =========================================================================
   STREAMLINED ASSIGNOR TOOLBAR & DROPDOWN MENUS
   ========================================================================= */

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.toolbar-primary-group,
.toolbar-dropdown-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.dropdown-wrap {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-1));
  z-index: 60;
  min-width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-menu[hidden] {
  display: none !important;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  min-height: 38px;
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
  background: var(--bg-app);
  color: var(--court-accent);
  outline: none;
}

.btn-draft-pill {
  position: relative;
}

@media (max-width: 768px) {
  .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-primary-group,
  .toolbar-dropdown-group {
    width: 100%;
    justify-content: stretch;
  }
  .toolbar-primary-group > *,
  .toolbar-dropdown-group > * {
    flex: 1 1 auto;
  }
}

/* ========================================================================= */
/* MULTI-LEAGUE TENANCY & SUPER ADMIN STYLING                                */
/* ========================================================================= */

.league-switcher {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.league-select-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.18rem 0.5rem 0.18rem 0.45rem;
  gap: 0.35rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.league-select-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.league-select-icon {
  font-size: 1rem;
}

.select-league {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  padding: 0.15rem 0.25rem 0.15rem 0;
}

.super-admin-modal-box {
  max-width: 1040px;
}

.super-admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.super-admin-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.provision-league-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   SHAREABLE DEEP LINKS & ROUTE HIGHLIGHTING
   ========================================================================== */
.pulse-highlight {
  outline: 3px solid #ff7a00 !important;
  box-shadow: 0 0 20px rgba(255, 122, 0, 0.6) !important;
  border-color: #ff7a00 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulseHighlight 1.5s infinite alternate;
}

@keyframes pulseHighlight {
  from {
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.4);
  }
  to {
    box-shadow: 0 0 22px rgba(255, 122, 0, 0.85);
  }
}

.btn-copy-fixture-link {
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-copy-fixture-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 122, 0, 0.12);
}

/* ==========================================================================
   Phase 8: Basketball England & FIBA Rulebook Knowledge Base Modal
   ========================================================================== */
#dialog-rulebook .modal-box {
  max-width: 960px;
  width: 95vw;
}

.rulebook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent, #ea580c);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.rulebook-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.rulebook-search-input {
  flex: 1;
  min-width: 250px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-md, 6px);
  font-size: 0.95rem;
  background: var(--surface, #ffffff);
  color: var(--text-primary, #0f172a);
}

.rulebook-category-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.rulebook-cat-btn {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-secondary, #475569);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rulebook-cat-btn:hover {
  border-color: var(--accent, #ea580c);
  color: var(--accent, #ea580c);
}

.rulebook-cat-btn.active {
  background: var(--color-accent-solid);
  color: #ffffff;
  border-color: var(--accent, #ea580c);
}

.rulebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.rule-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rule-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent, #ea580c);
}

.rule-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.rule-code-badge {
  background: var(--color-accent-solid);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.rule-category-tag {
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
  font-weight: 600;
}

.rule-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0.25rem 0 0.5rem 0;
}

.rule-card-summary {
  font-size: 0.85rem;
  color: var(--text-secondary, #475569);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.rule-key-points {
  margin: 0.5rem 0;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  color: var(--text-primary, #334155);
}

.rule-key-points li {
  margin-bottom: 0.35rem;
}

.rule-card-footer {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border-color, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
}

.rule-tags-wrap {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.rule-tag {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-secondary, #64748b);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.7rem;
}

/* =========================================================================
   P2-2: 7-Day Agenda List View & Availability Styles
   ========================================================================= */

.avail-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avail-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-day-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.agenda-day-card.agenda-today {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.agenda-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.agenda-day-title {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.agenda-day-body {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.agenda-empty-day {
  padding: 0.25rem 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.agenda-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  gap: 0.5rem;
  font-size: var(--text-xs);
}

.agenda-item-fixture {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.agenda-item-avail {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.agenda-item-unavail {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.agenda-item-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.agenda-time {
  font-weight: 700;
  white-space: nowrap;
}

.agenda-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.agenda-details strong {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.agenda-status-badge.accepted {
  color: var(--status-success);
}

.agenda-status-badge.pending {
  color: var(--status-warning);
}

/* PWA Offline Mode Status Banner (Issue #4) */
.offline-status-banner {
  background: #fef3c7;
  color: #78350f;
  border-bottom: 2px solid #f59e0b;
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.offline-status-banner[hidden] {
  display: none !important;
}

[data-theme="dark"] .offline-status-banner {
  background: #451a03;
  color: #fef3c7;
  border-bottom-color: #d97706;
}

.offline-banner-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.offline-banner-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.offline-banner-text {
  line-height: 1.4;
}













/* ==========================================================================
   LEAGUE MEMBERS & LEAGUE ONBOARDING (#63)
   ========================================================================== */

/* Visually hidden, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lm-container,
.lo-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.lo-container {
  max-width: 720px;
}

.lm-panel {
  padding: 1.25rem;
  min-width: 0;
}

.lm-panel .table-container {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.lm-panel .user-mgmt-toolbar {
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-subtle);
}

.lm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.lm-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.lm-tabs .workspace-pill {
  min-block-size: 44px;
}

/* High contrast in both themes (the accent orange with white text is only ~3.6:1). */
.lm-tabs .workspace-pill.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}

.lm-count {
  display: inline-block;
  min-width: 1.5rem;
  margin-left: 0.25rem;
  padding: 0.05rem 0.45rem;
  border-radius: 9999px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.75rem;
  text-align: center;
}

.lm-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.lm-toolbar .input,
.lm-toolbar .select {
  min-block-size: 44px;
  max-width: 320px;
}

.lm-label {
  font-weight: 700;
  color: var(--text-secondary);
}

.lm-add-form {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.lm-add-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.35rem 0;
}

.lm-add-row .input {
  flex: 1 1 260px;
  min-block-size: 44px;
}

.lm-add-row .btn,
.lm-actions .btn,
.lo-actions .btn {
  min-block-size: 44px;
}

.lm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lm-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.lm-card-main {
  flex: 1 1 320px;
  min-width: 0;
}

.lm-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lm-message {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-inline-start: 3px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.lm-actions,
.lo-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.lo-actions {
  margin-top: 1rem;
}

/* Status is always text + icon, never colour alone. */
.lm-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid currentColor;
  font-size: 0.78rem;
  font-weight: 700;
}

.lm-status-PENDING { color: #92400e; background: #fef3c7; }
.lm-status-APPROVED { color: #166534; background: #dcfce7; }
.lm-status-REJECTED { color: #991b1b; background: #fee2e2; }
.lm-status-WITHDRAWN { color: #334155; background: #e2e8f0; }

[data-theme="dark"] .lm-status-PENDING { color: #fcd34d; background: #3b2a08; }
[data-theme="dark"] .lm-status-APPROVED { color: #86efac; background: #0f2e1b; }
[data-theme="dark"] .lm-status-REJECTED { color: #fca5a5; background: #3b1010; }
[data-theme="dark"] .lm-status-WITHDRAWN { color: #cbd5e1; background: #1f293d; }

.lo-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
}

.lo-fieldset legend {
  font-weight: 700;
  padding: 0 0.4rem;
}

.lo-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lo-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-block-size: 44px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
}

.lo-option:focus-within {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.lo-option input[type="checkbox"] {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  flex: none;
}

.lo-option-code {
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .lm-card {
    flex-direction: column;
  }
  .lm-actions {
    width: 100%;
  }
  .lm-actions .btn {
    flex: 1 1 auto;
  }
}

.lm-caution {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border-inline-start: 3px solid #d97706;
  background: var(--bg-app);
  color: var(--text-secondary);
}

.lm-more {
  margin-top: 0.75rem;
  text-align: center;
}

/* Read-only viewer (#93) */
.readonly-banner {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border-inline-start: 3px solid var(--primary, #2563eb);
  background: var(--bg-app);
  color: var(--text-secondary);
}

.viewer-crew {
  list-style: none;
  margin: 0;
  padding: 0;
}

.viewer-crew li {
  white-space: nowrap;
}

.lo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}

.lo-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 44px;
}

.lo-check input[type="checkbox"] {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  flex: none;
}

.lm-declared {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.lm-unverified {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #b45309;
  color: #92400e;
  background: #fef3c7;
  font-size: 0.75rem;
  font-weight: 700;
}

.lm-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #15803d;
  color: #166534;
  background: #dcfce7;
  font-size: 0.75rem;
  font-weight: 700;
}

[data-theme="dark"] .lm-unverified { color: #fcd34d; background: #3b2a08; border-color: #b45309; }
[data-theme="dark"] .lm-verified { color: #86efac; background: #0f2e1b; border-color: #15803d; }

#form-lm-verify .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.lm-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.join-steps {
  margin: 0 0 1rem;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.4rem;
}

/* ==========================================================================
   AUTO-APPOINT: how it works, league settings, compare methods (#62)
   ========================================================================== */
.aa-method-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-app);
}

.aa-method-text {
  margin: 0;
  flex: 1 1 260px;
}

.aa-method-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.aa-method-actions .btn {
  min-block-size: 44px;
}

.aa-panel h4 {
  margin: 1.25rem 0 0.35rem;
}

.aa-list {
  margin: 0 0 0.5rem;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.3rem;
}

.aa-settings-body .lm-tabs {
  margin: 0 0 1rem;
}

.aa-weight-field input {
  max-width: 7rem;
}

.aa-why {
  margin-top: 0.35rem;
  font-size: 0.78rem;
}

.aa-why summary {
  cursor: pointer;
  min-block-size: 24px;
  color: var(--text-secondary);
  font-weight: 700;
}

.aa-why ul {
  margin: 0.35rem 0 0;
  padding-inline-start: 1.1rem;
}

.aa-compare-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.aa-stat {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.aa-stat strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.2;
}

.aa-compare-footer {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.aa-compare-footer .btn {
  min-block-size: 44px;
}

.aa-result-only-improved { color: #166534; }
.aa-result-only-current { color: #92400e; }
[data-theme="dark"] .aa-result-only-improved { color: #86efac; }
[data-theme="dark"] .aa-result-only-current { color: #fcd34d; }


/* ==========================================================================
   Visual Refresh v2 + Landing Page
   --------------------------------------------------------------------------
   Appended last so it can be reviewed (or reverted) as one block.
   1. Softer global surfaces: lighter shadows, calmer top bar.
   2. Signed-out chrome: only brand, theme toggle and "Sign in" are shown.
   3. Landing page (#view-LANDING): ONE promise, ONE call to action.
   4. Sign-in gate polish (#view-LOGIN_GATE).
   ========================================================================== */

:root {
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 18px 44px -12px rgba(15, 23, 42, 0.18);
  --text-5xl: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);
  /* Darker orange for filled buttons with white text: 5.2:1 (AA). The base accent is 3.6:1. */
  --color-accent-solid: #c2410c;
  --color-accent-solid-hover: #9a3412;
  /* #350: deeper red for filled badges and buttons with white text: 6.5:1 in both themes
     (--status-critical is #f87171 in dark mode, 2.8:1 with white). */
  --status-critical-solid: #b91c1c;
  --status-critical-solid-hover: #991b1b;
}

:root[data-theme="dark"] {
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 44px -12px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 44px -12px rgba(0, 0, 0, 0.6);
  }
}

/* 1. Calmer top bar */
.topbar {
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}

/* 2. Signed-out chrome: nothing to configure yet, so show nothing to configure */
body.is-signed-out .brand-subtitle,
body.is-signed-out #btn-open-feedback,
body.is-signed-out .topbar-actions > a[href="/api/docs"],
body.is-signed-out #btn-floating-feedback,
body.is-signed-out .mobile-bottom-nav {
  display: none !important;
}
body.is-landing .topbar {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  box-sizing: border-box;
}

/* 3. Landing page */
#view-LANDING {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 5.5rem 1.5rem 1.25rem;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
#view-LANDING[hidden] { display: none !important; }
#view-LANDING::before {
  /* one soft orange glow behind the hero; decorative only */
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: min(70vw, 760px);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--color-accent-subtle), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.landing-hero {
  /* fills the first screen so the audience section starts below the fold */
  min-height: calc(100svh - 8rem);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.landing-eyebrow {
  margin: 0 0 1rem;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-solid);
}
:root[data-theme="dark"] .landing-eyebrow { color: var(--color-accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .landing-eyebrow { color: var(--color-accent); }
}

.landing-title {
  margin: 0;
  font-size: var(--text-5xl);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--text-primary);
}
.landing-title-accent { display: block; color: var(--color-accent-solid); }
:root[data-theme="dark"] .landing-title-accent { color: var(--color-accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .landing-title-accent { color: var(--color-accent); }
}

.landing-lede {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--text-secondary);
}

.landing-actions { margin-top: 2.25rem; }

.btn-landing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.5rem;
  padding: 0 2rem;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-accent-solid);
  color: #fff;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px -8px rgba(194, 65, 12, 0.55);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-landing-cta:hover {
  background: var(--color-accent-solid-hover);
  transform: translateY(-1px);
}
.btn-landing-cta:active { transform: translateY(0); }
.btn-landing-cta:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}
.btn-landing-cta .icon { transition: transform 0.15s ease; }
.btn-landing-cta:hover .icon { transform: translateX(3px); }

.landing-note {
  margin: 0.9rem 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Illustration: a fixture that is already covered */
.landing-visual { display: flex; justify-content: center; }
.landing-card {
  width: 100%;
  max-width: 380px;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: rotate(1.5deg);
}
.landing-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}
.landing-card-status {
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--status-success-bg);
  color: #15803d;
  font-size: var(--text-xs);
  font-weight: 700;
}
:root[data-theme="dark"] .landing-card-status { color: #4ade80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .landing-card-status { color: #4ade80; }
}
.landing-card-fixture {
  margin: 1rem 0 1.25rem;
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.landing-card-fixture span { font-weight: 500; color: var(--text-muted); }
.landing-crew {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.landing-crew li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-app);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.landing-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: var(--color-accent-subtle);
  color: var(--color-accent-solid);
  font-size: var(--text-xs);
  font-weight: 800;
}
:root[data-theme="dark"] .landing-avatar { color: var(--color-accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .landing-avatar { color: var(--color-accent); }
}
.landing-crew-role { flex: 1; font-weight: 600; color: var(--text-primary); }
.landing-tick { font-size: var(--text-xs); font-weight: 700; color: #15803d; }
.landing-tick::before { content: "\2713\00a0"; }
:root[data-theme="dark"] .landing-tick { color: #4ade80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .landing-tick { color: #4ade80; }
}

.landing-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  padding-top: 1.5rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.landing-footer button {
  background: none;
  border: 0;
  padding: 0.35rem 0.25rem;
  font: inherit;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.landing-footer button:hover { color: var(--text-primary); }
.landing-footer button:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.landing-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.btn-landing-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 48px; padding: 0.75rem 1.35rem;
  border-radius: var(--radius-md); border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: var(--text-base); font-weight: 600; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-landing-secondary:hover { border-color: var(--color-accent-solid); background: var(--bg-surface-hover); }
.btn-landing-secondary:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.landing-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.55rem 0 0.85rem; }
.landing-mini-tag {
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.55rem;
  border-radius: 999px; background: var(--bg-app); border: 1px solid var(--border-subtle); color: var(--text-secondary);
}
.landing-crew-role small { display: block; font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }
.landing-score-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap;
  margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid var(--border-subtle);
}
.landing-score-pill {
  font-size: 0.74rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px;
  background: rgba(249, 115, 22, 0.14); color: var(--color-accent-solid);
}
:root[data-theme="dark"] .landing-score-pill { color: var(--color-accent); }
.landing-score-meta { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.landing-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem;
  max-width: 1080px; width: 100%; margin: 0 auto 2.75rem;
}
.landing-metric {
  padding: 1rem 1.1rem; border-radius: var(--radius-lg);
  background: var(--bg-surface); border: 1px solid var(--border-subtle); text-align: center;
}
.landing-metric strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--color-accent-solid); }
:root[data-theme="dark"] .landing-metric strong { color: var(--color-accent); }
.landing-metric span { display: block; margin-top: 0.2rem; font-size: 0.8rem; color: var(--text-secondary); }
.landing-role-kicker {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--color-accent-solid); margin-bottom: 0.35rem;
}
:root[data-theme="dark"] .landing-role-kicker { color: var(--color-accent); }
.landing-highlights { max-width: 1080px; width: 100%; margin: 2.75rem auto 0; }
.landing-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.landing-bento-card {
  padding: 1.2rem 1.3rem; border-radius: var(--radius-lg);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
}
.landing-bento-card h3 { margin: 0 0 0.4rem; font-size: 1rem; color: var(--text-primary); }
.landing-bento-card p { margin: 0; font-size: 0.88rem; line-height: 1.55; color: var(--text-secondary); }
.landing-closing {
  max-width: 1080px; width: 100%; margin: 2.75rem auto 1.25rem;
  padding: 1.75rem 2rem; border-radius: var(--radius-xl);
  background: var(--bg-surface); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap;
}
.landing-closing h2 { margin: 0 0 0.3rem; font-size: 1.3rem; color: var(--text-primary); }
.landing-closing p { margin: 0; font-size: 0.92rem; color: var(--text-secondary); }
.landing-closing-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.landing-disclaimer {
  max-width: 820px; margin: 0.5rem auto 0.25rem; text-align: center;
  font-size: 0.75rem; color: var(--text-muted); line-height: 1.45;
}

@media (max-width: 860px) {
  #view-LANDING { padding: 4.5rem 1.25rem 1rem; }
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-content: center;
    text-align: center;
  }
  .landing-lede { margin-inline: auto; }
  .landing-cta-row { justify-content: center; }
  .landing-card { transform: none; max-width: 360px; }
  .btn-landing-cta, .btn-landing-secondary { width: 100%; max-width: 22rem; }
  .landing-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-bento { grid-template-columns: 1fr; }
  .landing-closing { text-align: center; justify-content: center; padding: 1.5rem 1.25rem; }
  .landing-closing-actions { justify-content: center; width: 100%; }
}
@media (max-width: 480px) {
  /* Keep the promise and the button above the fold on a phone: illustration follows below */
  .landing-hero { gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-landing-cta, .btn-landing-cta .icon, .btn-landing-secondary { transition: none; }
  .btn-landing-cta:hover, .btn-landing-cta:hover .icon { transform: none; }
}

/* 4. Sign-in gate polish */
.login-gate-card {
  position: relative;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
}
.login-gate-header { border-bottom: 0; padding-top: 2.5rem; }
.login-gate-header h2 {
  margin: 0;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}
.login-gate-back {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.7rem 0.4rem 0.5rem;
  background: transparent;
  border: 0;
  border-radius: var(--radius-full);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.login-gate-back:hover { background: var(--bg-elevated); color: var(--text-primary); }
.login-gate-back:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.login-gate-form .btn-primary,
.login-gate-form #btn-login-gate-submit {
  background: var(--color-accent-solid);
}
.login-gate-form #btn-login-gate-submit:hover { background: var(--color-accent-solid-hover); }

/* Landing top bar on phones: one tidy row in normal flow (the older mobile rules wrap it) */
@media (max-width: 980px) {
  body.is-landing .topbar {
    position: relative;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 0.75rem 1rem;
  }
  body.is-landing .brand { width: auto; }
  body.is-landing .topbar-actions { flex-wrap: nowrap; width: auto; margin: 0; }
  body.is-landing #view-LANDING { padding-top: 1.5rem; }
}

/* Audience section (below the fold) */
.landing-audience {
  width: 100%;
  max-width: 1120px;
  margin: 3rem auto 0;
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--border-subtle);
}
.landing-audience-title {
  margin: 0 0 2rem;
  font-size: var(--text-3xl);
  letter-spacing: -0.025em;
  text-align: center;
}
.landing-audience-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.landing-audience-list li {
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.landing-audience-list h3 { margin: 0 0 0.5rem; font-size: var(--text-lg); }
.landing-audience-list p { margin: 0; color: var(--text-secondary); line-height: 1.55; }
@media (max-width: 860px) {
  .landing-hero { min-height: auto; }
  .landing-audience-list { grid-template-columns: 1fr; }
  .landing-audience-title { font-size: var(--text-2xl); }
}

/* The landing page has its own minimal footer; the full app footer would repeat it and dilute the single hook */
body.is-landing .app-footer { display: none !important; }

/* Fixture import (#110) */
.fi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.fi-messages {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

/* Authenticator app card in the Profile (#172) */
.totp-manage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
/* The setup key wraps in its own box (a one-line field cut it off), and a recovery code never splits at its dash. */
.totp-secret {
  font-family: var(--font-mono, monospace);
  font-size: 1rem;
  letter-spacing: 1px;
  resize: none;
  word-break: break-all;
}
.totp-recovery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.35rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0 0 0 1.6rem;
  font-family: var(--font-mono, monospace);
  font-size: 1rem;
  letter-spacing: 1px;
}
.totp-recovery-list li {
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------------------------------------------
   Availability confirmations (#206): the banner for officials, the card for assignors, the drawer chip.
   Phone first: stacked, 44px targets; side by side from 640px.
   --------------------------------------------------------------------------------------------------------------- */
.availability-banner,
.availability-gaps-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning);
  border-radius: var(--radius-md);
}
.availability-banner[hidden],
.availability-gaps-card[hidden] {
  display: none;
}
.availability-banner-done,
.availability-gaps-card-done {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  background: var(--status-success-bg);
  border-color: var(--status-success);
}
.availability-banner-tick {
  font-weight: 700;
}
.availability-banner-text {
  flex: 1 1 auto;
}

/* ==========================================================================
   #205: "Needs your response" list (official portal) and unread notifications
   ========================================================================== */
.needs-response-card {
  margin-bottom: 1.25rem;
  border-inline-start: 4px solid var(--status-warning);
}
.needs-response-header {
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.needs-response-header h2:focus {
  outline: 2px solid var(--border-focus, var(--brand-orange));
  outline-offset: 3px;
}
.needs-response-btn {
  min-block-size: 44px;
  min-inline-size: 44px;
}
/* A button that cannot be used must not look like one that can (the list has nothing clear to accept). */
.needs-response-btn:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border-subtle);
  cursor: not-allowed;
  opacity: 1;
}
.needs-response-confirm {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong, var(--border-subtle));
  border-radius: var(--radius-sm);
}
.needs-response-confirm p {
  margin: 0 0 0.5rem;
}
.needs-response-confirm-list {
  margin: 0 0 0.75rem;
  padding-inline-start: 1.1rem;
  font-size: 0.9rem;
}
.needs-response-confirm-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.needs-response-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.needs-response-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.needs-response-item.has-hard-clash {
  border-color: var(--status-critical);
}
.needs-response-item.has-soft-clash {
  border-color: var(--status-warning);
}
.needs-response-item.is-clear {
  border-color: var(--status-success);
}
.needs-response-main {
  min-inline-size: 0;
  flex: 1 1 auto;
}
.needs-response-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: baseline;
}
.needs-response-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.3rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}
.needs-response-clashes {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.availability-banner-error {
  margin: 0.25rem 0 0;
  font-weight: 600;
}
.availability-banner-actions,
.availability-gaps-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.availability-banner-actions .btn,
.availability-gaps-actions .btn {
  min-height: 44px;
  white-space: normal;
}
.availability-gaps-heading {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.availability-gaps-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}
.availability-gaps-selectall,
.availability-gaps-person label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  min-height: 44px;
  cursor: pointer;
}
.availability-gaps-people {
  list-style: none;
  margin: 0;
  padding: 0;
}
.availability-gaps-person {
  border-top: 1px solid var(--border-subtle);
}
.availability-gaps-person input[type="checkbox"],
.availability-gaps-selectall input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}
.availability-gaps-name {
  font-weight: 600;
}
.availability-gaps-note {
  display: block;
  padding: 0 0 0.5rem 1.85rem;
}
.tag-availability-unconfirmed {
  background: var(--status-warning-bg);
  border: 1px dashed var(--status-warning);
}
@media (min-width: 640px) {
  .availability-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .availability-banner-done,
  .availability-gaps-card-done {
    justify-content: flex-start;
  }
  .availability-banner-actions {
    flex-direction: row;
    flex: 0 0 auto;
  }
  .availability-gaps-actions {
    flex-direction: row;
    align-items: center;
  }
}
.needs-response-clash {
  display: flex;
  gap: 0.45rem;
  font-size: 0.86rem;
}
.needs-response-clash-hard {
  color: var(--status-critical);
}
.needs-response-clash-soft {
  color: var(--status-warning);
}
.needs-response-clash-icon {
  flex: 0 0 auto;
}
.needs-response-clear {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  color: var(--status-success);
}
.needs-response-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .needs-response-item {
    flex-direction: column;
  }
  .needs-response-buttons {
    flex-direction: row;
    inline-size: 100%;
  }
  .needs-response-buttons .btn {
    flex: 1 1 0;
    justify-content: center;
  }
  .needs-response-actions,
  .needs-response-actions .btn {
    inline-size: 100%;
  }
  .needs-response-confirm-buttons .btn {
    flex: 1 1 0;
    justify-content: center;
  }
}
.notifications-read-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0.5rem 0;
}
.notification-unread {
  border-inline-start: 3px solid var(--brand-orange);
}
.notification-mark-read-btn {
  margin-top: 0.4rem;
  min-block-size: 44px;
}
#notif-count-badge {
  min-inline-size: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--color-accent-solid);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1.1rem;
  text-align: center;
}

/* Season statement (#209) */
.statement-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; padding: 0 1rem; }
.statement-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.statement-status { padding: 0 1rem; min-height: 1.25rem; }
.statement-card #statement-body, .statement-note { padding: 0 1rem 1rem; }
.statement-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; margin: 0 0 1rem; }
.statement-summary-item { border: 1px solid var(--border-subtle); border-radius: 0.5rem; padding: 0.6rem 0.75rem; }
.statement-summary-item dt { font-size: var(--text-sm); }
.statement-summary-item dd { margin: 0; }
.statement-summary-value { font-size: var(--text-xl); font-weight: 700; }
.statement-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.statement-strong { font-weight: 600; }
.statement-print-root { display: none; }
#statement-print-root { page: statement; }
@page statement { size: A4 landscape; margin: 12mm; }
@media print {
  body.printing-statement > *:not(#statement-print-root) { display: none !important; }
  body.printing-statement #statement-print-root { display: block !important; background: #fff; color: #000; font-size: 10pt; }
  body.printing-statement #statement-print-root table { width: 100%; border-collapse: collapse; }
  body.printing-statement #statement-print-root th,
  body.printing-statement #statement-print-root td { border: 1px solid #000; padding: 2pt 4pt; color: #000; }
  body.printing-statement #statement-print-root .subtext { color: #000; }
  body.printing-statement .statement-summary-item { break-inside: avoid; border-color: #000; }
  body.printing-statement #statement-print-root .statement-summary { grid-template-columns: repeat(5, 1fr); gap: 3pt; margin-bottom: 6pt; }
  body.printing-statement #statement-print-root .statement-summary-item { padding: 2pt 5pt; }
  body.printing-statement #statement-print-root .statement-summary-value { font-size: 11pt; }
  body.printing-statement #statement-print-root h1 { font-size: 15pt; margin: 0 0 3pt; }
  body.printing-statement #statement-print-root p { margin: 0 0 2pt; }
  body.printing-statement #statement-print-root .statement-print-table { font-size: 8pt; table-layout: auto; }
  body.printing-statement #statement-print-root .statement-print-table thead { display: table-header-group; }
  body.printing-statement #statement-print-root .statement-print-table tr { break-inside: avoid; }
  body.printing-statement #statement-print-root .statement-print-table th { text-align: left; }
  body.printing-statement #statement-print-root .statement-print-table td.statement-num { text-align: right; white-space: nowrap; }
}
.statement-controls .btn, .statement-controls .select { min-height: 44px; }
/* "Secure your account" prompt and Profile checklist (#204) */
.account-security-banner {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom: 2px solid var(--color-accent);
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.account-security-banner[hidden] {
  display: none !important;
}
.account-security-banner-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 18rem;
  gap: 0.15rem;
}
.account-security-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.account-security-banner-actions .btn,
.security-checklist .btn {
  min-height: 44px;
}
.security-checklist {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.security-checklist li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
}
.security-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
}
.security-item-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 12rem;
}

/* Authenticator App QR Code (#196) */
.totp-qr-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin: 0.5rem 0 0.75rem;
}
.totp-qr-wrap[hidden] {
  display: none !important;
}

/* Failed Email Deliveries in Needs Attention (#195) */
.na-delivery-failures-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.na-failures-header {
  margin-bottom: 0.75rem;
}

.na-failures-header h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.na-failures-list {
  display: grid;
  gap: 0.75rem;
}

.delivery-failure-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #ef4444;
  border-radius: var(--radius-md);
}

.delivery-failure-info {
  flex: 1 1 260px;
  min-width: 0;
}

.delivery-failure-resend-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 0 1 auto;
}

.delivery-failure-email-input {
  min-height: 44px;
  min-width: 220px;
}

.delivery-failure-resend-btn {
  min-height: 44px;
  min-width: 88px;
}

/* Tidy wide-desktop landing hero spacing (#227) */
@media (min-width: 1120px) {
  .landing-hero {
    max-width: 1120px;
    margin: 0 auto;
    gap: 3rem;
  }
}

/* Today's Critical Items Strip above Fixture Grid (#228) */


.critical-pill-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

.critical-pill-warn {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}

.critical-pill-info {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}



/* ==========================================================================
   #207: Optional Per-League Matchday Board
   ========================================================================== */
.matchday-board-card {
  margin-bottom: 1rem;
}

.matchday-board-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.matchday-fixture-row {
  padding: 0.7rem 0.85rem;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.matchday-officials-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.matchday-official-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
}

.matchday-official-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   #224: Officials-First Mobile Home (3 Big Actions)
   ========================================================================== */
.official-mobile-home {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.official-mobile-home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.official-mobile-home-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.mobile-home-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: left;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.mobile-home-tile-btn {
  cursor: pointer;
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
}

.mobile-home-tile-btn:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.mobile-home-tile-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.mobile-home-tile-sub {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.mobile-home-tile-cta {
  margin-top: 0.25rem;
  align-self: flex-start;
}

.mobile-home-btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

/* ==========================================================================
   #208: Demo Site Notice Banner & Accessible Guided Tour Popover
   ========================================================================== */
.demo-site-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: rgba(245, 158, 11, 0.14);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 0.82rem;
}

.demo-site-banner-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.demo-tour-popover {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1200;
  max-width: 380px;
  width: calc(100vw - 2.5rem);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--accent);
}

.demo-tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.demo-tour-body {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.demo-tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-highlight {
    transition: none !important;
  }
}

/* ==========================================================================
   Liquid Glass Chrome & Modern UI Polish (iOS / Android App Prep)
   (#338: the glass tokens are defined once, in the #273 block below)
   ========================================================================== */
.topbar {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: inset 0 -1px 0 var(--glass-highlight);
  padding-top: max(0.65rem, env(safe-area-inset-top));
}

.subnav-bar {
  background: var(--glass-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.workspace-pills {
  background: color-mix(in srgb, var(--bg-app) 70%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0.25rem;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.workspace-pill {
  border-radius: var(--radius-full);
  transition: background-color 0.2s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease, transform 0.15s ease;
}

.workspace-pill.active {
  background: var(--color-accent-solid);
  color: var(--color-accent-contrast);
  border-color: transparent;
  box-shadow: 0 2px 8px var(--color-accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.date-preset-pill {
  background: var(--glass-bg-elevated);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.date-preset-pill:active,
.workspace-pill:active {
  transform: scale(0.97);
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .mobile-bottom-nav {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 62px;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  }
  .mobile-nav-btn {
    border-radius: var(--radius-full);
    padding: 0.35rem 0.65rem;
    transition: background-color 0.2s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease, transform 0.15s ease;
  }
  .mobile-nav-btn.active {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    font-weight: 700;
  }
  .mobile-nav-btn:active {
    transform: scale(0.94);
  }
}

#btn-floating-feedback,
.demo-tour-popover {
  background: var(--glass-bg-elevated);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

dialog::backdrop {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

dialog,
.modal-content {
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
}

.fixture-card,
.mobile-home-tile {
  border-radius: var(--radius-lg);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

@media (hover: hover) {
  .fixture-card:hover,
  .mobile-home-tile-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }
}

/* ==========================================================================
   #273: Apple Liquid Glass Navigation & Information Architecture Overhaul
   ========================================================================== */
/* #325: dark glass only in dark mode. It used to be the default, so with the system in light mode the
   header was dark grey while its text stayed dark slate (the inactive role toggle was barely visible). */
:root {
  --glass-blur: blur(22px) saturate(185%);
  --glass-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  --glass-bg: rgba(20, 27, 42, 0.62);
  --glass-bg-strong: rgba(17, 23, 38, 0.78);
  --glass-bg-pill: rgba(255, 255, 255, 0.06);
  --glass-bg-pill-hover: rgba(255, 255, 255, 0.11);
  --glass-bg-pill-active: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-strong: rgba(255, 255, 255, 0.24);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.34), 0 1px 2px rgba(0, 0, 0, 0.22);
  --glass-bg-elevated: rgba(31, 41, 61, 0.82);
  --glass-highlight: rgba(255, 255, 255, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass-bg: rgba(20, 27, 42, 0.62);
    --glass-bg-strong: rgba(17, 23, 38, 0.78);
    --glass-bg-pill: rgba(255, 255, 255, 0.06);
    --glass-bg-pill-hover: rgba(255, 255, 255, 0.11);
    --glass-bg-pill-active: rgba(255, 255, 255, 0.16);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-strong: rgba(255, 255, 255, 0.24);
    --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.24);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.34), 0 1px 2px rgba(0, 0, 0, 0.22);
    --glass-bg-elevated: rgba(31, 41, 61, 0.82);
    --glass-highlight: rgba(255, 255, 255, 0.14);
  }
}

:root,
[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.68);
  --glass-bg-strong: rgba(255, 255, 255, 0.86);
  --glass-bg-pill: rgba(15, 23, 42, 0.045);
  --glass-bg-pill-hover: rgba(15, 23, 42, 0.085);
  --glass-bg-pill-active: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(15, 23, 42, 0.10);
  --glass-border-strong: rgba(15, 23, 42, 0.16);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --glass-shadow: 0 10px 28px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06);
  --glass-bg-elevated: rgba(255, 255, 255, 0.84);
  --glass-highlight: rgba(255, 255, 255, 0.78);
}

/* Single-Row Floating Liquid Glass Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  overflow: visible;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 6px 24px rgba(0, 0, 0, 0.14);
  padding: 0.55rem 1.15rem;
  gap: 0.75rem;
  flex-wrap: nowrap;
  align-items: center;
}

.topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

/* Floating Liquid Glass Workspace Capsule */
.glass-capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: var(--glass-bg-pill);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.glass-capsule .workspace-pill {
  border-radius: 999px;
  padding: 0.36rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  transition: background 200ms var(--glass-spring), color 200ms var(--glass-spring), box-shadow 200ms var(--glass-spring), transform 180ms var(--glass-spring);
}

.glass-capsule .workspace-pill:hover {
  background: var(--glass-bg-pill-hover);
  color: var(--text-primary);
}

.glass-capsule .workspace-pill.active {
  background: var(--glass-bg-pill-active);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
  box-shadow: var(--glass-specular), 0 3px 10px rgba(0, 0, 0, 0.16);
}

/* Joined League + Season Liquid Glass Context Pill */
.glass-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.18rem 0.35rem;
  border-radius: 999px;
  background: var(--glass-bg-pill);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.glass-context-pill:empty {
  display: none;
}

.glass-context-pill .league-select-wrap {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0 0.25rem;
}

.glass-context-pill .select-league {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
  max-width: 215px;
}

.glass-context-divider {
  width: 1px;
  height: 18px;
  background: var(--glass-border-strong);
  margin: 0 0.15rem;
}

/* Glass Icon Button (Notifications Bell) */
.glass-icon-btn {
  position: relative;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  padding: 0;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg-pill);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  transition: background 180ms var(--glass-spring), transform 160ms var(--glass-spring);
}

.glass-icon-btn:hover {
  background: var(--glass-bg-pill-hover);
  transform: translateY(-1px);
}

.glass-icon-btn #notif-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.glass-icon-btn #notif-count-badge[hidden] {
  display: none;
}

/* Account Avatar Glass Capsule Trigger */
.nav-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.glass-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.65rem 0.2rem 0.24rem;
  border-radius: 999px;
  background: var(--glass-bg-pill);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 180ms var(--glass-spring), border-color 180ms var(--glass-spring), transform 160ms var(--glass-spring);
}

.glass-account-trigger:hover,
.glass-account-trigger[aria-expanded="true"] {
  background: var(--glass-bg-pill-hover);
  border-color: var(--glass-border-strong);
}

.glass-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent, #f97316), #ea580c);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.22);
}

.glass-account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.glass-account-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glass-account-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glass-chevron {
  opacity: 0.75;
  transition: transform 200ms var(--glass-spring);
}

[aria-expanded="true"] .glass-chevron {
  transform: rotate(180deg);
}

/* Frosted Liquid Glass Dropdown Menu */
.glass-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 252px;
  padding: 0.45rem;
  border-radius: 16px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--glass-specular), var(--glass-shadow);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.glass-dropdown-menu[hidden] {
  display: none;
}

.glass-dropdown-right {
  left: auto;
  right: 0;
}

.glass-menu-header {
  padding: 0.35rem 0.5rem 0.45rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.glass-menu-header:empty {
  display: none;
}

.glass-menu-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.glass-menu-divider {
  height: 1px;
  margin: 0.3rem 0.4rem;
  background: var(--glass-border);
}

.glass-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms var(--glass-spring), color 160ms var(--glass-spring);
}

.glass-menu-item[hidden] {
  display: none;
}

.glass-menu-item:hover,
.glass-menu-item:focus-visible {
  background: var(--glass-bg-pill-hover);
  outline: none;
}

.glass-menu-item.active {
  background: var(--glass-bg-pill-active);
  font-weight: 600;
}

.glass-menu-item-accent {
  color: var(--color-accent, #f97316);
  font-weight: 600;
}

.glass-menu-item-danger {
  color: var(--status-danger, #ef4444);
}

/* Tier 2: Floating Apple Liquid Glass Sub-Navigation Bar */
.glass-subnav {
  position: relative;
  z-index: 1100;
  overflow: visible;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 4px 18px rgba(0, 0, 0, 0.08);
  padding: 0.42rem 1.15rem;
}

.glass-subnav .role-tabs {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
  overflow: visible;
}

.glass-subnav .role-tab:not(.glass-menu-item) {
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  transition: background 200ms var(--glass-spring), color 200ms var(--glass-spring), border-color 200ms var(--glass-spring), box-shadow 200ms var(--glass-spring);
}

.glass-subnav .role-tab:not(.glass-menu-item):hover {
  background: var(--glass-bg-pill-hover);
  color: var(--text-primary);
}

.glass-subnav .role-tab:not(.glass-menu-item).active {
  background: var(--glass-bg-pill-active);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
  box-shadow: var(--glass-specular), 0 3px 12px rgba(0, 0, 0, 0.14);
}

/* Seasons Modal Sub-Tabs & Fee Schedule Table (#274) */
.seasons-modal-tabs {
  width: fit-content;
}

.fee-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.fee-schedule-table th,
.fee-schedule-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  text-align: left;
}

.fee-schedule-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .topbar {
    flex-wrap: wrap;
    padding: 0.5rem 0.8rem;
  }
  .glass-account-meta {
    display: none;
  }
  .glass-account-trigger {
    padding: 0.2rem 0.35rem 0.2rem 0.2rem;
  }
  .glass-context-pill .select-league {
    max-width: 135px;
  }
}

/* #278: Mobile Topbar & Form Overflow Polish */
@media (max-width: 768px) {
  body {
    overflow-x: clip;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.5rem 0.75rem;
  }
  .topbar .brand {
    order: 1;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    gap: 0.45rem;
  }
  .topbar .brand-subtitle {
    display: none;
  }
  .topbar .topbar-actions {
    display: contents;
  }
  .topbar #btn-open-notifications,
  .topbar #btn-landing-signin,
  .topbar #btn-open-auth-modal {
    order: 2;
  }
  .topbar #wrap-account-menu {
    order: 3;
  }
  .topbar .glass-context-pill {
    order: 4;
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    overflow: hidden;
    padding: 0.16rem 0.3rem;
  }
  .topbar .glass-context-pill .league-switcher {
    flex: 1 1 0;
    min-width: 0;
  }
  .topbar .glass-context-pill .league-select-wrap {
    width: 100%;
    min-width: 0;
  }
  .topbar .glass-context-pill .select-league {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 0.78rem;
    text-overflow: ellipsis;
  }
  .topbar #workspace-switcher.glass-capsule {
    order: 5;
    flex: 1 0 100%;
    width: 100%;
  }
  .topbar #workspace-switcher .workspace-pill {
    flex: 1 1 0;
    text-align: center;
    padding: 0.34rem 0.5rem;
    font-size: 0.8rem;
  }
  .glass-subnav {
    padding: 0.35rem 0.75rem;
  }
  .glass-subnav .role-tabs {
    gap: 0.22rem;
  }
  .glass-subnav .role-tab:not(.glass-menu-item) {
    padding: 0.34rem 0.68rem;
    font-size: 0.78rem;
  }
  .glass-breadcrumb-bar {
    padding: 0.35rem 0.75rem;
    gap: 0.5rem;
  }
  .role-view,
  .role-view .card,
  .workbench-split-pane,
  .workbench-left-pane,
  .fixture-deck-card,
  .card-top-bar,
  .card-matchup-box,
  .card-venue-row,
  .form-field,
  .form-grid,
  .form-grid > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  /* #279: Prevent 1fr grid tracks & nowrap venue text from clipping fixture cards past 390px viewports */
  .fixture-cards-deck,
  .deck-slots-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .fixture-deck-card {
    padding: 0.85rem;
    overflow: hidden;
  }
  .card-top-bar {
    flex-wrap: wrap;
  }
  .card-teams {
    font-size: 0.96rem;
    overflow-wrap: anywhere;
  }
  .card-venue-info {
    min-width: 0;
    flex: 1 1 auto;
  }
  .mobile-bottom-nav {
    bottom: max(6px, env(safe-area-inset-bottom));
    height: 56px;
  }
  .role-view .card select,
  .role-view .card input:not([type="checkbox"]):not([type="radio"]),
  .role-view .card textarea,
  .form-field select,
  .form-field input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .role-view .card label,
  .form-label {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

/* #276: Liquid Glass Back & Breadcrumb Navigation Bar */
.topbar .brand {
  cursor: pointer;
}

.glass-breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.42rem 1.25rem;
  background: var(--glass-bg-pill);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  position: relative;
  z-index: 50;
}

.glass-breadcrumb-bar[hidden] {
  display: none;
}

.glass-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-pill);
  box-shadow: var(--glass-specular);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms var(--glass-spring), transform 140ms var(--glass-spring), border-color 160ms var(--glass-spring);
}

.glass-back-btn[hidden] {
  display: none;
}

.glass-back-btn:hover,
.glass-back-btn:focus-visible {
  background: var(--glass-bg-pill-hover);
  border-color: var(--glass-border-strong);
  transform: translateX(-1px);
  outline: none;
}

.breadcrumb-trail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-item.current {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 140ms ease;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus-visible {
  color: var(--color-accent, #f97316);
  text-decoration: underline;
  outline: none;
}

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.65;
  user-select: none;
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .subnav-bar,
  .glass-subnav,
  .glass-capsule,
  .glass-context-pill,
  .glass-dropdown-menu,
  .glass-breadcrumb-bar,
  .mobile-bottom-nav,
  #btn-floating-feedback,
  .demo-tour-popover {
    background: var(--bg-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  dialog::backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-pill,
  .role-tab,
  .glass-account-trigger,
  .glass-icon-btn,
  .glass-back-btn,
  .glass-menu-item,
  .glass-chevron,
  .date-preset-pill,
  .mobile-nav-btn,
  .fixture-card,
  .official-mobile-home-tile {
    transition: none !important;
    transform: none !important;
  }
}

/* #307: Per-League Rules, Documents Library & Interactive Film Room */
.res-shell { max-width: 1280px; margin: 0 auto; padding: 1rem 1.25rem 2.5rem; }
.res-ref-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.res-ref-pill {
  display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem;
  padding: 0.35rem 0.75rem; border-radius: 999px; text-decoration: none;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-primary);
}
.res-ref-pill:hover { border-color: var(--color-accent-solid); }
.res-docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.9rem; margin-top: 0.85rem; }
.res-doc-card { padding: 1rem; }
.res-match-snippet {
  margin-top: 0.5rem; padding: 0.45rem 0.65rem; font-size: 0.8rem; border-radius: var(--radius-sm);
  background: rgba(249, 115, 22, 0.1); border-left: 3px solid var(--color-accent-solid); color: var(--text-primary);
}
.res-viewer-pane { margin-top: 1rem; padding: 1rem; }
.res-pdf-frame { width: 100%; height: 68vh; min-height: 460px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: #fff; }
.res-reader-content { max-height: 65vh; overflow-y: auto; padding: 0.85rem 1rem; border-radius: var(--radius-sm); background: var(--bg-app); border: 1px solid var(--border-subtle); line-height: 1.6; }
.res-reader-content h3, .res-reader-content h4 { margin: 0.9rem 0 0.35rem; color: var(--text-primary); }
.res-reader-content p { margin: 0.4rem 0; color: var(--text-secondary); }
.doc-reader-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.85rem; }
.doc-reader-table td { border: 1px solid var(--border-subtle); padding: 0.4rem 0.6rem; }
.res-film-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1rem; margin-top: 0.9rem; }
.res-film-card { padding: 1rem; display: flex; flex-direction: column; }
.res-video-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.res-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.res-film-scenario { margin: 0.6rem 0 0.7rem; font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); }
.res-ruling-box {
  margin-top: 0.65rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm);
  background: var(--bg-app); border: 1px solid var(--border-strong); border-left: 3px solid var(--color-accent-solid);
}
.res-ruling-verdict { font-weight: 800; font-size: 0.92rem; color: var(--color-accent-solid); }
:root[data-theme="dark"] .res-ruling-verdict { color: var(--color-accent); }
@media (max-width: 640px) { .res-film-grid, .res-docs-grid { grid-template-columns: 1fr; } }




/* #323: game-day links and buttons a referee taps on the move need a 44px target */
.hero-directions-link,
.hero-assignor-contact .assignor-link,
.mode-pill[data-avail-mode] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.hero-assignor-contact {
  flex-wrap: wrap;
  gap: 0.5rem;
}
.btn-call-assignor {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  font-weight: 700;
  text-decoration: none;
}

/* #324: anything scrolled into view (focus, deep links) stops clear of the sticky header and the floating nav */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 120px;
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .role-view:last-of-type,
  main.role-view {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* #321: the Inspector says which day the fixture is on before anything else */
.drawer-game-date {
  margin-top: 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* #328: compact KPI strip, one row of counts that filter the grid */
.kpi-strip.kpi-strip--compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.kpi-strip--compact .kpi-card {
  flex: 1 1 120px;
  flex-direction: row;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  min-height: 44px;
}
.kpi-strip--compact .kpi-value {
  font-size: 1.3rem;
  line-height: 1;
}
.kpi-strip--compact .kpi-label {
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
}
.toolbar-sync-pill-wrap[hidden] {
  display: none !important;
}

/* #329: shorter fixture rows (time, one-line matchup, one meta line) */
.compact-table td {
  vertical-align: middle;
}
.compact-table .cell-status {
  width: 64px;
  white-space: nowrap;
}
.health-badge-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.compact-table .cell-date-tipoff {
  width: 96px;
  white-space: nowrap;
}
.tipoff-time {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.tipoff-day {
  font-size: 0.72rem;
}
.fixture-matchup-line {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.25;
}
.fixture-comp-subtext {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tag-carpool-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.45);
  cursor: help;
}

/* #330: appoint popover beside a slot */
.appoint-popover {
  position: absolute;
  z-index: 1500;
  background: var(--bg-elevated, var(--bg-surface));
  border: 1px solid var(--border-strong, var(--border-subtle));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 18px 44px -12px rgba(0, 0, 0, 0.35));
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.appoint-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.appoint-popover-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.appoint-popover-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.appoint-popover-option:hover,
.appoint-popover-option:focus-visible {
  border-color: var(--color-accent);
}
.appoint-popover-name {
  font-weight: 700;
}
.appoint-popover-more {
  align-self: flex-end;
}

/* #331: travel beyond the limit */
.miles-over {
  color: var(--status-critical);
  font-weight: 800;
}

/* #332: referee schedule sub-tabs, one section at a time */
.portal-subtabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  margin: 0 0 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface);
  width: fit-content;
  max-width: 100%;
}
.portal-subtab {
  min-height: 44px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
}
.portal-subtab.active {
  background: var(--color-accent-solid);
  color: var(--color-accent-contrast, #fff);
}
#view-OFFICIAL_PORTAL[data-portal-tab="games"] [data-portal-section]:not([data-portal-section="games"]),
#view-OFFICIAL_PORTAL[data-portal-tab="slots"] [data-portal-section]:not([data-portal-section="slots"]),
#view-OFFICIAL_PORTAL[data-portal-tab="availability"] [data-portal-section]:not([data-portal-section="availability"]) {
  display: none !important;
}
#view-OFFICIAL_PORTAL[data-portal-tab] .portal-grid {
  grid-template-columns: minmax(0, 1fr);
}
#view-OFFICIAL_PORTAL[data-portal-tab="availability"] .portal-grid > .portal-side-stack:first-child,
#view-OFFICIAL_PORTAL[data-portal-tab="slots"] .portal-grid > .portal-side-stack[data-portal-section="availability"] {
  display: none;
}
@media (max-width: 768px) {
  .portal-subtabs {
    width: 100%;
  }
  .portal-subtab {
    flex: 1 1 0;
    padding: 0 0.5rem;
  }
}

/* #332: completed games collapsed by default */
.hub-appts-completed-summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* #333: on phones the bottom bar is the navigation; the top tabs would only repeat it.
   Assignors keep the League Setup menu, which the bottom bar does not cover. */
@media (max-width: 768px) {
  body[data-mobile-nav-workspace="OFFICIAL"] #subnav-bar,
  body[data-mobile-nav-workspace="CLUB"] #subnav-bar,
  body[data-mobile-nav-workspace="VIEWER"] #subnav-bar {
    display: none !important;
  }
  body[data-mobile-nav-workspace="ASSIGNOR"] #main-nav-tabs > .role-tab {
    display: none !important;
  }
  .mobile-nav-btn {
    min-height: 48px;
  }
  .mobile-nav-btn[aria-current="page"] .mobile-nav-label {
    font-weight: 800;
  }
}

/* #334: call a crew partner close to tip-off */
.btn-call-partner {
  min-height: 36px;
  margin-left: 0.35rem;
  text-decoration: none;
}
@media (pointer: coarse) {
  .btn-call-partner {
    min-height: 44px;
  }
}

/* #329: give the matchup room; venue and crew take what is left */
#games-compact-table td[data-label="Fixture & Competition"] {
  min-width: 210px;
}
#games-compact-table td.cell-venue {
  max-width: 170px;
}
#games-compact-table td.cell-venue .venue-full-hint {
  display: none;
}

/* #340: matchday card */
.matchday-card {
  border: 2px solid var(--color-accent);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.matchday-eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}
.matchday-head h2 {
  margin: 0.15rem 0;
  font-size: 1.15rem;
}
.matchday-times {
  margin: 0;
}
.matchday-directions,
.matchday-actions .btn,
.matchday-report {
  min-height: 48px;
}
.matchday-subhead {
  margin: 0;
  font-size: 0.85rem;
}
.matchday-partners {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.matchday-partner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.matchday-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.matchday-directions {
  white-space: normal;
  height: auto;
  text-align: center;
  line-height: 1.3;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* #354: the installed iOS app draws under the status bar (black-translucent + viewport-fit=cover).
   Keep this last: earlier .topbar rules (glass topbar, <=960px, <=768px) reset padding with the
   shorthand, which hid the header's first row (logo, notifications, account menu) under the clock. */
.topbar {
  padding-top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

/* #364: coverage map */
.coverage-wrap { padding: 0.75rem 0; }
.coverage-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-bottom: 0.75rem; font-size: 0.9rem; }
.coverage-toolbar label { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; }
.coverage-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; }
.coverage-map { height: 560px; border-radius: 12px; border: 1px solid var(--border-color, #e2e8f0); }
.coverage-review { max-height: 560px; overflow-y: auto; }
.coverage-review h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.coverage-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; font-size: 0.8rem; color: var(--text-secondary); margin: 0 0 0.75rem; }
.coverage-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.3rem; vertical-align: -1px; }
.coverage-legend .coverage-legend-district { background: rgba(59, 130, 246, 0.35); border: 1px solid #1d4ed8; }
.coverage-legend .coverage-legend-club, .coverage-club-icon span { background: #7c3aed; border: 2px solid #fff; border-radius: 3px; }
.coverage-club-icon span { display: block; width: 14px; height: 14px; box-shadow: 0 0 0 1px #4c1d95; }
.coverage-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.coverage-finding { border-left: 4px solid #64748b; padding: 0.45rem 0.6rem; background: var(--bg-surface-subtle, rgba(100, 116, 139, 0.06)); border-radius: 6px; }
.coverage-finding.sev-CRITICAL { border-left-color: #b91c1c; }
.coverage-finding.sev-WARNING { border-left-color: #b45309; }
.coverage-finding p { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-secondary); }
.coverage-sev { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.coverage-finding-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text-primary); text-align: left; text-decoration: underline; cursor: pointer; }
.coverage-note { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.75rem; }
.coverage-tables { margin-top: 1rem; }
.coverage-tables summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
@media (max-width: 960px) {
  .coverage-layout { grid-template-columns: 1fr; }
  .coverage-map { height: 420px; }
  .coverage-review { max-height: none; }
}

/* #366: development groups */
.dg-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; font-weight: 600; padding: 0.08rem 0.45rem; border-radius: 999px; border: 1px solid var(--dg, #2563eb); color: var(--text-primary); background: color-mix(in srgb, var(--dg, #2563eb) 14%, transparent); white-space: nowrap; }
.dg-chip::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dg, #2563eb); }
.dg-chip-blocked { --dg: #b91c1c; }
.dg-intro { margin-bottom: 1rem; }
.dg-toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; min-height: 44px; }
.dg-off { font-size: 0.85rem; color: var(--text-secondary); font-style: italic; }
.dg-table td { vertical-align: middle; }
.dg-members, .dg-create, .dg-rule-form { margin-top: 1rem; display: grid; gap: 0.6rem; }
.dg-members h4, .dg-create h4 { margin: 0; display: flex; gap: 0.4rem; align-items: center; }
.dg-member-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; display: grid; gap: 0.15rem; border: 1px solid var(--border-subtle, #e2e8f0); border-radius: 8px; padding: 0.5rem; }
.dg-member-list label { display: flex; align-items: center; gap: 0.5rem; min-height: 36px; cursor: pointer; }
.dg-actions, .dg-create-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.dg-create-row label { display: grid; gap: 0.2rem; font-size: 0.85rem; }
.dg-rules-card { padding: 1rem; display: grid; gap: 0.75rem; }
.dg-rules-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.dg-rules-head h2 { margin: 0; font-size: 1.05rem; }
.dg-rule-form fieldset { border: 1px solid var(--border-subtle, #e2e8f0); border-radius: 8px; padding: 0.6rem 0.8rem; }
.dg-rule-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.35rem 0; }
.dg-rule-div { min-width: 8rem; font-weight: 600; }
.dg-rule-groups { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; }
.dg-rule-group { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 32px; cursor: pointer; }
.dg-table th, .dg-table td { padding: 0.45rem 0.75rem; text-align: left; }
.dg-table { border-collapse: collapse; width: 100%; }
.dg-table tbody tr { border-top: 1px solid var(--border-subtle, #e2e8f0); }
.dg-rule-form > button, .dg-create-row > button { justify-self: start; }
.candidate-card-groups { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.3rem 0 0.1rem; }

/* #369: self-healing cover */
.attention-autocover { margin: 0.35rem 0 0; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.attention-autocover.is-active { color: var(--text-primary); }
.attention-card-action { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.cover-offers-card { border-left: 4px solid var(--status-critical-solid, #b91c1c); padding: 1rem 1.1rem; }
.cover-offers-title { margin: 0 0 0.25rem; font-size: 1.1rem; }
.cover-offer-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.cover-offer { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; align-items: center; padding: 0.6rem 0.75rem; border: 1px solid var(--border-subtle, #e2e8f0); border-radius: 10px; }
.cover-offer-actions { display: flex; gap: 0.5rem; }
.cover-offer-actions .btn { min-height: 44px; }
.auto-cover-settings { margin-top: 1.25rem; padding: 1rem; background: var(--bg-app); border: 1px solid var(--border-subtle); }
.auto-cover-settings h4 { margin: 0 0 0.35rem; }
.auto-cover-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; font-size: 0.88rem; }
.auto-cover-row .input { width: 5rem; display: inline-block; }
.auto-cover-check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; }

/* #373: My leagues in the profile */
.my-leagues { margin-top: 0.75rem; padding: 0.75rem; }
.my-leagues h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.my-leagues h4 { margin: 0.75rem 0 0.3rem; font-size: 0.85rem; }
.my-leagues-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.my-leagues-list li { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; font-size: 0.88rem; }
.my-leagues-role, .my-leagues-status { font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--bg-app); border: 1px solid var(--border-subtle); }
.my-leagues-status.status-pending { border-color: #b45309; }
.my-leagues-status.status-approved { border-color: #15803d; }
.my-leagues-status.status-rejected { border-color: #b91c1c; }
.my-leagues-join { display: grid; gap: 0.35rem; margin-top: 0.5rem; }
.my-leagues-join button { justify-self: start; }
.demo-personas-first { margin-bottom: 1.25rem; }
.demo-personas-first .oauth-divider { margin-top: 0; }

/* #379: first paint. Until start-up decides, a signed-out visitor sees neither the landing page nor the sign-in
   screen (the demo goes straight to its persona choice), and the league/season pill never shows empty. */
body.is-booting .role-view { visibility: hidden; }
body.is-booting::after { content: ""; position: fixed; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 3px solid var(--border-subtle, #cbd5e1); border-top-color: var(--color-accent-solid, #c2410c); animation: cc-boot-spin 0.8s linear infinite; }
@keyframes cc-boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body.is-booting::after { animation: none; } }
body.is-signed-out #topbar-context-pill { display: none !important; }

/* #379: landing page additions */
.landing-inline-cta { display: flex; justify-content: center; margin-top: 1.5rem; }
.landing-trust, .landing-faq { max-width: 960px; margin: 0 auto; padding: 2rem 1.25rem; }
.landing-trust-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.landing-trust-list li { padding: 1rem; border-radius: 14px; border: 1px solid var(--border-subtle, #e2e8f0); background: var(--bg-surface, #fff); line-height: 1.5; font-size: 0.95rem; }
.landing-trust-list strong { display: block; margin-bottom: 0.25rem; }
.landing-faq details { border-bottom: 1px solid var(--border-subtle, #e2e8f0); padding: 0.25rem 0; }
.landing-faq summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.landing-faq details p { margin: 0 0 0.85rem; line-height: 1.55; color: var(--text-secondary); }
@media (max-width: 640px) {
  .landing-title { font-size: clamp(2rem, 9vw, 2.6rem); }
}
.landing-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.landing-metric strong { font-size: 1.1rem; }
.landing-metric span { font-size: 0.88rem; line-height: 1.45; }
@media (max-width: 760px) { .landing-metrics { grid-template-columns: 1fr; } }

/* #383: shared venues, club home venues, league venue mode */
.venue-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.venue-notes-line { margin-top: 0.3rem; }
.venue-notes-heading { margin: 1rem 0 0.5rem; font-size: 0.95rem; }
.shared-panel:empty, #directory-venue-corrections:empty { display: none; }
.venue-mode-fieldset { border: 1px solid var(--border-color); border-radius: 8px; padding: 0.75rem; margin: 0.75rem 0; }
.venue-mode-fieldset legend { font-weight: 600; padding: 0 0.25rem; }
.venue-mode-choice, .club-home-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.venue-mode-central { margin: 0.4rem 0 0.6rem 1.5rem; max-height: 12rem; overflow-y: auto; }
.club-home-venues { max-height: 16rem; overflow-y: auto; margin-bottom: 0.75rem; }
.club-home-row label:first-of-type { flex: 1; }
.venue-correction { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.venue-correction-actions { display: flex; gap: 0.35rem; align-items: center; }
.venue-league-notes { margin-top: 0.35rem; }

/* #386: short help under a field, and plain grade names */
.form-hint { display: block; margin-top: 0.3rem; font-size: 0.8rem; line-height: 1.35; color: var(--text-secondary); }
.grade-detail { display: block; margin-top: 0.15rem; font-size: 0.75rem; color: var(--text-muted); }
button.tag-button { cursor: pointer; font: inherit; border: 1px solid transparent; min-height: 32px; }
button.tag-button:hover, button.tag-button:focus-visible { border-color: var(--border-color); }

/* #387 Grade Levels page */
.gs-page { display: grid; gap: 1rem; }
.gs-header { padding: 1.15rem 1.25rem; }
.gs-header h1 { margin: 0; font-size: 1.35rem; }
.gs-header .subtext { margin: 0.35rem 0 0; max-width: 70ch; }
.gs-top { padding: 1rem 1.25rem; display: grid; gap: 0.75rem; }
.gs-current { margin: 0; }
.gs-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.gs-picker select { min-width: 14rem; max-width: 100%; }
.gs-new-form { display: grid; gap: 0.4rem; max-width: 28rem; }
.gs-new-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.gs-note { margin: 0; color: var(--text-secondary); font-size: 0.9rem; }
.gs-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.gs-card { padding: 1rem; display: grid; gap: 0.75rem; align-content: start; }
.gs-card-head { display: grid; gap: 0.2rem; }
.gs-card-title { margin: 0; font-size: 1.05rem; }
.gs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.gs-level { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); }
.gs-level.gs-retired .gs-name { text-decoration: line-through; opacity: 0.7; }
.gs-level.gs-dragging { opacity: 0.5; }
.gs-level.gs-drop { outline: 2px dashed currentColor; outline-offset: 2px; }
.gs-handle { cursor: grab; user-select: none; color: var(--text-secondary); padding: 0 0.15rem; }
.gs-pos { min-width: 1.5rem; text-align: center; font-weight: 700; color: var(--text-secondary); }
.gs-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 0.15rem; }
.gs-name { width: 100%; }
.gs-usage { font-size: 0.78rem; }
.gs-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.gs-actions .btn { min-width: 2.75rem; min-height: 2.75rem; }
.gs-card-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; }
/* #393 Officials' grades */
.gs-off-tools { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.gs-off-tools .input { flex: 1 1 12rem; max-width: 20rem; }
.gs-off-check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; }
.gs-off-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-height: 32rem; overflow-y: auto; }
.gs-off-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem 0.75rem; align-items: end; padding: 0.6rem; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); }
.gs-off-who { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; min-width: 0; }
.gs-off-who .subtext { flex-basis: 100%; font-size: 0.8rem; }
.gs-off-field { display: grid; gap: 0.15rem; min-width: 0; }
.gs-off-field label { font-size: 0.8rem; color: var(--text-secondary); }
.gs-off-field select { width: 100%; }
.gs-tag { font-size: 0.72rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--color-accent-subtle); color: var(--text-primary); }
.gs-tag-warn { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.gs-off-empty { margin: 0; }
/* #396 Recent changes */
.gs-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.gs-history-item { padding: 0.6rem 0.75rem; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); display: grid; gap: 0.25rem; }
.gs-history-head { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; justify-content: space-between; }
.gs-history-summary { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.gs-history-changes summary { cursor: pointer; font-size: 0.85rem; min-height: 2.75rem; display: flex; align-items: center; }
.gs-history-changes ul { margin: 0.25rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; display: grid; gap: 0.2rem; }
@media (max-width: 560px) {
  .gs-level { flex-wrap: wrap; }
  .gs-handle { display: none; }
  .gs-main { flex-basis: calc(100% - 2.5rem); }
  .gs-actions { width: 100%; justify-content: flex-end; }
  .gs-off-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gs-off-who { grid-column: 1 / -1; }
  .gs-off-list { max-height: none; }
}
