@import './tokens.css';

/* Base Reset & Athletic Canvas */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-pitch);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

#app {
  max-width: var(--hud-max-w);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 12px) + 8px) 16px calc(env(safe-area-inset-bottom, 20px) + 24px) 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Icons */
.tt-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-orange { color: var(--brand-orange); }
.icon-green { color: var(--pitch-green); }
.icon-gold { color: var(--academy-gold); }
.icon-blue { color: var(--tactical-blue); }
.icon-large-pitch { width: 90px; height: 90px; color: var(--pitch-green); opacity: 0.85; }

/* Header & Status HUD */
.tt-header-hud {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

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

.hud-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--brand-orange);
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.hud-avatar:hover {
  border-color: var(--brand-orange);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transform: scale(1.04);
}

.hud-avatar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.hud-avatar-head svg {
  width: 22px;
  height: 22px;
}

.avatar-gear-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.hud-avatar:hover .avatar-gear-badge {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  background: var(--brand-orange-subtle);
  transform: rotate(45deg);
}

.avatar-gear-badge svg {
  width: 10px;
  height: 10px;
}

.hud-jersey-num {
  font-size: 1.25rem;
}

.hud-names {
  display: flex;
  flex-direction: column;
}

.hud-user-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-main);
  line-height: 1.15;
}

.hud-team-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.hud-lang-picker {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
}

.btn-lang {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
}
.btn-lang.active {
  background: var(--brand-orange);
  color: #fff;
}

/* Gmail-Style Corner User Button (First Name + Role Badge & Icon + Avatar) */
.hud-corner-user-btn,
.hud-corner-avatar-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 6px 4px 10px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  position: relative;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.hud-corner-user-btn:hover,
.hud-corner-avatar-btn:hover {
  background: color-mix(in srgb, var(--brand-orange) 10%, var(--bg-elevated));
  border-color: rgba(240, 95, 36, 0.25);
  transform: translateY(-1px);
}

.hud-corner-user-btn:active,
.hud-corner-avatar-btn:active {
  transform: scale(0.97);
}

.hud-corner-user-btn:focus-visible,
.hud-corner-avatar-btn:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
}

.hud-user-info-cue {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  line-height: 1.15;
}

.hud-user-firstname {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-main);
  transition: color 0.15s ease;
}

.hud-corner-user-btn:hover .hud-user-firstname {
  color: var(--brand-orange);
}

.hud-user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
}

.hud-role-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-role-icon svg,
.hud-user-role-badge svg,
.settings-role-badge svg {
  width: 12px;
  height: 12px;
}

/* Role Specific Badges (Parity across Header HUD & Settings Modal) */
.hud-user-role-badge.role-coach,
.settings-role-badge.role-coach {
  background: var(--brand-orange-subtle);
  border-color: rgba(240, 95, 36, 0.35);
  color: var(--brand-orange);
}

.hud-user-role-badge.role-manager,
.settings-role-badge.role-manager {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.hud-user-role-badge.role-player,
.settings-role-badge.role-player {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--pitch-green);
}

.hud-user-role-badge.role-parent,
.settings-role-badge.role-parent {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--academy-gold);
}

@media (max-width: 520px) {
  .hud-user-role-badge .hud-role-label {
    display: none;
  }
}

@media (max-width: 400px) {
  .hud-user-info-cue {
    display: none;
  }
  .hud-corner-user-btn {
    padding: 0;
  }
}

.corner-avatar-head {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--brand-orange) 14%, var(--bg-elevated));
  border: 1.5px solid var(--brand-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-orange);
  box-shadow: 0 2px 8px rgba(240, 95, 36, 0.22);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.hud-corner-user-btn:hover .corner-avatar-head,
.hud-corner-avatar-btn:hover .corner-avatar-head {
  border-color: #ff7843;
  color: #ffffff;
  background: var(--brand-orange);
  box-shadow: 0 4px 14px rgba(240, 95, 36, 0.45);
}

.corner-avatar-head svg {
  width: 20px;
  height: 20px;
}

.corner-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Offline Banner */
.offline-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--academy-gold);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.offline-banner.is-syncing {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--tactical-blue);
}

.offline-banner.is-synced {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--pitch-green);
}

.offline-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.offline-banner-icon svg {
  width: 16px;
  height: 16px;
}

/* Offline Pending Item & Tag in Activity Feed */
.activity-feed-item.offline-pending-item {
  border-left: 3px solid var(--academy-gold);
  background: color-mix(in srgb, var(--bg-card) 94%, var(--academy-gold));
}

.offline-pending-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--academy-gold);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.offline-pending-tag svg {
  width: 12px;
  height: 12px;
}

/* Player Stats in HUD */
.hud-player-stats {
  display: flex;
  gap: 10px;
}

.hud-stat-pill {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-pill-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.hud-pill-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hud-progress-bar-wrap {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.hud-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-orange), var(--academy-gold));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Cards */
.tt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Daily Mission Card */
.mission-card {
  border: 1px solid var(--border-subtle);
}
.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mission-badge {
  background: var(--brand-orange-subtle);
  color: var(--brand-orange);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mission-day-tag {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-dim);
}
.mission-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.mission-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Drills List */
.mission-drills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.mission-drill-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mission-drill-row.is-done {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}
.drill-status-check {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--pitch-green);
}
.drill-title-col {
  flex: 1;
}
.drill-name {
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: capitalize;
}

