:root {
  /* Brand Colors - Refined Green/Teal Theme */
  --tl-primary: #0f766e;           /* Teal primary */
  --tl-primary-light: #14b8a6;     /* Lighter teal for accents */
  --tl-primary-dark: #0d5f57;      /* Darker teal for depth */
  --tl-primary-soft: #ccfbf1;      /* Soft teal backgrounds */
  --tl-success: #22c55e;           /* Green for success */
  --tl-success-light: #bbf7d0;     /* Light success for text */
  --tl-warning: #f59e0b;           /* Amber for warnings */
  --tl-danger: #ef4444;            /* Red for errors/danger */
  --tl-danger-dark: #dc2626;       /* Darker danger for hover */
  --tl-danger-light: #fecaca;      /* Light danger for text */

  /* Backgrounds - Consistent Dark Theme */
  --tl-bg: #020617;                /* Deep slate background */
  --tl-surface: #0f172a;           /* Card/surface background */
  --tl-surface-elevated: #1e293b;  /* Elevated surfaces */
  --tl-surface-hover: rgba(15, 118, 110, 0.1); /* Hover state with primary color */

  /* Text Colors */
  --tl-text: #e5e7eb;              /* Primary text */
  --tl-text-secondary: #9ca3af;    /* Secondary text (alias for muted) */
  --tl-text-muted: #9ca3af;        /* Muted text */
  --tl-text-disabled: #6b7280;     /* Disabled text */

  /* Borders */
  --tl-border: rgba(148, 163, 184, 0.2);      /* Subtle borders */
  --tl-border-strong: rgba(148, 163, 184, 0.3); /* Stronger borders */

  /* Border Radius - Consistent rounding */
  --tl-radius-xs: 4px;             /* Extra small - details */
  --tl-radius-sm: 8px;             /* Small - buttons, badges */
  --tl-radius-md: 12px;            /* Medium - cards */
  --tl-radius-lg: 16px;            /* Large - modals, containers */
  --tl-radius-pill: 999px;         /* Pill-shaped elements */

  /* Shadows - Depth system */
  --tl-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --tl-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --tl-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --tl-shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.2);
  --tl-shadow-glow: 0 0 20px rgba(15, 118, 110, 0.3);
  --tl-shadow-glow-danger: 0 0 15px rgba(239, 68, 68, 0.4);
  --tl-shadow-focus: 0 0 0 3px rgba(15, 118, 110, 0.15);

  /* Typography */
  --tl-font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Global styled scrollbars */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--tl-border);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--tl-text-muted);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--tl-border) transparent;
}

body {
  margin: 0;
  font-family: var(--tl-font);
  background: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #000 100%);
  background-attachment: fixed;
  color: var(--tl-text);
  -webkit-font-smoothing: antialiased;
}

/* Form elements font reset */
input,
textarea,
select,
button {
  font-family: inherit;
}

/* Layout helpers */

.tl-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Utility classes for common inline styles */

.tl-page-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tl-page-header-flex h1,
.tl-page-header-flex h2 {
  margin: 0;
}

.tl-button-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Allow buttons in button groups to shrink and show ellipsis */
.tl-button-group .tl-button {
  flex: 0 1 auto;
  min-width: 0;
}

/* Flex utility classes */
.tl-flex {
  display: flex;
}

.tl-flex-col {
  display: flex;
  flex-direction: column;
}

.tl-flex-wrap {
  flex-wrap: wrap;
}

.tl-items-center {
  align-items: center;
}

.tl-items-start {
  align-items: flex-start;
}

.tl-justify-between {
  justify-content: space-between;
}

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

.tl-gap-sm {
  gap: 8px;
}

.tl-gap-md {
  gap: 12px;
}

.tl-gap-lg {
  gap: 16px;
}

/* Section header with title and actions */
.tl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Action row with buttons */
.tl-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tl-error-message {
  display: none;
  color: #fecaca;
  margin-bottom: 0.5rem;
}

.tl-success-message {
  display: none;
  color: #bbf7d0;
  margin-bottom: 0.5rem;
}

.tl-hidden {
  display: none;
}

.tl-no-margin {
  margin: 0 !important;
}

.tl-section-spacing {
  margin-top: 18px;
}

.tl-content-spacing {
  margin-top: 10px;
}

.tl-form-spacing {
  margin-top: 16px;
}

.tl-muted {
  opacity: 0.85;
}

/* Header */

.tl-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(15,23,42,0.95), rgba(15,23,42,0.85));
  border-bottom: 1px solid rgba(148,163,184,0.2);
}

.tl-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
}

.tl-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.tl-logo-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.tl-logo-mark {
  background: radial-gradient(circle at 20% 0, #a7f3d0 0, #14b8a6 30%, #0f766e 100%);
  color: #022c22;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(45,212,191,0.55);
}

.tl-logo-text {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.tl-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.tl-nav a {
  text-decoration: none;
  color: var(--tl-text-muted);
}

.tl-nav a:hover {
  color: #e5e7eb;
}

.tl-nav-login {
  padding-right: 0.5rem;
}

/* Buttons */

.tl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--tl-radius-sm);
  border: none;
  background: linear-gradient(120deg, var(--tl-primary) -10%, var(--tl-success) 110%);
  color: #ecfeff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  height: 40px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--tl-shadow-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  box-sizing: border-box;
}

.tl-button:hover {
  filter: brightness(0.8);
  box-shadow: none;
}

.tl-button:active {
  box-shadow: var(--tl-shadow-sm);
}



.tl-button-large {
  padding: 0.7rem 1.6rem;
  font-size: 0.95rem;
}

.tl-button-full {
  width: 100%;
}

.tl-button-warning {
  background: linear-gradient(135deg, var(--tl-danger), #dc2626);
  box-shadow: var(--tl-shadow-md);
}

.tl-button-warning:hover {
  box-shadow: var(--tl-shadow-lg);
}

.tl-button-warning:active {
  box-shadow: var(--tl-shadow-sm);
}

.tl-button-ghost {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border-strong);
  box-shadow: var(--tl-shadow-sm);
  color: var(--tl-text);
  padding: 0.625rem 1.25rem;
  box-sizing: border-box;
}

.tl-button-ghost:hover {
  background: var(--tl-surface-hover);
  border-color: var(--tl-primary);
  color: var(--tl-primary);
  box-shadow: var(--tl-shadow-md);
}

.tl-button-ghost:active {
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow-sm);
}

.tl-button-danger {
  background: var(--tl-danger) !important;
  border: 1px solid var(--tl-danger) !important;
  color: #ffffff !important;
  box-shadow: var(--tl-shadow-md) !important;
}

.tl-button-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: var(--tl-shadow-lg);
}

.tl-button-danger:active {
  background: #b91c1c;
}

.tl-button-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.tl-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--tl-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9px;
  margin-left: 6px;
}

.tl-request-card {
  padding: 16px;
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.tl-request-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.tl-request-card-name {
  font-weight: 600;
  color: var(--tl-text);
}

.tl-request-card-via {
  font-weight: 400;
  font-size: 12px;
  color: var(--tl-muted);
  margin-left: 4px;
}

.tl-request-card-email {
  font-size: 0.85rem;
  color: var(--tl-muted);
}

.tl-request-card-date {
  font-size: 0.8rem;
  color: var(--tl-muted);
}

.tl-request-card-message {
  font-size: 0.9rem;
  color: var(--tl-text-secondary);
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  font-style: italic;
}

.tl-request-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tl-request-status {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
}

.tl-request-status-pending {
  background: var(--tl-warning);
  color: #000;
}

.tl-request-status-approved {
  background: var(--tl-success);
  color: #000;
}

.tl-request-status-rejected {
  background: var(--tl-danger);
  color: #fff;
}

.tl-requests-filter {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 3px;
}

.tl-requests-filter-btn {
  border: none !important;
  background: transparent !important;
  color: var(--tl-text-muted) !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}

.tl-requests-filter-btn:hover:not(.tl-requests-filter-active) {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--tl-text) !important;
}

.tl-requests-filter-active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--tl-text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* History toggle for requests - reuses tl-standalone-past-section pattern */
.tl-history-section {
  margin-top: 16px;
}

.tl-history-section .tl-standalone-past-header {
  width: 100%;
}

.tl-history-section .tl-standalone-past-list {
  padding: 12px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--tl-border);
  border-top: none;
  border-radius: 0 0 var(--tl-radius-md) var(--tl-radius-md);
  opacity: 0.7;
}

.tl-history-section .tl-standalone-past-list p.tl-muted {
  margin: 0;
}

.tl-link-button {
  border: none;
  background: none;
  color: var(--tl-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
}

.tl-link-button:hover {
  color: #e5e7eb;
}


/* Hero */

.tl-hero {
  padding: 3rem 0 0;
}

.tl-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.4rem;
  align-items: center;
}

.tl-hero-inner.tl-hero-centered {
  display: block;
}

.tl-hero-text h1 {
  font-size: clamp(2.2rem, 3.1vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.tl-hero-text p {
  color: var(--tl-text-muted);
  font-size: 0.98rem;
  max-width: 34rem;
}

.tl-hero-actions {
  margin: 1.5rem 0 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.tl-hero-note {
  font-size: 0.8rem;
  color: #9ca3af;
}

.tl-hero-card {
  border-radius: var(--tl-radius-lg);
  border: 1px solid rgba(148,163,184,0.35);
  background:
    radial-gradient(circle at 0 0, rgba(14,165,233,0.35) 0, transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(45,212,191,0.35) 0, transparent 45%),
    rgba(15,23,42,0.98);
  box-shadow: var(--tl-shadow-soft);
  overflow: hidden;
}

.tl-hero-card-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(148,163,184,0.25);
  background: linear-gradient(to right, #020617, rgba(15,23,42,0.96));
  font-size: 0.78rem;
  color: #9ca3af;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.dot-red {
  background: #f97373;
}

.dot-amber {
  background: #facc15;
}

.dot-green {
  background: #4ade80;
}

.tl-hero-card-title {
  margin-left: auto;
  font-weight: 500;
}

.tl-hero-card-body {
  padding: 0.9rem 1rem 1rem;
  font-size: 0.92rem;
}

.tl-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.tl-hero-row-pill {
  gap: 0.4rem;
}

.tl-pill {
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(148,163,184,0.55);
}

.tl-pill-green {
  background: rgba(22,163,74,0.2);
  color: #bbf7d0;
  border-color: rgba(74,222,128,0.6);
}

.tl-pill-amber {
  background: rgba(234,179,8,0.12);
  color: #facc15;
  border-color: rgba(250,204,21,0.6);
}

/* Right-align the amber unpaid pill inside session cards */
.tl-session-card-body .tl-pill-amber {
  display: block;
  margin-left: auto;
}

.tl-hero-card-body hr {
  border: none;
  border-top: 1px solid rgba(148,163,184,0.2);
  margin: 0.7rem 0 0.6rem;
}

.tl-hero-teams {
  align-items: flex-start;
  gap: 1.2rem;
}

.tl-hero-teams h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
  margin: 0 0 0.3rem;
}

.tl-hero-teams ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* Sections */

.tl-section {
  padding: 2.8rem 0;
}

.tl-section-contrast {
  background: radial-gradient(circle at 0 0, #0f172a 0, #020617 50%, #000 100%);
  border-top: 1px solid rgba(148,163,184,0.24);
  border-bottom: 1px solid rgba(148,163,184,0.24);
}

.tl-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.tl-section-intro {
  color: var(--tl-text-muted);
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Left-aligned section variant */
.tl-section--left h2,
.tl-section--left .tl-section-intro {
  text-align: left;
  margin-left: 0;
  max-width: none;
}

/* Grid & cards */

.tl-grid {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.4rem;
}

.tl-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tl-card {
  border-radius: var(--tl-radius-md);
  border: 1px solid var(--tl-border-strong);
  padding: 1.25rem;
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tl-card:hover {
  box-shadow: var(--tl-shadow-md);
}

/* Stats box styling - matches share image appearance */
.tl-session-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--tl-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
}

.tl-card-body {
  margin: 0;
  padding: 1.25rem 0;
}

#tl-event-players-list,
#tl-players-list {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  border-radius: 0;
}

/* Ensure both event members and session players use identical row styling */
#tl-event-players-list .tl-player-row,
#tl-players-list .tl-player-row {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 1rem !important;
  align-items: center !important;
  padding: 0.75rem 1rem !important;
  margin-bottom: 0.5rem !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#tl-event-players-list .tl-player-row:last-child,
#tl-players-list .tl-player-row:last-child {
  margin-bottom: 0 !important;
}

#tl-event-players-list .tl-player-row:hover,
#tl-players-list .tl-player-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

#tl-event-players-list .tl-player-row-left,
#tl-players-list .tl-player-row-left {
  min-width: 0;
  text-align: left;
}

#tl-event-players-list .tl-player-row-right,
#tl-players-list .tl-player-row-right {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#tl-event-players-list .tl-player-name,
#tl-players-list .tl-player-name {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  text-decoration: none;
  line-height: 1.5;
}

#tl-event-players-list .tl-player-email,
#tl-players-list .tl-player-email {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

#tl-event-players-list .tl-session-actions,
#tl-players-list .tl-session-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

/* Plain links/buttons without .tl-button class */
#tl-event-players-list .tl-session-actions a:not(.tl-button),
#tl-players-list .tl-session-actions a:not(.tl-button) {
  color: var(--tl-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

#tl-event-players-list .tl-session-actions a:not(.tl-button):hover,
#tl-players-list .tl-session-actions a:not(.tl-button):hover {
  color: var(--tl-primary);
}

#tl-event-players-list .tl-session-actions button:not(.tl-button),
#tl-players-list .tl-session-actions button:not(.tl-button) {
  background: none;
  border: none;
  color: var(--tl-text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

#tl-event-players-list .tl-session-actions button:not(.tl-button):hover,
#tl-players-list .tl-session-actions button:not(.tl-button):hover {
  color: var(--tl-primary);
}

/* Team color indicators on player rows */
#tl-players-list .tl-player-row.tl-player-row-home,
#tl-event-players-list .tl-player-row.tl-player-row-home {
  border-left: 3px solid var(--tl-primary, #0f766e) !important;
}

#tl-players-list .tl-player-row.tl-player-row-away,
#tl-event-players-list .tl-player-row.tl-player-row-away {
  border-left: 3px solid #f59e0b !important;
}

