/* Workspace switcher — minimal styling (Task 2.7).
 *
 * Lives next to the brand in the topbar. The <details> element is the
 * positioning anchor; the dropdown <ul> sits absolute beneath it.
 */

.ws-switcher {
  position: relative;
  display: inline-block;
  margin-left: 0.5rem;
}

/* Client-brand chrome — renders between the Credenda wordmark and the
 * workspace switcher when a workspace is active. The advisor caption
 * surfaces in muted small-caps so it sits next to the client name
 * without competing for attention. */

.client-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.4rem;
  padding: 0 0.5rem 0 0.65rem;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.client-brand-logo {
  height: 1.2rem;
  width: auto;
  max-width: 4.5rem;
  object-fit: contain;
}

.client-brand-name {
  font-weight: 600;
}

.client-brand-advisor {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
}

.client-brand-advisor[data-advisor-fallback="true"] {
  /* Slightly louder so the user knows the logo is the advisor's, not
     the client's own. */
  opacity: 0.7;
  font-style: italic;
}

/* Hide the default disclosure triangle that <details>/<summary>
 * renders so our caret is the only one shown. */
.ws-switcher > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: var(--brand-color-bg, #fff);
  font: inherit;
  user-select: none;
}

.ws-switcher > summary::-webkit-details-marker {
  display: none;
}

.ws-switcher-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.ws-switcher-current {
  font-weight: 600;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-switcher-caret {
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.ws-switcher[open] .ws-switcher-caret {
  transform: rotate(180deg);
}

.ws-switcher-list {
  list-style: none;
  margin: 0.25rem 0 0 0;
  padding: 0.3rem 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 18rem;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 50;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.ws-switcher-item {
  margin: 0;
}

.ws-switcher-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.7rem;
  color: inherit;
  text-decoration: none;
}

.ws-switcher-link:hover,
.ws-switcher-link:focus {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}

.ws-switcher-link:focus-visible {
  outline: 2px solid var(--brand-color, #2952cc);
  outline-offset: -2px;
}

.ws-switcher-link.is-active {
  font-weight: 700;
  background: rgba(41, 82, 204, 0.08);
}

.ws-switcher-link-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-switcher-link-meta {
  flex: 0 0 auto;
  font-size: 0.75rem;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ws-switcher-link-org {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
}
