/* The shared header's right side: notification bell and account menu.
 *
 * Native <details> disclosures, so both work with scripting off. Colours and sizes
 * come from shell.v3.css's tokens. No inline style anywhere: the panel is positioned
 * from its trigger, and on a narrow screen it anchors to the header instead.
 */

.topbar-right { gap: 8px; }

.hdr-menu { position: relative; }
.hdr-menu > summary { list-style: none; cursor: pointer; }
.hdr-menu > summary::-webkit-details-marker { display: none; }

.hdr-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--hs-radius-sm);
  color: var(--hs-ink-muted);
  background: transparent;
}
.hdr-trigger:hover,
.hdr-menu[open] > .hdr-trigger { background: var(--hs-ground); color: var(--hs-ink); }
.hdr-trigger:focus-visible { outline: 2px solid var(--hs-aqua); outline-offset: 2px; }

.hdr-bell { width: 40px; justify-content: center; padding: 4px; }

.hdr-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--hs-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.hdr-name {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--hs-ink);
}
.hdr-caret { flex: none; transition: transform .15s; }
.hdr-menu[open] .hdr-caret { transform: rotate(180deg); }

.hdr-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1040;
  min-width: 240px;
  max-width: min(320px, calc(100vw - 28px));
  padding: 8px;
  background: var(--hs-surface);
  border: 1px solid var(--hs-border);
  border-radius: var(--hs-radius);
  box-shadow: var(--hs-shadow);
}
.hdr-panel-title {
  margin: 0;
  padding: 6px 10px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hs-ink-faint);
  overflow-wrap: anywhere;
}
.hdr-empty { margin: 0; padding: 14px 10px 16px; font-size: 14px; color: var(--hs-ink-muted); }

.hdr-list { list-style: none; margin: 0; padding: 0; }
.hdr-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--hs-radius-sm);
  background: transparent;
  color: var(--hs-ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.hdr-item:hover { background: var(--hs-ground); color: var(--hs-aqua); }
.hdr-item:focus-visible { outline: 2px solid var(--hs-aqua); outline-offset: -2px; }
/* UX2b. The application switcher: a name and a line of description per entry; the current
   application carries a left rule and `aria-current`, an unavailable one is plain text. */
.hdr-panel-apps { min-width: 280px; }
.hdr-app { display: flex; flex-direction: column; gap: 1px; }
.hdr-app-name { font-weight: 600; color: var(--hs-ink); }
.hdr-app-desc { font-size: 12.5px; color: var(--hs-ink-muted); }
.hdr-app[aria-current="true"] { box-shadow: inset 3px 0 0 var(--hs-aqua); background: var(--hs-info-bg); }
.hdr-app.is-unavailable { cursor: default; }
.hdr-app.is-unavailable .hdr-app-name { color: var(--hs-ink-muted); font-weight: 500; }
.hdr-app.is-unavailable:hover { background: transparent; }

.hdr-signout { border-top: 1px solid var(--hs-border); border-radius: 0 0 var(--hs-radius-sm) var(--hs-radius-sm); margin-top: 4px; }

@media (max-width: 991px) {
  /* The name is dropped, the avatar stays, and panels hang from the header edge so
     they cannot run off a narrow screen. */
  .hdr-caret { display: none; }
  /* The name stays in the accessibility tree: `display: none` removed the only text a
     screen reader had for the summary. Visually hidden, inside a positioned trigger. */
  .hdr-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .hdr-menu { position: static; }
  .hdr-panel { position: absolute; top: var(--hs-topbar-h); right: 8px; left: 8px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) { .hdr-caret { transition: none; } }

/* 2026-11-14. "Agreements & DPA" in the account menu: the entry, then which organisation it opens (or that a workspace is needed). */
.hdr-item-sub { display: block; margin-top: 1px; font-size: 12.5px; color: var(--hs-ink-muted); overflow-wrap: anywhere; }