#tl-players-list .tl-player-row.tl-player-row-bench,
#tl-event-players-list .tl-player-row.tl-player-row-bench {
  border-left: 3px solid #f59e0b !important;
}

/* Button styling within player lists */
#tl-event-players-list .tl-session-actions .tl-button,
#tl-players-list .tl-session-actions .tl-button {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--tl-radius-sm);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tl-card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.tl-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--tl-text-muted);
}

/* Steps */

.tl-steps {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.tl-steps li {
  border-radius: var(--tl-radius-md);
  border: 1px solid rgba(148,163,184,0.35);
  padding: 0.9rem 1rem;
  background: rgba(15,23,42,0.96);
}

.tl-steps h3 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}

.tl-steps p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--tl-text-muted);
}

/* Pricing */

.tl-pricing {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
}

.tl-card-pricing {
  max-width: 360px;
}

.tl-price {
  font-size: 1.7rem;
  margin: 0.2rem 0 0.7rem;
}

.tl-list {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
  font-size: 0.9rem;
}

.tl-list li {
  margin-bottom: 0.25rem;
}

.tl-small {
  font-size: 0.78rem;
  color: var(--tl-text-muted);
}

/* Auth pages */

.tl-main-auth {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tl-auth-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.25rem;
}

@media (max-width: 799px) {
  .tl-auth-wrapper {
    align-items: flex-start;
    padding-top: 2rem;
  }
}

.tl-auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15,23,42,0.96);
  border-radius: var(--tl-radius-lg);
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: var(--tl-shadow-soft);
  padding: 1.6rem 1.5rem 1.5rem;
}

.tl-auth-card h1 {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
}

.tl-auth-card p {
  margin: 0 0 1.3rem;
  font-size: 0.9rem;
  color: var(--tl-text-muted);
}

.tl-field {
  margin-bottom: 0.9rem;
}

.tl-field label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: #e5e7eb;
}

.tl-field-hint {
  font-size: 0.75rem;
  color: var(--tl-text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* Info icon tooltip */
.tl-tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  cursor: help;
}

.tl-info-icon {
  font-size: 0.85rem;
  color: var(--tl-text-muted);
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.tl-tooltip-trigger:hover .tl-info-icon,
.tl-tooltip-trigger:focus .tl-info-icon {
  opacity: 1;
  color: var(--tl-primary);
}

.tl-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  transform: none;
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-sm);
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--tl-text-muted);
  line-height: 1.4;
  width: 220px;
  max-width: calc(100vw - 80px);
  box-shadow: var(--tl-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 1000;
  pointer-events: none;
}

.tl-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 10px;
  border: 6px solid transparent;
  border-top-color: var(--tl-border);
}

.tl-tooltip-trigger:hover .tl-tooltip,
.tl-tooltip-trigger:focus .tl-tooltip {
  opacity: 1;
  visibility: visible;
}

.tl-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 0.9rem;
}

/* Form groups with labels */
.tl-form-group {
  margin-bottom: 1rem;
}

.tl-form-group > label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--tl-text);
}

.tl-input {
  width: 100%;
  border-radius: var(--tl-radius-sm);
  border: 1px solid var(--tl-border-strong);
  background: var(--tl-surface-elevated);
  padding: 0.625rem 0.875rem;
  font-family: var(--tl-font);
  font-size: 0.875rem;
  color: var(--tl-text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tl-input:hover {
  border-color: var(--tl-primary-light);
}

.tl-input:focus {
  outline: none;
  border-color: var(--tl-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  background: var(--tl-surface);
}

/* Hide datalist dropdown arrow on text inputs */
.tl-input[list]::-webkit-calendar-picker-indicator {
  display: none !important;
}

.tl-input[list] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Select dropdown styling */
select.tl-input {
  padding: 0.625rem 2rem 0.625rem 0.875rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

select.tl-input option,
select.tl-input optgroup {
  background: var(--tl-surface-elevated);
  color: var(--tl-text);
  padding: 0.5rem;
}

select.tl-input optgroup {
  font-weight: 600;
}

/* Calendar/Date picker icon styling */
.tl-input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.tl-input[type="date"]::-webkit-calendar-picker-indicator,
.tl-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(42%) sepia(93%) saturate(352%) hue-rotate(131deg) brightness(92%) contrast(88%);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.tl-input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.tl-input[type="date"]::-webkit-calendar-picker-indicator:hover,
.tl-input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.tl-auth-footer-text {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--tl-text-muted);
}

.tl-auth-footer-text a {
  color: #a5b4fc;
  text-decoration: none;
}

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

/* Footer */

.tl-footer {
  border-top: 1px solid rgba(148,163,184,0.3);
  padding: 1.2rem 0 1.5rem;
  background: #020617;
}

.tl-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tl-footer-links {
  display: flex;
  gap: 0.9rem;
  font-size: 0.85rem;
}

.tl-footer-links a {
  color: var(--tl-text-muted);
  text-decoration: none;
}

.tl-footer-links a:hover {
  color: #e5e7eb;
}

/* Responsiveness */

@media (max-width: 800px) {
  .tl-hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .tl-hero-card {
    order: -1;
  }

  .tl-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .tl-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .tl-header-inner {
    gap: 0.8rem;
  }

  .tl-nav {
    gap: 0.7rem;
    font-size: 0.8rem;
  }

  .tl-hero {
    padding-top: 1.8rem;
  }

  .tl-hero-text h1 {
    font-size: 1.9rem;
  }

  .tl-hero-card-body {
    padding: 0.85rem 0.85rem 0.9rem;
  }
}

/* ============================
   Dashboard layout & spacing
   ============================ */

.tl-main-dashboard {
  padding: 2.6rem 0 3.2rem;
}

.tl-page-header {
  margin-bottom: 1.6rem;
}

.tl-page-header h1 {
  margin: 0 0 0.3rem;
  font-size: 1.7rem;
}

.tl-page-header p {
  margin: 0;
  max-width: 26rem;
}

/* Summary strip (placeholder for future) */
.tl-dashboard-summary {
  margin-bottom: 1rem;
  display: none;
}

/* Top actions (New session button) */
.tl-dashboard-actions {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Session form */
.tl-session-form {
  margin-bottom: 1rem;
  /* Hidden by default – shown only when creating or editing via JS */
  display: none;
}

.tl-session-error {
  display: none;
  color: #fecaca;
  margin-bottom: 0.5rem;
}

.tl-form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Sessions list as a masonry grid: two columns, small implicit rows for tight packing */
.tl-sessions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1px;
  gap: 0 1.2rem;
  margin-top: 0.9rem;
  align-items: start;
}

/* Children just fill their grid cell naturally */
.tl-sessions-list > * {
  width: 100%;
}

/* Session cards – desktop layout */

.tl-session-card {
  border-radius: var(--tl-radius-md);
  border: 1px solid var(--tl-border-strong);
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  padding: 0 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 1.2rem;
}

.tl-session-card:hover {
  border-color: var(--tl-primary);
  box-shadow: var(--tl-shadow-md);
}


/* Title bar at the top of each session card – echoing the homepage hero card header */

.tl-session-card-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.5rem 1rem !important;
  height: 2.5rem !important; /* Fixed height for consistent title bars */
  box-sizing: border-box;
  border-bottom: 1px solid var(--tl-border);
  background: var(--tl-surface-elevated);
}

.tl-session-card-title {
  font-size: 0.8rem !important; /* Reduced from 0.9rem */
  font-weight: 600;
  letter-spacing: 0.15em !important; /* Slightly reduced letter spacing */
  text-transform: uppercase;
  color: #f9fafb;
  margin: 0 !important; /* Reset h3 default margins */
  margin-left: auto; /* ensure right alignment */
  line-height: 1.3 !important; /* Tighter line height */
}

.tl-session-card-header > :not(.tl-session-card-title) {
  display: none;
}

.tl-session-card-date {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
  white-space: nowrap;
}

/* Main body of the session card */

.tl-session-card-body {
  padding: 0.5rem 0.9rem 0.6rem !important;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--tl-text-muted);
}

.tl-session-card-body > * {
  width: 100%;
}

.tl-session-card-body p {
  margin: 0;
}


.tl-session-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
}

.tl-session-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tl-session-card-meta-item::before {
  content: "•";
  font-size: 0.9em;
  color: rgba(148,163,184,0.9);
}

/* Teams / unassigned preview area inside the dashboard cards
   ---------------------------------------------------------- */

.tl-session-teams-wrapper {
  margin-top: 0.25rem;
  width: 100%;
}

.tl-session-divider {
  height: 1px;
  background: rgba(148,163,184,0.18);
  margin: 0.35rem 0 0.55rem 0;
}

/* The row that contains HOME/AWAY columns or the single UNASSIGNED column */
.tl-session-teams-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2.5rem;
}

.tl-session-card-body .tl-session-teams-wrapper {
  width: 100%;
  margin-top: 1.1rem;
}

/* Column base */
.tl-team-column {
  flex: 1 1 0;
}

/* Right-align the AWAY column (2nd column) */
.tl-session-teams-row .tl-team-column:nth-child(2) {
  text-align: right;
}

/* If the AWAY column contains a list, keep list items aligned right too */
.tl-session-teams-row .tl-team-column:nth-child(2) .tl-team-list li {
  text-align: right;
}

/* ------------------------------------------
   Unassigned section styling (below HOME/AWAY)
   - Works for a dedicated unassigned block OR
     when the unassigned column uses .tl-team-single
   ------------------------------------------ */

/* If you render an explicit unassigned block below the row */
.tl-session-unassigned {
  margin-top: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.75rem;
  border-top: 1px solid rgba(148,163,184,0.18);
}

/* Make unassigned players display horizontally */
.tl-session-unassigned .tl-team-list,
.tl-team-column.tl-team-single .tl-team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  align-items: center;
}

/* Unassigned players as plain text items (no pills) */
.tl-session-unassigned .tl-team-list li,
.tl-team-column.tl-team-single .tl-team-list li {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  line-height: 1.35;
  white-space: nowrap;
}

/* Add subtle separators when listed horizontally */
.tl-session-unassigned .tl-team-list li::after,
.tl-team-column.tl-team-single .tl-team-list li::after {
  content: "·";
  opacity: 0.6;
  margin: 0 0.5rem;
}

.tl-session-unassigned .tl-team-list li:last-child::after,
.tl-team-column.tl-team-single .tl-team-list li:last-child::after {
  content: "";
  margin: 0;
}

/* Waiting list section - similar to unassigned but with numbered list */
.tl-session-waitlist {
  margin-top: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.75rem;
  border-top: 1px solid rgba(148,163,184,0.18);
}

/* Waitlist heading uses same color as other headings */

/* Make waiting list display horizontally like unassigned */
.tl-session-waitlist .tl-waitlist {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  align-items: center;
}

.tl-session-waitlist .tl-waitlist li {
  font-size: 0.9rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  white-space: nowrap;
}

/* Add subtle separators when listed horizontally */
.tl-session-waitlist .tl-waitlist li::after {
  content: "·";
  opacity: 0.6;
  margin: 0 0.5rem;
}

.tl-session-waitlist .tl-waitlist li:last-child::after {
  content: "";
  margin: 0;
}

/* Single-column layout (UNASSIGNED) should span the full width */
.tl-team-column.tl-team-single {
  flex: 1 0 100%;
  max-width: 100%;
}

/* HOME / AWAY / UNASSIGNED headings */
.tl-team-heading {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin: 0.4rem 0 0.3rem;
  /* Prevent iOS Safari from auto-inflating font size */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Player name list – no bullets, tighter spacing */
.tl-team-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tl-team-list li {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

/* Helper text when there are no players at all */
.tl-session-no-players {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--tl-text-muted);
}

/* Footer with stacked buttons */

.tl-session-card-footer {
  padding: 0.5rem 0.9rem !important;
  border-top: 1px solid rgba(148,163,184,0.26);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
}

.tl-session-card-footer .tl-button {
  width: 100%;
  justify-content: center;
}

/* Session chip row and chips (additional) */
.tl-session-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* In dashboard session previews, right-align the chip row so pills sit flush to the right side */
.tl-session-preview-meta .tl-session-chip-row {
  width: 100%;
  justify-content: flex-end;
}

.tl-session-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(148,163,184,0.55);
}

.tl-session-chip--paid {
  border-color: rgba(34,197,94,0.7);
  background: rgba(22,163,74,0.18);
  color: #bbf7d0;
}

.tl-session-chip--unpaid {
  border-color: rgba(250,204,21,0.8);
  background: rgba(234,179,8,0.16);
  color: #facc15;
}

/* Ensure links in sessions list fit the colour scheme */
#tl-sessions-list a {
  color: #e5e7eb;
  text-decoration: none;
}

#tl-sessions-list a:hover {
  color: #f9fafb;
  text-decoration: underline;
}

/* Session cards – mobile tweaks */

@media (max-width: 800px) {
  .tl-session-card {
    /* Header/body/footer handle their own padding */
    padding: 0;
  }

  /* Stack session cards in a single column on tablets/phones */
  .tl-sessions-list {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  /* Stack club cards in a single column on tablets/phones */
  .tl-clubs-list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Keep HOME/AWAY side-by-side on mobile with reduced gap */
  .tl-session-teams-row {
    gap: 1rem;
  }

  /* Prevent iOS Safari text inflation on all headings */
  .tl-team-heading,
  .tl-session-unassigned .tl-team-heading,
  .tl-session-card h4.tl-team-heading,
  .tl-session-unassigned h4,
  .tl-team-column h4 {
    font-size: 0.7rem !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    /* Additional iOS Safari fixes */
    max-height: 1.5em;
    line-height: 1.3;
  }

  .tl-team-list li {
    font-size: 0.8rem;
  }
}

@media (max-width: 640px) {
  .tl-page-header {
    text-align: left;
  }

  .tl-page-header p {
    max-width: 100%;
  }

  .tl-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tl-form-actions .tl-button {
    width: 100%;
    justify-content: center;
  }

  .tl-form-actions .tl-link-button {
    text-align: center;
    width: 100%;
  }

  .tl-session-header-text {
    flex-direction: column;
    align-items: flex-start;
  }

  .tl-session-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .tl-session-card {
    padding: 0 !important;
  }
}




/* ============================
   Session detail – players card
   ============================ */

/* Removed old .tl-players-list styles - now using unified #tl-players-list and #tl-event-players-list styles at end of file */

/* individual player row */

/* .tl-player-row block for player list in players page - now handled at end of file for flat rows */

/* .tl-player-main and .tl-player-meta handled in flat rows section */

/* error text for player form */

#tl-player-error {
  margin-top: 0.25rem;
}

