.member-account {
  position: fixed;
  right: var(--action-rail-right);
  top: max(30px, env(safe-area-inset-top, 0px));
  width: var(--action-rail-width);
  display: flex;
  justify-content: center;
  pointer-events: auto;
}
#member-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: var(--action-rail-width);
  padding: 0;
  color: #e6e5d8;
  background: transparent;
  border: 0;
}
/* The guest entry grows to its content; the signed-in avatar keeps the rail width. */
body:not([data-member='true']) .member-account {
  width: auto;
}
#member-signin-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: none;
  white-space: nowrap;
  min-height: 38px;
  padding: 0 16px 0 13px;
  border: 1px solid #e3e6dc30;
  border-radius: 999px;
  font:
    400 12px/1 Inter,
    'PingFang SC',
    sans-serif;
  letter-spacing: 0.3px;
  color: #ebece3;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: linear-gradient(135deg, #d9e6df0f, #102b3524);
  box-shadow: inset 0 1px 0 #ffffff0a;
  transition:
    background 0.25s,
    border-color 0.25s;
}
#member-signin-label::before {
  content: '';
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.8;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ebece3' stroke-width='1.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.2'/%3E%3Cpath d='M5.5 20v-1.3a6.5 6.5 0 0 1 13 0V20'/%3E%3C/svg%3E");
}
#member-button:hover #member-signin-label {
  border-color: #e3e6dc65;
  background: #d9e6df18;
}
#member-avatar {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  width: 32px;
  height: 32px;
  border: 1px solid #e5e3d838;
  padding: 2px;
  border-radius: 50%;
  box-shadow: 0 2px 12px #0319231a;
  background: #cddbd90a;
  backdrop-filter: blur(10px);
  transition:
    border-color 0.25s,
    background 0.25s;
}
#member-initial {
  font:
    15px/1 Georgia,
    serif;
  color: #e5e5d7;
}
#member-photo {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
  object-fit: cover;
  filter: saturate(0.7);
}
#member-menu {
  position: absolute;
  right: 0;
  top: 56px;
  width: min(260px, calc(100vw - 40px));
  padding: 21px;
  border: 1px solid #c7ddcf2b;
  border-radius: 20px;
  background: linear-gradient(135deg, #1b3039f7, #10262ff7);
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 65px #02182060;
  color: #e5eee6;
  font-family: Inter, 'PingFang SC', sans-serif;
}
#member-menu-caption {
  margin: 0 0 15px;
  color: #9bb4a7;
  font-size: 8px;
  letter-spacing: 2px;
}
#member-name {
  display: block;
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#member-email {
  display: block;
  margin: 7px 0 19px;
  font-size: 11px;
  color: #a4b9b0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#member-menu button {
  display: block;
  width: 100%;
  padding: 12px 10px;
  border-radius: 9px;
  text-align: left;
  background: transparent;
  color: #dbe7df;
  font:
    12px/1.4 Inter,
    'PingFang SC',
    sans-serif;
}
#member-menu button:hover,
#member-menu button:focus-visible {
  background: #d1e2d90b;
}
#member-menu #member-logout {
  margin-top: 10px;
  padding-top: 17px;
  border-top: 1px solid #d2e5da1a;
  border-radius: 0;
  color: #c6b6ae;
}
#member-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 40px 30px 30px;
  border: 1px solid #c7ddcf38;
  border-radius: 24px;
  background: linear-gradient(135deg, #1b3039fc, #10262ffc);
  box-shadow: 0 28px 90px #03192380;
  color: #e5eee6;
  text-align: center;
}
#member-dialog::backdrop {
  background: #06131b88;
  backdrop-filter: blur(7px);
}
#member-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 44px;
  height: 44px;
  background: transparent;
  color: #c3d0c4;
  font-size: 24px;
}
.member-eyebrow {
  margin: 0 0 20px;
  color: #a2b9aa;
  font:
    8px/1.4 Inter,
    sans-serif;
  letter-spacing: 4px;
}
#member-title {
  margin: 0;
  font:
    400 27px/1.5 Georgia,
    'Songti SC',
    serif;
  letter-spacing: 0.3px;
}
#member-description {
  margin: 18px 0 25px;
  font:
    12px/1.9 Inter,
    'PingFang SC',
    sans-serif;
  color: #b4c8bc;
}
#google-signin {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
#member-status {
  min-height: 20px;
  margin: 14px 0 0;
  font:
    11px/1.7 Inter,
    'PingFang SC',
    sans-serif;
  color: #cdbda7;
}
#member-guest-note {
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid #d2e5da20;
  font:
    10px/1.8 Inter,
    'PingFang SC',
    sans-serif;
  color: #91aea0;
}
.member-account [hidden] {
  display: none !important;
}

#member-button:hover #member-avatar,
#member-button[aria-expanded='true'] #member-avatar {
  border-color: #e5e3d87a;
  background: #cddbd918;
}
#member-button:focus-visible {
  outline: 1px solid #e5e3d8a6;
  outline-offset: 3px;
  border-radius: 50%;
}
@media (max-width: 700px) {
  .member-account {
    top: max(22px, env(safe-area-inset-top, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  #member-avatar,
  #member-signin-label {
    transition: none;
  }
}
