/* 雙位置滑動掣：手機可滑動，鍵盤同滑鼠亦可操作。 */
.account-switch{position:relative;display:inline-grid;grid-template-columns:1fr 1fr;align-items:center;isolation:isolate;flex-shrink:0;min-height:44px;width:140px;padding:4px;border:1px solid var(--line);border-radius:24px;background:var(--raised);color:var(--fg);font-family:inherit;font-size:16px;font-weight:700;cursor:pointer;touch-action:pan-y;user-select:none}
.account-switch[hidden]{display:none}
.account-switch::before{content:"";position:absolute;z-index:-1;top:4px;bottom:4px;left:4px;width:calc(50% - 4px);border-radius:20px;background:var(--accent);transition:transform .18s ease}
.account-switch[data-account="justin"]::before{transform:translateX(100%)}
.account-switch[data-account="mkt"]>span:first-child,.account-switch[data-account="justin"]>span:last-child{color:var(--on-accent)}
.account-switch:hover{border-color:var(--accent)}
.account-switch:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.account-switch:disabled{cursor:wait;opacity:.65}
.switch-status{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:1000;background:var(--surface);color:var(--fg);border-radius:8px;box-shadow:var(--shadow)}
.switch-status:not(:empty){padding:12px 20px}
.switch-dialog{width:min(420px,calc(100% - 32px));padding:24px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--fg);box-shadow:var(--shadow-lg)}
.switch-dialog::backdrop{background:var(--scrim)}
.switch-dialog h2{font-size:22px;margin:0 0 8px}.switch-dialog p{font-size:16px;color:var(--muted);line-height:1.5}
.switch-dialog label{display:block;font-size:16px;margin:16px 0 6px}.switch-dialog .field{width:100%}
.switch-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.switch-actions button{min-height:44px}
#switchError{color:var(--danger);min-height:20px}
@media(prefers-reduced-motion:reduce){.account-switch::before{transition:none}}
@media(max-width:640px){
 #app:has(.account-switch:not([hidden])){--tb-h:104px}
 .topbar:has(.account-switch:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:32px 44px;height:104px;min-height:0;gap:4px;padding:8px 10px;align-content:center}
 .topbar:has(.account-switch:not([hidden])) .tb-brand{height:32px;width:fit-content}
 .topbar:has(.account-switch:not([hidden])) .tb-right{margin:0;min-width:0;justify-content:space-between;flex-wrap:nowrap;gap:4px}
 .account-switch{width:124px}
 .tb-right:has(.account-switch:not([hidden])) .who{display:none}
 .tb-right:has(.account-switch:not([hidden])) .kbtn[onclick="openPal()"]{display:none}
}
