.account-dialog {
  --account-line: rgb(var(--tint) / .12);
  --account-error: #bd2837;
  --account-success: #237749;
  color: var(--hub-ink);
  background: var(--surface);
  border: 1px solid var(--account-line);
  border-radius: 20px;
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 20px;
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  font: 14px/1.45 var(--hub-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  box-shadow: 0 20px 80px #0003;
  scrollbar-width: thin;
}

:root[data-theme='dark'] .account-dialog {
  --account-error: #ff929c;
  --account-success: #8cd5ac;
}

.account-dialog::backdrop {
  background: rgb(0 0 0 / .28);
  backdrop-filter: blur(5px);
}

.account-dialog *, .account-dialog *::before, .account-dialog *::after { box-sizing: border-box; }
.account-dialog [hidden] { display: none !important; }
.account-dialog button, .account-dialog input { font: inherit; }
.account-dialog button { cursor: pointer; }
.account-dialog button:disabled { cursor: wait; opacity: .55; }
.account-dialog button:focus-visible, .account-dialog input:focus-visible { outline: 2px solid var(--hub-ink); outline-offset: 3px; }

.account-dialog-header { display: flex; position: sticky; top: -20px; z-index: 2; align-items: center; gap: 16px; justify-content: space-between; margin: -20px -20px 0; padding: 20px; background: var(--surface); border-bottom: 1px solid var(--account-line); }
.account-dialog-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.account-dialog-close { display: grid; place-items: center; border: 0; background: var(--pill); color: var(--hub-muted); width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; padding: 0; line-height: 0; }
.account-dialog-close svg { display: block; width: 14px; height: 14px; }
.account-dialog-close:hover { background: var(--pill-hover); color: var(--hub-ink); }
.account-dialog-description { margin: 8px 0 14px; color: var(--hub-muted); font-size: 13px; }
.account-dialog-header + .account-form-tabs { margin-top: 16px; }
.account-form-tabs { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 12px; margin-bottom: 14px; }
.account-form-tab { background: transparent; border: 0; border-radius: 9px; color: var(--hub-muted); height: 34px; flex: 1; font-size: 13px !important; font-weight: 500 !important; }
.account-form-tab[aria-pressed='true'] { color: var(--hub-ink); background: var(--surface); box-shadow: 0 1px 4px #00000012; }
.account-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.account-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.account-field-label { color: var(--hub-ink); font-size: 13px; font-weight: 500; }
.account-field-heading { display: flex; align-items: center; gap: 5px; min-height: 20px; }
.account-field-info { display: inline-flex; position: relative; }
.account-info-button { display: grid; place-items: center; width: 24px; height: 22px; padding: 2px; border: 0; border-radius: 50%; color: var(--hub-muted); background: transparent; cursor: help; }
.account-info-button svg { display: block; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.account-info-button:hover, .account-info-button:focus-visible { color: var(--hub-ink); background: var(--pill); }
.account-field-tooltip { position: fixed; z-index: 5; top: 0; left: 0; width: 240px; max-width: calc(100vw - 48px); padding: 10px 12px; border: 1px solid rgb(var(--tint) / .1); border-radius: 10px; background: var(--surface); color: var(--hub-ink); box-shadow: 0 5px 20px #0002; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; overflow: auto; }
.account-field-info[data-open]::after { content: ''; position: absolute; z-index: 4; top: var(--account-tooltip-top, 0px); left: 100%; width: 9px; height: var(--account-tooltip-height, 22px); }
.account-field-info[data-open][data-side='left']::after { left: auto; right: 100%; }
.account-field-input { min-width: 0; width: 100%; height: 40px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--hub-ink); padding: 0 12px; transition: border-color .15s, background-color .15s; }
.account-field-input::placeholder { color: var(--hub-faint); }
.account-field-input:hover { background: var(--pill); }
.account-field-input:focus { border-color: rgb(var(--tint) / .3); }
.account-field-input[aria-invalid='true'] { border-color: var(--account-error); }
.account-field-help { color: var(--hub-muted); font-size: 11.5px; }
.account-field-error { color: var(--account-error); font-size: 12px; line-height: 1.35; }
.account-text-button { background: transparent; border: 0; color: var(--hub-muted); padding: 0; text-decoration: underline; text-underline-offset: 3px; font-size: 12px !important; }
.account-text-button:hover { color: var(--hub-ink); }
.account-show-password { align-self: flex-start; margin-top: -4px; }
.account-captcha { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--account-line); padding-top: 12px; margin-top: 2px; }
.account-captcha-heading { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.account-captcha-picture { display: grid; place-items: center; min-height: 64px; overflow: hidden; border-radius: 10px; background: var(--surface-2); }
.account-captcha-image { display: block; height: 64px; width: 100%; object-fit: contain; }
.account-captcha-status { color: var(--hub-muted); font-size: 11.5px; }
.account-captcha .account-field { margin-top: 2px; }
.account-submit, .account-secondary { display: flex; justify-content: center; align-items: center; border: 0; border-radius: 10px; min-height: 40px; padding: 9px 16px; font-weight: 500 !important; text-align: center; }
.account-submit { color: var(--surface); background: var(--hub-ink); }
.account-submit:hover:not(:disabled) { opacity: .85; }
.account-secondary { background: var(--pill); color: var(--hub-ink); }
.account-secondary:hover:not(:disabled) { background: var(--pill-hover); }
.account-message { border-radius: 10px; padding: 10px 12px; background: color-mix(in srgb, var(--account-error) 9%, var(--surface)); color: var(--account-error); margin: 0 0 16px; font-size: 12.5px; overflow-wrap: anywhere; }
.account-message[data-kind='success'] { color: var(--account-success); background: color-mix(in srgb, var(--account-success) 9%, var(--surface)); }
.account-user { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; background: var(--surface-2); margin-bottom: 18px; overflow-wrap: anywhere; }
.account-user-label { color: var(--hub-muted); font-size: 12px; }
.account-user-email { font-size: 16px; font-weight: 500; }
.account-user-actions { display: flex; flex-direction: column; gap: 8px; }
.account-next-step { margin: 0 0 18px; color: var(--hub-muted); font-size: 13px; }

.account-identity-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; }
.account-identity-button { min-height: 42px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--hub-ink) 10%, transparent); border-radius: 11px; color: var(--hub-ink); background: var(--pill); font: 13px var(--hub-sans); cursor: pointer; }
.account-identity-button:disabled { opacity: .4; cursor: default; }
.account-identity-note, .account-verification-note { margin: 12px 0 16px; color: var(--hub-muted); font-size: 12px; line-height: 1.6; }
.account-verification-note { padding: 12px; border-radius: 10px; background: var(--pill); }
.account-verification-email { display: block; margin: 16px 0 24px; overflow-wrap: anywhere; font-weight: 500; }
.account-verification-actions { margin-bottom: 16px; }
@media (max-width: 520px) {
  .account-dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 20px; border-radius: 18px; }
  .account-field-input { height: 46px; font-size: 16px !important; }
  .account-submit, .account-secondary { min-height: 46px; }
  .account-dialog-close { width: 34px; height: 34px; }
}