/* Buttons */
.btn-primary {
  background: var(--brand-orange);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-large {
  width: 100%;
}
.btn-glow {
  box-shadow: var(--shadow-glow-orange);
}
.btn-primary.is-completed-test {
  background: var(--bg-elevated);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--text-main);
}
.btn-primary.is-completed-test .tt-icon {
  color: var(--pitch-green);
}
.btn-primary.is-completed-test:hover {
  border-color: var(--pitch-green);
  background: rgba(16, 185, 129, 0.1);
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--brand-orange-subtle);
  color: var(--brand-orange);
  border: 1px solid rgba(240, 95, 36, 0.35);
  line-height: 1;
  vertical-align: middle;
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-action-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Section Headings */
.section-subheading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* Quick Actions Grid */
.quick-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.quick-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
  text-align: center;
  transition: transform 0.1s;
}
.quick-action-card:active {
  transform: scale(0.96);
}
.quick-icon {
  width: 32px;
  height: 32px;
}
.quick-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Feed List */
.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.activity-feed-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 12px;
}
.activity-feed-item.verified-item {
  border-color: rgba(16, 185, 129, 0.3);
}
.feed-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-orange);
}
.feed-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.feed-item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.feed-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.feed-xp-pill {
  background: var(--academy-gold-subtle);
  color: var(--academy-gold);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.feed-item-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  gap: 6px;
  align-items: center;
}
.verified-tag {
  color: var(--pitch-green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.feed-coach-feedback {
  margin-top: 6px;
  background: var(--bg-elevated);
  border: 1px solid rgba(240, 95, 36, 0.25);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  font-style: italic;
}

/* Modals */
.tt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: pointer;
  animation: ttModalFadeIn 0.2s ease-out;
}
.tt-modal-backdrop.open {
  display: flex;
}
.tt-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: min(840px, calc(100vh - 48px));
  max-height: min(840px, calc(100dvh - 48px));
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-elevated);
  cursor: default;
  animation: ttModalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes ttModalScaleIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-tag {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-orange);
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Arcade / Drill Modal */
.test-arcade-card {
  text-align: center;
}
.test-heading {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  line-height: 1.2;
}
.test-pitch-instructions {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 10px;
  text-align: left;
}
.test-schematic-preview {
  padding: 20px;
  display: flex;
  justify-content: center;
}
.btn-glow {
  box-shadow: var(--shadow-card);
}
.btn-primary.is-completed-test {
  background: var(--bg-elevated);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--text-main);
}
.btn-primary.is-completed-test .tt-icon {
  color: var(--pitch-green);
}
.btn-primary.is-completed-test:hover {
  border-color: var(--pitch-green);
  background: rgba(16, 185, 129, 0.1);
}

/* Fullscreen Countdown & Timer */
.arcade-fullscreen {
  height: 85dvh;
  justify-content: space-between;
}
.big-countdown-digit {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--academy-gold);
}
.arcade-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.timer-giant {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-main);
  text-align: center;
}
.timer-pulse-end {
  color: var(--club-red);
  animation: tt-pulse-urgent 0.8s infinite;
}

/* Stepper Result Entry */
.tactile-stepper-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
}
.btn-step {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}
.btn-step:active {
  background: var(--brand-orange);
  color: #fff;
}
.stepper-giant .btn-step {
  width: 64px;
  height: 64px;
}
.stepper-val-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}
.stepper-val-num {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--brand-orange);
}
.stepper-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.level-standards-hint {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tier-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Activity Tracker / GPS */
.category-selector-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.cat-tab {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cat-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}
.cat-tab.active {
  background: var(--brand-orange-subtle);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}
.cat-tab[data-cat="ball"].active {
  background: var(--pitch-green-subtle);
  border-color: var(--pitch-green);
  color: var(--pitch-green);
}
.cat-tab[data-cat="gym"].active {
  background: var(--tactical-blue-subtle);
  border-color: var(--tactical-blue);
  color: var(--tactical-blue);
}
.cat-tab[data-cat="other_sport"].active {
  background: var(--academy-gold-subtle);
  border-color: var(--academy-gold);
  color: var(--academy-gold);
}
.gps-control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 12px;
}
.gps-canvas {
  width: 100%;
  height: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.gps-metrics-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}
