body.auth-locked .app-shell{display:none}
body:not(.auth-locked) .account-form-body label{display:flex;flex-direction:column;gap:7px;font-size:14px;color:var(--secondary)}
.account-form-body input,.account-form-body select{width:100%;height:42px;padding:9px 11px;border:1px solid var(--control-border);border-radius:6px;background:var(--input-bg);color:var(--ink);font-size:15px}
.top-right{min-width:0;gap:9px}
.account-identity{display:flex;align-items:center;gap:8px;min-width:0;max-width:185px;padding:3px 11px 3px 3px;border:1px solid var(--line);border-radius:999px;background:var(--surface-alt)}
#account-avatar{flex-shrink:0;background:var(--green);color:var(--surface);font-weight:700}
#account-label{min-width:0;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);font-size:13px;font-weight:600}
#logout-button{flex-shrink:0;padding:7px 9px;border:0;background:transparent;color:var(--muted);font-size:12px}
#logout-button:hover{border:0;background:var(--accent-soft);color:var(--green)}
.accounts-layout{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);align-items:start;gap:18px}
.account-form-body{display:flex;flex-direction:column;gap:15px;padding:20px}
.account-form-body button{align-self:flex-start}
.account-form-body p,.account-list-panel>p{margin:0;color:var(--muted);font-size:13px;line-height:1.6}
.account-list{padding:6px 20px}
.account-row{display:flex;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--line)}
.account-row:last-child{border-bottom:0}
.account-row-main{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
.account-row-main strong{font-size:15px;overflow-wrap:anywhere}
.account-row-main small{font-size:12px;color:var(--muted)}
.account-row select{min-width:110px;height:36px;font-size:13px}
.account-row button{padding:7px 10px;font-size:12px}
.account-list-panel>p{padding:0 20px 18px}
.account-edit-dialog{width:min(430px,94vw)}
.account-edit-dialog form{display:flex;flex-direction:column}
.account-edit-dialog .dialog-footer{justify-content:space-between}
#password-change-dialog{width:min(430px,94vw)}
#password-change-error{color:var(--error-ink)}
@media(max-width:850px){.accounts-layout{grid-template-columns:1fr}}
@media(max-width:600px){.auth-view{min-height:calc(100dvh - 57px);padding:18px}.account-row{flex-wrap:wrap}.account-row-main{flex-basis:100%}.top-right{gap:4px}.account-identity{gap:5px;max-width:96px;padding:3px 7px 3px 3px}.top-right .avatar{display:grid;width:27px;height:27px;flex-shrink:0}#account-label{display:block;max-width:50px;font-size:12px}#logout-button{padding:6px 5px;font-size:12px}}

/* Login presentation stays scoped to the locked view. */
html body.auth-locked .topbar{background:var(--canvas);border-bottom-color:transparent}
body.auth-locked .top-divider{display:none}
html body.auth-locked .auth-view{position:relative;isolation:isolate;flex:1;min-height:calc(100dvh - 64px);display:grid;place-items:center;padding:48px 24px 72px;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,var(--surface-raised),transparent 72%),var(--canvas)}
html body:not(.auth-locked) .auth-view{display:none}
.auth-glow{position:absolute;z-index:-1;width:430px;height:430px;max-width:75vw;border-radius:50%;pointer-events:none;filter:blur(45px);opacity:.55;animation:auth-drift 12s ease-in-out 3 alternate}
.auth-glow-blue{top:4%;left:calc(50% - 460px);background:radial-gradient(circle,#b5cadb,transparent 70%)}
.auth-glow-gold{bottom:-12%;right:calc(50% - 450px);background:radial-gradient(circle,#dcd0b3,transparent 70%);animation-delay:-6s}
.auth-panel{position:relative;width:min(448px,100%);padding:38px 40px 40px;border:1px solid #ffffffbd;border-radius:24px;background:color-mix(in srgb,var(--surface-raised) 90%,transparent);box-shadow:0 24px 70px #30465b12,0 3px 12px #30465b06,inset 0 1px #ffffffa6;backdrop-filter:blur(18px);animation:auth-arrive .65s cubic-bezier(.22,1,.36,1) both}
.auth-panel::before{content:'';position:absolute;top:-1px;left:24%;right:24%;height:2px;background:linear-gradient(90deg,transparent,#8ca7bd,transparent)}
.auth-heading{display:flex;flex-direction:column;align-items:center;gap:18px;margin-bottom:24px}
.auth-emblem{display:grid;place-items:center;width:56px;height:56px;border:1px solid #ffffff70;border-radius:17px;background:linear-gradient(145deg,#607e98,#334d68);color:#fff;box-shadow:0 8px 18px #334d6824,inset 0 1px #ffffff30}
.auth-emblem svg{width:25px;height:25px}
.auth-system-name{font-size:12px;font-weight:500;letter-spacing:.12em;color:var(--muted);text-align:center;line-height:1.7}
.auth-card{display:flex;flex-direction:column;gap:21px;width:100%;margin:0}
.auth-card[hidden],#auth-status[hidden],#auth-error[hidden]{display:none}
.auth-intro{text-align:center;margin-bottom:6px}
html .auth-card h1{margin:0;font-size:29px;font-weight:650;line-height:1.4;letter-spacing:.04em}
.auth-intro p{margin:10px 0 0;color:var(--muted);font-size:13px;line-height:1.8;text-wrap:pretty}
.auth-card .auth-field{display:flex;flex-direction:column;gap:9px;color:var(--secondary);font-size:13px;font-weight:550;animation:auth-arrive .55s .08s both}
.auth-card .auth-field:nth-of-type(2){animation-delay:.16s}
.auth-input-wrap{display:flex;align-items:center;gap:12px;min-height:52px;padding:0 15px;border:1px solid var(--line);border-radius:11px;background:var(--input-bg);color:var(--muted);transition:border-color .2s,box-shadow .2s,background .2s}
.auth-input-wrap>span{pointer-events:none;transition:color .2s}
.auth-input-wrap svg{width:18px;height:18px}
.auth-input-wrap:hover{border-color:var(--control-border)}
.auth-input-wrap:focus-within{border-color:var(--focus);box-shadow:0 0 0 4px color-mix(in srgb,var(--focus) 12%,transparent);background:var(--surface-raised)}
.auth-input-wrap:focus-within>span{color:var(--green)}
html .auth-card input{min-width:0;width:100%;height:50px;padding:0;border:0;outline:none;background:transparent;border-radius:0;color:var(--ink);font-size:16px;font-weight:400;box-shadow:none}
html .auth-card input:focus-visible{outline:none}
.auth-card input::placeholder{color:var(--muted);opacity:.7;font-size:14px}
html .auth-card #auth-submit{position:relative;width:100%;min-height:52px;margin-top:6px;padding:13px 20px;border:1px solid #405c77;border-radius:11px;background:linear-gradient(110deg,#3e5873,#587792);color:#fff;font-size:15px;font-weight:550;letter-spacing:.08em;box-shadow:0 6px 14px #30465b20;transition:transform .2s,box-shadow .2s,filter .2s;animation:auth-arrive .55s .24s backwards}
html .auth-card #auth-submit:hover:not(:disabled){transform:translateY(-2px);filter:brightness(1.08);box-shadow:0 9px 20px #30465b2c}
html .auth-card #auth-submit:active:not(:disabled){transform:translateY(0);box-shadow:0 3px 8px #30465b18}
.auth-submit-arrow{position:absolute;right:19px;transition:transform .2s}
#auth-submit:hover .auth-submit-arrow{transform:translateX(3px)}
html .auth-card #auth-submit:disabled{opacity:.75;cursor:wait}
.auth-spinner{display:none;width:17px;height:17px;border:2px solid #ffffff50;border-top-color:#fff;border-radius:50%;animation:auth-spin .75s linear infinite}
.auth-card[aria-busy="true"] .auth-spinner{display:block}
.auth-card[aria-busy="true"] .auth-submit-arrow{display:none}
.auth-card #auth-error{margin:0;padding:11px 13px;border:1px solid color-mix(in srgb,var(--error-ink) 20%,transparent);border-radius:9px;background:color-mix(in srgb,var(--error-ink) 6%,transparent);color:var(--error-ink);font-size:13px;line-height:1.7;animation:auth-error-in .25s ease-out}
#auth-status{margin:0;color:var(--secondary);text-align:center;font-size:14px;line-height:1.9}
html[data-theme="dark"] .auth-panel{border-color:#56667577;box-shadow:0 24px 70px #00000025,inset 0 1px #ffffff0a}
html[data-theme="dark"] .auth-glow{opacity:.16}
@keyframes auth-arrive{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@keyframes auth-drift{from{transform:translate(-15px,-12px) scale(.95)}to{transform:translate(35px,24px) scale(1.08)}}
@keyframes auth-spin{to{transform:rotate(360deg)}}
@keyframes auth-error-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){
 html body.auth-locked .auth-view{min-height:calc(100dvh - 86px);padding:26px 18px 46px}
 .auth-panel{padding:30px 25px 32px;border-radius:20px}
 .auth-heading{gap:15px;margin-bottom:21px}
 html .auth-card h1{font-size:26px}
 .auth-glow-blue{left:-35%}.auth-glow-gold{right:-35%}
}
@media(prefers-reduced-motion:reduce){
 .auth-view *,.auth-view *::before{animation:none!important;transition:none!important}
 html .auth-card #auth-submit:hover:not(:disabled){transform:none}
}
