.telegram-auth-dialog{position:fixed;inset:0;box-sizing:border-box;width:min(440px,calc(100% - 32px));height:fit-content;max-width:none;max-height:calc(100dvh - 32px);margin:auto;padding:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-panel);color:var(--text);background:var(--bg-card);box-shadow:0 24px 80px -20px var(--shadow);font:14px/1.6 var(--ui-font);backdrop-filter:blur(var(--glass-blur))}
.telegram-auth-dialog[open]{display:block}
.telegram-auth-dialog::backdrop{background:rgba(4,12,22,.65);backdrop-filter:blur(8px)}
body:has(.telegram-auth-dialog[open]){overflow:hidden}
.telegram-auth-card{display:flex;flex-direction:column;min-height:0;max-height:calc(100dvh - 34px)}
.telegram-auth-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex:none;padding:24px 24px 18px;border-bottom:1px solid var(--border-subtle)}
.telegram-auth-badge{font:600 10px/1.5 var(--mono);letter-spacing:.1em;color:var(--cyan)}
.telegram-auth-header h2{margin:8px 0 0;font:600 21px/1.35 var(--ui-font);letter-spacing:-.02em;overflow-wrap:anywhere}
.telegram-auth-dialog .telegram-auth-close{flex:none;width:40px;height:40px;min-height:40px;padding:0;display:grid;place-items:center}
.telegram-auth-body{padding:20px 24px 24px;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.telegram-auth-body p{margin:0;color:var(--muted);overflow-wrap:anywhere;font-size:13px;line-height:1.7}
.telegram-login-container{display:flex;justify-content:center;align-items:center;min-height:46px;max-width:100%;margin:22px 0}
.telegram-login-container iframe{max-width:100%;border:0}
.telegram-auth-body .telegram-auth-status:empty{display:none}
.telegram-auth-body .telegram-auth-status:not(:empty){margin:0 0 18px;padding:12px;border:1px solid var(--border-subtle);border-radius:var(--radius-control);background:var(--bg-subtle);color:var(--text)}
.telegram-auth-actions{display:flex;flex-direction:column;gap:10px;margin-top:18px}
.telegram-auth-actions .button{width:100%;min-height:44px;white-space:normal;text-align:center;line-height:1.5;text-decoration:none}
.telegram-auth-dialog [hidden],.telegram-auth-progress[hidden]{display:none!important}
.telegram-auth-progress{position:fixed;z-index:1000;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);padding:10px 16px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);box-shadow:var(--glass-sheen);color:var(--text);font:12px/1.6 var(--mono);pointer-events:none}
@media(max-width:480px){.telegram-auth-dialog{width:calc(100% - 16px);max-height:calc(100dvh - 16px)}.telegram-auth-card{max-height:calc(100dvh - 18px)}.telegram-auth-header{padding:18px 16px 14px}.telegram-auth-header h2{font-size:20px}.telegram-auth-body{padding:18px 16px}.telegram-login-container{margin:18px 0}}

.telegram-referral-field { display:grid; gap:8px; margin:12px 0 18px; font:12px/1.5 var(--mono); }
.telegram-referral-field input { width:100%; min-width:0; box-sizing:border-box; text-transform:uppercase; }
.telegram-referral-field p { margin:0; color:var(--muted); }