.metric-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
}
.metric-lbl {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.btn-gps-live.is-active-recording {
  background: var(--club-red);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.tt-input, .tt-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
}
.tt-input:focus, .tt-textarea:focus {
  outline: none;
  border-color: var(--brand-orange);
}
.tt-slider {
  accent-color: var(--brand-orange);
  height: 6px;
  border-radius: var(--radius-full);
}

/* Activity Tracker Card Layout */
.activity-tracker-card {
  padding: 0 !important;
  overflow: hidden !important;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
}

.tracker-modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.tracker-scroll-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tracker-footer-cta {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  margin-top: 0;
  flex-shrink: 0;
}

/* Coach Hub & Tabs */
.coach-tabs-nav {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.coach-tabs-nav::-webkit-scrollbar {
  display: none;
}
.coach-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.coach-tab.active {
  background: var(--bg-elevated);
  color: var(--brand-orange);
}
.coach-tab-content {
  display: none;
}
.coach-tab-content.active {
  display: block;
}

/* Roster Table */
.roster-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.roster-table-responsive {
  overflow-x: auto;
}
.tt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.tt-table th, .tt-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.col-num { width: 35px; }
.col-actions { width: 124px; min-width: 124px; }
.text-right { text-align: right; }
.btn-group-icons {
  display: inline-flex;
  gap: 6px;
}
.btn-table-icon {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
}
.tt-spl-crest {
  width: 20px;
  height: 20px;
}
.level-badge-sm {
  background: var(--academy-gold-subtle);
  color: var(--academy-gold);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Weekly Puzzle Header & Week Navigator */
.puzzle-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.puzzle-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.puzzle-week-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.btn-week-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-week-nav:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  background: var(--bg-elevated);
}
.btn-week-nav svg {
  width: 16px;
  height: 16px;
}
.week-nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.week-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.week-number-label {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
  line-height: 1;
}
.current-week-tag {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.btn-jump-current-week {
  background: rgba(240, 95, 36, 0.12);
  border: 1px solid rgba(240, 95, 36, 0.35);
  color: var(--brand-orange);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-jump-current-week:hover {
  background: var(--brand-orange);
  color: #ffffff;
}
.week-date-range {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.empty-week-template-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: color-mix(in srgb, var(--bg-surface) 90%, var(--brand-orange));
  border: 1px solid rgba(240, 95, 36, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.template-banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.template-banner-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(240, 95, 36, 0.15);
  color: var(--brand-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.template-banner-icon-box svg {
  width: 20px;
  height: 20px;
}
.template-banner-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}
.template-banner-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.btn-copy-template-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-orange);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(240, 95, 36, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-copy-template-act:hover {
  background: var(--brand-orange-hover);
}
.btn-copy-template-act svg {
  width: 15px;
  height: 15px;
}
.puzzle-quick-actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.btn-copy-template-subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-copy-template-subtle:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}
.btn-copy-template-subtle svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 520px) {
  .nav-btn-text {
    display: none;
  }
  .btn-week-nav {
    padding: 8px 10px;
  }
  .empty-week-template-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-copy-template-act {
    justify-content: center;
  }
}

/* Weekly Puzzle Days Grid */
.puzzle-days-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .puzzle-days-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.puzzle-day-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.puzzle-day-box.has-mission {
  border-color: rgba(240, 95, 36, 0.35);
}
.day-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.day-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.day-mission-count {
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 2px;
}
.day-missions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.day-mission-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.day-mission-item:hover {
  border-color: rgba(240, 95, 36, 0.5);
  background: var(--bg-surface);
}
.day-mission-item.is-targeted {
  /* Symmetrical borders: clean European academy look */
  border-color: rgba(59, 130, 246, 0.35);
}
.mission-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.mission-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.mission-target-chip.chip-team {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
}
.mission-target-chip.chip-targeted {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}
.btn-mission-item-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}
.btn-mission-item-edit:hover {
  color: var(--brand-orange);
}
.btn-mission-item-edit svg {
  width: 13px;
  height: 13px;
}
.day-mission-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.mission-item-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}
.day-reps-tag {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.day-reps-tag svg {
  width: 12px;
  height: 12px;
}
.mission-cat-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}
.day-test-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Attendance Sheet */
.attendance-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attendance-player-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.status-btn-group {
  display: flex;
  gap: 4px;
}
.btn-att {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-att.status-present.active {
  background: var(--pitch-green);
  border-color: var(--pitch-green);
  color: #fff;
}
.btn-att.status-absent.active {
  background: var(--club-red);
  border-color: var(--club-red);
  color: #fff;
}
.btn-att.status-sick.active {
  background: var(--academy-gold);
  border-color: var(--academy-gold);
  color: #000;
}

@media (max-width: 440px) {
  .attendance-player-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .status-btn-group {
    width: 100%;
    display: flex;
  }
  .btn-att {
    flex: 1;
    text-align: center;
  }
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0;
}

/* Verification Feed */
.verification-stream-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.verification-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.verification-item.is-verified {
  border-color: rgba(16, 185, 129, 0.3);
}
.item-player-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.player-num-chip {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--bg-surface);
  color: var(--brand-orange);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}
.player-full-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}
.player-team-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(240, 95, 36, 0.12);
  color: var(--brand-orange);
  border: 1px solid rgba(240, 95, 36, 0.25);
  font-weight: 600;
}
.item-coach-feedback {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--pitch-green);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.item-coach-feedback svg {
  width: 14px;
  height: 14px;
  stroke: var(--pitch-green);
}
.item-notes {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 4px 0 0 0;
}
.rpe-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--tactical-blue);
  border-radius: var(--radius-sm);
}
.btn-verify-chip {
  align-self: flex-start;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.btn-unverified {
  background: var(--brand-orange);
  color: #fff;
}
.btn-verified {
  background: rgba(16, 185, 129, 0.2);
  color: var(--pitch-green);
  border: 1px solid var(--pitch-green);
}

/* MyClub Attendance Header & Controls */
.attendance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.att-head-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.att-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-myclub-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-myclub-sync.is-syncing svg {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* MyClub Status Banner */
.myclub-status-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.myclub-banner-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.myclub-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-main);
}
.myclub-brand-pill strong {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  letter-spacing: 0.03em;
  font-size: 1rem;
  color: var(--text-main);
}
.myclub-domain-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.myclub-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pitch-green);
  display: inline-block;
}
.myclub-dot.pulse {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.myclub-last-sync {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.myclub-stats-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.att-stat-chip {
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
}
.att-stat-chip strong {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 0.95rem;
  margin-right: 2px;
}
.att-stat-chip.chip-present strong { color: var(--pitch-green); }
.att-stat-chip.chip-registered strong { color: var(--tactical-blue); }
.att-stat-chip.chip-absent strong { color: var(--club-red); }

/* Player Attendance Row Details */
.player-info-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}
.player-info-mini .p-num {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-orange);
  min-width: 26px;
}
.player-info-mini .p-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.player-info-mini .p-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}
.p-myclub-tag {
  display: flex;
  align-items: center;
  gap: 4px;
}
.myclub-badge-tag {
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.myclub-badge-tag svg {
  width: 12px;
  height: 12px;
}
.myclub-badge-tag.tag-confirmed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--pitch-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.myclub-badge-tag.tag-registered {
  background: rgba(59, 130, 246, 0.15);
  color: var(--tactical-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.myclub-badge-tag.tag-absent {
  background: rgba(225, 29, 72, 0.15);
  color: var(--club-red);
  border: 1px solid rgba(225, 29, 72, 0.3);
}
.myclub-badge-tag.tag-none {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Modal Drawer & Form Elements */
.input-addon-group {
  display: flex;
  align-items: center;
}
.input-addon-group .tt-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}
.input-addon {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: none;
  padding: 10px 14px;
  color: var(--text-dim);
  font-size: 0.88rem;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}
.modal-info-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.45;
}
.modal-title-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-footer-cta {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Coach Header & Multi-Team Switcher
   ========================================================================== */
.hud-coach-names {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-team-picker-trigger-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.hud-team-picker-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: default;
  text-align: left;
  color: inherit;
}

.hud-team-picker-btn.has-multiple-teams {
  cursor: pointer;
}

.hud-team-main-name {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.15;
  color: var(--text-main);
  transition: color 0.15s ease;
  margin: 0;
}

.hud-team-picker-btn.has-multiple-teams:hover .hud-team-main-name {
  color: var(--brand-orange);
}

.hud-team-age-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid rgba(240, 95, 36, 0.35);
  color: var(--brand-orange);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-switch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.hud-team-picker-btn.has-multiple-teams:hover .team-switch-badge {
  background: var(--brand-orange-subtle);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  transform: translateY(1px);
}

/* Quick Dropdown Menu for Desktop & Tablet */
.hud-quick-team-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 9999;
  min-width: 290px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  animation: tt-dropdown-fade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-quick-team-menu.is-open {
  display: flex;
}

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

.quick-team-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.quick-team-menu-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-team-menu-title svg {
  width: 14px;
  height: 14px;
}

.quick-team-menu-count {
  font-size: 0.72rem;
  color: var(--brand-orange);
}

.quick-team-menu-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 280px;
  overflow-y: auto;
}

.quick-team-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.quick-team-item:hover {
  background: color-mix(in srgb, var(--brand-orange) 10%, var(--bg-elevated));
  border-color: var(--brand-orange);
}

.quick-team-item.is-active {
  background: color-mix(in srgb, var(--brand-orange) 16%, var(--bg-elevated));
  border-color: var(--brand-orange);
}

.quick-team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-team-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.quick-team-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.quick-team-check svg {
  width: 16px;
  height: 16px;
}

.hud-coach-subline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-wrap: nowrap;
}

.hud-coach-title-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-coach-title-btn:hover .hud-coach-title {
  color: var(--brand-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hud-coach-title {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.hud-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-switch-cue-link {
  background: transparent;
  border: none;
  padding: 0 4px;
  color: var(--brand-orange);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s ease;
}

.hud-switch-cue-link:hover {
  opacity: 0.8;
}

.hud-avatar.hud-coach-avatar {
  background: color-mix(in srgb, var(--brand-orange) 20%, var(--bg-elevated));
  border-color: rgba(240, 95, 36, 0.4);
  color: var(--brand-orange);
}

/* Team Switcher Modal */
.team-switcher-card {
  max-width: 440px;
}

.team-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.team-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  color: var(--text-main);
}

.team-option-btn:hover {
  border-color: var(--brand-orange);
  background: color-mix(in srgb, var(--brand-orange) 8%, var(--bg-elevated));
}

.team-option-btn.is-active {
  border-color: var(--brand-orange);
  background: color-mix(in srgb, var(--brand-orange) 14%, var(--bg-elevated));
}

.team-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-option-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.3px;
}

.team-option-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.team-active-check svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Clickable Roster Table Rows & Player Profile Links
   ========================================================================== */
.roster-player-row.is-clickable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.btn-player-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.btn-player-profile-link .player-name-text {
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.15s ease;
  cursor: pointer;
}

.btn-player-profile-link .player-affordance-arrow {
  display: inline-flex;
  align-items: center;
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-player-profile-link .player-affordance-arrow svg {
  width: 14px;
  height: 14px;
}

.roster-player-row.is-clickable:hover {
  background: color-mix(in srgb, var(--brand-orange) 8%, var(--bg-card));
}

.roster-player-row.is-clickable:hover .player-name-text,
.btn-player-profile-link:hover .player-name-text {
  color: var(--brand-orange);
}

.roster-player-row.is-clickable:hover .player-affordance-arrow,
.btn-player-profile-link:hover .player-affordance-arrow {
  opacity: 1;
  transform: translateX(3px);
  color: var(--brand-orange);
}

.btn-view-player {
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-view-player:hover {
  background: var(--brand-orange-subtle);
  color: var(--brand-orange);
  border-color: var(--brand-orange);
}

/* ==========================================================================
   Player History Modal
   ========================================================================== */
.player-history-card {
  max-width: 620px;
  max-height: 85dvh;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.player-history-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.player-history-scroll-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.player-history-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-jersey-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand-orange);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.history-player-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-player-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.history-player-team {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.player-summary-hud {
  display: flex;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.player-summary-hud .summary-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-summary-hud .pill-val {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.history-quick-actions {
  display: flex;
  gap: 8px;
}

.btn-action-ghost {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-action-ghost:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.history-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-top: 10px;
}

.history-section-heading .heading-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.history-section-heading .heading-count {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.history-stream-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease;
}

.history-item-row.is-verified {
  border-color: rgba(16, 185, 129, 0.35);
}

.history-item-row.is-pending {
  border-color: rgba(245, 158, 11, 0.35);
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-item-type {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-cat-icon {
  display: flex;
  align-items: center;
}

.item-cat-icon svg {
  width: 16px;
  height: 16px;
  color: var(--brand-orange);
}

.item-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-main);
}

.item-timestamp {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.history-item-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-pill {
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.metric-pill strong {
  color: var(--text-main);
}

.metric-pill.xp-pill {
  color: var(--brand-orange);
  border-color: rgba(240, 95, 36, 0.3);
  font-weight: 600;
}

.metric-pill.rpe-pill {
  color: var(--tactical-blue);
}

.history-item-notes {
  font-size: 0.84rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0;
  padding-left: 6px;
  border-left: 2px solid var(--border-strong);
}

.history-item-verification-zone {
  margin-top: 4px;
}

.history-verified-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.history-verified-badge svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.verified-text-wrap {
  display: flex;
  flex-direction: column;
}

.verified-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pitch-green);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.verified-feedback {
  font-size: 0.82rem;
  color: var(--text-main);
  margin: 2px 0 0 0;
}

.history-verify-inline .btn-verify-now {
  background: color-mix(in srgb, var(--pitch-green) 18%, var(--bg-card));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--pitch-green);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.history-verify-inline .btn-verify-now:hover {
  background: var(--pitch-green);
  color: #ffffff;
}

.history-empty-box {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   Mission & Drill Picker Modal (Drill Bank, Custom Drill, Targeting)
   ========================================================================== */
.mission-picker-card {
  max-width: 580px;
  width: 95vw;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-elevated);
}

/* Modal Pinned Header */
.picker-modal-header {
  padding: 16px 20px 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-modal-title-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.picker-day-headline {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.picker-tab-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-top: 4px;
}

.picker-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.picker-tab-btn svg {
  width: 15px;
  height: 15px;
}

.picker-tab-btn.active {
  background: var(--bg-surface);
  color: var(--brand-orange);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-strong);
}

/* Modal Scrollable Body */
.picker-modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.picker-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.picker-search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.picker-search-input {
  padding-left: 36px;
  padding-right: 32px;
  width: 100%;
  height: 40px;
  font-size: 0.88rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

.search-icon-box {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.search-icon-box svg {
  width: 15px;
  height: 15px;
}

.btn-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.btn-search-clear svg {
  width: 14px;
  height: 14px;
}

.picker-categories-scroller {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.picker-categories-scroller::-webkit-scrollbar {
  display: none;
}

.picker-cat-pill {
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.picker-cat-pill:hover {
  border-color: var(--brand-orange);
  color: var(--text-main);
}

.picker-cat-pill.is-active {
  background: var(--brand-orange-subtle);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  font-weight: 700;
}

.picker-drills-scroller {
  max-height: none;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 0;
}

/* Drill Bank Cards: Balanced, Clean European Academy Style */
.drill-bank-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drill-bank-card:hover {
  border-color: rgba(240, 95, 36, 0.4);
  background: var(--bg-elevated);
}

.drill-bank-card.is-selected {
  border-color: var(--brand-orange);
  background: var(--brand-orange-subtle);
  box-shadow: none;
}

.drill-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.drill-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.drill-cat-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.drill-source-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--brand-orange-subtle);
  border: 1px solid rgba(240, 95, 36, 0.25);
  color: var(--brand-orange);
}

.drill-level-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

.drill-card-check {
  color: var(--brand-orange);
  display: flex;
  align-items: center;
}

.drill-card-check svg {
  width: 15px;
  height: 15px;
}

.drill-card-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2px 0;
  line-height: 1.2;
}

.drill-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.drill-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.74rem;
}

.drill-reps-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pitch-green);
  font-weight: 600;
}

.drill-reps-pill svg {
  width: 12px;
  height: 12px;
}

.drill-video-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #60a5fa;
  font-weight: 600;
}

.drill-video-pill svg {
  width: 12px;
  height: 12px;
}

.drill-empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Selected Drill Meta Box: Refined Elevated Surface */
.selected-drill-meta-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 6px;
  box-shadow: none;
}

.selected-drill-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--text-main);
  flex-wrap: wrap;
}

.drill-selected-badge {
  color: var(--pitch-green);
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drill-selected-badge svg {
  width: 14px;
  height: 14px;
}

#selected-drill-name-display {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.96rem;
}

.picker-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .picker-two-col {
    grid-template-columns: 1fr;
  }
}

.unit-stepper-combo {
  display: flex;
  gap: 8px;
  align-items: center;
}

.unit-select {
  max-width: 110px;
  height: 36px;
  font-size: 0.84rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

/* Sober Coach Stepper */
.stepper-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.stepper-compact .stepper-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.stepper-compact .stepper-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.stepper-compact .stepper-btn svg {
  width: 14px;
  height: 14px;
}

.stepper-compact .stepper-value-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 52px;
  padding: 0 4px;
}

.stepper-compact .stepper-val {
  font-size: 1.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.stepper-compact .stepper-unit {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.picker-two-col .tt-textarea,
.picker-custom-view .tt-textarea,
.picker-custom-view .tt-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.86rem;
  width: 100%;
}

.picker-two-col .tt-textarea:focus,
.picker-custom-view .tt-textarea:focus,
.picker-custom-view .tt-input:focus {
  border-color: var(--brand-orange);
  outline: none;
  box-shadow: 0 0 0 1px var(--brand-orange);
}

/* Targeting Section */
.picker-targeting-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

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

.target-scope-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.scope-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.scope-btn.active {
  background: var(--bg-surface);
  color: var(--brand-orange);
}

.targeted-players-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 8px;
}

.role-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.role-chip:hover {
  border-color: var(--brand-orange);
  color: var(--text-main);
  background: var(--bg-elevated);
}

.role-chip svg {
  width: 12px;
  height: 12px;
}

.role-chip-action {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.targeting-count-bar {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.players-checkbox-scroller {
  max-height: none;
  overflow-y: visible;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

@media (max-width: 480px) {
  .players-checkbox-scroller {
    grid-template-columns: 1fr;
  }
}

.player-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-main);
  user-select: none;
  transition: all 0.12s ease;
}

.player-checkbox-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.player-checkbox-item.is-checked {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.1);
}

.player-checkbox-item.is-checked .player-cb-name {
  color: #60a5fa;
  font-weight: 600;
}

.player-num-chip {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--brand-orange);
  font-size: 0.8rem;
  min-width: 24px;
}

