/* Correctifs mobiles ciblés : noms visibles dans les raccourcis et fiche athlète sans débordement. */

@media (max-width: 900px) {
  html,
  body,
  #root {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Les petits carrés doivent afficher le prénom, pas le résumé d'état. */
  .ip-athlete-directory .ip-id-card > h2 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    min-height: 16px !important;
    max-height: 32px !important;
    margin: 9px 0 0 !important;
    overflow: hidden !important;
    color: #10121a !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.12 !important;
    letter-spacing: -0.025em !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .ip-athlete-directory .ip-id-card > .ip-id-card-subtitle,
  .ip-athlete-directory .ip-id-card > .ip-id-card-metrics,
  .ip-athlete-directory .ip-id-card > .ip-id-card-days-label,
  .ip-athlete-directory .ip-id-card > .ip-id-card-days {
    display: none !important;
  }

  /* La fiche athlète ne doit jamais imposer une largeur supérieure à l'écran. */
  .ip-athlete-profile-v2 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .ip-athlete-profile-v2 > *,
  .ip-athlete-profile-v2 section,
  .ip-athlete-profile-v2 nav,
  .ip-athlete-profile-v2 article {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ip-athlete-profile-v2 .ip-profile-hero {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 18px !important;
  }

  .ip-athlete-profile-v2 .ip-profile-identity,
  .ip-athlete-profile-v2 .ip-profile-identity > div:last-child {
    min-width: 0 !important;
  }

  .ip-athlete-profile-v2 .ip-profile-identity p {
    overflow-wrap: anywhere !important;
  }

  .ip-athlete-profile-v2 .ip-profile-status {
    justify-items: start !important;
  }

  .ip-athlete-profile-v2 .ip-profile-quick-actions {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .ip-athlete-profile-v2 .ip-profile-quick-action {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 8px !important;
    overflow: hidden !important;
    padding: 10px !important;
  }

  .ip-athlete-profile-v2 .ip-profile-quick-action > span:last-child {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .ip-athlete-profile-v2 .ip-profile-quick-action strong,
  .ip-athlete-profile-v2 .ip-profile-quick-action small {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Le texte de la trajectoire était en nowrap et élargissait toute la page. */
  .ip-athlete-profile-v2 .ip-trajectory-teaser {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .ip-athlete-profile-v2 .ip-trajectory-teaser-top,
  .ip-athlete-profile-v2 .ip-trajectory-teaser-top > div:first-child,
  .ip-athlete-profile-v2 .ip-trajectory-teaser-range,
  .ip-athlete-profile-v2 .ip-trajectory-teaser-next,
  .ip-athlete-profile-v2 .ip-trajectory-teaser-next > span {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .ip-athlete-profile-v2 .ip-trajectory-teaser-top h2,
  .ip-athlete-profile-v2 .ip-trajectory-teaser-range strong,
  .ip-athlete-profile-v2 .ip-trajectory-teaser-range > span,
  .ip-athlete-profile-v2 .ip-trajectory-teaser-next strong {
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  .ip-athlete-profile-v2 .ip-profile-passport,
  .ip-athlete-profile-v2 .ip-profile-passport-head,
  .ip-athlete-profile-v2 .ip-profile-passport-grid,
  .ip-athlete-profile-v2 .ip-profile-passport-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ip-athlete-profile-v2 .ip-profile-passport-head h2,
  .ip-athlete-profile-v2 .ip-profile-objective strong,
  .ip-athlete-profile-v2 .ip-profile-record strong {
    overflow-wrap: anywhere !important;
  }
}

@media (max-width: 430px) {
  .ip-athlete-profile-v2 .ip-profile-identity {
    gap: 12px !important;
  }

  .ip-athlete-profile-v2 .ip-profile-identity > div[aria-hidden] {
    width: 56px !important;
    height: 56px !important;
    font-size: 23px !important;
  }

  .ip-athlete-profile-v2 .ip-profile-identity h1 {
    font-size: 31px !important;
  }

  .ip-athlete-profile-v2 .ip-trajectory-teaser-confidence {
    display: none !important;
  }
}
