/* Shared header corrections used by every public application page. */
.main-nav a {
  min-width: 0;
}

.main-nav .nav-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 780px) {
  .site-header .header-actions {
    display: flex;
  }

  .site-header .profile-button {
    display: flex;
    width: 42px;
    min-width: 42px !important;
    height: 42px;
    padding: 3px;
    justify-content: center;
  }

  .site-header .profile-button > span,
  .site-header .profile-button > em {
    display: none;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 66px;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-header .brand {
    min-width: 0;
  }

  .site-header .brand > span:last-child {
    min-width: 0;
  }

  .site-header .brand b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-header .header-actions {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    gap: 7px;
  }

  .site-header .profile-button {
    width: 38px;
    min-width: 38px !important;
    height: 38px;
    padding: 3px;
    border: 0;
    background: transparent;
  }

  .site-header .profile-button i {
    width: 32px;
    height: 32px;
  }

  .site-header .main-nav {
    position: fixed;
    z-index: 40;
    right: 10px;
    bottom: 8px;
    left: 10px;
    width: auto;
    height: 58px;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .site-header .main-nav a {
    min-width: 0;
    padding: 0 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
  }

  .site-header .main-nav .nav-icon {
    width: 16px;
    height: 16px;
  }

  .site-header .profile-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 74px;
    width: min(330px, calc(100vw - 24px));
    max-height: calc(100vh - 155px);
    overflow-y: auto;
    transform-origin: bottom right;
  }
}

@media (max-width: 390px) {
  .site-header .theme-toggle {
    display: none;
  }
}