.player-cb-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.is-hidden {
  display: none !important;
}

/* Modal Pinned Footer: Clean & Aligned */
.picker-actions-row {
  padding: 14px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

.picker-actions-row .btn-primary {
  min-width: 140px;
}

.btn-danger {
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.35);
  color: var(--club-red);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: var(--club-red);
  color: #ffffff;
}

/* Light Theme Overrides for Mission Picker */
[data-theme="light"] .mission-picker-card {
  background: #ffffff;
}
[data-theme="light"] .picker-modal-header,
[data-theme="light"] .picker-actions-row {
  background: #ffffff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .drill-bank-card {
  background: #ffffff;
  border: 1px solid #e4e4eb;
}
[data-theme="light"] .drill-bank-card:hover {
  background: #f8f8fb;
  border-color: var(--brand-orange);
}
[data-theme="light"] .drill-bank-card.is-selected {
  background: rgba(240, 95, 36, 0.08);
  border-color: var(--brand-orange);
}
[data-theme="light"] .drill-card-title {
  color: #09090b;
}
[data-theme="light"] .selected-drill-meta-box {
  background: #f8f8fb;
  border: 1.5px solid #dcdce6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .selected-drill-header {
  color: #09090b;
}
[data-theme="light"] #selected-drill-name-display {
  color: #09090b;
}
[data-theme="light"] .stepper-compact .stepper-btn {
  background: #ffffff;
  border: 1px solid #d0d0dc;
  color: #09090b;
}
[data-theme="light"] .targeted-players-panel {
  background: #f8f8fb;
  border: 1px solid #e0e0ea;
}
[data-theme="light"] .player-checkbox-item {
  background: #ffffff;
  border: 1px solid #e0e0ea;
  color: #09090b;
}
[data-theme="light"] .player-checkbox-item.is-checked {
  background: rgba(240, 95, 36, 0.08);
  border-color: var(--brand-orange);
}
[data-theme="light"] .role-chip {
  background: #ffffff;
  border: 1px solid #dcdce6;
  color: #09090b;
}
[data-theme="light"] .picker-two-col .tt-textarea,
[data-theme="light"] .picker-custom-view .tt-textarea,
[data-theme="light"] .picker-custom-view .tt-input {
  background: #ffffff;
  border: 1px solid #dcdce6;
  color: #09090b;
}

