/* Shop context and the signed-in person share one compact account control. */
.app-header { position: relative; z-index: 20; gap: 24px; }
.account-menu { position: relative; min-width: 0; max-width: 100%; }
.account-menu__trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  min-height: 54px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: start;
  color: var(--ink);
}
.account-menu__trigger:hover:not(:disabled), .account-menu__trigger[aria-expanded=true] { background: transparent; }
.account-menu__trigger[aria-expanded=true] .account-menu__shop,
.account-menu__trigger:hover .account-menu__shop { color: var(--accent); }
.account-menu__mark { position: relative; flex: none; display: block; }
.account-menu__logo { flex: none; width: 44px; height: 44px; border: 1px solid transparent; }
.account-menu__logo.has-image { background: white; border-color: var(--line); }
.account-menu__logo img { display: block; width: 100%; height: 100%; padding: 3px; object-fit: contain; border-radius: inherit; }
.account-menu__heading { display: grid; gap: 2px; min-width: 0; }
.account-menu__shop-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-menu__brand { flex: none; font-size: 21px; font-weight: 700; }
.account-menu__user-line { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; line-height: 1.6; font-weight: 400; color: #4e6258; }
.account-menu__user-label { flex: none; }
#header-user-name { min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role-badge { display: inline-block; flex: none; padding: 1px 7px; border-radius: 4px; background: #eaf0ea; color: #355546; font-size: 12px; line-height: 1.7; font-weight: 500; white-space: nowrap; }
.profile-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; color: #4e6258; font-size: 14px; }
.profile-identity > bdi { min-width: 0; overflow-wrap: anywhere; }
.account-menu__divider { flex: none; width: 1px; height: 23px; background: #cfd6cf; margin-inline: 3px; }
.account-menu__shop { min-width: 0; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; font-weight: 600; }
/* The menu indicator stays with the logo, leaving the shop name uncluttered. */
.account-menu__indicator {
  position: absolute;
  inset-inline-end: -5px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 16px;
  border: 1px solid #cfd8cf;
  border-radius: 5px;
  background: #fff;
  color: var(--accent);
  pointer-events: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.account-menu__indicator svg { width: 18px; height: 11px; }
.account-menu__trigger:hover .account-menu__indicator,
.account-menu__trigger[aria-expanded=true] .account-menu__indicator { background: var(--accent); border-color: var(--accent); color: #fff; }
.account-menu__panel {
  position: absolute;
  inset-block-start: calc(100% + 10px);
  inset-inline-start: 0;
  z-index: 30;
  width: 330px;
  max-width: calc(100vw - 32px);
  max-height: min(520px, calc(100dvh - 100px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d7ded6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 32px #23352b14, 0 2px 6px #23352b08;
  animation: account-menu-in .14s ease-out;
}
.account-menu__identity { display: flex; align-items: center; gap: 13px; padding: 20px; border-bottom: 1px solid #edf0eb; }
.account-menu__identity > div { min-width: 0; }
.account-menu__identity .profile-picture { width: 46px; height: 46px; font-size: 22px; }
.account-menu__identity strong { display: block; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.account-menu__identity #account-email { display: block; margin: 1px 0 0; font-size: 13px; text-align: start; overflow-wrap: anywhere; }
.account-menu__caption { display: block; margin-top: 5px; font-size: 13px; color: #355546; }
.account-menu__actions { display: grid; gap: 3px; padding: 8px; }
.account-menu__actions button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  text-align: start;
  white-space: normal;
}
.account-menu__actions svg { flex: none; width: 20px; height: 20px; color: #667c6f; }
.account-menu__actions #logout { color: #874936; border-top: 1px solid #edf0eb; margin-top: 4px; border-radius: 0 0 4px 4px; }
.account-menu__actions #logout svg { color: inherit; }
.account-menu__actions #logout:hover:not(:disabled) { background: #fbf6f3; }
.account-menu__actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: #f1f4ef; }
.account-menu__links { display: none; align-items: center; gap: 12px; padding: 10px 20px 14px; border-top: 1px solid #edf0eb; font-size: 13px; color: var(--muted); }
.account-menu__links a { display: inline-flex; align-items: center; min-height: 44px; }
main:has(> #shop:not([hidden])) { padding-top: 14px; }
@keyframes account-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  .app-header:has(.account-menu:not([hidden])) > .public-links { display: none; }
  .account-menu { width: 100%; }
  .account-menu__shop { max-width: none; }
  .account-menu__trigger { max-width: 100%; }
  .account-menu__links { display: flex; }
}
@media (max-width: 480px) {
  .account-menu__trigger { width: 100%; gap: 8px; }
  .account-menu__logo { width: 38px; height: 38px; font-size: 25px; }
  .account-menu__heading { gap: 3px; }
  .account-menu__shop-line { gap: 6px; }
  .account-menu__brand { font-size: 18px; }
  .account-menu__user-line { gap: 6px; font-size: 13px; }
  .account-menu__user-label { display: none; }
  #header-user-name { max-width: none; }
  .account-role-badge { padding-inline: 5px; }
  .account-menu__shop { font-size: 17px; }
  .account-menu__divider { height: 20px; margin-inline: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  .account-menu__panel { animation: none; }
  .account-menu__indicator { transition: none; }
}