/* smaller tweaks on mobile */

@media (max-width: 640px) {
  /* Remove old .tl-player-row mobile tweaks, now handled at end of file */
}

/* Force global dark background */

html,
body {
  background: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #000 100%) !important;
  background-attachment: fixed !important;
  color: var(--tl-text);
}

/* Make sure the main dashboard doesn’t override it */
.tl-main-dashboard {
  background: transparent;
}

/* ============================================
   Session detail page layout & styling
   ============================================ */

.tl-main-session {
  padding: 2.6rem 0 3.2rem;
}

.tl-session-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  overflow-x: hidden;
}

/* Page heading */

/* Cards */

/* (kept for backwards compatibility) */
.tl-players-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
}

/* Base fallback (specific styling is handled above under .tl-players-list .tl-player-row) */
.tl-player-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tl-player-row:last-child {
  margin-bottom: 0;
}

.tl-player-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.tl-player-row-left {
  min-width: 0;
  text-align: left;
}

.tl-player-row-right {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.tl-player-name {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  text-decoration: none;
  line-height: 1.5;
}

.tl-player-link {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tl-player-link:hover {
  color: var(--tl-link-hover-color, var(--tl-primary));
  text-decoration: none;
}

.tl-player-email {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .tl-player-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .tl-player-row-right {
    width: 100%;
  }

  .tl-player-row-right .tl-button,
  .tl-player-row-right .tl-button-small {
    width: 100%;
  }
}

.tl-player-main {
  font-weight: 500;
}

.tl-player-meta {
  margin-top: 0.2rem;
}


/* Player form */

/* ============================================
   Dashboard session preview card
   ============================================ */

/* Session preview body: single column with room for the teams layout */
.tl-session-preview-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  row-gap: 0.4rem !important;
  padding: 0.5rem 0.9rem 0.5rem !important;
  border-top: 1px solid rgba(148,163,184,0.24);
}

.tl-session-preview-body > .tl-session-preview-meta {
  width: 100%;
}

/* We now keep everything left-aligned; only HOME / AWAY are split
   using .tl-session-teams-row inside the teams wrapper. */
.tl-session-preview-body > .tl-session-preview-meta:last-child {
  align-items: flex-start;
  text-align: left;
}

.tl-session-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem !important;
}


.tl-session-preview-label {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
}

.tl-session-preview-value {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* pill chips for paid / unpaid counts */
.tl-session-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* In dashboard session preview cards, put paid left and unpaid right */
.tl-session-preview-meta .tl-session-chip-row {
  width: 100%;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Generic row inside the preview body used for text + pill combos */
.tl-session-preview-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

/* Labels left, values right */
.tl-session-preview-row .tl-session-preview-label {
  flex: 0 0 auto;
}

.tl-session-preview-row .tl-session-preview-value {
  margin-left: auto;
  text-align: right;
}


/* Payments row: chips only (no label), paid left / unpaid right */
.tl-session-preview-row--payments {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.tl-session-preview-row--payments .tl-session-chip-row {
  width: 100%;
  justify-content: space-between;
  gap: 0.75rem;
}

.tl-session-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(148,163,184,0.55);
}

.tl-session-chip--paid {
  border-color: rgba(34,197,94,0.7);
  background: rgba(22,163,74,0.18);
  color: #bbf7d0;
}

.tl-session-chip--unpaid {
  border-color: rgba(250,204,21,0.8);
  background: rgba(234,179,8,0.16);
  color: #facc15;
}


/* Dashboard-specific overrides (moved from dashboard.html inline styles) */

/* Paid/unpaid pills no longer used (players must pay before joining) */
.tl-session-preview-row--payments,
.tl-session-chip--paid,
.tl-session-chip--unpaid {
  display: none !important;
}

/* Dashboard card: two action buttons side-by-side */
.tl-session-preview-actions-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

/* Add margin only when copy link button follows */
.tl-session-preview-actions-row + .tl-button {
  margin-top: 8px;
}

.tl-session-preview-actions-row .tl-button {
  flex: 1 1 0;
  width: 50%;
}

/* When only one button is visible (non-organisers), center it horizontally */
.tl-session-preview-actions-row.tl-single-button {
  margin-bottom: 0;
}

.tl-session-preview-actions-row.tl-single-button .tl-button {
  flex: 0 1 auto;
  width: auto;
  min-width: 220px;
  max-width: 100%;
}

@media (max-width: 640px) {
  .tl-session-preview-counts {
    text-align: left;
  }
}

/* Responsive tweaks for detail */
/* =============================
   Session manage page – tabs
   ============================= */

.tl-session-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
  margin-bottom: 0.9rem;
}

/* Tabs wrapper for scroll buttons */
.tl-tabs-container {
  position: relative;
  margin-top: 1rem;
  width: 100%;
}

.tl-tabs-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--tl-border-strong);
  background: var(--tl-bg);
  color: var(--tl-text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--tl-shadow-md);
}

.tl-tabs-scroll-btn:hover {
  background: var(--tl-surface);
  border-color: var(--tl-primary);
  color: var(--tl-primary);
  box-shadow: var(--tl-shadow-lg);
}

.tl-tabs-scroll-btn.visible {
  display: flex;
}

.tl-tabs-scroll-btn-left {
  left: 4px;
}

.tl-tabs-scroll-btn-right {
  right: 4px;
}

.tl-tabs-scroll-btn svg {
  width: 16px;
  height: 16px;
}

.tl-session-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--tl-radius-lg);
  background: var(--tl-surface);
  border: 1px solid var(--tl-border-strong);
  box-shadow: var(--tl-shadow-sm);
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.tl-session-tabs::-webkit-scrollbar {
  display: none;
}

/* Scroll indicators for tab bars (all screen sizes) */
.tl-tabs-wrapper {
  position: relative;
  width: 100%;
}

.tl-tabs-scroll-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  /* Match the tab bar's rounded corners */
  border-radius: var(--tl-radius-lg);
}

.tl-tabs-scroll-indicator.visible {
  opacity: 1;
}

.tl-tabs-scroll-indicator:not(.visible) {
  pointer-events: none;
}

.tl-tabs-scroll-indicator-right {
  right: 0;
  background: linear-gradient(to right, transparent 0%, var(--tl-surface) 50%);
  justify-content: flex-end;
  padding-right: 8px;
  border-radius: 0 var(--tl-radius-lg) var(--tl-radius-lg) 0;
}

.tl-tabs-scroll-indicator-left {
  left: 0;
  background: linear-gradient(to left, transparent 0%, var(--tl-surface) 50%);
  justify-content: flex-start;
  padding-left: 8px;
  border-radius: var(--tl-radius-lg) 0 0 var(--tl-radius-lg);
}

.tl-tabs-scroll-indicator svg {
  width: 16px;
  height: 16px;
  color: var(--tl-text-muted);
}

.tl-tabs-scroll-indicator:hover svg {
  color: var(--tl-text);
}

.tl-tabs-scroll-indicator-right svg {
  animation: tl-scroll-hint-right 1s ease-in-out infinite;
}

.tl-tabs-scroll-indicator-left svg {
  animation: tl-scroll-hint-left 1s ease-in-out infinite;
}

@keyframes tl-scroll-hint-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

@keyframes tl-scroll-hint-left {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-3px); }
}

.tl-formation-selector {
  display: flex;
  align-items: center;
}

.tl-input-small {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  min-width: 90px;
}

.tl-session-tab {
  border: none;
  background: transparent;
  color: var(--tl-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--tl-radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  /* Grow to fill bar, don't shrink below content — scroll if overflow */
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tl-session-tab:hover:not(.tl-session-tab-active) {
  background: var(--tl-surface-hover);
  color: var(--tl-text);
}

.tl-session-tab-active {
  background: linear-gradient(135deg, var(--tl-primary), var(--tl-success));
  color: #ecfeff;
  box-shadow: var(--tl-shadow-md);
}

.tl-session-tab-panel {
  display: none;
}

.tl-session-tab-panel-active {
  display: block;
  margin-top: 1.25rem;
}

/* =============================
   Session manage page – Overview styling
   ============================= */

/* Info grids: no card, just stacked rows */
#tl-session-info-grid,
#tl-club-info-grid,
#tl-event-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Each row in the info grid */
#tl-session-info-grid > div,
#tl-club-info-grid > div,
#tl-event-info-grid > div {
  line-height: 1.5;
}

/* Labels (When/Where/etc.) */
#tl-session-info-grid strong,
#tl-club-info-grid strong,
#tl-event-info-grid strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tl-text-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

/* Values */
#tl-session-info-grid span,
#tl-club-info-grid span,
#tl-event-info-grid span {
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.95rem;
}

/* Hide empty rows, separate non-empty visible rows */
#tl-session-info-grid > div:empty,
#tl-club-info-grid > div:empty,
#tl-event-info-grid > div:empty {
  display: none;
}

#tl-session-info-grid > div:not(:empty) ~ div:not(:empty),
#tl-club-info-grid > div:not(:empty) ~ div:not(:empty),
#tl-event-info-grid > div:not(:empty) ~ div:not(:empty) {
  padding-top: 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

/* Overview footer actions: Edit (left) + Share session link (right) */
.tl-session-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
}

/* Push the Share button to the right */
.tl-session-footer-actions #tl-share-session-btn {
  margin-left: auto;
}

/* Share link section */
#tl-session-share {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  align-items: center;
}

#tl-session-share label,
#tl-session-share .tl-summary-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tl-text-muted);
}

#tl-session-share input,
#tl-session-share .tl-input {
  flex: 1 1 420px;
  min-width: 280px;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.92);
  padding: 0.6rem 0.85rem;
  color: rgba(226, 232, 240, 0.92);
}

/* Don't auto-push every button; the footer actions handle alignment */
#tl-session-share .tl-link-button {
  margin-left: 0;
}

/* Mobile: collapse to one column */
@media (max-width: 640px) {
  #tl-session-info-grid h3:nth-of-type(n + 2),
  #tl-session-info-grid h3:nth-of-type(n + 2) + * {
    padding-top: 0.5rem;
  }

  #tl-session-share button,
  #tl-session-share .tl-button,
  #tl-session-share .tl-link-button {
    margin-left: 0;
  }
}

/* =============================
   Session manage page – pitch view
   ============================= */

.tl-pitch-view {
  width: 100%;
}

/* Shared section header + title styles (re-usable across tabs) */
.tl-section-header,
.tl-players-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}

.tl-section-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.tl-pitch-board {
  position: relative;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  background: rgba(84, 214, 126, 0.06);
  padding-top: 56%; /* landscape pitch */
  overflow: hidden;
  margin-bottom: 1.25rem;
  min-height: 200px; /* Prevent too much vertical compression */
}

.tl-pitch-markings {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  z-index: 1;
  pointer-events: none;
}

.tl-pitch-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.tl-pitch-centre-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255,255,255,0.18);
}

.tl-pitch-centre-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
}

.tl-pitch-box {
  position: absolute;
  top: 22%;
  bottom: 22%;
  width: 18%;
  border: 1px solid rgba(255,255,255,0.18);
}

.tl-pitch-box-left { left: 0; border-left: 0; }
.tl-pitch-box-right { right: 0; border-right: 0; }

.tl-pitch-goal {
  position: absolute;
  top: 44%;
  bottom: 44%;
  width: 3.5%;
  border: 1px solid rgba(255,255,255,0.18);
}

.tl-pitch-goal-left { left: -3.5%; }
.tl-pitch-goal-right { right: -3.5%; }

.tl-pitch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 800px) {
  /* Keep pitch home/away side-by-side on mobile */
  .tl-pitch-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  /* For fixtures: 75% Starting XI, 25% Bench */
  body[data-session-type="fixture"] .tl-pitch-row {
    grid-template-columns: 3fr 1fr;
    gap: 0.75rem;
  }

  .tl-pitch-side {
    padding: 0.6rem 0.5rem;
    min-width: 0;
  }

  .tl-pitch-side-title {
    font-size: 0.7rem;
  }

  /* Truncate player names in pitch list pills on mobile */
  .tl-pitch-list .tl-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  .tl-pitch-bench .tl-pitch-list .tl-pill {
    text-align: right;
  }
}

.tl-pitch-side {
  border-radius: var(--tl-radius-lg);
  border: 1px solid var(--tl-border-strong);
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow-sm);
  padding: 0.9rem 1rem;
}

.tl-pitch-side-title {
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.tl-pitch-side-title-right {
  text-align: right;
}

.tl-pitch-unassigned {
  margin-top: 1.25rem;
  border-radius: var(--tl-radius-lg);
  border: 1px solid var(--tl-border-strong);
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow-sm);
  padding: 0.9rem 1rem;
}

.tl-pitch-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

/* =============================
   Fixture Mode - Half Pitch
   ============================= */

/* Bench section styling - default (hidden, horizontal below pitch) */
.tl-pitch-bench {
  margin-top: 1.25rem;
  border-radius: var(--tl-radius-lg);
  border: 1px solid var(--tl-border-strong);
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow-sm);
  padding: 0.9rem 1rem;
}

.tl-pitch-bench .tl-pitch-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Fixture mode - applied via body[data-session-type="fixture"] */

/* Half-pitch aspect ratio (more square) */
body[data-session-type="fixture"] .tl-pitch-board {
  padding-top: 70%;
}

/* Move centre line to right edge */
body[data-session-type="fixture"] .tl-pitch-centre-line {
  left: auto;
  right: 0;
}

/* Move centre circle to right edge and clip to half */
body[data-session-type="fixture"] .tl-pitch-centre-circle {
  left: auto;
  right: 0;
  transform: translate(50%, -50%);
  clip-path: inset(0 50% 0 0);
}

/* Hide away-side pitch elements */
body[data-session-type="fixture"] .tl-pitch-box-right {
  display: none;
}

body[data-session-type="fixture"] .tl-pitch-goal-right {
  display: none;
}

/* Hide away team column in fixture mode */
body[data-session-type="fixture"] .tl-pitch-side-away {
  display: none;
}

/* Two-column layout for fixture (Starting XI + Bench side by side) */
body[data-session-type="fixture"] .tl-pitch-row {
  grid-template-columns: 1fr 1fr;
}

