/* ============================================================
   Account menu — the signed-in identity in the marketing nav.
   Built by the nav script in each pages/Proven_Web/*.html from
   window.__PROVEN_SESSION__ (helpers/marketingSession.js).
   Uses the tokens in colors_and_type.css and mirrors .btn-ghost.
   ============================================================ */

.pa-account { position: relative; display: inline-flex; }

.pa-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 12px 4px 4px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--fg1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s, border-color .15s;
}
.pa-account-btn:hover,
.pa-account-btn[aria-expanded="true"] { border-color: var(--fg1); background: var(--bg-raised); }
.pa-account-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-color: var(--brand-orange); }

.pa-account-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
  line-height: 1.2;
}
.pa-account-caption {
  color: var(--fg2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.pa-account-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa-account-chev { width: 10px; height: 10px; flex: none; transition: transform .15s; }
.pa-account-btn[aria-expanded="true"] .pa-account-chev { transform: rotate(180deg); }

.pa-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--brand-dark-blue);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.pa-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-avatar-lg { width: 44px; height: 44px; font-size: 15px; }

.pa-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 280px;
  max-width: calc(100vw - 32px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-orange);
  border-radius: 3px;
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
}
.pa-account-menu[hidden] { display: none; }

.pa-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.pa-account-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pa-account-fullname {
  color: var(--fg1);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.pa-account-email {
  color: var(--fg2);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pa-account-role {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(var(--brand-light-blue-rgb), 0.16);
  color: var(--fg1);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pa-account-items { padding: 6px; display: flex; flex-direction: column; }
.pa-account-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  background: transparent;
  border: 0;
  border-radius: 2px;
  color: var(--fg1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.pa-account-item:hover,
.pa-account-item:focus-visible { outline: none; background: var(--bg-raised); }
.pa-account-sep { height: 1px; margin: 6px 4px; background: var(--border); }

@media (max-width: 720px) {
  .pa-account-btn { min-height: 32px; padding: 2px; gap: 0; border-radius: 2px; }
  .pa-account-btn .pa-avatar { width: 26px; height: 26px; font-size: 10px; }
  .pa-account-label,
  .pa-account-chev { display: none; }
  /* Anchor to the viewport, not the avatar, so the panel keeps the 16px page gutter. */
  .pa-account-menu { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; max-width: none; }
}