/* Light Theme Parity for Attendance, MyClub & Headers */
[data-theme="light"] .myclub-status-banner {
  background: #f4f4f7;
  border-color: #e2e2ea;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .myclub-brand-pill {
  color: #18181b;
}

[data-theme="light"] .myclub-brand-pill strong {
  color: #18181b;
}

[data-theme="light"] .myclub-domain-sub {
  background: #ffffff;
  border-color: #dcdce6;
  color: #52525b;
}

[data-theme="light"] .myclub-last-sync {
  color: #71717a;
}

[data-theme="light"] .att-stat-chip {
  background: #ffffff;
  border-color: #dcdce6;
  color: #18181b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .attendance-player-item {
  background: #f8f8fb;
  border-color: #e4e4ec;
}

[data-theme="light"] .player-info-mini .p-name {
  color: #18181b;
}

[data-theme="light"] .btn-att {
  background: #ffffff;
  border-color: #d0d0dc;
  color: #52525b;
}

[data-theme="light"] .btn-att:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

[data-theme="light"] .myclub-badge-tag.tag-none {
  background: #ffffff;
  border-color: #dcdce6;
  color: #71717a;
}

[data-theme="light"] .hud-role-pill {
  background: #f0f0f4;
  border-color: #dcdce6;
  color: #52525b;
}

