/* Momentum team switcher polish.
 * This stylesheet intentionally overrides release-r41 without altering its
 * application bundle or business logic.
 */

.team-switch {
  min-height: 48px;
  margin-bottom: 18px;
  padding: 9px 10px;
  border-color: #dce6e1;
  background: #f7f9f8;
  box-shadow: 0 1px 0 rgb(24 82 71 / 4%);
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.team-switch:hover {
  border-color: #c7d8d1;
  background: #f1f6f4;
}

.team-switch:has(+ .team-menu) {
  border-color: #8fb9ad;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgb(40 105 94 / 10%);
}

.team-switch > svg:last-child {
  flex: 0 0 auto;
  transition: transform 140ms ease;
}

.team-switch:has(+ .team-menu) > svg:last-child {
  transform: rotate(180deg);
}

.team-switch:focus-visible,
.team-menu button:focus-visible {
  outline: 2px solid #28695e;
  outline-offset: 2px;
}

.team-menu {
  top: 128px;
  left: 16px;
  right: 16px;
  z-index: 50;
  display: grid;
  gap: 3px;
  max-height: min(360px, calc(100vh - 148px));
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #d9e5e0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 18px 44px rgb(24 49 42 / 16%),
    0 3px 10px rgb(24 49 42 / 7%);
  transform-origin: top center;
  animation: momentum-team-menu-in 140ms ease-out;
}

.team-menu::before {
  content: "切换团队";
  padding: 4px 10px 6px;
  color: #75827f;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.team-menu button {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 36px 0 10px;
  overflow: hidden;
  color: #40544f;
  font-size: 13px;
  font-weight: 600;
  line-height: 40px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition:
    color 120ms ease,
    background-color 120ms ease;
}

.team-menu button:hover {
  color: #203d36;
  background: #f2f6f4;
}

.team-menu button.active,
.team-menu button.active:hover {
  color: #185247;
  background: #e5f2ed;
}

.team-menu button.active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #ffffff;
  background: #28695e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

.team-menu .team-menu-admin {
  min-height: 46px;
  margin-top: 7px;
  padding-top: 5px;
  border-top: 1px solid #e8efec;
  border-radius: 0 0 8px 8px;
  color: #28695e;
}

.team-menu .team-menu-admin:hover {
  color: #174f45;
  background: #edf5f2;
}

.team-menu .team-menu-admin::after {
  content: "→";
  position: absolute;
  top: calc(50% + 2px);
  right: 11px;
  color: #5d8d82;
  font-size: 16px;
  font-weight: 500;
  transform: translateY(-50%);
  transition: transform 120ms ease;
}

.team-menu .team-menu-admin:hover::after {
  transform: translate(2px, -50%);
}

.team-menu::-webkit-scrollbar {
  width: 8px;
}

.team-menu::-webkit-scrollbar-thumb {
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #c9d8d2;
}

@keyframes momentum-team-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-switch,
  .team-switch > svg:last-child,
  .team-menu,
  .team-menu button,
  .team-menu .team-menu-admin::after {
    animation: none;
    transition: none;
  }
}
