#organizations-modal .modal-box,
#organizations-modal #organizations {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#organizations-modal .modal-box {
  max-height: calc(100dvh - 3rem);
}

.organization-switcher {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 16px;
  margin-top: 16px;
}

.organization-switcher [hidden] {
  display: none;
}

.organization-switcher__search {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--app-border-strong);
  border-radius: 10px;
  background: var(--app-surface);
}

.organization-switcher__search:focus-within {
  border-color: var(--app-link);
  box-shadow: 0 0 0 3px var(--app-border-soft);
}

.organization-switcher__search > svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--app-text-muted);
}

.organization-switcher__search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--app-text);
  font: inherit;
  font-size: 14px;
}

.organization-switcher__search input::placeholder {
  color: var(--app-text-muted);
}

.organization-switcher__search button {
  flex-shrink: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--app-surface-muted);
  color: var(--app-text);
  font-size: 13px;
  cursor: pointer;
}

.organization-switcher__list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.organization-switcher__item {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--app-border-soft);
  border-radius: 12px;
  background: var(--app-surface);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.organization-switcher__item:any-link {
  color: var(--app-link);
}

.organization-switcher__item:hover {
  border-color: var(--app-link);
  box-shadow: 0 3px 12px var(--app-shadow);
}

.organization-switcher :is(a, button):focus-visible {
  outline: 2px solid var(--app-link);
  outline-offset: 2px;
}

.organization-switcher__details {
  min-width: 0;
  overflow-wrap: anywhere;
}

.organization-switcher__name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.organization-switcher__alias {
  margin: 0;
  color: var(--app-text-muted);
  font-size: 14px;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.organization-switcher__current {
  flex-shrink: 0;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 12px;
  color: var(--app-link);
  font-size: 12px;
  white-space: nowrap;
}

.organization-switcher__empty {
  margin: 0;
  padding: 32px 8px;
  color: var(--app-text-muted);
  font-size: 14px;
  text-align: center;
}