[data-theme="light"] .hud-coach-title {
  color: #18181b;
}

[data-theme="light"] .gps-canvas {
  background: #f0f0f4;
}

[data-theme="light"] .mission-target-chip.chip-team {
  background: #f0f0f4;
  border: 1px solid #e2e2ea;
  color: #52525b;
}

[data-theme="light"] .mission-target-chip.chip-targeted {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #2563eb;
}

/* ==========================================================================
   Tactile Result Entry & Screen-Half Tap Zones (Glove & Mud Friendly)
   ========================================================================== */
.result-entry-card.has-tap-zones {
  position: relative;
  overflow: hidden;
}

.stepper-tap-zones-container {
  position: absolute;
  top: 60px;
  bottom: 90px;
  left: 0;
  right: 0;
  display: flex;
  pointer-events: auto;
  z-index: 1;
}

.stepper-tap-zone {
  flex: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}

.stepper-tap-zone-left:active {
  background: rgba(240, 95, 36, 0.08);
}

.stepper-tap-zone-right:active {
  background: rgba(16, 185, 129, 0.08);
}

.tactile-stepper-wrap.stepper-giant {
  position: relative;
  z-index: 2;
  gap: 28px;
  margin: 16px 0 8px 0;
}

.stepper-giant .stepper-btn {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.stepper-giant .stepper-btn svg {
  width: 28px;
  height: 28px;
}

.stepper-giant .stepper-btn:active {
  transform: scale(0.92);
  background: var(--brand-orange);
  color: #ffffff;
  border-color: var(--brand-orange);
}

.tap-zone-hint {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.tap-zone-hint svg {
  width: 16px;
  height: 16px;
  color: var(--brand-orange);
}

/* ==========================================================================
   Coach Quick Feedback Chips (1-Click Personalized Bus Verification)
   ========================================================================== */
.coach-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-quick-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-quick-chip:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  background: color-mix(in srgb, var(--brand-orange) 8%, var(--bg-surface));
}

.btn-quick-chip:active {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #ffffff;
  transform: scale(0.96);
}

/* ==========================================================================
   Team Pulse Banner ("Just nu i laget")
   ========================================================================== */
.section-team-pulse {
  margin-bottom: 24px;
}

.team-pulse-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 92%, var(--pitch-green) 8%) 0%, var(--bg-card) 100%);
  border: 1px solid color-mix(in srgb, var(--pitch-green) 30%, var(--border-subtle));
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pulse-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pulse-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pitch-green);
}

