#install-app{border:1px solid #dbe5f4;border-radius:10px;padding:10px 14px;font-size:12px;color:#5276ad;background:#fff}#connection-status{position:fixed;top:0;left:0;right:0;margin:0;padding:10px 16px;background:#fff0d4;color:#805b14;text-align:center;z-index:150;font-size:12px}.mobile-nav a.selected,.mobile-nav button.selected{color:#2864e8;background:#edf3ff;border-radius:12px}.mobile-nav a:not(.selected){color:#536b91}
@media(min-width:541px){.center>.site-header{position:relative}#install-app{position:absolute;right:0;top:0}.top-actions>button{transition:background .15s,border-color .15s}.top-actions>button:hover{background:#f0f5ff;border-color:#b8ccef}}
@media(max-width:540px){
 .center>.site-header{display:flex;align-items:center;justify-content:space-between;width:100%;margin:0 0 20px;gap:10px}.center>.site-header .brand{margin:0}.site-header #install-app{font-size:10px;padding:9px 10px;max-width:135px}.center{padding-top:max(16px,env(safe-area-inset-top))}
 .mobile-nav{z-index:100;padding-top:8px;background:#fff;box-shadow:0 -5px 24px #20314d08}.mobile-nav button,.mobile-nav a{min-height:50px}
 body.app-screen-open{overflow:hidden}.app-screen-open>.center{visibility:hidden;pointer-events:none}
 #shop[open],#account[open],#help[open],#chat[open]{position:fixed;inset:0 0 calc(74px + env(safe-area-inset-bottom)) 0;margin:0;transform:none;width:100%;max-width:none;height:auto;max-height:none;border:0;border-radius:0;box-shadow:none;background:#f5f7fb;z-index:80;overflow:hidden;display:flex;flex-direction:column;padding:0}
 #shop .service-dialog-header,#account .service-dialog-header,#help .service-dialog-header,#chat .chat-header{background:#fff;padding:max(16px,env(safe-area-inset-top)) 20px 16px;border-bottom:1px solid #e4eaf4;flex-shrink:0;min-height:72px}
 #shop .service-dialog-header h2,#account .service-dialog-header h2,#help .service-dialog-header h2{font-size:21px;margin:0}#account .eyebrow{display:none}
 #shop .service-dialog-body,#account .service-dialog-body,#help .service-dialog-body{padding:22px 18px;flex:1;overflow:auto;min-height:0;overscroll-behavior:contain}#shop .service-dialog-footer{background:#fff;padding:14px 18px;flex-shrink:0}
 #account .account-balance{background:#e8f0ff}#account .account-key{background:#fff;border:1px solid #e4eaf4;border-radius:12px;padding:14px;margin-bottom:10px}
 #chat #chat-messages{flex:1;min-height:0;overflow:auto}#chat #chat-form{background:white}#chat #chat-error:empty{display:none}
 #guide-zoom,#install-help,.legal-dialog{z-index:120}
}
@media(display-mode:standalone){#install-app{display:none}.center{min-height:100dvh}body{overscroll-behavior-y:none}}
@media(max-width:540px){.center>.site-header{justify-content:center}.center>.site-header .brand{margin:0 auto}}

/* Compact sign-in and registration window on phones. */
@media(max-width:540px){
 body:has(#account[open] #account-auth:not([hidden]))::after{content:'';position:fixed;inset:0;background:#17243b66;backdrop-filter:blur(3px);z-index:105}
 body.app-screen-open:has(#account[open] #account-auth:not([hidden]))>.center{visibility:visible}
 #account[open]:has(#account-auth:not([hidden])){inset:auto;left:50%;top:calc(var(--visible-height,100dvh) / 2);transform:translate(-50%,-50%);width:calc(100% - 28px);max-width:420px;height:auto;max-height:calc(var(--visible-height,100dvh) - 32px);margin:0;border:1px solid #e1e7f1;border-radius:20px;background:white;box-shadow:0 20px 70px #17243b26;z-index:110}
 #account:has(#account-auth:not([hidden])) .service-dialog-header{padding:18px 18px 14px;min-height:0;background:white}
 #account:has(#account-auth:not([hidden])) .service-dialog-header h2{font-size:18px}
 #account:has(#account-auth:not([hidden])) .service-dialog-body{padding:16px 18px 20px;flex:0 1 auto;background:white}
}

#image-preview{display:none!important}.recognizing{display:flex;align-items:center;gap:9px}.recognizing::before{content:"";width:15px;height:15px;flex:none;border:2px solid #dce6f7;border-top-color:#2864e8;border-radius:50%;animation:ocr-spin .8s linear infinite}@keyframes ocr-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.recognizing::before{animation:none}}

#iid-form .iid-tools-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 16px}#iid-form .iid-tools-row #iid-count{flex:1;min-width:0;font-size:12px;line-height:1.5;margin:0}#iid-form .iid-tools-row .upload-row{display:flex;align-items:center;flex-shrink:0;gap:6px;margin:0}#iid-form .iid-tools-row .upload-button{white-space:nowrap;font-size:12px;min-height:40px;padding:8px 10px}#iid-form #error-panel{margin:12px 0 20px}#iid-form #ocr-status:not(:empty){margin-bottom:18px}

/* Confirmation code: three groups per row. */
#code-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px}
#code-grid .code-part{min-width:0;flex-direction:column;gap:6px}
#code-grid .code-part span{align-self:center;width:auto;flex:none;text-align:center}
#code-grid .code-part code{width:100%;flex:none;font-size:16px;letter-spacing:0}
@media(max-width:360px){#code-grid .code-part code{font-size:14px}}

/* Center the final two confirmation-code groups. */
#code-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
#code-grid .code-part{grid-column:span 2}
#code-grid .code-part:nth-child(7){grid-column:2 / span 2}
#code-grid .code-part:nth-child(8){grid-column:4 / span 2}

/* Compact order-check button on mobile. */
@media(max-width:540px){#key-form button[type=submit]{width:fit-content;max-width:100%;padding-left:28px;padding-right:28px;margin-left:auto;margin-right:auto}}

@media(max-width:540px){#key-form button[type=submit]{font-size:16px}}
