/* Vue mobile coach chargée directement par index.html pour éviter les anciennes feuilles en cache. */

@keyframes ip-plan-last-day-pulse {
  0%, 100% {
    background: #ffe3df;
    box-shadow: inset 0 0 0 2px #c73d34, 0 0 0 0 rgba(199,61,52,.38);
  }
  50% {
    background: #ffbcb4;
    box-shadow: inset 0 0 0 3px #b42318, 0 0 0 9px rgba(199,61,52,0);
  }
}

@media (max-width: 900px) {
  /* Calendrier des séances d'un athlète : lecture verticale, sans tableau horizontal. */
  .ip-athlete-calendar-scroll {
    overflow: visible !important;
    margin-inline: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .ip-athlete-calendar-card {
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .ip-athlete-calendar-weekdays { display: none !important; }
  .ip-athlete-calendar-weeks { display: grid !important; gap: 12px !important; }

  .ip-athlete-calendar-week {
    display: block !important;
    overflow: hidden !important;
    border: 1px solid rgba(20,32,70,.1) !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 14px 34px rgba(4,11,30,.18) !important;
  }

  .ip-athlete-calendar-phase {
    padding: 11px 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(20,32,70,.09) !important;
  }

  .ip-athlete-calendar-week-label {
    grid-template-columns: auto minmax(0,1fr) auto !important;
    align-items: center !important;
    gap: 6px 9px !important;
    padding: 0 2px 9px !important;
  }

  .ip-athlete-calendar-week-label strong {
    overflow: hidden !important;
    font-size: 12px !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .ip-athlete-calendar-week-label small {
    grid-column: auto !important;
    white-space: nowrap !important;
  }

  .ip-athlete-calendar-phase-list {
    grid-template-columns: repeat(auto-fit,minmax(118px,1fr)) !important;
  }

  .ip-athlete-calendar-phase-band,
  .ip-athlete-calendar-phase-empty { min-height: 42px !important; }

  .ip-athlete-calendar-week-days { display: block !important; }

  .ip-athlete-calendar-day {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 54px minmax(0,1fr) !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    border-top: 1px solid rgba(20,32,70,.075) !important;
    border-right: 0 !important;
  }

  .ip-athlete-calendar-day.is-outside { display: none !important; }

  .ip-athlete-calendar-day > header {
    min-height: 58px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding-right: 10px !important;
    border-right: 1px solid rgba(20,32,70,.08) !important;
  }

  .ip-athlete-calendar-day > header::before {
    color: rgba(20,32,70,.46);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .ip-athlete-calendar-day:nth-child(1) > header::before { content: 'Lun'; }
  .ip-athlete-calendar-day:nth-child(2) > header::before { content: 'Mar'; }
  .ip-athlete-calendar-day:nth-child(3) > header::before { content: 'Mer'; }
  .ip-athlete-calendar-day:nth-child(4) > header::before { content: 'Jeu'; }
  .ip-athlete-calendar-day:nth-child(5) > header::before { content: 'Ven'; }
  .ip-athlete-calendar-day:nth-child(6) > header::before { content: 'Sam'; }
  .ip-athlete-calendar-day:nth-child(7) > header::before { content: 'Dim'; }

  .ip-athlete-calendar-events {
    align-content: center !important;
    gap: 7px !important;
    margin-top: 0 !important;
  }

  .ip-athlete-calendar-events:empty::after {
    content: 'Repos / rien de prévu';
    align-self: center;
    color: rgba(20,32,70,.38);
    font-size: 10px;
    font-weight: 650;
  }

  .ip-athlete-calendar-event {
    padding: 10px 10px 10px 12px !important;
    border-radius: 11px !important;
  }

  .ip-athlete-calendar-event strong,
  .ip-athlete-calendar-event small {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .ip-athlete-calendar-event strong { font-size: 12.5px !important; line-height: 1.32 !important; }
  .ip-athlete-calendar-event small { font-size: 10px !important; line-height: 1.35 !important; }

  /* Page Athlètes : raccourcis carrés, trois par ligne. */
  .ip-athlete-directory-intro p { display: none !important; }
  .ip-athlete-directory-grid {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 8px !important;
  }

  .ip-id-card {
    min-height: 0 !important;
    aspect-ratio: 1 !important;
    padding: 9px !important;
    border-radius: 17px !important;
  }

  .ip-id-card-head > div[aria-hidden] {
    width: 30px !important;
    height: 30px !important;
    font-size: 12px !important;
  }

  .ip-id-card-status {
    width: 9px !important;
    height: 9px !important;
    min-width: 9px !important;
    max-width: 9px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: currentColor !important;
    font-size: 0 !important;
  }

  .ip-id-card-status::before { display: none !important; }
  .ip-id-card h2 { margin: 8px 0 0 !important; font-size: 14px !important; white-space: normal !important; }
  .ip-id-card-subtitle,
  .ip-id-card-metrics,
  .ip-id-card-days-label,
  .ip-id-card-days { display: none !important; }
  .ip-id-card-open { justify-content: flex-end !important; margin-top: auto !important; font-size: 16px !important; }
  .ip-id-card-open span:first-child { display: none !important; }

  /* Accueil : même accès rapide, sans rail horizontal. */
  .ip-athlete-rail,
  .ip-athlete-rail.ip-athlete-rail-une-rangee {
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 0 !important;
    scroll-snap-type: none !important;
  }

  .ip-athlete-rail > li {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
  }

  .ip-athlete-mini-card {
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 1 !important;
    padding: 9px !important;
    border-radius: 16px !important;
  }

  .ip-athlete-mini-top > div[aria-hidden] {
    width: 27px !important;
    height: 27px !important;
    font-size: 11px !important;
  }

  .ip-athlete-mini-state {
    width: 9px !important;
    height: 9px !important;
    min-width: 9px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: currentColor !important;
    font-size: 0 !important;
  }

  .ip-athlete-mini-state > span { display: none !important; }
  .ip-athlete-mini-card > strong { font-size: 12.5px !important; line-height: 1.1 !important; }
  .ip-athlete-mini-card > small { font-size: 8.5px !important; line-height: 1.15 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ip-rangee[style*="ip-plan-last-day-pulse"] {
    animation: none !important;
    background: #ffe0dc !important;
    box-shadow: inset 0 0 0 2px #c73d34 !important;
  }
}