.pulse-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pitch-green);
  box-shadow: 0 0 8px var(--pitch-green);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.pulse-stat-lead {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pulse-trained-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-main);
}

.pulse-trained-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pulse-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.team-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--brand-orange) 14%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--brand-orange) 40%, transparent);
  color: var(--brand-orange);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.team-streak-pill svg {
  width: 14px;
  height: 14px;
}

.team-weekly-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  width: 140px;
}

.team-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-subtle);
  overflow: hidden;
}

.team-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--pitch-green);
  transition: width 0.4s ease;
}

.team-progress-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 580px) {
  .team-pulse-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .pulse-right {
    width: 100%;
    align-items: stretch;
  }
  .team-weekly-progress-wrap {
    width: 100%;
    align-items: flex-start;
  }
  .team-streak-pill {
    align-self: flex-start;
  }
}

/* ==========================================================================
   Skill Radar & Athletic Pillars Profile
   ========================================================================== */
.section-skill-radar {
  margin-bottom: 28px;
}

.skill-radar-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.skill-radar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0 16px 0;
}

.skill-radar-svg {
  width: 100%;
  max-width: 360px;
  height: auto;
  overflow: visible;
}

.radar-grid-ring {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.radar-axis-line {
  stroke: var(--border-subtle);
  stroke-width: 1;
}

.radar-data-polygon {
  stroke: var(--brand-orange);
  stroke-width: 2.5;
  stroke-linejoin: round;
  transition: all 0.3s ease;
}

.radar-data-dot {
  fill: #ffffff;
  stroke: var(--brand-orange);
  stroke-width: 2.5;
}

.radar-axis-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-secondary);
}

.radar-axis-val {
  font-family: var(--font-heading);
  font-weight: 700;
  fill: var(--brand-orange);
}

.skill-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.skill-pillar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.pillar-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pillar-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pillar-val {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.pillar-track {
  width: 100%;
  height: 5px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.pillar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.pillar-fill-green { background: var(--pitch-green); }
.pillar-fill-orange { background: var(--brand-orange); }
.pillar-fill-gold { background: var(--academy-gold); }
.pillar-fill-blue { background: var(--tactical-blue); }
.pillar-fill-red { background: var(--club-red); }

/* ==========================================================================
   Light Mode Overrides (Parity for Team Pulse, Skill Radar & Quick Chips)
   ========================================================================== */
[data-theme="light"] .team-pulse-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, #ffffff 100%);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .pulse-trained-number {
  color: #09090b;
}
[data-theme="light"] .team-streak-pill {
  background: rgba(240, 95, 36, 0.08);
  border-color: rgba(240, 95, 36, 0.3);
}
[data-theme="light"] .skill-radar-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .radar-grid-ring {
  stroke: #e2e8f0;
}
[data-theme="light"] .radar-axis-line {
  stroke: #e2e8f0;
}
[data-theme="light"] .radar-axis-label {
  fill: #475569;
}
[data-theme="light"] .skill-pillar-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}
[data-theme="light"] .pillar-val {
  color: #09090b;
}
[data-theme="light"] .btn-quick-chip {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}
[data-theme="light"] .stepper-giant .stepper-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #09090b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Taitotaso Toast Notification System
   ========================================================================== */