/* Hide unassigned section in fixture mode (use bench instead) */
body[data-session-type="fixture"] .tl-pitch-unassigned {
  display: none;
}

/* In fixture mode, show bench and style like the away side column */
body[data-session-type="fixture"] .tl-pitch-bench {
  display: block !important;
  margin-top: 0;
  border-radius: var(--tl-radius-lg);
  border: 1px solid var(--tl-border-strong);
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow-sm);
  padding: 0.9rem 1rem;
}

body[data-session-type="fixture"] .tl-pitch-bench .tl-pitch-side-title {
  text-align: right;
  font-weight: 600;
  color: var(--tl-text);
  margin-bottom: 0.75rem;
}

body[data-session-type="fixture"] .tl-pitch-bench .tl-pitch-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}


/* ============================================
   Dashboard – hide inline edit forms in cards
   (management happens on separate pages)
   ============================================ */

/* Hide any form content rendered inside a session card */
.tl-session-card form {
  display: none !important;
}

/* Hide generic field rows & inline form actions if they
   are not already wrapped in a <form> */
.tl-session-card .tl-field,
.tl-session-card .tl-form-actions {
  display: none !important;
}

/* Hide inline text links under the card header such as
   "Quick edit", "View players", "Delete session" so that
   the only main CTA is the green Manage button. */
.tl-session-card .tl-inline-actions,
.tl-session-card a.tl-inline-link {
  display: none !important;
}

/* =============================
   Tables (shared, "boxed" like tl-players-list)
   ============================= */

/* Wrap for tables so long content can scroll on small screens */
.tl-table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* Base table class (used inside .tl-table-box) */
.tl-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

/* Helpful column sizing for Event sessions tables: Date | Time | Status | Players | Action */
.tl-table-box .tl-table thead th:nth-child(1),
.tl-table-box .tl-table tbody td:nth-child(1) {
  width: 16rem;
}

.tl-table-box .tl-table thead th:nth-child(2),
.tl-table-box .tl-table tbody td:nth-child(2) {
  width: 5.5rem;
  white-space: nowrap;
}

.tl-table-box .tl-table thead th:nth-child(3),
.tl-table-box .tl-table tbody td:nth-child(3) {
  width: 7.5rem;
  white-space: nowrap;
}

.tl-table-box .tl-table thead th:nth-child(4),
.tl-table-box .tl-table tbody td:nth-child(4) {
  width: 5.5rem;
  white-space: nowrap;
}

/* Subtle hover to help scan rows */
.tl-table-box .tl-table tbody tr:hover td {
  background: rgba(148, 163, 184, 0.06);
}

/* Normalise table layout inside the boxed wrapper */
.tl-table-box .tl-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.tl-table-box .tl-table thead th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tl-text-muted);
  padding: 0.75rem 0.8rem;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  white-space: nowrap;
}


.tl-table-box .tl-table tbody td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  vertical-align: middle;
  color: rgba(226, 232, 240, 0.92);
}

/* Session tables: allow the "When" cell to be multi-line without breaking alignment */
.tl-table-box .tl-table tbody td:first-child {
  vertical-align: top;
  line-height: 1.25;
}

/* Action buttons (Manage/Delete) in tables should look like real buttons, not links */
.tl-table-box .tl-table td:last-child {
  vertical-align: top;
}

/* If the UI renders actions as <a class="tl-link-button">, force them to look like buttons */
.tl-table-box .tl-table td:last-child .tl-link-button,
.tl-table-box .tl-table td:last-child a,
.tl-table-box .tl-table td:last-child button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--tl-radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--tl-primary), #22c55e);
  color: #ecfeff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--tl-shadow-md);
  white-space: nowrap;
}

.tl-table-box .tl-table td:last-child .tl-link-button:hover,
.tl-table-box .tl-table td:last-child a:hover,
.tl-table-box .tl-table td:last-child button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: var(--tl-shadow-lg);
}

.tl-table-box .tl-table td:last-child .tl-link-button:active,
.tl-table-box .tl-table td:last-child a:active,
.tl-table-box .tl-table td:last-child button:active {
  transform: translateY(0);
  box-shadow: var(--tl-shadow-sm);
}

/* Destructive action variant when present */

.tl-table-box .tl-table td:last-child .tl-link-button.tl-danger,
.tl-table-box .tl-table td:last-child a.tl-danger,
.tl-table-box .tl-table td:last-child button.tl-danger {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  box-shadow: var(--tl-shadow-md);
}

.tl-table-box .tl-table td:last-child .tl-link-button.tl-danger:hover,
.tl-table-box .tl-table td:last-child a.tl-danger:hover,
.tl-table-box .tl-table td:last-child button.tl-danger:hover {
  box-shadow: var(--tl-shadow-lg);
}

/* Warning action variant when present (e.g. Cancel) */
.tl-table-box .tl-table td:last-child .tl-link-button.tl-warning,
.tl-table-box .tl-table td:last-child a.tl-warning,
.tl-table-box .tl-table td:last-child button.tl-warning {
  background: linear-gradient(135deg, #a16207, #facc15);
  color: #1f2937;
  font-weight: 700;
  box-shadow: var(--tl-shadow-md);
}

.tl-table-box .tl-table td:last-child .tl-link-button.tl-warning:hover,
.tl-table-box .tl-table td:last-child a.tl-warning:hover,
.tl-table-box .tl-table td:last-child button.tl-warning:hover {
  box-shadow: var(--tl-shadow-lg);
}

.tl-table-box .tl-table tbody tr:last-child td {
  border-bottom: none;
}

/* Keep action cells tight */
.tl-table-box .tl-table td:last-child,
.tl-table-box .tl-table th:last-child {
  text-align: right;
  white-space: nowrap;
}

/* Optional: muted empty-state row */
.tl-table-box .tl-table .tl-table-empty {
  color: var(--tl-text-muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .tl-table-box {
    border-radius: 14px;
  }

  .tl-table-box .tl-table thead th,
  .tl-table-box .tl-table tbody td {
    padding: 0.6rem 0.7rem;
  }

  .tl-table-box .tl-table thead {
    display: none;
  }

  .tl-table-box .tl-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 0.75rem;
    padding: 0.7rem 0.7rem;
  }

  .tl-table-box .tl-table tbody td {
    display: block;
    padding: 0;
    border-bottom: none;
  }

  .tl-table-box .tl-table tbody td:last-child {
    justify-self: end;
    align-self: start;
  }
}

/* ===== Session players list (flat rows) ===== */

.tl-players-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tl-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 14px 1.25rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: background 0.2s ease;
}

.tl-player-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tl-player-row + .tl-player-row {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.tl-player-main {
  font-size: 0.88rem;
  font-weight: 500;
  min-width: 0;
}

.tl-player-main strong {
  font-weight: 600;
}

.tl-player-meta {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
}

/* Safety: neutralise any legacy li-card styling */
.tl-players-list > li {
  background: transparent;
  box-shadow: none;
}

@media (max-width: 640px) {
  .tl-player-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tl-player-meta {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Toggle Switch */
.tl-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  cursor: pointer;
}

.tl-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tl-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--tl-border);
  border-radius: 24px;
  transition: all 0.2s ease;
}

.tl-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--tl-text-muted);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.tl-toggle-switch input:checked + .tl-toggle-slider {
  background-color: var(--tl-primary);
  border-color: var(--tl-primary);
}

.tl-toggle-switch input:checked + .tl-toggle-slider:before {
  transform: translateX(24px);
  background-color: white;
}

.tl-toggle-switch input:focus + .tl-toggle-slider {
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}

/* Notification Preference Rows */
.tl-pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tl-pref-row:last-child {
  border-bottom: none;
}

.tl-pref-row.tl-pref-sub {
  padding-left: 16px;
  opacity: 0.9;
}

.tl-pref-row.tl-pref-sub .tl-pref-label {
  font-size: 0.9rem;
}

.tl-pref-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding-right: 24px;
}

.tl-pref-label {
  font-weight: 500;
  color: var(--tl-text);
}

.tl-pref-desc {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
}

/* Pitch zone styling for simple mode - no visible borders by default */
.tl-pitch-zone {
  transition: all 0.2s ease;
  border-radius: 4px;
}

/* On smaller screens, expand zones to full pitch height to prevent player rearrangement */
@media (max-width: 900px) {
  .tl-pitch-zone {
    top: 0 !important;
    height: 100% !important;
  }
}

/* Position circles also need adjusted vertical positioning on small screens */
@media (max-width: 700px) {
  .tl-position-circle {
    /* Increase vertical spacing by adjusting transform */
  }
}

/* Position circle styling for professional mode */
.tl-position-circle {
  border: 2px solid transparent;
  background: transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
  /* position and transform are set inline by JS - do not override here */
}

/* Hide position labels when not dragging */
.tl-position-label {
  opacity: 0 !important;
  transition: opacity 0.2s ease;
}

body.tl-dragging .tl-position-label {
  opacity: 0.5 !important;
}

/* Show position circles only when dragging is active */
body.tl-dragging .tl-position-circle {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

/* Empty position circles during drag should be more visible */
body.tl-dragging .tl-position-circle:empty,
body.tl-dragging .tl-position-circle:not(:has(.tl-pill-wrapper)) {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* Highlight on hover during drag */
body.tl-dragging .tl-position-circle:hover {
  border-color: rgba(15, 118, 110, 0.8);
  background: rgba(15, 118, 110, 0.2);
  transform: translate(-50%, -50%) scale(1.15);
}

/* Highlight for touch drag (fullscreen pitch) */
.tl-position-circle-highlight {
  border-color: rgba(15, 118, 110, 0.8) !important;
  background: rgba(15, 118, 110, 0.3) !important;
  transform: translate(-50%, -50%) scale(1.15);
}

/* Touch drag drop zone highlight */
.tl-drop-highlight {
  border-color: rgba(15, 118, 110, 0.8) !important;
  background: rgba(15, 118, 110, 0.15) !important;
  box-shadow: 0 0 12px rgba(15, 118, 110, 0.4);
}

.tl-pitch-column.tl-drop-highlight {
  background: rgba(15, 118, 110, 0.1) !important;
}

/* ========================================================================
   Series Modal Styles
   ======================================================================== */

.tl-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tl-modal-content {
  background: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #000 100%);
  border: 1px solid var(--tl-border-strong);
  border-radius: var(--tl-radius-lg);
  padding: 0;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--tl-shadow-lg);
}

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

.tl-modal-header h2 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.5rem;
}

.tl-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.tl-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

#series-modal-form {
  padding: 24px;
}

.tl-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.tl-modal-actions .tl-button {
  min-width: 100px;
  box-sizing: border-box;
  height: 42px;
}

/* Position badge styling */
.tl-position-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.6rem;
  background: var(--tl-primary);
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Injury badge styling - matches position badge size */
.tl-injury-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tl-injury-badge--injured {
  background: #ef4444;
  color: #fff;
}
.tl-injury-badge--recovering {
  background: #f59e0b;
  color: #000;
}
.tl-injury-badge--doubtful {
  background: #eab308;
  color: #000;
}

/* Professional mode position display */
.tl-player-position {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--tl-primary);
  font-weight: 500;
}

/* Player rows: vertically centre left/right content */
.tl-player-row-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Ensure the right side contents sit centred too */
.tl-player-row-right {
  display: flex;
  align-items: center;
}

/* Attendance dropdown selector */
.tl-attendance-toggle {
  display: inline-flex;
  align-items: center;
}

.tl-attendance-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--tl-surface-elevated);
  border: 1px solid var(--tl-border-strong);
  border-radius: var(--tl-radius-sm);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-family: var(--tl-font);
  font-size: 0.875rem;
  color: var(--tl-text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  min-width: 115px;
}

.tl-attendance-select:hover:not(:disabled) {
  border-color: var(--tl-primary-light);
}

.tl-attendance-select:focus {
  outline: none;
  border-color: var(--tl-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  background-color: var(--tl-surface);
}

.tl-attendance-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Playing state - green accent */
.tl-attendance-select.tl-attendance-in {
  border-color: var(--tl-success);
  color: var(--tl-success);
}

.tl-attendance-select.tl-attendance-in:hover:not(:disabled) {
  border-color: var(--tl-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Not playing state - muted */
.tl-attendance-select.tl-attendance-out {
  color: var(--tl-text-muted);
}

.tl-attendance-select.tl-attendance-out:hover:not(:disabled) {
  border-color: var(--tl-primary-light);
}

/* Loading state */
.tl-attendance-select.tl-attendance-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Cookie Consent Banner */
.tl-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--tl-surface);
  border-top: 1px solid var(--tl-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  padding: 1rem;
  display: none;
}

.tl-cookie-banner.visible {
  display: block;
  animation: slideUp 0.3s ease-out;
}

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

.tl-cookie-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tl-cookie-banner-text {
  flex: 1;
  min-width: 280px;
}

.tl-cookie-banner-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--tl-text);
  line-height: 1.5;
}

.tl-cookie-banner-text a {
  color: var(--tl-primary-light);
  text-decoration: underline;
}

.tl-cookie-banner-text a:hover {
  color: var(--tl-primary);
}

.tl-cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.tl-cookie-banner-actions .tl-button {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .tl-cookie-banner-inner {
    flex-direction: column;
    text-align: center;
  }

  .tl-cookie-banner-actions {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Clubs ===== */

.tl-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--tl-text);
}

.tl-clubs-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 0.9rem;
  margin-bottom: 2rem;
  align-items: start;
}

/* Club cards fill their grid cell naturally */
.tl-clubs-list > * {
  width: 100%;
}

.tl-club-card {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.tl-club-card:hover {
  border-color: var(--tl-border-strong);
  box-shadow: var(--tl-shadow-md);
}

.tl-club-card-color-bar {
  height: 4px;
  background: var(--tl-primary-light);
}

.tl-club-card-content {
  padding: 1rem;
  flex: 1;
}

.tl-club-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--tl-text);
}

/* In the new club card design (using session card structure), reset club-card-name to match session-card-title */
.tl-club-card-new .tl-club-card-header .tl-club-card-name {
  font-size: 0.8rem !important;
  font-weight: 600;
  letter-spacing: 0.15em !important;
  text-transform: uppercase;
  color: #f9fafb;
  margin: 0 !important;
  line-height: 1.3 !important;
}

.tl-club-card-meta {
  margin-bottom: 0.75rem;
}

.tl-club-card-location {
  font-size: 0.875rem;
  color: var(--tl-text-muted);
}

