/* Sign-in dialog, account card and avatar. Uses the tokens in app.css. */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { position: relative; width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--control); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.modal h2 { margin: 0; font: 600 24px/30px var(--display); }
.modal p { margin: 0; font-size: 14px; line-height: 20px; }
.modal .fine { font-size: 12px; line-height: 17px; color: var(--faint); }
.modal .m-x { position: absolute; top: 14px; right: 14px; }
.m-form { display: flex; flex-direction: column; gap: 12px; }
.m-form .btn { width: 100%; }
.m-form .link-btn { align-self: center; }
.m-form input[name="code"] { font: 600 22px/1 var(--mono); letter-spacing: .3em; text-align: center; height: 52px; }
.g-btn { min-height: 44px; display: flex; justify-content: center; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); font: 600 13px/1 var(--display); flex: none; }
.acct-btn { padding: 0; overflow: hidden; }
.acct { max-width: 920px; display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.acct .avatar { width: 40px; height: 40px; font-size: 16px; }
.acct > div:not(.acct-actions) { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.acct span { font-size: 13px; }
.acct-actions { display: flex; align-items: center; gap: 14px; }
@media (max-width: 640px) { .modal { padding: 22px; } .acct-actions { width: 100%; } }
@media print { .modal-wrap { display: none !important; } }
/* Profile menu and account page */
.pwrap { position: relative; }
.pmenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 300px; background: var(--card); border: 1px solid var(--control); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.pm-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pm-head .avatar { width: 36px; height: 36px; font-size: 15px; }
.pm-head div { display: flex; flex-direction: column; min-width: 0; }
.pm-head b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-head div span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-plan { background: var(--raised); border-radius: 12px; padding: 12px; }
.pm-plan .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pm-plan b { font: 600 15px/20px var(--display); }
.pm-plan p { margin: 6px 0 0; font-size: 12px; line-height: 17px; color: var(--muted); }
.pm-list { display: flex; flex-direction: column; gap: 2px; }
.pm-list .btn { margin-bottom: 6px; }
.pm-list a, .pm-list button:not(.btn) { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
.pm-list a:hover, .pm-list button:not(.btn):hover { background: var(--raised); text-decoration: none; }
.pm-list button[data-action="signout"] { color: var(--muted); }
.acct-card { max-width: 720px; }
.acct-id { display: flex; align-items: center; gap: 14px; }
.acct-id .avatar { width: 48px; height: 48px; font-size: 19px; }
.acct-id div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-id b { font: 600 18px/24px var(--display); }
.acct-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 640px) { .pmenu { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; } }
@media (max-width: 960px) { .top-actions .btn span.avatar { display: inline-flex; } .top-actions .btn[data-action="signin"] span { display: inline; } }
/* magic link: sent state */
.m-sent { display: flex; gap: 14px; align-items: flex-start; background: var(--raised); border-radius: 16px; padding: 16px; }
.m-sent svg { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.m-sent div { display: flex; flex-direction: column; gap: 4px; }
.m-sent b { font: 600 17px/22px var(--display); }
.m-sent span { color: var(--muted); font-size: 14px; line-height: 21px; overflow-wrap: anywhere; }
