.nav-account {
  display: flex;
  align-items: center;
  flex: none;
}
@media (min-width: 1400px) {
  header.nav .nav-account { margin-inline-start: calc(clamp(18px, 5vw, 72px) - 16px); }
}
#account-profile-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-hi);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--ice);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
#account-profile-button:not(:disabled):hover {
  border-color: var(--cyan);
  background: rgba(var(--accent-rgb), .14);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), .14);
}
#account-profile-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#account-profile-button:disabled { cursor: wait; opacity: .7; }

.account-avatar {
  display: grid;
  position: relative;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
}
.account-avatar [hidden] { display: none !important; }
.account-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-avatar-default {
  position: relative;
  display: block;
  width: 52%;
  height: 53%;
  color: var(--ice);
}
.account-avatar-default::before,
.account-avatar-default::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: solid currentColor;
  border-width: max(1px, .08em);
}
.account-avatar-default::before { top: 0; width: 45%; height: 45%; border-radius: 50%; }
.account-avatar-default::after { bottom: 0; width: 88%; height: 42%; border-radius: 60% 60% 35% 35%; }



#account-profile-dialog {
  --profile-surface: #0b1724;
  --profile-field: #08121c;
  --profile-ink: #ecf7ff;
  --profile-muted: #adbdcb;
  --profile-border: #304558;
  --profile-gutter: clamp(1rem, 4vw, 1.75rem);
  position: fixed;
  inset: 0;
  width: min(34rem, calc(100% - 1.25rem));
  max-width: none;
  max-height: calc(100vh - 1.25rem);
  max-height: calc(100dvh - 1.25rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--profile-border);
  border-top-color: var(--line-hi);
  border-radius: 16px;
  background: radial-gradient(ellipse 110% 12rem at 0 0, rgba(var(--accent-rgb), .1), transparent), var(--profile-surface);
  box-shadow: 0 28px 100px #0009, 0 0 36px rgba(var(--accent-rgb), .07);
  color: var(--profile-ink);
  color-scheme: dark;
  font-family: inherit;
  line-height: 1.45;
  letter-spacing: normal;
}
html[data-theme="deep-space"] #account-profile-dialog {
  --profile-surface: #141118;
  --profile-field: #100d14;
  --profile-ink: #fff5ed;
  --profile-muted: #c6b9c8;
  --profile-border: #4c3d4c;
}
#account-profile-dialog::backdrop { background: #04091060; }
html[data-theme="deep-space"] #account-profile-dialog::backdrop { background: #08060d58; }
#account-profile-dialog[open] { animation: account-profile-enter .2s var(--ease, ease-out) both; }
@keyframes account-profile-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
#account-profile-dialog [hidden] { display: none !important; }
.account-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .9rem var(--profile-gutter);
  border-bottom: 1px solid var(--line);
}
.account-profile-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3.7vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: .015em;
}
#account-profile-dialog button { appearance: none; cursor: pointer; font: inherit; }
#account-profile-dialog .account-profile-close {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: var(--ice);
  border: 1px solid var(--profile-border);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), .04);
  font-size: 1.5rem;
  line-height: 1;
}
#account-profile-dialog .account-profile-close:hover {
  border-color: var(--line-hi);
  background: rgba(var(--accent-rgb), .1);
}
#account-profile-form {
  display: grid;
  gap: 1rem;
  padding: 1rem var(--profile-gutter) .9rem;
}
.account-profile-picture {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), .035);
}
#account-avatar-edit {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: clamp(66px, 18vw, 80px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line-hi);
  border-radius: 50%;
  background: var(--profile-field);
  color: var(--ice);
}
#account-avatar-edit:hover:not(:disabled) { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.account-avatar-camera {
  position: absolute;
  inset: auto -3px -2px auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-hi);
  border-radius: 50%;
  background: var(--profile-surface);
}
.account-avatar-camera i {
  position: relative;
  width: 13px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.account-avatar-camera i::before,
.account-avatar-camera i::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); }
.account-avatar-camera i::before { top: -3px; width: 5px; height: 2px; border: 1px solid currentColor; border-bottom: 0; border-radius: 1px 1px 0 0; }
.account-avatar-camera i::after { top: 1px; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; }
.account-profile-picture-copy { min-width: 0; }
.account-profile-picture-copy p { margin: 0 0 .1rem; font-weight: 650; }
#account-profile-dialog small,
#account-profile-status { color: var(--profile-muted); font-size: .8125rem; overflow-wrap: anywhere; }
#account-profile-dialog .account-profile-restore {
  display: block;
  min-height: 36px;
  margin-top: .15rem;
  padding: 0;
  color: var(--ice);
  border: 0;
  background: none;
  font-size: .8rem;
}
#account-profile-dialog .account-profile-restore:hover { text-decoration: underline; text-underline-offset: .2em; }
#account-profile-fields {
  display: grid;
  gap: .8rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.account-profile-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.account-profile-field { display: grid; min-width: 0; gap: .3rem; font-size: .875rem; }
