.screen-actions {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  pointer-events: auto;
}
body[data-screen="account"] {
  min-height: 100svh;
  background: linear-gradient(#d8e8f1, #f0f5f6 76%);
}
body[data-screen="account"] :is(.return-link, .screen-actions) { display: none; }
#plaza-account {
  display: grid;
  gap: 15px;
  width: min(418px, calc(100% - 32px));
  margin: clamp(38px, 10svh, 100px) auto 32px;
  padding: clamp(20px, 5vw, 32px);
  border: 1px solid #b6cbd2;
  border-top: 3px solid #648a88;
  background: #f5fafbe8;
  box-shadow: 0 15px 40px #354f6513;
}
#account-title { font-size: clamp(1.65rem, 5vw, 2.25rem); letter-spacing: -.045em; }
.account-form { display: grid; gap: 12px; }
.account-google { gap: 10px; padding-inline: 12px; background: #fff; border-color: #747775; color: #1f1f1f; }
.account-google img { object-fit: contain; }
.account-google:hover { filter: none; box-shadow: inset 0 0 0 1px #747775; }
.account-apple { padding: 0; border: 0; background: #000; color: #fff; overflow: hidden; }
.account-apple img { max-width: 100%; object-fit: contain; }
.account-hint { color: var(--muted); font-size: .875rem; }
.account-field { display: grid; gap: 4px; min-width: 0; font-size: .88rem; font-weight: 650; }
.account-field :is(input, select) {
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid #9eb8c2;
  border-radius: 2px;
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.25 var(--sans);
}
.account-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.account-options .text-button { min-height: 38px; }
.account-switch-mode { justify-self: center; min-height: 44px; }
.account-feedback { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.account-feedback:empty { display: none; }
.account-privacy { justify-self: start; color: var(--muted); font-size: .85rem; text-decoration: underline; }
.plaza-privacy {
  display: grid;
  gap: 12px;
  width: min(640px, calc(100% - 32px));
  margin: clamp(24px, 9svh, 78px) auto;
}
.plaza-privacy a { justify-self: start; color: var(--accent); }
.plaza-privacy h1 { font-size: 2.4rem; letter-spacing: -.045em; }
.plaza-privacy h2 { margin-top: 10px; font-size: 1.12rem; }
.plaza-privacy p { color: var(--muted); overflow-wrap: anywhere; }

.screen-header {
  --menu-paper: #fbfcf7;
  --menu-line: #bbccc2;
  --menu-ink: #29483e;
  --menu-muted: #536d63;
  --menu-hover: #ecf3ec;
  --menu-selected: #deeee3;
  --menu-shadow: 0 12px 30px #193e442b, 0 2px 7px #193e4416;
  --menu-viewport-space: max(110px, calc(env(safe-area-inset-top) + 92px));
}
.account-menu { position: relative; flex: none; }
.account-menu-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  border: 1px solid var(--menu-line);
  border-radius: 24px;
  padding: 3px 12px 3px 4px;
  background: var(--menu-paper);
  color: var(--menu-ink);
  box-shadow: 0 2px 6px #193e4414;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 700;
  list-style: none;
}
.account-menu-trigger::-webkit-details-marker { display: none; }
.account-menu-trigger::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.account-menu[open] > .account-menu-trigger::after { transform: translateY(2px) rotate(225deg); }
.account-menu-trigger:hover, .account-menu[open] > .account-menu-trigger {
  border-color: #93b2a3;
  background: var(--menu-hover);
}
.account-menu-trigger:focus-visible { outline-offset: 2px; }
.account-portrait {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid #a9c0b4;
  border-radius: 50%;
  background: var(--menu-selected);
}
.account-portrait > canvas { display: block; width: 100%; height: 100%; }
.account-portrait > .ui-icon { width: 18px; height: 18px; }
.account-username {
  max-inline-size: 17ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-username:empty { display: none; }
.account-menu-panel {
  position: absolute;
  z-index: 1;
  inset: calc(100% + 8px) 0 auto auto;
  width: min(236px, calc(100vw - 78px));
  max-height: calc(100dvh - var(--menu-viewport-space));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--menu-line);
  border-radius: 15px;
  background: var(--menu-paper);
  color: var(--menu-ink);
  box-shadow: var(--menu-shadow);
}
.account-group + .account-group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #dce7dd;
}
.account-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  font: 650 .88rem/1.25 var(--sans);
}
.account-item > .ui-icon { width: 18px; height: 18px; color: var(--menu-muted); }
.account-item:hover { background: var(--menu-hover); text-decoration: none; }
.account-item:focus-visible { outline-offset: -2px; }
.account-signout, .account-signout > .ui-icon { color: #893947; }
.account-signout:hover { background: #f6ebeb; }
.account-menu-panel .account-feedback { padding: 6px 9px; }
body[data-screen="plaza"] .screen-header:has(.account-menu[open]) { z-index: 5; }
@media (max-width: 540px) {
  .screen-header { --menu-viewport-space: max(88px, calc(env(safe-area-inset-top) + 73px)); }
  .account-menu-trigger { gap: 5px; padding-inline: 4px 8px; font-size: .8rem; }
  .account-portrait { width: 30px; height: 30px; }
  .account-username { max-inline-size: clamp(64px, 24.5vw, 124px); }
}
@media (max-width: 390px) {
  .screen-actions { gap: 0; }
  .screen-actions :is(.sound-toggle, .village-inbox) { min-width: 34px; }
  body[data-screen="plaza"] .wordmark h1 { font-size: clamp(1.15rem, 5vw, 1.3rem); }
}
@media (max-width: 360px) {
  .account-menu-trigger { padding-inline: 4px 7px; }
  .account-portrait { width: 27px; height: 27px; }
  .account-username { max-inline-size: 58px; }
}

.account-invitation { padding: 8px 0; color: var(--ink); }
.account-invitation button { font-size: .85rem; }