.tl-club-card-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--tl-text-muted);
}

.tl-club-card-actions {
  padding: 0 1rem 1rem 1rem;
}

.tl-club-card-actions .tl-button {
  width: 100%;
}

/* Club Chat */
#tab-chat.tl-session-tab-panel-active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 450px); /* Fallback - includes footer */
  height: calc(100dvh - 450px); /* Header + page title + tabs + footer + margins */
}

.tl-chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* Allow shrinking */
}

.tl-chat-messages {
  flex: 1;
  min-height: 0; /* Allow shrinking in flex context */
  overflow-y: auto;
  padding: 1rem;
  background: var(--tl-bg); /* Neutral background */
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tl-chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--tl-radius-md);
  /* Other people's messages use club color (set via inline style from JS) */
  background: var(--tl-chat-other-bg, var(--tl-club-color, var(--tl-primary)));
  color: var(--tl-chat-other-text, #fff);
  border: none;
}

.tl-chat-message-own {
  align-self: flex-end;
  /* Your own messages in grey (same as tab bar) */
  background: #334155; /* slate-700 - matches tab bar */
  color: #f8fafc; /* slate-50 */
}

.tl-chat-message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: inherit;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.tl-chat-message-header .tl-chat-message-time {
  margin-left: auto;
}

.tl-chat-delete-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  color: inherit;
  opacity: 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tl-chat-message:hover .tl-chat-delete-btn {
  opacity: 0.5;
}

.tl-chat-delete-btn:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444 !important;
}

.tl-chat-report-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  color: inherit;
  opacity: 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tl-chat-message:hover .tl-chat-report-btn {
  opacity: 0.5;
}

.tl-chat-report-btn:hover {
  opacity: 1 !important;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24 !important;
}

/* Chat message ellipsis menu */
.tl-chat-menu-wrapper {
  position: relative;
  display: inline-flex;
  margin-left: 6px;
}

.tl-chat-menu-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  color: inherit;
  opacity: 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1;
  width: 24px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tl-chat-message:hover .tl-chat-menu-btn {
  opacity: 0.5;
}

.tl-chat-menu-btn:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.1);
}

.tl-chat-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--tl-surface-elevated, #1e293b);
  border: 1px solid var(--tl-border, rgba(148, 163, 184, 0.2));
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 120px;
  z-index: 100;
  overflow: hidden;
}

.tl-chat-menu-dropdown.open {
  display: block;
}

.tl-chat-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--tl-text, #f1f5f9);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tl-chat-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tl-chat-menu-item-danger {
  color: #ef4444;
}

.tl-chat-menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.tl-chat-message-name {
  font-weight: 600;
  color: inherit;
}

.tl-chat-message-own .tl-chat-message-name {
  color: inherit;
}

.tl-chat-on-behalf-of {
  font-weight: 400;
  opacity: 0.7;
  font-size: 0.8em;
}

.tl-chat-message-text {
  font-size: 0.875rem;
  line-height: 1.4;
  word-break: break-word;
}

.tl-chat-form {
  display: flex;
  gap: 0.5rem;
}

.tl-chat-form .tl-input {
  flex: 1;
}

.tl-chat-empty {
  text-align: center;
  padding: 2rem;
  color: var(--tl-text-muted);
}

/* Club event sections */
.tl-club-event-section {
  margin-bottom: 1.5rem;
}

.tl-club-event-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tl-text-muted);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--tl-border);
}

.tl-club-event-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid var(--tl-primary);
}

.tl-club-event-card:hover {
  background: var(--tl-surface-elevated);
  border-color: var(--tl-border-strong);
}

.tl-club-event-card.tl-event-fixture {
  border-left-color: var(--tl-primary);
}

.tl-club-event-card.tl-event-training {
  border-left-color: #f59e0b;
}

.tl-club-event-card.tl-event-other {
  border-left-color: var(--tl-text-muted);
}

.tl-club-event-info {
  flex: 1;
}

.tl-club-event-name {
  font-weight: 600;
  color: var(--tl-text);
  margin-bottom: 0.125rem;
}

.tl-club-event-meta {
  font-size: 0.8rem;
}

.tl-club-event-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tl-club-event-edit {
  background: none;
  border: none;
  color: var(--tl-text-secondary);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.tl-club-event-edit:hover {
  color: var(--tl-primary);
}

/* Club member cards (mirrors event card styling) */
.tl-club-member-section {
  margin-bottom: 1.5rem;
}

.tl-club-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  border-left: 3px solid var(--tl-primary);
  transition: all 0.2s ease;
}

.tl-club-member-card:hover {
  background: var(--tl-surface-elevated);
  border-color: var(--tl-border-strong);
}

.tl-club-member-info {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.tl-club-member-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--tl-text);
  margin-bottom: 0.125rem;
}

.tl-club-member-meta {
  font-size: 0.8rem;
}

/* Actions within club member cards - always stay right */
.tl-club-member-card .tl-session-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  flex-grow: 0;
  margin-left: auto;
  width: auto !important;
}

/* Ensure buttons scale down on smaller screens */
.tl-club-member-card .tl-session-actions .tl-button {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--tl-radius-sm);
  white-space: nowrap;
}

@media (max-width: 800px) {
  /* Stack player cards vertically on mobile */
  .tl-club-member-card {
    flex-wrap: wrap !important;
  }

  .tl-club-member-card .tl-club-member-info {
    width: 100%;
    flex: 1 1 100%;
    margin-bottom: 0.5rem;
  }

  .tl-club-member-card .tl-session-actions.tl-player-actions {
    display: flex;
    width: 100% !important;
    margin-left: 0;
    margin-top: 4px;
    gap: 8px;
  }

  .tl-club-member-card .tl-session-actions.tl-player-actions .tl-button {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
}

@media (max-width: 480px) {
  .tl-club-member-card .tl-session-actions .tl-button {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Ensure club member cards don't wrap on desktop - actions stay right */
@media (min-width: 801px) {
  .tl-club-member-card {
    flex-wrap: nowrap !important;
    overflow: hidden;
  }
}

.tl-club-member-card .tl-club-member-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Waitlist drag-and-drop styles */
.tl-club-member-card.tl-dragging {
  opacity: 0.5;
  background: rgba(59, 130, 246, 0.1);
}

.tl-club-member-card.tl-drag-over {
  border-top: 2px solid #3b82f6;
  margin-top: -2px;
}

.tl-drag-handle:hover {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* New club card styling (matches event cards) */
.tl-club-card-new {
  position: relative;
}

.tl-club-card-new .tl-club-card-header {
  border-bottom-width: 1px;
  border-bottom-style: solid;
  justify-content: flex-end;
  /* Color is set dynamically via JS */
}

/* Override the rule that hides non-title elements in club card headers */
.tl-club-card-new .tl-club-card-header > .tl-club-header-crest {
  display: block !important;
}

.tl-club-header-crest {
  height: 1rem;
  width: auto;
  max-width: 1.5rem;
  object-fit: contain;
  border-radius: 2px;
  margin-right: auto;
  flex-shrink: 0;
}

.tl-main-dashboard .tl-club-header-crest {
  height: 2rem;
  max-width: 2.5rem;
}

.tl-club-card-new .tl-club-card-body {
  position: relative;
}

.tl-club-card-new .tl-club-card-crest {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--tl-radius-sm);
  background: var(--tl-surface-elevated);
  padding: 4px;
}

/* Field subheading */
.tl-field-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--tl-text);
}

/* Club identity (color + crest combined) */
.tl-club-identity {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.tl-identity-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tl-identity-label {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
}

/* Crest upload */
.tl-crest-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tl-crest-preview {
  width: 100px;
  height: 100px;
  border: 2px dashed var(--tl-border);
  border-radius: var(--tl-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tl-surface-elevated);
  overflow: hidden;
}

.tl-crest-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tl-crest-placeholder {
  font-size: 0.75rem;
  color: var(--tl-text-muted);
  text-align: center;
}

.tl-crest-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Color picker in modal */
.tl-color-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tl-color-picker input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 100px;
  padding: 0;
  border: 2px solid var(--tl-border);
  border-radius: var(--tl-radius-sm);
  cursor: pointer;
  background: transparent;
}

.tl-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.tl-color-picker input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: calc(var(--tl-radius-sm) - 2px);
}

.tl-color-picker input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: calc(var(--tl-radius-sm) - 2px);
}

/* Required field marker */
.tl-required {
  color: var(--tl-danger);
}

