/* Compact manager actions and explicit contrast on every dark dialog surface. */
html body :is(#spv-user-menu,#spv-db-menu){width:280px;min-width:0;max-width:calc(100vw - 24px);box-sizing:border-box;padding:12px;background:#fff;color:#20374d}
html body :is(#spv-user-menu,#spv-db-menu) .spv-menu-action-row{display:grid;grid-template-columns:minmax(0,1fr) 32px;align-items:center;gap:6px;margin:6px 0}
html body :is(#spv-user-menu,#spv-db-menu) .spv-menu-action-row>button:not(.spv-context-help),
html body :is(#spv-user-menu,#spv-db-menu)>#spv-signout{display:flex;align-items:center;justify-content:flex-start;width:100%;min-width:0;min-height:44px;box-sizing:border-box;padding:11px 12px;margin:0;border:1px solid #c5d0da;border-radius:8px;background:#edf2f6;color:#20374d;font:650 14px/1.4 system-ui;text-align:left;white-space:normal}
html body :is(#spv-user-menu,#spv-db-menu)>#spv-signout{margin-top:8px;background:#fff0f0;color:#922d36;border-color:#d9a5ab}
html body :is(#spv-user-menu,#spv-db-menu) .spv-menu-action-row>button:not(.spv-context-help):hover{background:#dfe8ef}
html body :is(#spv-user-menu,#spv-db-menu)>#spv-signout:hover{background:#f9dcdf}
html body .spv-context-help,
html body :is(#spv-user-menu,#spv-db-menu) .spv-context-help,
html body #spv-tools-panel .spv-context-help{display:inline-grid!important;place-items:center!important;flex:0 0 32px!important;width:32px!important;height:32px!important;min-width:32px!important;max-width:32px!important;min-height:32px!important;max-height:32px!important;box-sizing:border-box!important;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;color:#344e65!important;font:700 14px/1 system-ui!important;box-shadow:none!important;vertical-align:middle!important;position:relative!important}
html body .spv-context-help::before{content:'';position:absolute;width:18px;height:18px;border:1px solid currentColor;border-radius:50%;box-sizing:border-box;pointer-events:none}
html body .spv-context-help:focus-visible{outline:2px solid #287795!important;outline-offset:1px!important}
/* Set inherited tokens as well as text: general dialog rules used dark text. */
html body dialog.spv-help-dialog{--ink:#f5f7fa;--premium-ink:#f5f7fa;--muted:#d5dce4;color-scheme:dark;background:#343b45!important;color:#f5f7fa!important;border-color:#929ca8}
html body dialog.spv-help-dialog :is(h1,h2,h3,h4,p,small,strong,b,span,li,label,summary){color:#f5f7fa!important;-webkit-text-fill-color:#f5f7fa!important;opacity:1!important}
html body dialog.spv-help-dialog button{background:#d2d8df!important;color:#202832!important;-webkit-text-fill-color:#202832!important;min-height:44px;line-height:1.4}
html body :is(#spv-status-dialog,#spv-backups-dialog,#spv-backups-dialog #confirm,.spv-demo-auth-panel,.spv-worker-demo-box,.spv-feedback-dialog){--ink:#f5f7fa;--premium-ink:#f5f7fa;--muted:#d5dce4;color:#f5f7fa!important;color-scheme:dark}
html body :is(#spv-status-dialog,#spv-backups-dialog,#spv-backups-dialog #confirm,.spv-demo-auth-panel,.spv-worker-demo-box,.spv-feedback-dialog) :is(h1,h2,h3,h4,p,small,strong,b,span,li,label,summary){color:#f5f7fa!important;-webkit-text-fill-color:#f5f7fa!important;opacity:1!important}
html body :is(.spv-demo-auth-panel,.spv-feedback-dialog) :is(input,select,textarea){color-scheme:light;background:#f8fafc!important;color:#202832!important;-webkit-text-fill-color:#202832!important}
html body :is(.spv-demo-auth-panel,.spv-feedback-dialog) :is(input,textarea)::placeholder{color:#546171!important;opacity:1}
html body .spv-demo-auth-panel .spv-auth-error{color:#ffd0d0!important;-webkit-text-fill-color:#ffd0d0!important}
html body #spv-save-notice,html body #spv-save-notice span{color:#fff!important;-webkit-text-fill-color:#fff!important}
html body #spv-save-notice button{color:#202832!important;-webkit-text-fill-color:#202832!important}
html body .spv-demo-auth-panel,html body .spv-worker-demo-box{border-color:#929ca8!important}
html body #spv-backups-dialog#spv-backups-dialog button,
html body #spv-worker-demo-ok{background:#d2d8df!important;color:#202832!important;-webkit-text-fill-color:#202832!important}
html body #spv-backups-dialog#spv-backups-dialog a{color:#e4e9ef!important}
html body :is(#spv-status-dialog,#spv-backups-dialog,#spv-backups-dialog #confirm,.spv-demo-auth-panel,.spv-worker-demo-box,.spv-feedback-dialog) button :is(span,strong,b){color:inherit!important;-webkit-text-fill-color:currentColor!important}

/* Keep recovery controls hidden when no preserved draft exists. */
#spv-db-menu .spv-menu-action-row:has(>button[hidden]){display:none!important}
html body #spv-db-menu>#spv-db-close{display:flex;align-items:center;justify-content:center;min-height:44px;width:100%;box-sizing:border-box;margin-top:8px;border:1px solid #c5d0da;border-radius:8px;background:#edf2f6;color:#20374d;font:650 14px/1.4 system-ui}
html body #spv-demo-login .spv-login-meta #spv-version-open{width:auto!important;min-height:34px!important;height:auto!important;margin:0!important;padding:8px 0!important;border:0!important;border-radius:0!important;background:transparent!important;color:#d8dce2!important;font:400 12px/1.5 system-ui!important;cursor:pointer;text-decoration:underline;text-underline-offset:3px;box-shadow:none!important}
.spv-release-dialog li{margin:12px 0}.spv-release-dialog ul{padding-left:20px}.spv-release-dialog>button{width:100%;margin:12px 0 0}