.tt-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: calc(100% - 32px);
  max-width: 440px;
  pointer-events: none;
}

.tt-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.925rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

.tt-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tt-toast.is-hiding {
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  pointer-events: none;
}

.tt-toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.tt-toast-icon-wrap .tt-icon {
  width: 18px;
  height: 18px;
}

/* Toast Variants */
.tt-toast-success {
  border-left: 3.5px solid var(--pitch-green);
}
.tt-toast-success .tt-toast-icon-wrap {
  background: var(--pitch-green-subtle);
  color: var(--pitch-green);
}

.tt-toast-error {
  border-left: 3.5px solid var(--club-red);
}
.tt-toast-error .tt-toast-icon-wrap {
  background: rgba(225, 29, 72, 0.15);
  color: var(--club-red);
}

.tt-toast-warning {
  border-left: 3.5px solid var(--academy-gold);
}
.tt-toast-warning .tt-toast-icon-wrap {
  background: var(--academy-gold-subtle);
  color: var(--academy-gold);
}

.tt-toast-info {
  border-left: 3.5px solid var(--tactical-blue);
}
.tt-toast-info .tt-toast-icon-wrap {
  background: var(--tactical-blue-subtle);
  color: var(--tactical-blue);
}

.tt-toast-message {
  flex: 1;
  word-break: break-word;
  font-weight: 500;
  color: var(--text-main);
}

.tt-toast-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.tt-toast-close:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.tt-toast-close .tt-icon {
  width: 16px;
  height: 16px;
}

/* Light Theme Parity */
[data-theme="light"] .tt-toast {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

[data-theme="light"] .tt-toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   User Settings & Profile Modal (Triggered via Avatar Head, Gmail Style)
   ========================================================================== */
.settings-modal-backdrop {
  justify-content: flex-end;
  align-items: flex-start;
  padding: calc(env(safe-area-inset-top, 12px) + 76px) max(16px, calc((100vw - var(--hud-max-w)) / 2 + 16px)) 24px 16px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.settings-modal-card {
  max-width: 440px;
  width: 100%;
  max-height: min(720px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-subtle);
  transform-origin: top right;
  animation: ttSettingsCardPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ttSettingsCardPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 640px) {
  .settings-modal-backdrop {
    justify-content: center;
    align-items: center;
    padding: 16px;
  }
  .settings-modal-card {
    max-width: 100%;
    max-height: 88vh;
    transform-origin: center center;
  }
}

.settings-modal-card .modal-top {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.settings-modal-header-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 24px 8px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.settings-avatar-head {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--brand-orange);
  background: color-mix(in srgb, var(--brand-orange) 16%, var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-orange);
  flex-shrink: 0;
}

.settings-avatar-head svg {
  width: 28px;
  height: 28px;
}

.settings-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.settings-user-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-user-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: 0.3px;
  line-height: 1.1;
}

.settings-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-orange) 16%, var(--bg-card));
  color: var(--brand-orange);
  border: 1px solid rgba(240, 95, 36, 0.4);
}

.settings-meta-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.settings-age-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--brand-orange);
}

.settings-user-email {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.settings-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.settings-section-title svg {
  width: 15px;
  height: 15px;
  color: var(--brand-orange);
}

.settings-section-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
}

.settings-toggle-group {
  display: flex;
  gap: 8px;
}

.settings-option-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.settings-option-btn svg {
  width: 16px;
  height: 16px;
}

.settings-option-btn:hover {
  border-color: var(--brand-orange);
  color: var(--text-main);
  background: color-mix(in srgb, var(--brand-orange) 6%, var(--bg-elevated));
}

.settings-option-btn.is-active {
  border-color: var(--brand-orange);
  background: color-mix(in srgb, var(--brand-orange) 16%, var(--bg-elevated));
  color: var(--brand-orange);
}

.settings-lang-group .settings-option-btn strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.settings-section-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-audio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-team-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-team-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  color: var(--text-main);
  text-align: left;
  transition: all 0.15s ease;
}

.settings-team-item:hover {
  border-color: var(--brand-orange);
  background: color-mix(in srgb, var(--brand-orange) 8%, var(--bg-elevated));
}

.settings-team-item.is-active {
  border-color: var(--brand-orange);
  background: color-mix(in srgb, var(--brand-orange) 14%, var(--bg-elevated));
}

.settings-team-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}

.settings-team-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.settings-team-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-team-check svg {
  width: 16px;
  height: 16px;
}

.settings-cache-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cache-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
}

.cache-status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cache-status-pill.is-online {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.cache-status-pill.is-online .status-dot {
  background: #10b981;
}

.cache-status-pill.is-offline {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.cache-status-pill.is-offline .status-dot {
  background: #f59e0b;
}

.cache-btns-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-logout-link {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-logout-link:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Light Theme Parity for Settings Modal */
[data-theme="light"] .settings-modal-backdrop {
  background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .settings-modal-card {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border-subtle);
}