/* Club page */
.tl-club-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.tl-club-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tl-club-info-label {
  font-size: 0.75rem;
  color: var(--tl-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tl-club-info-value {
  font-size: 1rem;
  color: var(--tl-text);
  font-weight: 500;
}

.tl-club-description {
  color: var(--tl-text-muted);
  line-height: 1.6;
}

.tl-club-home-content {
  line-height: 1.7;
  color: var(--tl-text);
}

.tl-club-home-content p {
  margin: 0 0 1rem 0;
}

.tl-club-home-content p:last-child {
  margin-bottom: 0;
}

.tl-club-home-content h1,
.tl-club-home-content h2,
.tl-club-home-content h3 {
  color: var(--tl-text);
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.tl-club-home-content h1 { font-size: 1.75rem; }
.tl-club-home-content h2 { font-size: 1.5rem; }
.tl-club-home-content h3 { font-size: 1.25rem; }

.tl-club-home-content ul,
.tl-club-home-content ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

.tl-club-home-content li {
  margin-bottom: 0.5rem;
}

.tl-club-home-content a {
  color: var(--tl-accent);
  text-decoration: underline;
}

.tl-club-home-content strong {
  font-weight: 600;
}

.tl-club-home-content blockquote {
  border-left: 3px solid var(--tl-accent);
  padding-left: 1rem;
  margin: 0 0 1rem 0;
  color: var(--tl-text-muted);
}

.tl-club-home-content hr {
  border: none;
  border-top: 1px solid var(--tl-border);
  margin: 1.5rem 0;
}

/* Poll Styles */
.tl-poll-card {
  padding: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--tl-border);
  border-radius: 12px;
  margin-bottom: 16px;
}

.tl-poll-header {
  margin-bottom: 16px;
}

.tl-poll-title {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
}

.tl-poll-description {
  margin: 0;
}

.tl-poll-meta {
  margin: 8px 0 0 0;
}

.tl-poll-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 8px;
}

.tl-poll-badge-ended {
  background: rgba(148,163,184,0.2);
  color: var(--tl-text-muted);
}

.tl-poll-badge-active {
  background: rgba(20,184,166,0.2);
  color: var(--tl-primary-light);
}

.tl-poll-option-result {
  margin-bottom: 16px;
}

.tl-poll-option-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tl-poll-option-voted {
  font-weight: 600;
}

.tl-poll-option-votes {
  cursor: help;
}

.tl-poll-progress-track {
  height: 8px;
  background: rgba(148,163,184,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.tl-poll-progress-bar {
  height: 100%;
  background: rgba(148,163,184,0.5);
  border-radius: 4px;
  transition: width 0.3s;
}

.tl-poll-progress-bar.tl-poll-progress-voted {
  background: var(--tl-club-color, var(--tl-primary-light));
}

.tl-poll-progress-bar:not([style*="width: 0"]) {
  min-width: 8px;
}

.tl-poll-option-vote {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--tl-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.tl-poll-option-vote:hover {
  border-color: var(--tl-primary);
}

.tl-poll-vote-input {
  width: 18px;
  height: 18px;
}

.tl-poll-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Announcement Styles */
.tl-announcement-card {
  padding: 20px;
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.tl-announcement-card.tl-announcement-unread {
  background: rgba(15, 118, 110, 0.05);
  border-left: 3px solid var(--tl-primary);
}

.tl-announcement-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tl-announcement-title {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-announcement-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.tl-announcement-badge-urgent {
  background: var(--tl-danger);
  color: white;
}

.tl-announcement-badge-important {
  background: var(--tl-warning);
  color: #000;
}

.tl-announcement-badge-new {
  background: var(--tl-primary);
  color: white;
}

.tl-announcement-badge-pinned {
  background: rgba(148, 163, 184, 0.2);
  color: var(--tl-text-muted);
}

.tl-announcement-content {
  margin: 0 0 12px 0;
  color: var(--tl-text-secondary);
  white-space: pre-wrap;
  line-height: 1.5;
}

.tl-announcement-meta {
  font-size: 0.85rem;
  color: var(--tl-text-muted);
}

.tl-announcement-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.tl-club-event-card {
  padding: 1rem;
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
}

.tl-club-event-card:hover {
  border-color: var(--tl-border-strong);
  background: var(--tl-surface-hover);
}

.tl-club-event-card:last-child {
  margin-bottom: 0;
}

.tl-club-event-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tl-club-event-meta {
  font-size: 0.875rem;
}

/* ========================================
   Homepage Demo Sections
   ======================================== */

/* Dashboard cards section */
.tl-homepage-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 800px) {
  .tl-homepage-cards {
    grid-template-columns: 1fr;
  }
}

.tl-homepage-card {
  pointer-events: none;
}

.tl-homepage-card .tl-session-card-footer {
  display: none;
}

/* Session chips for paid/unpaid */
.tl-session-chip-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tl-session-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--tl-radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.tl-session-chip--paid {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.tl-session-chip--unpaid {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Team list styling for homepage */
.tl-team-player {
  font-size: 0.875rem;
  color: var(--tl-text-muted);
  padding: 0.25rem 0;
}

.tl-text-muted {
  color: var(--tl-text-disabled);
  font-style: italic;
}

/* Pitch Demo Section */
.tl-homepage-pitch-demo {
  margin-top: 2rem;
}

.tl-pitch-demo {
  max-width: 900px;
  margin: 0 auto;
}

.tl-pitch-demo-players {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tl-pitch-demo-player {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.tl-pitch-demo-player::before {
  content: attr(data-initials);
}

.tl-pitch-demo-player-away {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* Pill styles for away team */
.tl-pill-away {
  background: rgba(220, 38, 38, 0.15) !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
  color: #fca5a5 !important;
}

/* Club feature cards */
.tl-club-feature-card {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.tl-club-feature-card:hover {
  border-color: var(--tl-primary);
  box-shadow: var(--tl-shadow-md);
}

.tl-club-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--tl-radius-sm);
  background: linear-gradient(135deg, var(--tl-primary), var(--tl-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
}

.tl-club-feature-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--tl-text);
}

.tl-club-feature-card p {
  margin: 0;
  color: var(--tl-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Club demo card */
.tl-homepage-club-demo {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.tl-homepage-club-demo .tl-homepage-card {
  max-width: 400px;
}

/* Grid adjustments for 2-column */
.tl-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
  .tl-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ===== Pitch Player Badge Styles with Proportional Scaling ===== */

/*
 * Use CSS custom property --pitch-scale set by JavaScript based on pitch width.
 * This ensures elements scale proportionally when the pitch resizes.
 * Default fallback is 40px for circles, 36px for badges.
 */

/* Position circles (professional mode drop targets) - scale with pitch */
.tl-position-circle {
  /* Size is set via CSS custom property --pitch-scale from JS */
  width: var(--pitch-circle-size, 40px);
  height: var(--pitch-circle-size, 40px);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  font-size: var(--pitch-circle-font, 0.6rem);
  font-weight: 600;
  flex-wrap: wrap;
  padding: 2px;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.tl-position-label {
  font-size: var(--pitch-label-font, 0.5rem);
  pointer-events: none;
}

/* Base styles for pitch player elements - scale with pitch */
.tl-pitch-player-wrapper {
  width: var(--pitch-badge-size, 36px);
  height: var(--pitch-badge-size, 36px);
  display: block;
}

.tl-pitch-player-badge {
  width: var(--pitch-badge-size, 36px);
  height: var(--pitch-badge-size, 36px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--pitch-badge-font, 13px);
}

.tl-pitch-player-label {
  position: absolute;
  top: var(--pitch-name-top, 40px);
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--pitch-name-font, 12px);
  white-space: nowrap;
  color: #cbd5f5;
}

/* Hide player name labels at 900px to reduce clutter and prevent overlap */
@media (max-width: 900px) {
  .tl-pitch-player-label {
    display: none;
  }
}

/* Hide position labels on smaller screens */
@media (max-width: 600px) {
  .tl-position-label {
    display: none;
  }
}

/* ===== Session Tree Component ===== */

/* Tree Container */
.tl-session-tree-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

/* Series Item */
.tl-series-item {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.tl-series-item:last-child {
  margin-bottom: 0;
}

.tl-series-item:hover {
  border-color: rgba(148,163,184,0.3);
}

/* Series Header */
.tl-series-header {
  display: flex;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  user-select: none;
  background: var(--tl-surface);
  transition: background 0.2s ease;
}

.tl-series-header:hover {
  background: rgba(15, 118, 110, 0.05);
}

.tl-series-header.expanded {
  border-bottom: 1px solid var(--tl-border);
}

/* Expand Button */
.tl-expand-btn {
  background: none;
  border: none;
  color: var(--tl-text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.tl-expand-btn.expanded {
  transform: rotate(90deg);
}

.tl-expand-btn:hover {
  color: var(--tl-text);
}

/* Series Info */
.tl-series-info {
  flex: 1;
  min-width: 0;
}

.tl-series-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--tl-text);
}

.tl-series-icon {
  font-size: 18px;
}

.tl-series-pattern {
  font-size: 13px;
  color: var(--tl-text-muted);
  margin: 0;
}

.tl-series-stats {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}

.tl-series-stat {
  font-size: 12px;
  color: var(--tl-text-muted);
  opacity: 0.7;
}

.tl-series-stat strong {
  color: var(--tl-text);
  font-weight: 600;
}

/* Series Actions */
.tl-series-actions {
  display: flex;
  gap: 10px;
  margin-left: 16px;
  flex-shrink: 0;
  align-items: center;
}

/* Session List (within series) */
.tl-series-sessions {
  display: none;
  background: rgba(0, 0, 0, 0.2);
}

.tl-series-sessions.expanded {
  display: block;
}

/* Sessions Sections (Upcoming / Past) */
.tl-sessions-section-header {
  padding: 8px 16px 8px 48px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tl-text-muted);
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--tl-border);
}

.tl-past-sessions .tl-sessions-list {
  opacity: 0.7;
}

/* Override grid layout for session lists within series */
.tl-series-sessions .tl-sessions-list {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: unset !important;
  gap: 0 !important;
  margin-top: 0 !important;
  align-items: stretch !important;
}

/* Session Instance (within series) */
.tl-session-instance {
  display: flex !important;
  align-items: center !important;
  padding: 10px 16px 10px 48px;
  border-bottom: 1px solid var(--tl-border);
  transition: background 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.tl-session-instance:last-child {
  border-bottom: none;
}

.tl-session-instance:hover {
  background: rgba(15, 118, 110, 0.03);
}

/* Session Status Indicator */
.tl-session-status-icon {
  margin-right: 12px;
  font-size: 16px;
  flex-shrink: 0;
  align-self: center;
}

.tl-session-instance[data-status="past"] .tl-session-status-icon {
  color: #10b981;
}

.tl-session-instance[data-status="cancelled"] .tl-session-status-icon {
  color: #ef4444;
}

.tl-session-instance[data-status="upcoming"] .tl-session-status-icon {
  color: #94a3b8;
}

/* Session Info (within series) */
.tl-session-instance .tl-session-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.tl-session-info p.tl-session-date {
  font-size: 13px;
  color: var(--tl-text-muted);
  font-weight: 400;
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

.tl-session-info .tl-session-details {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--tl-text-muted);
  opacity: 0.7;
  margin: 0;
  padding: 0;
  line-height: 1.4;
  margin-top: 2px;
}

.tl-session-players {
  color: var(--tl-text-muted);
}

/* Session Badges */
.tl-session-badges {
  display: flex;
  gap: 6px;
  margin-left: 12px;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
}

.tl-badge {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tl-badge.cancelled {
  background: #7f1d1d;
  color: #fca5a5;
}

.tl-badge.overridden {
  background: #78350f;
  color: #fdba74;
}

/* Session Actions (within tree) */
.tl-session-instance .tl-session-actions,
.tl-standalone-session .tl-session-actions {
  display: flex;
  gap: 10px;
  margin-left: 12px;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
}

/* Empty State */
.tl-no-sessions {
  padding: 32px;
  text-align: center;
  color: var(--tl-text-muted);
  font-size: 14px;
}

/* Loading State */
.tl-tree-loading {
  padding: 32px;
  text-align: center;
  color: var(--tl-text-muted);
}

.tl-tree-loading::after {
  content: "...";
  animation: tl-dots 1.5s steps(4, end) infinite;
}

@keyframes tl-dots {
  0%, 20% { content: "."; }
  40% { content: ".."; }
  60%, 100% { content: "..."; }
}

/* Standalone Session (not part of series) */
.tl-standalone-session {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.tl-standalone-session:last-child {
  margin-bottom: 0;
}

.tl-standalone-session:hover {
  border-color: rgba(148,163,184,0.3);
  background: rgba(15, 118, 110, 0.03);
}

/* Session Name (prominent display) */
.tl-session-name {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--tl-text);
  line-height: 1.3;
}

/* Past Standalone Sessions Section - Collapsible */
.tl-standalone-past-section {
  margin-top: 24px;
}

.tl-standalone-past-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tl-text-muted);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--tl-radius-md);
  border: 1px solid var(--tl-border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tl-standalone-past-header:hover {
  background: rgba(0, 0, 0, 0.25);
  border-color: var(--tl-border-hover, var(--tl-border));
}

.tl-standalone-past-section.expanded .tl-standalone-past-header {
  border-radius: var(--tl-radius-md) var(--tl-radius-md) 0 0;
  border-bottom: none;
}

.tl-standalone-past-header .tl-past-expand-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 10px;
  margin-left: 8px;
}

.tl-standalone-past-section.expanded .tl-past-expand-icon {
  transform: rotate(90deg);
}

.tl-standalone-past-header .tl-past-count {
  font-size: 11px;
  color: var(--tl-text-muted);
  font-weight: 500;
  opacity: 0.8;
}

.tl-standalone-past-list {
  display: none;
  flex-direction: column;
  gap: 0;
  opacity: 0.7;
}

.tl-standalone-past-section.expanded .tl-standalone-past-list {
  display: flex;
}

.tl-standalone-past-list .tl-standalone-session {
  border-radius: 0;
  border-top: none;
}

.tl-standalone-past-list .tl-standalone-session:first-child {
  border-top: 1px solid var(--tl-border);
}

.tl-standalone-past-list .tl-standalone-session:last-child {
  border-radius: 0 0 var(--tl-radius-md) var(--tl-radius-md);
}

/* Payment Receipts */
.tl-receipts-list {
  opacity: 1;
}

.tl-receipts-list .tl-standalone-session {
  border-top: 1px solid var(--tl-border);
}

.tl-receipt-item {
  padding: 0;
  border-bottom: 1px solid var(--tl-border);
}

.tl-receipt-item:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--tl-radius-md) var(--tl-radius-md);
}

.tl-receipt-item:first-child {
  border-top: 1px solid var(--tl-border);
}

.tl-receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}

.tl-receipt-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tl-receipt-info {
  flex: 1;
  min-width: 0;
}

.tl-receipt-desc {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-receipt-amount {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.tl-receipt-detail {
  display: none;
  padding: 0 16px 12px;
  border-top: 1px solid var(--tl-border);
  margin: 0 12px;
}

.tl-receipt-item.expanded .tl-receipt-detail {
  display: block;
}

.tl-receipt-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.tl-receipt-detail-total {
  font-weight: 600;
  border-top: 1px solid var(--tl-border);
  margin-top: 4px;
  padding-top: 10px;
}

.tl-receipt-download-btn {
  margin-top: 12px;
}

.tl-receipts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 0 4px;
}

/* Club Session Type Sections */
.tl-club-session-type-section {
  margin-bottom: 32px;
}

.tl-club-session-type-section:last-child {
  margin-bottom: 0;
}

.tl-club-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--tl-text);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tl-border);
}

/* Session Tree Responsive */
@media (max-width: 800px) {
  .tl-series-header {
    flex-wrap: wrap;
    padding: 12px;
  }

  .tl-series-actions {
    margin-left: 0;
    margin-top: 12px;
    width: 100%;
    justify-content: flex-end;
  }

  .tl-session-instance {
    flex-wrap: wrap;
    padding: 12px 12px 12px 32px;
  }

  .tl-session-instance .tl-session-actions,
  .tl-standalone-session .tl-session-actions {
    margin-left: 28px;
    margin-top: 8px;
    width: 100%;
  }

  .tl-series-stats {
    flex-direction: column;
    gap: 4px;
  }

  /* Standalone session cards - mobile layout */
  .tl-standalone-session {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .tl-standalone-session .tl-session-status-icon {
    display: none;
  }

  .tl-standalone-session .tl-session-info {
    width: 100%;
  }

  .tl-standalone-session .tl-session-name {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .tl-standalone-session .tl-session-date {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .tl-standalone-session .tl-session-details {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tl-standalone-session .tl-session-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .tl-standalone-session .tl-session-actions {
    display: flex;
    gap: 8px;
    margin-left: 0;
    margin-top: 4px;
  }

  .tl-standalone-session .tl-session-actions .tl-button {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ===== Confirm Modal ===== */

.tl-confirm-modal-body {
  padding: 24px;
}

.tl-confirm-modal-body #tl-confirm-modal-message {
  margin: 0 0 24px 0;
  color: var(--tl-text);
  line-height: 1.6;
}

.tl-confirm-modal-actions {
  display: flex;
  flex-direction: row-reverse;
  gap: 12px;
}

.tl-confirm-modal-actions .tl-button {
  flex: 1;
}

/* Choice buttons for multi-option dialogs */
.tl-confirm-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.tl-confirm-choices .tl-button {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  justify-content: flex-start;
}

/* ===== Match Results ===== */

.tl-result-card {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.tl-result-card:hover {
  border-color: rgba(148,163,184,0.3);
}

.tl-result-card.tl-result-win {
  border-left: 3px solid var(--tl-success, #22c55e);
}

.tl-result-card.tl-result-loss {
  border-left: 3px solid var(--tl-danger, #ef4444);
}

.tl-result-card.tl-result-draw {
  border-left: 3px solid var(--tl-warning, #f59e0b);
}

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

.tl-result-date {
  font-size: 12px;
  color: var(--tl-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tl-result-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 16px);
  margin-bottom: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.tl-result-team {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 12px);
  flex: 1;
  min-width: 0;
}

.tl-result-team-home {
  justify-content: flex-end;
  text-align: right;
}

.tl-result-team-away {
  justify-content: flex-start;
  text-align: left;
}

.tl-result-team-name {
  font-size: clamp(11px, 3vw, 15px);
  font-weight: 500;
  color: var(--tl-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.tl-result-team-score {
  font-size: clamp(18px, 5vw, 28px);
  font-weight: 700;
  color: var(--tl-text);
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.tl-result-vs {
  font-size: 12px;
  color: var(--tl-text-muted);
  text-transform: uppercase;
}

.tl-result-goals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--tl-border);
  margin-top: 4px;
}

.tl-result-goals-home {
  text-align: right;
}

.tl-result-goals-away {
  text-align: left;
}

.tl-goal-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--tl-text);
  margin-bottom: 4px;
  line-height: 1.4;
  min-width: 0;
}

.tl-result-goals-home .tl-goal-line {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.tl-goal-minute {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--tl-text-muted);
  min-width: 24px;
}

.tl-result-goals-home .tl-goal-minute {
  text-align: left;
}

.tl-result-goals-away .tl-goal-minute {
  text-align: right;
}

.tl-goal-scorer {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.tl-goal-assist {
  font-size: 12px;
  color: var(--tl-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.tl-result-notes {
  font-size: 13px;
  color: var(--tl-text-muted);
  font-style: italic;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--tl-border);
}

/* Responsive */
@media (max-width: 600px) {
  .tl-result-vs {
    display: none;
  }

  .tl-result-goals {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tl-result-goals-home {
    text-align: right;
  }

  .tl-result-goals-away {
    text-align: left;
  }

  .tl-result-events {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .tl-result-events-home {
    text-align: right !important;
  }

  .tl-result-events-away {
    text-align: left !important;
  }
}

/* ===== Live Match Button ===== */

.tl-button-live {
  background: #ef4444;
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
  padding: 0.625rem 1.25rem 0.625rem 28px !important; /* Extra left space for pulsing dot */
}

.tl-button-live:hover {
  background: #dc2626;
}

.tl-button-live::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== Live Match Section ===== */

.tl-live-section {
  border: 1px solid #ef4444;
  position: relative;
}

.tl-live-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tl-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  animation: livePulse 1.5s infinite;
}

.tl-live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

/* Live match card styling */
.tl-result-card.tl-result-live {
  border-left: 3px solid #ef4444;
}

.tl-live-badge-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  animation: livePulse 1.5s infinite;
}

.tl-live-badge-small::before {
  content: '';
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
}

/* ==========================================================================
   MOBILE RESPONSIVE STYLES
   ========================================================================== */

/* --------------------------------------------------------------------------
   Small Phones (320px - 375px)
   -------------------------------------------------------------------------- */
@media (max-width: 375px) {
  /* Container padding reduction */
  .tl-container {
    padding: 0 0.75rem;
  }

  /* Typography adjustments */
  h1, .tl-page-header h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  /* Button adjustments */
  .tl-button {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  .tl-button-large {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  /* Card padding reduction */
  .tl-card {
    padding: 1rem;
  }

  /* Session card team names */
  .tl-session-card-team-name {
    font-size: 0.8rem;
  }

  /* Input fields */
  .tl-input {
    padding: 0.75rem;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  /* Modal adjustments */
  .tl-modal-overlay {
    padding: 10px;
  }

  .tl-modal-content {
    max-width: 100%;
    border-radius: var(--tl-radius-md);
  }

  .tl-modal-header {
    padding: 1rem;
  }

  /* Hero section */
  .tl-hero h1 {
    font-size: 1.75rem;
  }

  .tl-hero p {
    font-size: 0.9rem;
  }
}

/* --------------------------------------------------------------------------
   All Mobile Devices (up to 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 800px) {
  /* Page header flex stacking */
  .tl-page-header-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .tl-page-header-flex .tl-button-group {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* Button group stacking */
  .tl-button-group {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Section header and action rows stack on mobile */
  .tl-section-header,
  .tl-action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .tl-section-header > *,
  .tl-action-row > * {
    width: 100%;
  }

  /* Inline flex elements that should wrap */
  [style*="display: flex"],
  [style*="display:flex"] {
    flex-wrap: wrap !important;
  }

  /* Session card improvements */
  .tl-session-card {
    padding: 1rem;
  }

  .tl-session-card-body {
    gap: 1rem;
  }

  .tl-session-card-teams {
    gap: 1rem;
    flex-direction: column;
    text-align: center;
  }

  .tl-session-card-vs {
    margin: 0;
  }

  .tl-session-card-team {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }

  /* Fixture card score display */
  .tl-result-card {
    padding: 0.75rem;
  }

  .tl-result-score {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
  }

  /* Touch-friendly button sizes */
  .tl-button {
    min-height: 44px;
  }

  .tl-button-small {
    min-height: 36px;
    padding: 0.5rem 0.875rem;
  }

  /* Form improvements */
  .tl-field-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tl-form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tl-form-actions .tl-button {
    width: 100%;
  }

  /* Modal improvements */
  .tl-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .tl-modal-content {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--tl-radius-lg) var(--tl-radius-lg) 0 0;
    margin: 0;
  }

  .tl-modal-header {
    padding: 1rem 1.25rem;
  }

  .tl-modal-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tl-modal-actions .tl-button {
    width: 100%;
  }

  /* Tab navigation - grow to fill space on mobile */
  .tl-session-tabs {
    display: flex;
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }

  .tl-session-tabs::-webkit-scrollbar {
    display: none;
  }

  .tl-session-tabs .tl-session-tab {
    flex: 1 0 auto;
    white-space: nowrap;
    justify-content: center;
  }

  /* Prevent page horizontal overflow from tab containers */
  .tl-session-shell,
  .tl-container {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Dashboard cards */
  .tl-dashboard-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tl-dashboard-actions .tl-button {
    width: 100%;
  }

  /* Club cards - stack vertically on mobile */
  .tl-clubs-list {
    grid-template-columns: 1fr !important;
  }

  /* Club card improvements */
  .tl-club-card-new {
    padding: 1rem;
  }

  .tl-club-card-stats {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Player list items */
  .tl-player-list-item {
    padding: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tl-player-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }

  /* Session info grid */
  .tl-session-info-grid {
    grid-template-columns: 1fr;
  }

  /* Share link input */
  .tl-share-link-input {
    min-width: 0;
    width: 100%;
  }

  /* Hero section */
  .tl-hero {
    padding: 2rem 0;
  }

  .tl-hero-grid {
    gap: 2rem;
  }

  /* Feature grid */
  .tl-feature-grid {
    gap: 1.5rem;
  }

  .tl-feature-card {
    padding: 1.25rem;
  }

  /* Session tree actions */
  .tl-session-tree-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Pitch view improvements */
  .tl-pitch-container {
    flex-direction: column;
  }

  .tl-pitch-side-panel {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
  }

  /* Result card grid */
  .tl-results-grid {
    gap: 1rem;
  }

  /* Chat interface */
  .tl-chat-container {
    max-height: 50vh;
  }

  .tl-chat-input-wrapper {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tl-chat-input-wrapper .tl-button {
    width: 100%;
  }

  /* Prevent iOS zoom on chat input - must be 16px minimum */
  .tl-chat-form .tl-input,
  #tl-chat-input,
  #tl-club-chat-input,
  #tl-event-chat-input {
    font-size: 16px;
  }

  /* Admin tables */
  .tl-admin-table {
    font-size: 0.8rem;
  }

  .tl-admin-table th,
  .tl-admin-table td {
    padding: 0.5rem;
  }
}

/* Tab scroll indicators are styled globally — visible at all screen sizes when needed */

/* --------------------------------------------------------------------------
   Medium-Small Phones (up to 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Section titles */
  .tl-section-title {
    font-size: 1rem;
  }

  /* Session card score prominent */
  .tl-session-card-score {
    font-size: 2rem;
    padding: 0.5rem 1rem;
  }

  /* Scorers list compact */
  .tl-scorers-list {
    font-size: 0.75rem;
  }

  /* Cookie banner compact */
  .tl-cookie-banner {
    padding: 1rem;
  }

  .tl-cookie-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .tl-cookie-banner-buttons {
    flex-direction: column;
    width: 100%;
  }

  .tl-cookie-banner-buttons .tl-button {
    width: 100%;
  }

  /* Account page sections */
  .tl-account-section {
    padding: 1rem;
  }

  /* Price display */
  .tl-session-price {
    font-size: 0.8rem;
  }
}

/* --------------------------------------------------------------------------
   Touch-friendly improvements
   -------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets */
  .tl-button {
    min-height: 44px;
    min-width: 44px;
  }

  .tl-link-button {
    padding: 0.75rem;
  }

  /* Remove hover effects that don't work well on touch */
  .tl-button:hover {
    transform: none;
  }

  .tl-card:hover {
    transform: none;
  }

  /* Checkbox/radio larger touch targets */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
  }

  /* Select dropdown larger */
  select.tl-input {
    min-height: 48px;
  }
}

/* --------------------------------------------------------------------------
   iOS Safe Area support
   -------------------------------------------------------------------------- */
@supports (padding: max(0px)) {
  .tl-mobile-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .tl-modal-content {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* --------------------------------------------------------------------------
   Prevent text zoom on iOS
   -------------------------------------------------------------------------- */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select.tl-input,
  textarea.tl-input,
  input.tl-input {
    font-size: 16px;
  }
}

/* --------------------------------------------------------------------------
   Mobile Bottom Navigation Bar
   -------------------------------------------------------------------------- */
.tl-mobile-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--tl-border);
  display: none;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.tl-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--tl-text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  min-width: 64px;
}

.tl-mobile-nav-item:hover,
.tl-mobile-nav-item.active {
  color: var(--tl-primary-light);
}

.tl-mobile-nav-item svg {
  width: 24px;
  height: 24px;
}

/* Mobile nav visible state - only on mobile screens */
@media (max-width: 800px) {
  nav#tl-mobile-nav.tl-mobile-nav.tl-nav-visible {
    display: flex !important;
  }

  body.tl-has-mobile-nav {
    padding-bottom: 72px !important;
  }

  /* Ensure footer is above mobile nav */
  body.tl-has-mobile-nav .tl-footer {
    margin-bottom: 72px;
  }
}

/* Force hide on desktop */
@media (min-width: 801px) {
  .tl-mobile-nav,
  nav#tl-mobile-nav.tl-mobile-nav.tl-nav-visible {
    display: none !important;
  }

  body.tl-has-mobile-nav {
    padding-bottom: 0 !important;
  }

  /* Remove footer margin on desktop */
  body.tl-has-mobile-nav .tl-footer {
    margin-bottom: 0;
  }
}

/* Very small phones */
@media (max-width: 375px) {
  .tl-mobile-nav-item {
    padding: 8px 10px;
    min-width: 56px;
    font-size: 0.65rem;
  }

  .tl-mobile-nav-item svg {
    width: 22px;
    height: 22px;
  }
}

/* --------------------------------------------------------------------------
   Weather Widget
   -------------------------------------------------------------------------- */
.tl-weather-widget {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
  margin-top: 0.25rem;
}

.tl-weather-main {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl-weather-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.tl-weather-temp {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.92);
}

.tl-weather-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: rgba(148, 163, 184, 0.7);
  font-size: 0.85rem;
}

.tl-weather-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.tl-weather-label {
  color: rgba(148, 163, 184, 0.7);
}

.tl-weather-desc {
  text-transform: capitalize;
  color: rgba(226, 232, 240, 0.92);
}

.tl-weather-loading {
  color: rgba(148, 163, 184, 0.7);
  font-size: 0.85rem;
  padding: 4px 0;
}

.tl-weather-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  margin-top: 6px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 8px;
  color: rgba(251, 191, 36, 0.85);
  font-size: 0.82rem;
}

.tl-weather-alert-icon {
  font-size: 0.95rem;
}

.tl-weather-alert-text {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Financial Summary
   -------------------------------------------------------------------------- */
.tl-financial-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  justify-content: center;
}

.tl-financial-stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
}

.tl-financial-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(148, 163, 184, 0.7);
  margin-bottom: 4px;
}

.tl-financial-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tl-text);
}

/* --------------------------------------------------------------------------
   Empty / Unavailable States
   -------------------------------------------------------------------------- */
.tl-empty-state {
  color: rgba(148, 163, 184, 0.5);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Direct Messages Panel
   -------------------------------------------------------------------------- */
.tl-dm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}

.tl-dm-overlay-visible {
  opacity: 1;
  visibility: visible;
}

.tl-dm-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--tl-surface);
  border-left: 1px solid var(--tl-border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.tl-dm-panel-open {
  transform: translateX(0);
}

.tl-dm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--tl-border);
  background: var(--tl-surface-elevated);
}

.tl-dm-back,
.tl-dm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--tl-radius-sm);
  color: var(--tl-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tl-dm-back:hover,
.tl-dm-close:hover {
  background: var(--tl-surface-hover);
  color: var(--tl-text);
}

.tl-dm-title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tl-text);
}

.tl-dm-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tl-dm-conversations {
  flex: 1;
  overflow-y: auto;
}

.tl-dm-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--tl-border);
  transition: background 0.15s ease;
}

.tl-dm-conv-item:hover {
  background: var(--tl-surface-hover);
}

.tl-dm-conv-unread {
  background: rgba(15, 118, 110, 0.08);
}

.tl-dm-conv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tl-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.tl-dm-conv-info {
  flex: 1;
  min-width: 0;
}

.tl-dm-conv-name {
  font-weight: 600;
  color: var(--tl-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-dm-conv-preview {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-dm-conv-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--tl-primary);
  color: #fff;
  border-radius: var(--tl-radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* DM Chat View */
.tl-dm-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tl-dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tl-dm-msg {
  max-width: 80%;
  display: flex;
  flex-direction: column;
}

.tl-dm-msg-other {
  align-self: flex-start;
}

.tl-dm-msg-own {
  align-self: flex-end;
}

.tl-dm-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
}

.tl-dm-msg-other .tl-dm-msg-bubble {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  border-radius: 4px 16px 16px 16px;
}

.tl-dm-msg-own .tl-dm-msg-bubble {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  color: var(--tl-text);
  border-radius: 16px 16px 4px 16px;
}

.tl-dm-msg-text {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.tl-dm-msg-time {
  font-size: 0.7rem;
  color: var(--tl-text-muted);
  margin-top: 4px;
}

.tl-dm-msg-other .tl-dm-msg-time {
  color: rgba(255, 255, 255, 0.7);
}

.tl-dm-msg-own .tl-dm-msg-time {
  text-align: right;
}

.tl-dm-input-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--tl-border);
  background: var(--tl-surface-elevated);
}

.tl-dm-input-form .tl-input {
  flex: 1;
}

/* DM Header Badge in Nav */
.tl-dm-header-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--tl-radius-sm);
  color: var(--tl-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tl-dm-header-btn:hover {
  background: var(--tl-surface-hover);
  color: var(--tl-text);
}

.tl-dm-header-btn svg {
  width: 22px;
  height: 22px;
}

#tl-dm-header-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--tl-danger);
  color: #fff;
  border-radius: var(--tl-radius-pill);
  font-size: 0.65rem;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Unified Messages Panel (combines DMs, Clubs, Events)
   -------------------------------------------------------------------------- */

.tl-messages-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tl-messages-overlay-visible {
  opacity: 1;
  visibility: visible;
}

.tl-messages-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--tl-surface);
  border-left: 1px solid var(--tl-border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.tl-messages-panel-open {
  transform: translateX(0);
}

.tl-messages-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--tl-border);
  background: var(--tl-surface-elevated);
  flex-shrink: 0;
}

.tl-messages-back,
.tl-messages-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--tl-radius-sm);
  color: var(--tl-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tl-messages-back:hover,
.tl-messages-close:hover {
  background: var(--tl-surface-hover);
  color: var(--tl-text);
}

.tl-messages-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-messages-title {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tl-text);
}

.tl-messages-content {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Channel List */
.tl-messages-channels {
  flex: 1;
  overflow-y: auto;
}

.tl-messages-section-header {
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--tl-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--tl-bg);
  border-bottom: 1px solid var(--tl-border);
}

.tl-messages-channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--tl-border);
}

