/* Profile menu (profile-menu.js): the round picture that replaced the Account and Settings buttons, and its dropdown.
   Colours, type and motion come from design/tokens.css. */

/* The picture: initials on navy, or the account's photo when it has one */
.pm-pic, [data-profile-pic] {
  display: grid; place-items: center; flex: none;
  border-radius: 50%; overflow: hidden;
  background: var(--navy); color: #fff;
  font-family: var(--font); font-weight: 600; letter-spacing: .02em; line-height: 1;
  user-select: none;
}
.pm-pic img, [data-profile-pic] img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* In the app bar (resort.js): a 40 px circle in a 48 px target, right of the page links */
.app-profile {
  position: relative; display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease);
}
.app-profile [data-profile-pic] { width: 40px; height: 40px; font-size: 15px; box-shadow: 0 0 0 2px #fff, 0 1px 4px var(--stroke); }
.app-profile:hover [data-profile-pic] { filter: brightness(1.22); }
.app-profile[aria-expanded="true"] [data-profile-pic] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgb(var(--navy-rgb) / .25); }
.app-profile:active { transform: scale(.95); }
.app-bar .app-profile:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 0; }
/* Its badge (friends.js on the map pages: new messages and friend requests; friends.css draws it) on the picture */
@media (min-width: 961px) { .app-profile .badge { top: 0; right: 0; } }
/* Up to 960 px the same button is the bar's one ☰ (2026-10-31, on every page): a 48 px tile, the picture only in the
   menu's head; its menu adds the search and the page links (profile-menu.js) */
.app-profile > svg { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 960px) {
  .app-profile { border-radius: var(--radius); background: var(--fill-2); color: var(--text); transition: background var(--dur-fast) var(--ease); }
  .app-profile:hover, .app-profile[aria-expanded="true"] { background: var(--fill-hover); }
  .app-profile > svg { display: block; }
  .app-profile [data-profile-pic] { display: none; }
}

/* ---------- The dropdown ---------- */

.pm {
  position: fixed; z-index: 1000;
  box-sizing: border-box;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-padding-bottom: 40px;   /* a row moved to with the arrow keys stops clear of the fade at the foot (.pm-more) */
  padding: 6px;
  background: var(--glass-solid);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font); color: var(--text);
}
.pm-list:focus { outline: none; }   /* the role="menu" list inside the box (profile-menu.js), focused after a click */
.pm.pm-in { animation: pm-drop var(--dur-fast) var(--ease-out); }
@keyframes pm-drop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
/* More below (profile-menu.js sets .pm-more): on a short phone page the box scrolls and its last rows, Sign out among
   them, start out of view, so its foot fades out with a chevron, as Home's widgets show theirs (dashboard.css); gone
   once it's scrolled to the end. Sticky, over the rows' padding: it stays at the box's foot while they move under it */
.pm::after {
  content: ""; position: sticky; bottom: -6px; display: block; height: 40px; margin: -40px -6px 0;
  pointer-events: none; opacity: 0; transition: opacity var(--dur-fast) var(--ease);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230066cc' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") center bottom 4px / 18px no-repeat,
    linear-gradient(rgb(255 255 255 / 0), var(--glass-solid) 70%);
}
.pm.pm-more::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pm.pm-in { animation: none; } .pm::after { transition: none; } }

/* Who's signed in */
.pm-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.pm-head .pm-pic { width: 40px; height: 40px; font-size: 15px; }
.pm-who { display: flex; flex-direction: column; min-width: 0; }
.pm-name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-email { font-size: var(--text-sm); color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pm-sep { height: 1px; margin: 4px 6px; background: var(--separator); }

/* Items: 44 px touch targets */
.pm-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; padding: 8px 10px;
  box-sizing: border-box;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text); text-decoration: none; text-align: left;
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1.3;
  cursor: pointer;
}
.pm-item svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pm-label { display: flex; flex-direction: column; min-width: 0; }
.pm-label small { font-size: var(--text-sm); font-weight: 400; color: var(--muted); }
.pm-item:hover, .pm-item:focus { background: var(--fill-hover); outline: none; }
.pm-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.pm-item[aria-current="page"] { font-weight: 600; }
.pm-item[aria-current="page"] svg { stroke: var(--navy); }
.pm-item:disabled { cursor: default; opacity: .6; }
.pm-item[aria-disabled="true"] { cursor: progress; opacity: .6; }
.pm-signout, .pm-signout svg { color: var(--destructive); stroke: var(--destructive); }

.pm-error { margin: 4px 10px 6px; font-size: var(--text-sm); color: var(--destructive); }
