.account-root { display: flex; align-items: center; min-width: 0; }
.account-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; max-width: 150px; padding: 6px 13px;
  border: 1px solid #c7d3fb; border-radius: 10px; background: #f2f5ff; color: #294bc2;
  font-size: 14px; font-weight: 620; transition: background .18s ease, border-color .18s ease;
}
.account-trigger:hover { border-color: #92a8f3; background: #e8eefe; }
.account-trigger .icon { width: 17px; height: 17px; }
.account-trigger span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-trigger.signed-in { background: white; border-color: var(--line); color: var(--ink); }
body.has-account-dialog { overflow: hidden; }
dialog.account-dialog {
  width: min(420px, calc(100% - 28px)); max-height: calc(100dvh - 28px);
  padding: 25px 29px 27px; overflow: auto; overscroll-behavior: contain;
  border: 1px solid #d8deeb; border-radius: 19px;
}
.account-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.account-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: var(--cobalt); color: white; }
.account-mark .icon { width: 29px; height: 29px; stroke-width: 1.9; }
#account-title { font-size: 30px; line-height: 1.12; letter-spacing: -.052em; }
#account-intro { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.account-modes { display: flex; gap: 3px; margin: 21px 0 18px; padding: 4px; border-radius: 10px; background: #f0f2f6; }
.account-modes button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  min-height: 35px; padding: 6px; border-radius: 7px; font-size: 14px; font-weight: 600;
}
.account-modes button[aria-pressed=true] { color: #2646bb; background: white; box-shadow: 0 1px 4px #2034501c; }
.account-field { display: block; margin: 15px 0 7px; font-size: 14px; font-weight: 600; }
.account-dialog input {
  display: block; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #c8d0dd;
  border-radius: 9px; background: #fff; color: var(--ink); font-size: 16px;
}
.account-dialog input:focus-visible { outline: 2px solid #5878f1; outline-offset: 1px; }
.account-hint { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-secret { position: relative; }
.account-secret input { padding-right: 47px; }
#account-reveal {
  display: grid; place-items: center; position: absolute; inset: 1px 1px 1px auto; width: 43px;
  border: 0; border-radius: 8px; background: transparent; color: #546174;
}
#account-reveal .icon { width: 18px; height: 18px; }
#account-reveal:hover { color: var(--cobalt); }
.account-eye-slash { display: none; }
#account-reveal[aria-pressed=true] .account-eye-slash { display: block; }
.account-dialog .account-submit { width: 100%; min-height: 45px; margin-top: 20px; font-size: 14px; font-weight: 620; }
.account-dialog button:disabled { cursor: wait; opacity: .65; }
.account-feedback { margin-top: 12px; color: #9e2936; font-size: 13px; line-height: 1.5; }
.account-feedback:empty { display: none; }
.account-identity { display: flex; gap: 12px; align-items: center; margin-top: 19px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.account-identity > svg { width: 22px; height: 22px; color: var(--cobalt); }
.account-identity > span { min-width: 0; }
.account-identity small, .account-identity strong { display: block; }
.account-identity small { color: var(--muted); font-size: 12px; }
.account-identity strong { margin-top: 3px; overflow-wrap: anywhere; font-size: 16px; font-weight: 620; }
.account-signout { width: 100%; margin-top: 5px; padding: 11px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; }
.account-signout:hover { color: var(--ink); background: var(--page); }
.account-toast:not(:empty) {
  position: fixed; z-index: 30; inset: auto 50% max(18px, env(safe-area-inset-bottom)) auto; transform: translateX(50%);
  width: max-content; max-width: calc(100% - 32px); padding: 11px 16px;
  background: #182842; color: #fff; border-radius: 10px; box-shadow: 0 7px 24px #15253a32;
  font-size: 14px; line-height: 1.45; pointer-events: none;
}
@media (max-width: 690px) {
  .account-trigger { min-height: 36px; max-width: 112px; font-size: 12px; padding-inline: 9px; }
}
@media (max-width: 460px) {
  dialog.account-dialog { padding: 19px 20px 21px; }
  .account-top { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .account-mark .icon { stroke-dasharray: 36; animation: accountTrace .65s ease-out both; }
  .account-toast:not(:empty) { animation: accountToast .2s ease-out both; }
  @keyframes accountTrace { from { stroke-dashoffset: 36; } to { stroke-dashoffset: 0; } }
  @keyframes accountToast { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
}

.account-optional { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 450; }
.account-email-section { margin-top: 12px; padding: 15px 0 1px; border-top: 1px solid var(--line); }
.account-email-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-email-line > div { min-width: 0; }
.account-profile-label { display: block; color: var(--muted); font-size: 12px; }
#account-current-email { display: block; margin-top: 4px; font-size: 14px; font-weight: 540; overflow-wrap: anywhere; }
#account-edit-email, #account-cancel-email {
  flex: none; min-height: 40px; padding: 5px 8px; background: transparent;
  border: 0; border-radius: 7px; color: #294bc2; font-size: 14px; font-weight: 550;
}
#account-edit-email:hover, #account-cancel-email:hover { background: var(--blue-tint); }
.account-email-notice { margin-top: 8px; color: #14603e; font-size: 13px; }
.account-email-notice:empty { display: none; }
.account-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.account-edit-actions .button-primary { min-height: 40px; }
@media (max-width: 460px) {
  .account-dialog:has(#account-register-tab[aria-pressed=true]) .account-top { margin-bottom: 11px; }
}