.tl-messages-channel-item:hover {
  background: var(--tl-surface-hover);
}

.tl-messages-channel-unread {
  background: rgba(15, 118, 110, 0.08);
}

.tl-messages-channel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tl-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.tl-messages-channel-avatar-img {
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.tl-messages-channel-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.tl-messages-channel-info {
  flex: 1;
  min-width: 0;
}

.tl-messages-channel-name {
  font-weight: 600;
  color: var(--tl-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-messages-channel-preview {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-messages-channel-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--tl-primary);
  color: #fff;
  border-radius: var(--tl-radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-messages-channel-action {
  display: none;
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--tl-text-muted);
  font-size: 0.85rem;
  border-radius: var(--tl-radius-sm);
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.tl-messages-channel-action:hover {
  color: var(--tl-error, #dc2626);
  background: rgba(220, 38, 38, 0.1);
}

.tl-messages-channel-item:hover .tl-messages-channel-action {
  display: block;
}

/* Touch devices: always show action button at lower opacity */
@media (hover: none) {
  .tl-messages-channel-action {
    display: block;
    opacity: 0.5;
  }
  .tl-messages-channel-action:active {
    opacity: 1;
    color: var(--tl-error, #dc2626);
  }
}

/* Left/inactive group chats */
.tl-messages-channel-left {
  opacity: 0.5;
}

.tl-messages-channel-left .tl-messages-channel-preview {
  font-style: italic;
}

/* Chat View */
.tl-messages-chat {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Don't use overflow: hidden - it breaks scrolling */
}


.tl-messages-pinned-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(20, 184, 166, 0.1);
  border-bottom: 1px solid var(--tl-border);
  font-size: 0.8rem;
  color: var(--tl-primary-light);
}

.tl-messages-pinned-bar button {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--tl-primary-light);
  cursor: pointer;
  font-size: 0.75rem;
  text-decoration: underline;
}

/* Input wrapper - contains reply bar and input form */
.tl-messages-input-wrapper {
  flex-shrink: 0;
  border-top: 1px solid var(--tl-border);
  background: var(--tl-surface-elevated);
}

/* WhatsApp-style reply bar (above input) */
.tl-messages-reply-bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  background: var(--tl-surface);
  border-bottom: 1px solid var(--tl-border);
  border-left: 3px solid var(--tl-primary);
}

.tl-messages-reply-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl-messages-reply-label {
  font-size: 0.75rem;
  color: var(--tl-primary-light);
}

.tl-messages-reply-label strong {
  color: var(--tl-text);
}

.tl-messages-reply-preview {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-messages-reply-bar button {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--tl-text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--tl-radius-sm);
  transition: all 0.15s ease;
}

.tl-messages-reply-bar button:hover {
  color: var(--tl-text);
  background: var(--tl-surface-hover);
}

/* Club-themed reply bar */
.tl-messages-input-wrapper.tl-messages-club-themed .tl-messages-reply-bar {
  border-left-color: var(--tl-club-color);
}

.tl-messages-input-wrapper.tl-messages-club-themed .tl-messages-reply-label {
  color: var(--tl-club-color);
}

.tl-messages-list {
  flex: 1 1 0%;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

/* Push messages to bottom when there's space */
.tl-messages-list::before {
  content: '';
  flex: 1 1 auto;
}

/* Messages: Sent (own) = LEFT, Received (other) = RIGHT */
.tl-msg {
  max-width: 80%;
  display: flex;
  flex-direction: column;
}

/* Sent messages (own) - LEFT side, dark background */
.tl-msg-own {
  align-self: flex-start;
}

/* Received messages (other) - RIGHT side, teal gradient */
.tl-msg-other {
  align-self: flex-end;
}

.tl-msg-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tl-text-muted);
  margin-bottom: 2px;
}

.tl-msg-other .tl-msg-sender {
  text-align: right;
}

.tl-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 1rem;
}

/* Sent (own) - dark surface, left side */
.tl-msg-own .tl-msg-bubble {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  color: var(--tl-text);
  border-radius: 16px 16px 16px 4px;
}

/* Received (other) - gradient matching main buttons, right side */
.tl-msg-other .tl-msg-bubble {
  background: linear-gradient(120deg, var(--tl-primary) -10%, var(--tl-success) 110%) !important;
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}

/* Club-themed: use club color for received messages */
.tl-messages-club-themed .tl-msg-other .tl-msg-bubble {
  background: var(--tl-club-color) !important;
}

.tl-msg-reply-indicator {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-bottom: 4px;
  font-style: italic;
}

/* Deleted message placeholder */
.tl-msg-deleted .tl-msg-bubble,
.tl-msg-bubble-deleted {
  background: var(--tl-bg-tertiary) !important;
  border: 1px dashed var(--tl-border) !important;
  color: var(--tl-text-muted) !important;
}

.tl-msg-deleted .tl-msg-time {
  color: var(--tl-text-muted) !important;
}

.tl-msg-text {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.tl-msg-time {
  font-size: 0.7rem;
  margin-top: 4px;
}

.tl-msg-own .tl-msg-time {
  color: var(--tl-text-muted);
}

.tl-msg-other .tl-msg-time {
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

/* Reactions on messages */
.tl-msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.tl-msg-reaction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: transparent;
  border: none;
  border-radius: var(--tl-radius-pill);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.tl-msg-reaction:hover {
  opacity: 1;
  background: var(--tl-surface-elevated);
  transform: scale(1.1);
}

.tl-msg-reaction-active {
  opacity: 1;
  background: rgba(20, 184, 166, 0.12);
}

/* Reactions in club-themed chat */
.tl-messages-club-themed .tl-msg-reaction {
  opacity: 0.6;
}

.tl-messages-club-themed .tl-msg-reaction:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.tl-messages-club-themed .tl-msg-reaction-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

/* Message action buttons */
.tl-msg-actions {
  display: flex;
  gap: 2px;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tl-msg:hover .tl-msg-actions,
.tl-msg.tl-msg-actions-visible .tl-msg-actions {
  opacity: 1;
}

/* On touch devices, show only on tap */
@media (hover: none) {
  .tl-msg-actions {
    opacity: 0;
  }
  .tl-msg.tl-msg-actions-visible .tl-msg-actions {
    opacity: 1;
  }
}

.tl-msg-action-btn {
  background: none;
  border: none;
  border-radius: var(--tl-radius-sm);
  padding: 4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  color: var(--tl-text-muted);
  opacity: 0.6;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tl-msg-action-btn:hover {
  opacity: 1;
  background: var(--tl-surface-elevated);
  transform: scale(1.15);
}

.tl-msg-action-btn:active {
  transform: scale(0.95);
}

/* Club-themed action buttons */
.tl-messages-club-themed .tl-msg-action-btn {
  color: #fff;
  opacity: 0.5;
  background: none;
  border: none;
}

.tl-messages-club-themed .tl-msg-action-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

/* Reaction picker */
.tl-reaction-picker {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--tl-surface-elevated);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  box-shadow: var(--tl-shadow-lg);
  z-index: 10000;
}

.tl-reaction-picker-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: var(--tl-radius-sm);
  transition: background 0.15s ease;
}

.tl-reaction-picker-btn:hover {
  background: var(--tl-surface-hover);
}

/* Club-themed reaction picker - always use light background for emoji visibility */
.tl-reaction-picker.tl-reaction-picker-themed {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tl-reaction-picker.tl-reaction-picker-themed .tl-reaction-picker-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Input form - inside input wrapper */
.tl-messages-input-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--tl-surface-elevated);
  flex-shrink: 0;
}

.tl-messages-input-form .tl-input {
  flex: 1;
}

/* Send button - high specificity to override club page's injected .tl-button styles */
.tl-messages-panel .tl-messages-input-form .tl-button,
.tl-messages-panel .tl-messages-input-form .tl-button:not(.tl-button-danger) {
  background: linear-gradient(120deg, var(--tl-primary) -10%, var(--tl-success) 110%) !important;
  color: #fff !important;
}

/* Club-themed: use club color for Send button with auto-contrasted text */
.tl-messages-panel .tl-messages-input-wrapper.tl-messages-club-themed .tl-button,
.tl-messages-panel .tl-messages-input-wrapper.tl-messages-club-themed .tl-button:not(.tl-button-danger) {
  background: var(--tl-club-color) !important;
  color: var(--tl-club-text-color, #fff) !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .tl-messages-panel {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Chat Enhancements - Reactions, Replies, Pins, Mentions
   -------------------------------------------------------------------------- */

/* Reply indicator */
.tl-chat-reply-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--tl-surface-elevated);
  border-left: 3px solid var(--tl-primary);
  border-radius: 0 var(--tl-radius-sm) var(--tl-radius-sm) 0;
  font-size: 0.8rem;
  color: var(--tl-text-muted);
}

.tl-chat-reply-indicator-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-chat-reply-indicator-close {
  background: transparent;
  border: none;
  color: var(--tl-text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
}

.tl-chat-reply-indicator-close:hover {
  color: var(--tl-text);
}

/* Reply preview on message */
.tl-chat-reply-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 0 var(--tl-radius-xs) var(--tl-radius-xs) 0;
  font-size: 0.75rem;
  cursor: pointer;
}

.tl-chat-reply-preview:hover {
  background: rgba(0, 0, 0, 0.3);
}

.tl-chat-reply-preview-name {
  font-weight: 600;
  opacity: 0.9;
}

.tl-chat-reply-preview-text {
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thread indicator */
.tl-chat-thread-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--tl-radius-pill);
  font-size: 0.7rem;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tl-chat-thread-count:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

/* Reactions */
.tl-chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.tl-chat-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--tl-radius-pill);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-chat-reaction:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
}

