/* Authentication is fail-closed: the workspace is hidden until login resolves. */
body.auth-pending #app { visibility:hidden; }
#auth-wall { position:fixed;inset:0;z-index:5000;display:flex;align-items:center;
  justify-content:center;background:var(--bg,#10182c);padding:18px; }
body:not(.auth-pending) #auth-wall {display:none;}
.auth-card {width:min(440px,100%);padding:30px;border:1px solid var(--line,#8da0bc);
  border-radius:18px;background:var(--panel,#e8edf8);color:var(--text,#182339);
  box-shadow:0 16px 70px #0004;display:flex;flex-direction:column;gap:12px;
  max-height:min(90vh,790px);overflow:auto;}
.auth-card .auth-brand {display:flex;align-items:center;gap:12px;font-size:14px;letter-spacing:.07em;}
.auth-card h2 {font-size:22px;margin:12px 0 0;}
.auth-card p {margin:0;line-height:1.7;font-size:13px;}
.auth-card label {font-size:13px;font-weight:600;}
.auth-card input {width:100%;min-height:40px;}
#auth-confirm-row:not(.hidden) {display:flex;flex-direction:column;gap:10px;}
#auth-cloud-row:not(.hidden),#auth-cloud-settings:not(.hidden) {display:flex;flex-direction:column;gap:10px;}
#auth-error {min-height:16px;color:#bd4153;font-weight:600;}
.auth-account-user {padding:10px 12px;border-radius:8px;background:var(--surface,#eee);margin:8px 0;}
.auth-account-list {display:grid;gap:8px;max-height:250px;overflow:auto;}
.auth-account-row {display:flex;gap:8px;justify-content:space-between;align-items:center;
  border:1px solid var(--line,#adb8cb);border-radius:9px;padding:8px;flex-wrap:wrap;}
.auth-account-row .row {flex-wrap:wrap;}
.auth-account-form {display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end;}
.auth-account-form .field {min-width:0;}
.auth-account-form .field input,.auth-account-form .field select {width:100%;}
body.role-viewer .side-tabs button:not([data-side="search"]):not([data-side="personal"]):not(.dock-header-collapse),
body.role-viewer .main-pane,body.role-viewer .ai-pane,
body.role-viewer .dock-divider,body.role-viewer #restore-ai-pane,
body.role-viewer .top-actions > :not(#auth-account):not(#server-dot),
body.role-viewer #search-exploration {display:none!important;}
body.role-viewer .workspace {display:block!important;}
body.role-viewer .workspace.dock-hide-left > .sidebar {display:block!important;}
body.role-viewer .sidebar {width:100%!important;max-width:none!important;height:100%;}
body.role-viewer .side-tabs {justify-content:flex-start;}
body.role-viewer .top-actions #auth-account {display:inline-flex!important;}
body.role-viewer #collapse-search-pane {display:none!important;}
body.role-viewer .search-results {max-height:none;}
/* Cloud viewers have their OWN songs; the legacy local viewer must remain
   dictionary-only. Full editing is allowed, admin masters/AI stay hidden. */
body.role-cloud-viewer .side-tabs button:not([data-side="search"]):not([data-side="personal"]):not([data-side="songs"]):not(.dock-header-collapse),
body.role-cloud-viewer .ai-pane,body.role-cloud-viewer #dock-right-divider,
body.role-cloud-viewer #restore-ai-pane,body.role-cloud-viewer #search-exploration,
body.role-cloud-viewer .top-actions > :not(#auth-account):not(#server-dot){display:none!important;}
body.role-cloud-viewer .workspace{grid-template-columns:var(--dock-left,294px) 7px minmax(280px,1fr) 0px 0px!important;}
@media (max-width:600px){.auth-account-form {grid-template-columns:1fr;}}
