.kg-repo-header{
    margin: -.15rem 0 1rem;
  }
  .kg-repo-title{
    font-size: 1.18rem;
    font-weight: 760;
    letter-spacing: -.025em;
    min-width: 0;
  }
  .kg-repo-title a{
    text-decoration: none;
    color: var(--bs-body-color);
  }
  .kg-repo-title a:hover{ text-decoration: underline; }
  .kg-repo-title .text-muted{ font-weight: 650; }

  .kg-tabs .nav-link{ color: var(--bs-body-color); }
  .kg-tabs .nav-link.active{ font-weight: 700; }

  .kg-tabstrip{
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .kg-tabstrip::-webkit-scrollbar{ display:none; }
  .kg-tabstrip .nav-link{
    white-space: nowrap;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: .15rem;
  }
  .kg-repo-header .dropdown-menu{ z-index: 2050; }
  .kg-repo-dropdown .dropdown-item{ display:flex; align-items:center; }

  @media (min-width: 992px){
    .kg-tabstrip{ overflow: visible; flex-wrap: wrap; }
  }

  .kg-tabs.nav-tabs{ border-bottom: 0; }


  @media (max-width: 767.98px){
    .kg-repo-header .badge{
      font-size: .72rem;
      max-width: 100%;
    }
    .kg-repo-header .kg-repo-title{
      width: 100%;
      font-size: 1.05rem;
    }
    .kg-repo-header .kg-tabs .nav-link{
      padding-top: .58rem;
      padding-bottom: .58rem;
    }
    .kg-repo-header .nav-item.ms-auto{
      margin-left: 0 !important;
    }
  }

/* Mobile/tablet repository navigation: dropdowns must open inside the tab area,
   not be clipped by the horizontal scroll container. */
.kg-tabstrip .nav-link.dropdown-toggle{
  cursor: pointer;
}

@media (max-width: 991.98px){
  .kg-tabstrip{
    flex-wrap: wrap;
    gap: .35rem;
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: .65rem;
  }

  .kg-tabstrip .nav-item{
    flex: 0 0 auto;
  }

  .kg-tabstrip .nav-item.ms-auto{
    margin-left: 0 !important;
  }

  .kg-tabstrip .nav-link{
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: var(--bs-body-bg);
    padding: .48rem .72rem;
    min-height: 2.35rem;
  }

  .kg-tabstrip .nav-link.active,
  .kg-tabstrip .nav-link.show{
    border-color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
  }

  .kg-tabstrip .dropdown-menu.show{
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin: .35rem 0 .55rem;
    min-width: min(22rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
  }

  .kg-tabstrip .nav-item.dropdown:has(> .dropdown-menu.show){
    flex: 1 0 100%;
  }

  .kg-tabstrip .nav-item.dropdown:has(> .dropdown-menu.show) > .nav-link{
    width: max-content;
    max-width: 100%;
  }
}

.kg-repo-mobile-nav{
  border:1px solid var(--kg-border, var(--bs-border-color));
  border-radius:14px;
  overflow:hidden;
  background:var(--kg-panel-bg, var(--bs-body-bg));
  box-shadow:0 10px 24px rgba(27,31,36,.06);
}
.kg-repo-mobile-nav-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.8rem .9rem;
  border-bottom:1px solid var(--kg-border-muted, var(--bs-border-color-translucent));
  background:var(--kg-panel-bg-subtle, var(--bs-tertiary-bg));
  font-weight:800;
}
.kg-repo-mobile-nav-path{
  min-width:0;
  max-width:48%;
  color:var(--kg-fg-muted, var(--bs-secondary-color));
  font-size:.76rem;
  font-weight:700;
}
.kg-repo-mobile-link,
.kg-repo-mobile-group > summary{
  min-height:3rem;
  padding:.82rem .9rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  border-bottom:1px solid var(--kg-border-muted, var(--bs-border-color-translucent));
  color:var(--bs-body-color);
  text-decoration:none;
  font-weight:760;
  list-style:none;
  cursor:pointer;
  background:var(--kg-panel-bg, var(--bs-body-bg));
}
.kg-repo-mobile-link:last-child,
.kg-repo-mobile-group:last-child > summary{
  border-bottom:0;
}
.kg-repo-mobile-group > summary::-webkit-details-marker{
  display:none;
}
.kg-repo-mobile-link:hover,
.kg-repo-mobile-group > summary:hover{
  background:var(--kg-panel-bg-hover, var(--bs-tertiary-bg));
}
.kg-repo-mobile-link.active,
.kg-repo-mobile-group > summary.active{
  color:var(--bs-primary);
  background:rgba(var(--bs-primary-rgb), .075);
}
.kg-repo-mobile-group[open] > summary{
  border-bottom:1px solid var(--kg-border-muted, var(--bs-border-color-translucent));
}
.kg-repo-mobile-group[open] .kg-repo-mobile-chevron{
  transform:rotate(180deg);
}
.kg-repo-mobile-chevron{
  transition:transform .16s ease;
}
.kg-repo-mobile-submenu{
  padding:.35rem;
  display:grid;
  gap:.25rem;
  border-bottom:1px solid var(--kg-border-muted, var(--bs-border-color-translucent));
  background:var(--kg-panel-bg-subtle, var(--bs-tertiary-bg));
}
.kg-repo-mobile-group:last-child .kg-repo-mobile-submenu{
  border-bottom:0;
}
.kg-repo-mobile-submenu a{
  padding:.68rem .75rem;
  display:flex;
  align-items:center;
  min-height:2.55rem;
  border-radius:10px;
  color:var(--bs-body-color);
  text-decoration:none;
  font-weight:650;
}
.kg-repo-mobile-submenu a:hover{
  background:var(--kg-panel-bg-hover, var(--bs-body-bg));
}
.kg-repo-mobile-submenu a.active{
  background:var(--kg-panel-bg, var(--bs-body-bg));
  color:var(--bs-primary);
  box-shadow:inset 3px 0 0 var(--bs-primary);
}

@media (max-width: 767.98px){
  .kg-repo-nav-desktop{
    display:none;
  }
  .kg-repo-header{
    margin-bottom:.85rem;
  }
}

@media (max-width: 390px){
  .kg-repo-mobile-nav-title{
    align-items:flex-start;
    flex-direction:column;
    gap:.2rem;
  }
  .kg-repo-mobile-nav-path{
    max-width:100%;
  }
}