.account-profile-field small { margin-inline-start: .25rem; font-weight: 400; }
.account-profile-field :is(input, select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid var(--profile-border);
  border-radius: 8px;
  background: var(--profile-field);
  color: var(--profile-ink);
  font: inherit;
  font-size: 16px;
}
.account-profile-field input::placeholder { color: var(--profile-muted); opacity: .75; }
.account-profile-field input[type="date"]::-webkit-date-and-time-value { text-align: start; }
.account-profile-visibility {
  margin: 0;
  color: var(--profile-muted);
  font-size: .8125rem;
}
.account-profile-actions { display: flex; align-items: center; justify-content: space-between; gap: .55rem .85rem; }
#account-profile-status { flex: 1; margin: 0; }
#account-profile-status[data-error] { color: #ffc1be; }
.account-profile-footer {
  display: grid;
  grid-template-columns: auto;
  justify-content: end;
  gap: .5rem;
  padding: .85rem var(--profile-gutter);
  border-top: 1px solid var(--line);
  background: rgba(var(--accent-rgb), .025);
}
.account-profile-footer:has(#account-profile-admin:not([hidden])) {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}
#account-profile-admin { display: contents; }
#account-profile-dialog :is(.account-profile-action, .account-profile-primary) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .55rem .45rem;
  border: 1px solid var(--profile-border);
  border-radius: 8px;
  color: var(--ice);
  background: rgba(var(--accent-rgb), .045);
  font-size: .875rem;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
}
#account-profile-dialog .account-profile-action:hover:not(:disabled) {
  border-color: var(--line-hi);
  background: rgba(var(--accent-rgb), .095);
}
#account-profile-dialog #account-profile-logout {
  border-color: rgba(218, 137, 141, .38);
  background: rgba(218, 137, 141, .07);
  color: #f3c2c3;
}
#account-profile-dialog #account-profile-logout:hover:not(:disabled) {
  border-color: #c7868b;
  background: rgba(218, 137, 141, .13);
}
#account-profile-dialog .account-profile-primary {
  padding-inline: 1.1rem;
  border-color: var(--line-hi);
  background: linear-gradient(110deg, rgba(var(--accent-rgb), .19), rgba(var(--violet-rgb), .11));
  font-weight: 650;
}
#account-profile-dialog .account-profile-primary:hover:not(:disabled) { border-color: var(--ice); }
.account-profile-footer:has(#account-profile-delete:not([hidden])) {
  grid-template-columns: auto auto;
  justify-content: space-between;
}
#account-profile-dialog #account-profile-delete {
  border-color: transparent;
  background: transparent;
  color: var(--profile-muted);
}
#account-profile-dialog #account-profile-delete:hover:not(:disabled) {
  color: #ffc1be;
  background: rgba(218, 137, 141, .08);
}
#account-close-view {
  display: grid;
  gap: 1rem;
  padding: 1rem var(--profile-gutter) var(--profile-gutter);
}
.account-close-warning {
  padding: .8rem 1rem;
  border: 1px solid rgba(218, 137, 141, .36);
  border-radius: 10px;
  background: rgba(218, 137, 141, .06);
  font-size: .875rem;
}
.account-close-warning p { margin: 0; }
.account-close-warning p + p { margin-top: .45rem; color: var(--profile-muted); }
#account-close-status { margin: 0; color: var(--profile-muted); font-size: .8125rem; }
#account-close-status:empty { display: none; }
#account-close-status[data-error] { color: #ffc1be; }
.account-close-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
#account-profile-dialog .account-profile-danger {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .55rem .9rem;
  border: 1px solid rgba(218, 137, 141, .62);
  border-radius: 8px;
  background: rgba(218, 137, 141, .16);
  color: #ffe2e3;
  font-size: .875rem;
  font-weight: 650;
}
#account-profile-dialog .account-profile-danger:hover:not(:disabled) { background: rgba(218, 137, 141, .25); }
#account-profile-dialog button:disabled { opacity: .65; cursor: wait; }
#account-profile-dialog :is(input, select, a, button, canvas):focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (max-width: 350px) {
  .account-profile-pair { grid-template-columns: 1fr; gap: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  #account-profile-dialog[open] { animation: none; }
}
