.neon-account-launcher {
  position: fixed;
  z-index: 70;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 3px;
  border: 1px solid rgba(16, 232, 255, 0.82);
  border-radius: 50%;
  background: rgba(2, 8, 19, 0.9);
  box-shadow: 0 0 18px rgba(16, 232, 255, 0.3), inset 0 0 12px rgba(255, 62, 208, 0.12);
  cursor: pointer;
}

.neon-account-launcher img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.neon-account-launcher span {
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid #030712;
  border-radius: 50%;
  background: #ffda6b;
}

.neon-account-launcher[data-lifecycle="ready"] span { background: #4dffaf; box-shadow: 0 0 9px rgba(77, 255, 175, 0.8); }
.neon-account-launcher[data-lifecycle="recoverable-error"] span,
.neon-account-launcher[data-lifecycle="session-expired"] span { background: #ff5f7f; }
.neon-account-launcher:focus-visible,
.account-action:focus-visible,
.account-sheet__close:focus-visible,
.account-recovery-form input:focus-visible { outline: 3px solid #ffda6b; outline-offset: 3px; }
.account-delete-form input:focus-visible { outline: 3px solid #ffda6b; outline-offset: 3px; }

.neon-account-sheet {
  box-sizing: border-box;
  width: min(94vw, 470px);
  max-height: min(88dvh, 700px);
  margin: auto max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) auto;
  padding: 0;
  overflow: hidden auto;
  border: 1px solid rgba(16, 232, 255, 0.62);
  border-radius: 8px;
  background: rgba(3, 8, 19, 0.98);
  box-shadow: 0 0 44px rgba(16, 232, 255, 0.25), -18px 0 60px rgba(255, 62, 208, 0.12);
  color: #eefaff;
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

.neon-account-sheet::backdrop { background: rgba(0, 3, 10, 0.72); backdrop-filter: blur(5px); }
.account-sheet__rail { height: 3px; background: linear-gradient(90deg, #ff3ed0, #10e8ff 54%, #4dffaf); box-shadow: 0 0 16px rgba(16, 232, 255, 0.58); }
.account-sheet__header { display: grid; grid-template-columns: 66px minmax(0, 1fr) 44px; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid rgba(16, 232, 255, 0.18); }
.account-sheet__portrait { width: 66px; height: 76px; padding: 3px; clip-path: polygon(12% 0, 88% 0, 100% 10%, 100% 90%, 88% 100%, 12% 100%, 0 90%, 0 10%); background: linear-gradient(145deg, #10e8ff, #ff3ed0); }
.account-sheet__portrait img { width: 100%; height: 100%; object-fit: cover; clip-path: inherit; background: #050b18; }
.account-sheet__eyebrow { margin: 0 0 4px; color: #4dffaf; font-size: 11px; font-weight: 950; }
.account-sheet__header h2 { margin: 0; font-size: 21px; letter-spacing: 0; }
.account-sheet__header p:last-child { margin: 5px 0 0; color: #9eb4c5; font-size: 13px; line-height: 1.35; }
.account-sheet__close { width: 44px; height: 44px; border: 0; background: transparent; color: #eefaff; font: 400 30px/1 system-ui; cursor: pointer; }
.account-sheet__body { display: grid; gap: 14px; padding: 18px; }
.account-sheet__legal { min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 18px; padding: 2px 18px 12px; border-top: 1px solid rgba(164, 205, 225, 0.12); }
.account-sheet__legal a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: #9eb4c5; font-size: 12px; font-weight: 850; text-decoration: none; }
.account-sheet__legal a:hover { color: #4dffaf; }
.account-message { padding: 13px 14px; border-left: 3px solid #10e8ff; background: rgba(16, 232, 255, 0.06); }
.account-message strong { color: #eefaff; }
.account-message p { margin: 5px 0 0; color: #b8cad7; font-size: 14px; line-height: 1.45; }
.account-sheet__saved { border-left-color: #4dffaf; background: rgba(77, 255, 175, 0.07); }
.account-sheet__loading { border-left-color: #ffda6b; }
.account-actions { display: grid; gap: 10px; }
.account-action { display: grid; place-items: center; min-height: 48px; padding: 0 16px; border: 1px solid rgba(158, 180, 197, 0.44); border-radius: 7px; background: rgba(4, 14, 32, 0.96); color: #eefaff; cursor: pointer; font: 900 14px/1 system-ui; text-decoration: none; }
.account-action--primary { border-color: #4dffaf; background: rgba(4, 35, 38, 0.95); }
.account-action--secondary { border-color: #10e8ff; }
.account-action--quiet { color: #b8cad7; }
.account-action--play { border-color: rgba(255, 218, 107, 0.55); color: #ffda6b; }
.account-action:disabled { cursor: wait; opacity: 0.55; }
.account-recovery-key { padding: 14px; border: 1px solid rgba(255, 218, 107, 0.5); background: rgba(255, 218, 107, 0.06); }
.account-recovery-key span { color: #ffda6b; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.account-recovery-key strong { display: block; margin-top: 9px; overflow-wrap: anywhere; color: #eefaff; font: 900 16px/1.5 ui-monospace, monospace; }
.account-recovery-key p { margin: 8px 0 0; color: #b8cad7; font-size: 13px; line-height: 1.4; }
.account-recovery-form { display: grid; gap: 9px; padding-top: 4px; }
.account-recovery-form label { color: #b8cad7; font-size: 13px; font-weight: 900; }
.account-recovery-form input { width: 100%; min-height: 48px; border: 1px solid rgba(16, 232, 255, 0.5); border-radius: 7px; background: rgba(0, 4, 12, 0.78); color: #eefaff; font: 800 16px/1.2 ui-monospace, monospace; padding: 10px 12px; text-transform: uppercase; }
.account-controls { margin-top: 16px; border-top: 1px solid rgba(164, 205, 225, 0.18); color: #9fb7c8; }
.account-controls summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font: 750 13px/1.2 system-ui, sans-serif; }
.account-controls p, .account-delete-form label { font-size: 13px; line-height: 1.45; }
.account-delete-form { display: grid; gap: 9px; padding-bottom: 4px; }
.account-delete-form input { min-height: 46px; box-sizing: border-box; border: 1px solid rgba(255, 95, 127, 0.55); border-radius: 6px; background: rgba(2, 7, 18, 0.8); color: #f7fbff; padding: 0 12px; font: 700 16px/1 system-ui, sans-serif; }
.account-action--danger { border-color: rgba(255, 95, 127, 0.72); background: rgba(115, 17, 43, 0.46); color: #ffdce4; }

@keyframes account-identity-activate {
  45% { transform: scale(1.08); box-shadow: 0 0 30px rgba(77, 255, 175, 0.5), inset 0 0 14px rgba(16, 232, 255, 0.2); }
}

.neon-account-launcher.is-activated { animation: account-identity-activate 560ms ease-out both; }
.neon-account-sheet[open] { animation: account-sheet-enter 180ms ease-out both; }
@keyframes account-sheet-enter { from { opacity: 0; transform: translateX(12px); } }

@media (max-width: 600px) {
  body:has(.site-header) .neon-account-launcher,
  body:has(.profile-header) .neon-account-launcher { top: max(82px, calc(env(safe-area-inset-top) + 72px)); }
  .neon-account-sheet { width: 100%; max-width: none; max-height: min(86dvh, 680px); margin: auto 0 0; border-radius: 8px 8px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .account-sheet__header { grid-template-columns: 58px minmax(0, 1fr) 44px; gap: 10px; padding: 14px; }
  .account-sheet__portrait { width: 58px; height: 66px; }
  .account-sheet__body { padding: 14px; }
}

@media (max-width: 360px) and (max-height: 700px) {
  .neon-account-sheet { max-height: 100dvh; border-radius: 0; }
  .account-sheet__header, .account-sheet__body { padding: 12px; }
  .account-sheet__body { gap: 10px; }
  .account-actions { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .neon-account-sheet, .neon-account-launcher { animation: none !important; scroll-behavior: auto; }
}
