/* Setup wizard, login, account menu. */
#auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--bg); }
#auth[hidden] { display: none; }
.auth-wrap { width: min(520px, 100%); display: grid; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 18px; letter-spacing: -.02em; }
.auth-brand b { font-weight: 600; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; gap: 6px; }
.auth-card h1 { font-size: 22px; font-weight: 600; }
.auth-card .lead { color: var(--muted); margin: 0 0 14px; }
.auth-card.done { text-align: center; justify-items: center; }
.auth-card.done .success-mark { width: 56px; height: 56px; margin-bottom: 6px; }
.auth-form { display: grid; gap: 4px; }
.auth-form .btn.block, .btn.block { width: 100%; justify-content: center; height: 40px; margin-top: 8px; }
.auth-actions { justify-content: space-between; margin-top: 10px; }
.auth-foot { text-align: center; color: var(--faint); font: 11.5px var(--mono); margin: 0; }
.auth-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; font-size: 12.5px; color: var(--faint); flex-wrap: wrap; }
.auth-steps li { display: flex; align-items: center; gap: 6px; }
.auth-steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--line-strong); margin-right: 2px; }
.auth-steps span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font: 600 11px var(--mono); }
.auth-steps li.now { color: var(--text); font-weight: 600; }
.auth-steps li.now span { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.auth-steps li.done span { background: var(--ok); color: #fff; border-color: var(--ok); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); cursor: pointer; padding: 4px; display: grid; }
.pw-toggle svg { width: 16px; height: 16px; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 4px; align-items: center; margin-top: 6px; }
.pw-meter i { height: 4px; border-radius: 2px; background: var(--surface-2); }
.pw-meter span { font-size: 12px; color: var(--muted); padding-left: 8px; min-width: 80px; text-align: right; }
.pw-meter[data-level="1"] i:nth-child(-n+1) { background: var(--err); }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-level="3"] i:nth-child(-n+3) { background: var(--ok); }
.pw-meter[data-level="4"] i { background: var(--ok); }
.check-row { gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 8px 0; cursor: pointer; flex-wrap: nowrap; }
.check-row input { margin-top: 3px; accent-color: var(--ink); }
.auth-card .alert { margin: 6px 0; }
.auth-card .alert .spin { width: 16px; height: 16px; }
.shake { animation: shake .4s ease; }

/* Account menu */
.avatar { cursor: pointer; }
.account-menu { position: absolute; right: 20px; top: 50px; z-index: 60; width: 260px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--pop); padding: 6px; display: grid; }
.account-menu.hidden { display: none; }
.am-head { display: grid; gap: 2px; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.am-head b { font-weight: 600; }
.am-head span { color: var(--muted); font-size: 12.5px; }
.am-head .badge { justify-self: start; margin-top: 4px; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; border: 0; background: none;
  font-size: 13.5px; text-align: left; cursor: pointer; color: var(--text); }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }
.account-menu svg { width: 15px; height: 15px; color: var(--muted); }
.topbar { position: sticky; }
.auth-mode .chat { display: none; }