.tl-chat-reaction-own {
  background: rgba(15, 118, 110, 0.3);
  border-color: rgba(15, 118, 110, 0.5);
}

.tl-chat-reaction-emoji {
  font-size: 0.9rem;
  line-height: 1;
}

.tl-chat-reaction-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: inherit;
  opacity: 0.9;
}

/* Reaction Picker */
.tl-chat-reaction-picker {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  padding: 6px 8px;
  background: var(--tl-surface-elevated);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  box-shadow: var(--tl-shadow-md);
  z-index: 100;
}

.tl-chat-reaction-picker.open {
  display: flex;
  gap: 4px;
}

.tl-chat-reaction-picker-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--tl-radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.tl-chat-reaction-picker-btn:hover {
  background: var(--tl-surface-hover);
  transform: scale(1.15);
}

/* Pin badge */
.tl-chat-message-pinned {
  position: relative;
}

.tl-chat-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-left: 8px;
  background: rgba(251, 191, 36, 0.2);
  border-radius: var(--tl-radius-xs);
  font-size: 0.65rem;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tl-chat-pin-badge svg {
  width: 10px;
  height: 10px;
}

/* Pinned messages bar */
.tl-chat-pinned-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(251, 191, 36, 0.1);
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
  cursor: pointer;
  transition: background 0.15s ease;
}

.tl-chat-pinned-bar:hover {
  background: rgba(251, 191, 36, 0.15);
}

.tl-chat-pinned-bar-icon {
  color: #fbbf24;
  font-size: 0.9rem;
}

.tl-chat-pinned-bar-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--tl-text-muted);
}

.tl-chat-pinned-bar-count {
  font-weight: 600;
  color: #fbbf24;
}

/* @Mention autocomplete */
.tl-mention-autocomplete {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 4px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--tl-surface-elevated);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-md);
  box-shadow: var(--tl-shadow-md);
  z-index: 100;
  display: none;
}

.tl-mention-autocomplete.open {
  display: block;
}

.tl-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tl-mention-item:hover,
.tl-mention-item.selected {
  background: var(--tl-surface-hover);
}

.tl-mention-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tl-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.tl-mention-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--tl-text);
}

/* Mention highlight in message text */
.tl-mention {
  color: var(--tl-primary-light);
  font-weight: 600;
  background: rgba(20, 184, 166, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Message Actions (react button on hover) */
.tl-chat-message-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tl-chat-message:hover .tl-chat-message-actions {
  opacity: 1;
}

.tl-chat-react-btn {
  background: transparent;
  border: none;
  padding: 2px 6px;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: var(--tl-radius-sm);
  transition: background 0.15s ease;
}

.tl-chat-react-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Message User Button (on member cards) */
.tl-message-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-sm);
  color: var(--tl-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-message-user-btn:hover {
  background: var(--tl-surface-hover);
  border-color: var(--tl-primary);
  color: var(--tl-primary-light);
}

.tl-message-user-btn svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Chat Enhancements - Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .tl-dm-panel {
    max-width: 100%;
  }

  .tl-weather-widget {
    flex-direction: column;
    align-items: flex-start;
  }

  .tl-weather-details {
    width: 100%;
  }

  .tl-chat-reaction-picker {
    left: auto;
    right: 0;
  }
}

/* --------------------------------------------------------------------------
   Notification Panel (Slide-out)
   -------------------------------------------------------------------------- */
.tl-notification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}

.tl-notification-overlay-visible {
  opacity: 1;
  visibility: visible;
}

.tl-notification-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--tl-surface);
  border-left: 1px solid var(--tl-border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.tl-notification-panel-open {
  transform: translateX(0);
}

.tl-notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--tl-border);
  background: var(--tl-surface-elevated);
}

.tl-notification-panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--tl-text);
}

.tl-notification-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-notification-mark-all {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius-sm);
  color: var(--tl-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-notification-mark-all:hover {
  background: var(--tl-surface-hover);
  border-color: var(--tl-primary);
  color: var(--tl-primary-light);
}

.tl-notification-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--tl-radius-sm);
  color: var(--tl-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tl-notification-panel-close:hover {
  background: var(--tl-surface-hover);
  color: var(--tl-text);
}

.tl-notification-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}


.tl-notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tl-border);
  text-decoration: none;
  color: var(--tl-text);
}

.tl-notification-item:hover {
  background: var(--tl-surface-hover);
}

.tl-notification-item.tl-notification-unread {
  background: var(--tl-primary-bg, rgba(20, 184, 166, 0.08));
  border-left: 3px solid var(--tl-primary);
}

.tl-notification-item-content {
  flex: 1;
  min-width: 0;
}

.tl-notification-item-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tl-text);
  margin-bottom: 2px;
}

.tl-notification-item-message {
  font-size: 0.8rem;
  color: var(--tl-text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tl-notification-item-time {
  font-size: 0.75rem;
  color: var(--tl-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.tl-notification-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--tl-text-muted);
}

@media (max-width: 600px) {
  .tl-notification-panel {
    max-width: 100%;
  }
}

/* Respect reduced motion preferences (WCAG 2.1) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
