/* Keep the signed-in name visible; longer names wrap inside the header. */
.hdr .library-actions { min-width: 0; max-width: min(55%, 520px); }
.hdr .user-menu { min-width: 0; max-width: 100%; flex: 0 1 auto; }
.hdr .user-menu > .account-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; max-width: 100%; height: auto; min-height: 38px; padding: 8px 12px; gap: 8px;
  border-radius: var(--radius-pill); color: var(--label); background: var(--fill-4);
  white-space: normal; text-align: start;
  box-shadow: inset 0 0 0 var(--hairline) var(--separator-quiet);
}
.hdr .user-menu > .account-button:hover, .hdr .user-menu[open] > .account-button { background: var(--glass-hover); }
.hdr .user-menu > .account-button .account-label {
  min-width: 0; overflow-wrap: anywhere; font: 600 14px/1.5 var(--font-sans);
}
.hdr .user-menu > .account-button .glyph { flex: none; width: 12px; height: 12px; }
.account-identity { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 14px; margin-bottom: 6px; border-bottom: var(--hairline) solid var(--separator-quiet); }
.account-name { font: 600 16px/1.4 var(--font-sans); color: var(--label); overflow-wrap: anywhere; }
.account-role { font: var(--text-footnote); color: var(--label-secondary); }
.hdr .user-menu-items { min-width: 248px; max-width: calc(100vw - 32px); }
.account-sheet .account-identity { padding-inline: 10px; }
/* Actions share the left edge, in RTL order: assistant, account, refresh. */
.library-actions > .assistant-btn { margin-inline-end: 0; border-radius: var(--radius-pill); }
.library-actions > .assistant-btn:not([aria-expanded="true"]) {
  background: linear-gradient(145deg, var(--selection-sheen), transparent 65%), var(--selection-fill);
  color: var(--accent-text); box-shadow: inset 0 0 0 var(--hairline) var(--separator), var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px) saturate(135%); backdrop-filter: blur(12px) saturate(135%);
}
.library-actions > .assistant-btn:not([aria-expanded="true"]):hover { background-color: var(--glass-hover); }
 #mobileAssistantBtn, #mobileRefreshBtn { display: none; }
@media (max-width: 767px) {
  .hdr #assistantBtn, .hdr #refreshBtn { display: none; }
  .hdr #mobileAssistantBtn, .hdr #mobileRefreshBtn { display: inline-flex; flex: none; }
  .hdr .library-actions { max-width: 100%; }
  .hdr .user-menu > .account-button { min-height: 44px; }
  .account-sheet .user-menu-items { min-width: 0; max-width: none; }
  #mobileAssistantBtn { border-radius: 50%; background: var(--selection-fill); box-shadow: inset 0 0 0 var(--hairline) var(--separator-quiet); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .library-actions > .assistant-btn:not([aria-expanded="true"]) { background: var(--glass-fallback); }
}
@media (prefers-reduced-transparency: reduce) {
  .library-actions > .assistant-btn:not([aria-expanded="true"]) { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-fallback); }
}
@media (forced-colors: active) {
  .hdr .user-menu > .account-button, .library-actions > .assistant-btn { border: 1px solid ButtonText; }
}
