/* Keep the global navigation available while reading long repository pages. */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgb(0 0 0 / 7%);
}

#navbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--color-text);
}

#navbar-logo img {
  flex-shrink: 0;
  border-radius: 7px;
  object-fit: contain;
}

.manthub-wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

html {
  scroll-padding-top: 64px;
}

/* Compact migration providers share the fluid repository layout. */
.repository.migrate .mh-migrate-entries {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.repository.migrate .mh-migrate-entry {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border-radius: 12px;
}
.repository.migrate .mh-migrate-entry:hover {
  transform: translateY(-2px);
}
.repository.migrate .mh-migrate-entry:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}
.repository.migrate .mh-migrate-icon {
  display: flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
}
.repository.migrate .mh-migrate-icon svg {
  width: 40px;
  height: 40px;
}
.repository.migrate .mh-migrate-entry > .content {
  flex: 1;
  min-width: 0;
  padding: 0;
  border-top: 0;
  overflow-wrap: anywhere;
}
.repository.migrate .mh-migrate-entry .header {
  font-size: 16px;
  line-height: 1.4;
}
.repository.migrate .mh-migrate-entry .description {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

/* Keep application dashboards fluid. This file ships inside the application image. */
.page-content:is(.dashboard, .repository, .admin, .organization, .explore, .user.settings, .user.profile, .notification) {
  --mh-dashboard-gutter: clamp(16px, 1.5vw, 28px);
}
.page-content:is(.dashboard, .repository, .admin, .organization, .explore, .user.settings, .user.profile, .notification) > .ui.container,
.page-content:is(.dashboard, .repository, .admin, .organization, .explore, .user.settings, .user.profile, .notification) > .secondary-nav .ui.container {
  box-sizing: border-box;
  width: calc(100% - 2 * var(--mh-dashboard-gutter)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}
.page-content:is(.dashboard, .repository, .admin, .organization, .explore, .user.settings, .user.profile, .notification) .flex-container-main {
  min-width: 0;
}
.page-content:is(.dashboard, .repository, .admin, .organization, .explore, .user.settings, .user.profile, .notification) input[type="file"] {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}
.dashboard .activity-heatmap-container {
  max-width: 100%;
  overflow-x: auto;
}
#user-heatmap .heatmap-svg :is(.heatmap-month-label, .heatmap-day-label) {
  font-size: var(--mh-heatmap-label-size, 6px);
}
.admin .table.segment {
  max-width: 100%;
  overflow-x: auto;
}
.admin #user-list-search-form {flex-wrap: wrap;}
.admin #user-list-search-form > .tw-flex-1 {flex: 1 1 240px; min-width: 0;}
.admin #user-list-search-form > .ui.menu {flex-wrap: wrap; max-width: 100%; min-width: 0;}
.repository.settings .flex-text-block.flex-wrap > div {max-width: 100%; min-width: 0;}
.repository.settings .ui.checkbox {max-width: 100%; min-width: 0;}
.repository.settings .ui.checkbox label {white-space: normal; overflow-wrap: anywhere;}
@media (min-width: 1024px) {
  .dashboard.feeds > .flex-container > .flex-container-main {flex: 1 1 0;}
  .dashboard.feeds > .flex-container > .flex-container-sidebar {
    flex: 0 0 clamp(280px, 28vw, 400px);
    width: clamp(280px, 28vw, 400px);
    min-width: 0;
  }
}
@media (max-width: 767px) {
  .dashboard.feeds > .flex-container {flex-direction: column;}
  .dashboard.feeds > .flex-container > :is(.flex-container-main, .flex-container-sidebar) {
    width: 100%; min-width: 0; max-width: 100%;
  }
  .dashboard.feeds > .flex-container > .flex-container-main {order: 0;}
  .dashboard.feeds > .flex-container > .flex-container-sidebar {order: 1;}
  .dashboard .activity-heatmap-container #user-heatmap {min-width: 640px;}
}

@media (max-width: 767px) {
  #navbar {
    max-height: 100dvh;
    overflow: auto;
  }
}

