/* The profile (core/profile.js): Sign in with Discord, or the signed-in chip and its menu. In mics.dev's colours,
   Discord's own blurple only where Discord is the action. */
.pf { position: relative; display: flex; align-items: center; flex: none; }
.pf :focus-visible { outline: none; box-shadow: var(--focus); }

/* signed out */
.pf-signin { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 16px 0 13px; border: 0; border-radius: var(--r-pill); background: #5865f2; color: #fff; font: 700 14px/1 'Manrope', sans-serif; cursor: pointer; white-space: nowrap; box-shadow: 0 6px 20px rgba(88, 101, 242, .28); transition: background var(--d-1), transform var(--d-1), box-shadow var(--d-2); }
.pf-signin:hover { background: #4752c4; box-shadow: 0 8px 26px rgba(88, 101, 242, .38); }
.pf-signin:active { transform: translateY(1px); }
.pf-logo { flex: none; width: 20px; height: 20px; }

/* signed in: the chip */
.pf-me { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 10px 0 4px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: rgba(21, 18, 31, .8); color: var(--text); font: 600 14px/1 'Manrope', sans-serif; cursor: pointer; backdrop-filter: blur(8px); transition: border-color var(--d-1), background var(--d-1); }
.pf-me:hover, .pf-me[aria-expanded="true"] { border-color: var(--line-3); background: var(--surface-2); }
.pf-av { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); }
.pf-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform var(--d-2) var(--ease); }
.pf-me[aria-expanded="true"] .pf-chev { transform: rotate(180deg); }
/* not on the Discord yet: a dot on the picture says the menu has something for them */
.pf-nudge { position: relative; }
.pf-nudge::after { content: ''; position: absolute; left: 26px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #5865f2; box-shadow: 0 0 0 2px var(--bg); }

/* the menu */
.pf-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: var(--z-popover); width: 296px; padding: 8px; border: 1px solid var(--line-2); border-radius: 16px; background: #15121f; box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .3); transform-origin: top right; }
@media (prefers-reduced-motion: no-preference) {
  .pf-menu:not([hidden]) { animation: pf-in .16s var(--ease); }
  @keyframes pf-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
}
.pf-card { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.pf-card img { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); }
.pf-card div { min-width: 0; }
.pf-card b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15.5px/1.25 'Outfit', sans-serif; color: var(--white); }
.pf-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.pf-status { display: flex; align-items: center; gap: 8px; margin: 0 2px 4px; padding: 9px 10px; border-radius: var(--r-2); background: var(--success-bg); color: var(--success); font-size: 13.5px; font-weight: 600; }
.pf-status svg { flex: none; width: 16px; height: 16px; }
.pf-join { display: flex; align-items: center; gap: 12px; margin: 0 2px 2px; padding: 11px 12px; border-radius: 12px; background: #5865f2; color: #fff; text-decoration: none; transition: background var(--d-1); }
.pf-join:hover, .pf-join:focus-visible { background: #4752c4; color: #fff; }
.pf-join .pf-logo { width: 24px; height: 24px; }
.pf-join b { display: block; font: 700 14px/1.25 'Manrope', sans-serif; }
.pf-join small { display: block; font-size: 12.5px; opacity: .85; }
.pf-recheck { display: block; width: calc(100% - 4px); margin: 0 2px; padding: 7px 10px; border: 0; background: none; color: var(--lilac); font: 600 12.5px/1.3 'Manrope', sans-serif; text-align: left; cursor: pointer; border-radius: var(--r-1); }
.pf-recheck:hover { text-decoration: underline; text-underline-offset: 3px; }
.pf-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.pf-menu a[role="menuitem"]:not(.pf-join), .pf-menu button[role="menuitem"]:not(.pf-recheck) { display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-2); background: none; color: var(--text); font: 600 14px/1 'Manrope', sans-serif; text-align: left; text-decoration: none; cursor: pointer; }
.pf-menu a[role="menuitem"]:not(.pf-join):hover, .pf-menu button[role="menuitem"]:not(.pf-recheck):hover,
.pf-menu a[role="menuitem"]:not(.pf-join):focus-visible, .pf-menu button[role="menuitem"]:not(.pf-recheck):focus-visible { background: var(--hover-2); color: var(--white); box-shadow: none; }
.pf-menu [role="menuitem"]:not(.pf-join) > svg:first-child { flex: none; width: 18px; height: 18px; color: var(--muted); }
.pf-menu [role="menuitem"] > span { flex: 1; }
.pf-ext { flex: none; width: 14px; height: 14px; color: var(--faint); }

/* narrow: the chip is the picture alone, the sign-in button just "Sign in" */
@media (max-width: 720px) {
  .pf-name, .pf-me .pf-chev, .pf-long { display: none; }
  .pf-me { padding: 0 4px; }
  .pf-signin { height: 36px; padding: 0 13px 0 11px; font-size: 13.5px; }
  .pf-menu { position: fixed; top: 64px; right: 12px; left: auto; width: min(296px, calc(100vw - 24px)); }
}

/* ── where it sits in the explorer ── */
/* the bar over the content: the search, and the profile at its right */
.appbar { display: flex; align-items: flex-start; gap: 16px; margin: -14px 0 22px; }
.appbar > .gsearch { flex: 1; min-width: 0; margin: 0; }
.appbar-profile { margin-left: auto; }
/* the home moves the search into its hero: the profile alone, over the hero's top right corner */
main { position: relative; }
.appbar:not(:has(.gsearch)) { position: absolute; top: 24px; right: var(--gutter); z-index: var(--z-sticky); margin: 0; }
/* the phone's top bar: the search button and the profile at its right; the bar over the content keeps the search only */
.topbar-end { display: flex; align-items: center; gap: 6px; }
.topbar-end .pf { display: none; }
@media (max-width: 900px) {
  .topbar-end .pf { display: flex; }
  .appbar { margin-top: 0; }
  .appbar-profile { display: none; }
}
