/* Football Kit Encyclopedia v3.7.10.1
 * Shared timeline containment + verified-relation fill.
 * Applies to every singular encyclopedia entity that renders the shared
 * kit-timeline component. Desktop never relies on page-level horizontal
 * overflow; mobile keeps a contained touch scroller.
 */

/* Timeline is always bounded by its own panel, never by the page rail. */
.fke-encyclopedia .fke-main .fke-kit-timeline{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* Desktop/tablet: show the archive as a wrapping grid so no final card is
   visually clipped behind the right edge of the detail rail. */
.fke-encyclopedia .fke-main .fke-kit-timeline>ol{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:14px 0 0!important;
  padding:0!important;
  overflow:visible!important;
  list-style:none!important;
  scrollbar-width:auto!important;
}
.fke-encyclopedia .fke-main .fke-kit-timeline>ol>li{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  padding:11px 12px!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
.fke-encyclopedia .fke-main .fke-kit-timeline>ol>li>a{
  display:block!important;
  min-width:0!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}

/* Verified entity groups should fill the available rail instead of becoming
   a narrow left-aligned island when only one or two entity types exist. */
.fke-encyclopedia .fke-main :is(.fke-national-team-profile__relation-grid,.fke-team-profile__relations-grid,.fke-country-profile-v3760__related-grid){
  width:100%!important;
  max-width:100%!important;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important;
  align-items:stretch!important;
}
.fke-encyclopedia .fke-main :is(.fke-national-team-profile__relation-block,.fke-team-profile__relations-grid>*,.fke-country-profile-v3760__related-grid>*){
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}

@media(max-width:900px){
  .fke-encyclopedia .fke-main .fke-kit-timeline>ol{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
@media(max-width:720px){
  .fke-encyclopedia .fke-main .fke-kit-timeline>ol{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* Phone: keep the useful swipe pattern, but the overflow belongs to the list
   itself. The page and the panel remain fixed to the viewport rail. */
@media(max-width:560px){
  .fke-encyclopedia .fke-main .fke-kit-timeline{
    overflow:hidden!important;
  }
  .fke-encyclopedia .fke-main .fke-kit-timeline>ol{
    display:flex!important;
    gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    padding:0 2px 7px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x proximity!important;
    overscroll-behavior-inline:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .fke-encyclopedia .fke-main .fke-kit-timeline>ol>li{
    flex:0 0 168px!important;
    width:168px!important;
    min-width:168px!important;
    scroll-snap-align:start!important;
  }
  .fke-encyclopedia .fke-main :is(.fke-national-team-profile__relation-grid,.fke-team-profile__relations-grid,.fke-country-profile-v3760__related-grid){
    grid-template-columns:1fr!important;
  }
}