/* Repository migration status: animated manthub mark replaces Gitea's loading.png. */
.mh-migrating {
  position: relative;
  display: grid;
  place-items: center;
  width: min(300px, 100%);
  height: 220px;
  margin: 12px auto 4px;
}
.mh-migrating-logo {
  position: relative;
  z-index: 1;
  overflow: visible;
  filter: drop-shadow(0 18px 30px rgb(0 80 244 / 24%));
  animation: mh-migrating-float 3.2s ease-in-out infinite;
}
.mh-migrating-tile {fill: #0050f4;}
.mh-migrating-m {fill: #fff; stroke: #fff; stroke-width: 2.4; stroke-linejoin: round;}
.mh-migrating-edges {fill: none; stroke: #97c6fd; stroke-width: 4.4; stroke-linecap: round; stroke-linejoin: round;}
.mh-migrating-flow {
  fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 2.5 6.5;
  animation: mh-migrating-flow .9s linear infinite;
}
.mh-migrating-node {
  fill: #97c6fd;
  transform-box: fill-box;
  transform-origin: center;
  animation: mh-migrating-node 1.8s ease-in-out infinite;
}
.mh-migrating-node:nth-of-type(2) {animation-delay: .3s;}
.mh-migrating-node:nth-of-type(3) {animation-delay: .6s;}
.mh-migrating-orbit {
  /* A tilted circle keeps a fixed ellipse outline while its dot circles the logo. */
  --mh-orbit-size: 260px;
  --mh-orbit-tilt: -15deg;
  --mh-orbit-lean: 70deg;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--mh-orbit-size);
  height: var(--mh-orbit-size);
  margin: calc(var(--mh-orbit-size) / -2) 0 0 calc(var(--mh-orbit-size) / -2);
  border: 1.5px solid #9fc8ff;
  border-radius: 50%;
  transform: rotate(var(--mh-orbit-tilt)) rotateX(var(--mh-orbit-lean));
  animation: mh-migrating-orbit 9s linear infinite;
}
.mh-migrating-orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -7px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: #147dff;
  box-shadow: 0 0 0 4px rgb(20 125 255 / 14%);
}
.mh-migrating-orbit-reverse {
  --mh-orbit-size: 196px;
  --mh-orbit-tilt: 24deg;
  --mh-orbit-lean: 62deg;
  border-color: rgb(159 200 255 / 55%);
  animation-duration: 13s;
  animation-direction: reverse;
}
.mh-migrating-orbit-reverse::after {right: auto; left: -5px; width: 11px; height: 11px; margin-top: -6px; background: #97c6fd;}
.mh-migrating-bar {
  position: relative;
  overflow: hidden;
  width: min(240px, 80%);
  height: 4px;
  margin: 6px auto 18px;
  border-radius: 99px;
  background: rgb(0 80 244 / 12%);
}
.mh-migrating-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0074ff, #0050f4);
  animation: mh-migrating-bar 1.6s ease-in-out infinite;
}
.mh-migrating-failed .mh-migrating-logo {animation: none; filter: grayscale(.45) drop-shadow(0 14px 24px rgb(35 52 81 / 16%));}
.mh-migrating-badge {fill: #dc3545; stroke: var(--color-body); stroke-width: 3;}
.mh-migrating-badge-mark {fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round;}
@keyframes mh-migrating-float {50% {transform: translateY(-6px);}}
@keyframes mh-migrating-flow {to {stroke-dashoffset: -9;}}
@keyframes mh-migrating-node {0%, 60%, 100% {transform: scale(1); fill: #97c6fd;} 30% {transform: scale(1.28); fill: #fff;}}
@keyframes mh-migrating-orbit {
  from {transform: rotate(var(--mh-orbit-tilt)) rotateX(var(--mh-orbit-lean)) rotate(0deg);}
  to {transform: rotate(var(--mh-orbit-tilt)) rotateX(var(--mh-orbit-lean)) rotate(360deg);}
}
@keyframes mh-migrating-bar {0% {transform: translateX(-100%);} 100% {transform: translateX(250%);}}
html[data-theme*="dark"] .mh-migrating-orbit {border-color: rgb(95 150 230 / 45%);}
@media (max-width: 480px) {
  .mh-migrating {height: 190px;}
  .mh-migrating-logo {width: 124px; height: 124px;}
  .mh-migrating-orbit {--mh-orbit-size: 230px;}
  .mh-migrating-orbit-reverse {--mh-orbit-size: 172px;}
}
@media (prefers-reduced-motion: reduce) {
  .mh-migrating-logo, .mh-migrating-flow, .mh-migrating-node, .mh-migrating-orbit, .mh-migrating-bar > span {animation: none;}
  .mh-migrating-flow {stroke-dasharray: none; opacity: .5;}
  .mh-migrating-bar > span {width: 100%; opacity: .5;}
}
