.telegram-entry{display:block;min-height:100vh}
.telegram-entry .auth-top{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px clamp(12px,4vw,42px);max-width:1200px;margin:auto}
.telegram-entry .auth-page{padding-top:clamp(12px,4vh,46px)}
.telegram-entry .standalone-card{width:100%;max-width:540px;min-width:0;box-sizing:border-box}
.telegram-choices{display:grid;gap:12px;margin:20px 0}
.telegram-entry form{display:grid;gap:16px;margin-top:22px}
.telegram-entry [hidden]{display:none!important}
.telegram-entry form select{font:inherit;color:inherit;background:#102735;border:1px solid #3a5666;border-radius:10px;padding:12px;width:100%;box-sizing:border-box}
.telegram-entry input,.telegram-entry form select{min-width:0;max-width:100%}
.telegram-confirm{display:flex!important;align-items:flex-start;gap:10px;font-size:14px;line-height:1.55}
.telegram-confirm input{display:inline-block!important;width:18px!important;height:18px;min-height:18px!important;padding:0!important;flex:none;margin:3px 0!important;accent-color:#d9b777}
.telegram-entry .button{box-sizing:border-box;white-space:normal;text-align:center;min-width:0}
.telegram-entry #telegramReopen{margin-top:16px}
.telegram-entry .form-error{overflow-wrap:anywhere}
.account-telegram-actions{display:flex;flex-wrap:wrap;gap:10px}
#accountTelegramCard{min-width:0;overflow-wrap:anywhere}
#accountTelegramCard input[type=password]{width:100%;min-width:0;box-sizing:border-box;padding:12px;border:1px solid #3a5666;border-radius:10px;background:#102735;color:inherit;font:inherit;margin:8px 0 14px}
#accountTelegramCard .button{white-space:normal;max-width:100%;box-sizing:border-box}
@media(max-width:400px){.telegram-entry .standalone-card{padding:22px 18px}.telegram-entry .auth-top{padding:12px}.telegram-entry h1{font-size:32px}.telegram-entry .public-brand{font-size:14px}}

.telegram-entry .auth-top .language-switch{width:auto;margin-left:auto}
.telegram-entry .public-brand b{white-space:nowrap}
.telegram-entry form label{margin:0}
.telegram-entry form>.button{margin-top:4px}
/* Keep the shared profile grid inside a mobile Mini App viewport. */
@media(max-width:760px){.profile-layout{grid-template-columns:minmax(0,1fr)}.equipment-card,.profile-aside{min-width:0}}
body.trionis-telegram{min-width:0;box-sizing:border-box;min-height:var(--trionis-tg-height,100dvh);padding-top:calc(var(--trionis-tg-safe-top,0px) + var(--trionis-tg-content-top,0px));padding-bottom:calc(var(--chat-reserve,0px) + var(--trionis-tg-safe-bottom,0px) + var(--trionis-tg-content-bottom,0px));padding-left:calc(var(--trionis-tg-safe-left,0px) + var(--trionis-tg-content-left,0px));padding-right:calc(var(--trionis-tg-safe-right,0px) + var(--trionis-tg-content-right,0px))}
@media(max-width:760px){#accountTelegramPassword{font-size:16px}}
/* Fixed chat is outside body padding: constrain it to the visible Mini App area. */
body.trionis-telegram{--tg-chat-top:calc(var(--trionis-tg-safe-top,0px) + var(--trionis-tg-content-top,0px));--tg-chat-bottom:calc(var(--trionis-tg-safe-bottom,0px) + var(--trionis-tg-content-bottom,0px));--tg-chat-left:calc(var(--trionis-tg-safe-left,0px) + var(--trionis-tg-content-left,0px));--tg-chat-right:calc(var(--trionis-tg-safe-right,0px) + var(--trionis-tg-content-right,0px));--tg-chat-height:min(var(--trionis-tg-height,100dvh),var(--chat-viewport,100dvh));--tg-chat-offset:max(var(--chat-keyboard,0px),calc(100dvh - var(--trionis-tg-height,100dvh)))}
body.trionis-telegram .chat-dock{left:calc((100% + var(--tg-chat-left) - var(--tg-chat-right))/2);bottom:calc(var(--tg-chat-offset) + var(--tg-chat-bottom) + 8px);max-width:calc(100% - var(--tg-chat-left) - var(--tg-chat-right) - 16px);min-height:0;max-height:max(0px,calc(var(--tg-chat-height) - var(--tg-chat-top) - var(--tg-chat-bottom) - 16px))}
body.trionis-telegram .chat-launcher{bottom:calc(var(--tg-chat-offset) + var(--tg-chat-bottom) + 12px);right:calc(var(--tg-chat-right) + 12px)}
body.trionis-telegram .chat-scroll{min-height:0}
@media(max-width:899px){body.trionis-telegram .chat-dock{height:calc(var(--tg-chat-height) - var(--tg-chat-top) - var(--tg-chat-bottom) - 16px);padding-bottom:0;border-radius:16px}}
