/* Staff app switcher — Training, Log book, Inventory.
   External stylesheet only. Tap targets are at least 48px. */

.ppm-appswitch {
  position: relative;
  flex: 0 0 auto;
}

.ppm-appswitch__details {
  position: relative;
}

.ppm-appswitch__summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 48px;
  min-width: 48px;
  padding: 0 12px;
  margin: 0;
  list-style: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 10px;
}

.ppm-appswitch__summary::-webkit-details-marker,
.ppm-appswitch__summary::marker {
  display: none;
  content: "";
}

.ppm-appswitch__summary:focus-visible,
.ppm-appswitch__link:focus-visible {
  outline: 3px solid #8a6a00;
  outline-offset: 2px;
}

html[data-look-scheme="dark"] .ppm-appswitch__summary:focus-visible,
html[data-look-scheme="dark"] .ppm-appswitch__link:focus-visible,
html[data-theme="dark"] .ppm-appswitch__summary:focus-visible,
html[data-theme="dark"] .ppm-appswitch__link:focus-visible {
  outline-color: #f2d36b;
}

.ppm-appswitch__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  min-width: 12rem;
  padding: 6px;
  background: #fff;
  color: #404040;
  border: 1px solid #b7d4cc;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 64, 64, 0.14);
}

html[data-look-scheme="dark"] .ppm-appswitch__panel,
html[data-theme="dark"] .ppm-appswitch__panel {
  background: #1a2e2c;
  color: #e8f2ef;
  border-color: #2f4a47;
}

.ppm-appswitch__link {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.ppm-appswitch__link:hover {
  background: rgba(0, 90, 90, 0.08);
}

.ppm-appswitch__link[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  border-left: 4px solid #005a5a;
  padding-left: 8px;
}

html[data-look-scheme="dark"] .ppm-appswitch__link[aria-current="page"],
html[data-theme="dark"] .ppm-appswitch__link[aria-current="page"] {
  border-left-color: #9ee0d8;
}

@media print {
  .ppm-appswitch { display: none !important; }
}


/* Fit the existing Training header flex order (look.css). Without this, the
   switcher defaults to order 0 and sits on top of the logo on a phone. */
@media (max-width: 768px) {
  /* Keep the logo from shrinking to 0 when the user name is long; otherwise
     the brand overflows and paints over the Apps control. */
  header.top:has(.ppm-appswitch) a.brand {
    flex: 0 0 auto;
    min-width: 0;
    overflow: hidden;
  }
  header.top:has(.ppm-appswitch) nav.ppm-appswitch {
    order: 2;
    margin-left: auto;
    flex: 0 0 auto;
    width: auto;
  }
  header.top:has(.ppm-appswitch) nav.site-nav {
    order: 3;
    margin-left: 0;
  }
  header.top:has(.ppm-appswitch) .bell-wrap { order: 4; }
  header.top:has(.ppm-appswitch) .user-menu {
    order: 5;
    margin-left: 0;
    flex: 1 1 0;
    min-width: 0;
    max-width: 9rem;
  }
  header.top:has(.ppm-appswitch) .user-menu-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (min-width: 769px) {
  header.top:has(.ppm-appswitch) .ppm-appswitch {
    order: 3;
    margin-left: 8px;
    flex: 0 0 auto;
  }
  header.top:has(.ppm-appswitch) .view-as-toggle-bar { order: 4; }
  header.top:has(.ppm-appswitch) .bell-wrap { order: 5; }
  header.top:has(.ppm-appswitch) .user-menu { order: 6; }
}
