.login-card{width:min(410px,100%);padding:36px;border:1px solid #29463d;border-radius:20px;background:linear-gradient(150deg,#101e1a,#0a1411);box-shadow:0 35px 90px #0008}
.login-card form{width:auto;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.login-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:24px 0 8px;padding:4px;border:1px solid #263f37;border-radius:10px;background:#07100e}
.login-tabs button{padding:9px;border:0;border-radius:7px;background:transparent;color:#71877f;font-size:11px}
.login-tabs button.active{background:#173328;color:#a9efd3}
.wechat-panel{text-align:center}
.wechat-panel>p{margin:17px 0;color:#71877f;font-size:11px}
.wechat-frame-shell{height:390px;overflow:hidden;border:1px solid #2d473f;border-radius:12px;background:#fff}
.wechat-frame-shell iframe{width:100%;height:100%;border:0}
.wechat-refresh{width:100%;margin-top:11px;padding:11px;border:1px solid #3d6658;border-radius:9px;background:transparent;color:#b7d7cc;font-size:11px}
.wechat-refresh:hover{border-color:var(--green);color:var(--green)}
.bind-choice{margin-top:24px}
.bind-choice>small{color:var(--green);font-size:8px;letter-spacing:.12em}
.bind-choice h3{margin:9px 0;font-size:18px}
.bind-choice>p{margin:0;color:#71877f;font-size:11px;line-height:1.7}
.bind-choice input[type=hidden]{display:none}
.login-card>.portal-notice{margin-top:16px}
.login-card [hidden]{display:none!important}
@media(max-width:720px){.login-card{padding:28px 22px}.wechat-frame-shell{height:370px}}
.setup-login{--setup-qr-scale:.8;color-scheme:light;background:#fff;color:#243447;font-size:14px}
.setup-login .operator-story,.setup-login .login-heading,.setup-login .login-footnote,.setup-login .login-tabs{display:none}
.setup-login .operator-page{display:block;min-height:100vh}
.setup-login .operator-login{box-sizing:border-box;min-height:100vh;padding:12px 24px;background:#fff}
.setup-login .login-card,.setup-login .operator-ready{width:min(360px,100%);padding:0;box-sizing:border-box;border:0;border-radius:0;background:#fff;box-shadow:none}
.setup-login .wechat-panel{position:relative;width:calc(320px * var(--setup-qr-scale));margin:auto}
.setup-login .wechat-panel>p{display:none}
.setup-login .wechat-frame-shell{width:calc(320px * var(--setup-qr-scale));height:calc(460px * var(--setup-qr-scale));border:0;border-radius:0;background:#fff}
.setup-login .wechat-frame-shell iframe{display:block;width:320px;height:460px;transform:scale(var(--setup-qr-scale));transform-origin:top left}
.setup-login .login-card:has(>.portal-notice:not([hidden])){--setup-qr-scale:.65}
/* The QR itself is the retry target; no second row of login controls. */
.setup-login .wechat-panel>.wechat-refresh{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:8px;background:transparent;color:transparent;font-size:0}
.setup-login .wechat-panel>.wechat-refresh:focus-visible{outline:2px solid #2874c6;outline-offset:3px}
.setup-login-switch{display:block;margin:14px auto 0;padding:6px 12px;min-height:32px;border:0;border-radius:5px;background:transparent;color:#326aab;font-size:14px}
.setup-login-switch:hover{color:#175494;background:#f2f6fb}
.setup-login-switch:focus-visible{outline:2px solid #2874c6;outline-offset:2px}
.setup-login .login-card form{padding:0}
.setup-login .operator-login form>p{margin:0 0 20px;font-size:14px;color:#697586}
.setup-login .operator-login label{gap:7px;margin:14px 0;color:#465366;font-size:13px}
.setup-login .operator-login input{box-sizing:border-box;min-width:0;width:100%;padding:10px 12px;border:1px solid #cfd7e2;border-radius:6px;background:#fff;color:#243447;font-size:14px}
.setup-login .operator-login input:focus{border-color:#2874c6;box-shadow:0 0 0 3px #2874c612}
.setup-login .operator-login .portal-primary{margin-top:20px;padding:11px 14px;border-radius:6px;background:#2874c6;color:#fff;font-size:14px;font-weight:500}
.setup-login .bind-choice{margin-top:0}
.setup-login .bind-choice>small{color:#697586;font-size:12px;letter-spacing:0}
.setup-login .bind-choice h3{margin:10px 0;font-size:20px;font-weight:600}
.setup-login .bind-choice>p{color:#697586;font-size:13px;line-height:1.6}
.setup-login .login-card>.portal-notice{margin-top:12px;font-size:12px;line-height:1.5}
.setup-login .portal-notice.error{border-color:#f0c7c3;background:#fff5f4;color:#a63730}
.setup-login .portal-notice.success{border-color:#c6e2d2;background:#f3faf6;color:#2b6c49}
.setup-login .operator-ready{padding:24px}
.setup-login .operator-ready>small{color:#2b6c49}
.setup-login .operator-ready p{color:#697586;font-size:14px}
.setup-login .ready-mark{color:#2b6c49;border-color:#a4cfb6}
@media(max-height:420px){
  .setup-login{--setup-qr-scale:.7}
  .setup-login .operator-login{padding:8px 24px}
  .setup-login .login-card:has(>.portal-notice:not([hidden])){--setup-qr-scale:.5}
  .setup-login-switch{margin-top:2px}
}
