/* ChurchCoor mobile header + Members navigation. Desktop styles remain unchanged. */
.churchcoor-mobile-shell-nav { display: none; }

@media (max-width: 860px) {
  .churchcoor-mobile-shell .main {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .churchcoor-mobile-shell-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 65;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 4px max(6px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #dfe7f0;
    background: #fff;
    box-shadow: 0 -5px 20px rgba(9, 43, 69, .06);
  }
  .churchcoor-mobile-shell-nav a,
  .churchcoor-mobile-shell-nav button {
    display: flex;
    min-width: 0;
    min-height: 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #68758a;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }
  .churchcoor-mobile-shell-nav .selected {
    background: #e8f2fb;
    color: #174d7c;
  }
  .churchcoor-mobile-shell-nav .nav-symbol {
    font-size: 22px;
    line-height: 1;
  }
}

@media (max-width: 680px) {
  /* The APK supplies a fixed header: the website header should scroll away. */
  .churchcoor-mobile-shell .topbar {
    position: relative;
    top: auto;
    display: flex;
    height: auto;
    min-height: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
  }
  .churchcoor-mobile-shell .topbar-left {
    display: flex;
    flex: 1 1 100%;
    padding-right: 46px;
    min-width: 0;
    align-items: center;
    gap: 10px;
  }
  .churchcoor-mobile-shell .topbar-left > div {
    min-width: 0;
  }
  .churchcoor-mobile-shell .page-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .churchcoor-mobile-shell .page-subtitle {
    display: none;
  }
  .churchcoor-mobile-shell .topbar-actions {
    display: flex;
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }
  .churchcoor-mobile-shell .topbar .icon-button {
    display: none; /* dashboard's placeholder notification button */
  }
  .churchcoor-mobile-shell .topbar .profile,
  .churchcoor-mobile-shell .topbar .user {
    position: absolute;
    top: 10px;
    right: 12px;
    margin: 0;
    padding: 0;
  }
  .churchcoor-mobile-shell .topbar .avatar {
    width: 36px;
    height: 36px;
    flex: none;
  }
  .churchcoor-mobile-shell #churchcoor-global-language-wrap {
    display: flex;
    margin-left: auto;
    min-width: 0;
    max-width: calc(100% - 50px);
    flex: 0 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }
  .churchcoor-mobile-shell #churchcoor-global-language-label {
    font-size: 11px;
    white-space: nowrap;
  }
  .churchcoor-mobile-shell #churchcoor-global-language {
    width: 116px;
    max-width: 100%;
    min-width: 0;
  }
}

/* The member-numbering page has its own back link and its mobile sidebar was
   hidden before: provide a safe way to open it from the shared bottom bar. */
@media (max-width: 680px) {
  .churchcoor-mobile-shell .topbar > div:first-child:not(.topbar-left) {
    min-width: 0;
    width: 100%;
    padding-right: 48px;
  }
  .churchcoor-mobile-shell .topbar h1 {
    margin: 3px 0 0;
    font-size: 17px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .churchcoor-mobile-shell .topbar > #churchcoor-global-language-wrap {
    max-width: 100%;
  }
}
@media (max-width: 860px) {
  .churchcoor-numbering-menu-open .sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 91;
    width: min(285px, 86vw);
    height: 100dvh;
    overflow-y: auto;
  }
  .churchcoor-numbering-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    border: 0;
    background: rgba(9, 43, 69, .55);
  }
  .churchcoor-numbering-menu-close {
    display: block;
    margin: 0 0 12px auto;
    border: 1px solid #ffffff77;
    border-radius: 8px;
    padding: 6px 11px;
    background: #ffffff22;
    color: white;
    font: inherit;
  }
}


/* Account menu is shared by Dashboard, Members and every standard page. */
.topbar .profile,
.topbar .user {
  position: relative;
  cursor: pointer;
}
.churchcoor-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  width: max-content;
  min-width: 150px;
  padding: 6px;
  border: 1px solid #d9e3ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(9, 43, 69, .18);
}
.churchcoor-account-menu[hidden] {
  display: none;
}
.churchcoor-logout {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 11px 14px;
  background: transparent;
  color: #9f2f2f;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.churchcoor-logout:hover,
.churchcoor-logout:focus-visible {
  background: #fff0f0;
  outline: none;
}
.churchcoor-logout:disabled {
  opacity: .55;
  cursor: wait;
}
