/* Dialogs use the administration rhythm and retain their native focus handling. */
body:has(#crop-dialog[open],#document-detail[open]){overflow:hidden}
:is(#crop-dialog,#document-detail){box-sizing:border-box;padding:20px;width:min(960px,calc(100% - 32px));max-height:calc(100dvh - 32px);margin:auto;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border-radius:14px;border:1px solid var(--line);background:var(--paper);color:var(--ink);overflow-wrap:anywhere}
:is(#crop-dialog,#document-detail)::backdrop{background:#07132199;backdrop-filter:none}
:is(#crop-dialog,#document-detail) :is(.crop-heading,.mobile-menu-heading){display:flex;align-items:flex-start;gap:12px;margin:0 0 12px}
:is(#crop-dialog,#document-detail) :is(.crop-heading,.mobile-menu-heading){position:sticky;top:0;z-index:2;background:var(--paper);padding-bottom:12px;border-bottom:1px solid var(--line)}
:is(#crop-dialog,#document-detail) h2{font-size:22px;line-height:1.3;letter-spacing:-.025em;margin:6px 0 0;font-weight:600}
#crop-dialog .crop-heading .eyebrow{display:none}
:is(#crop-dialog,#document-detail) :is(button,a.secondary-link){min-height:44px;padding:10px 14px;font-size:13px;line-height:1.4}
:is(#crop-close,#document-detail-close){width:44px;flex:0 0 44px;margin-left:auto}
#crop-dialog p{font-size:13px;line-height:1.6;margin:12px 0}
#crop-dialog label{font-size:13px}
#crop-dialog input[type=range]{display:block;width:100%;min-height:44px;margin:4px 0}
#crop-dialog .crop-stage{margin:16px 0}
#crop-dialog .crop-stage canvas{max-height:40dvh}
#crop-dialog .crop-actions{gap:10px;flex-wrap:wrap;margin-top:16px}
#crop-dialog[aria-busy=true] .crop-stage{pointer-events:none;opacity:.7}
:is(#crop-dialog,#document-detail) :is(input,select,textarea):not([type=range]):not([type=checkbox]){font-size:16px;min-height:44px}
:is(#crop-dialog,#document-detail) :is(button,a,input,select,textarea,summary,canvas):focus-visible{outline:3px solid var(--accent,var(--blue));outline-offset:3px}
#document-detail .job{margin:0;padding:0;border:0;background:transparent;min-width:0}
#document-detail .job h3{font-size:18px;line-height:1.4;margin:0 0 12px}
#document-detail .job h2{font-size:18px;line-height:1.4;margin:0 0 12px}
#document-detail .job p{font-size:13px;line-height:1.6;margin:12px 0}
#document-detail .job small{font-size:12px;line-height:1.6}
#document-detail .jobtop{display:flex;align-items:flex-start;flex-wrap:wrap;gap:12px}
#document-detail .jobtop>div{flex:1 1 240px;min-width:0}
#document-detail .jobtop>a{display:inline-flex;align-items:center;min-height:44px;font-size:13px}
#document-detail summary{display:flex;align-items:center;min-height:44px;padding:10px 0;margin:0;font-size:14px;cursor:pointer}
#document-detail details{margin:12px 0}
#document-detail details[open]>summary{margin-bottom:12px}
#document-detail summary::after{content:'';width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin:0 4px 4px auto;flex:0 0 auto}
#document-detail details[open]>summary::after{transform:rotate(225deg);margin-bottom:0}
#document-detail :is(pre,table){max-width:100%;font-size:13px}
#document-detail pre{white-space:pre-wrap;overflow-wrap:anywhere}
#document-detail .job-actions{display:flex;gap:10px;flex-wrap:wrap}
.dialog-message{padding:10px 12px;margin:12px 0;font-size:13px;line-height:1.6;background:var(--surface);border:1px solid var(--line);border-radius:8px}
.dialog-error{border-left:3px solid #c57c62}
#toast{box-sizing:border-box;max-width:min(480px,calc(100% - 32px));right:16px;bottom:max(16px,env(safe-area-inset-bottom));padding:12px 16px;border-radius:10px;font-size:13px;line-height:1.6;overflow-wrap:anywhere;pointer-events:none}
#errorbar{padding:12px 16px;border-radius:10px;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
#errorbar:not([hidden]){display:flex;align-items:flex-start;gap:12px}
#errorbar>span{flex:1;min-width:0}
#errorbar>button{flex:0 0 44px;width:44px;min-height:44px;padding:8px;background:transparent;border:1px solid currentColor;border-radius:8px;color:inherit;font-size:16px}
#errorbar>button:focus-visible{outline:3px solid currentColor;outline-offset:3px}
#busy{gap:12px}#busytext{font-size:14px;line-height:1.6}
.notice-settings{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.notice-settings h2{font-size:22px;line-height:1.3;margin:0 0 8px}
.notice-settings p{font-size:13px;line-height:1.6;max-width:80ch;margin:8px 0 16px}
.notice-settings .notice-admin-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px}
.notice-settings .check-label{display:flex;gap:10px;align-items:center;margin:12px 0}
.notice-settings .check-label input{width:18px;min-height:18px;margin:0}
.notice-settings a{display:inline-flex;align-items:center;min-height:44px;font-size:13px}
@media(max-width:650px){:is(#crop-dialog,#document-detail){padding:16px;width:calc(100% - 24px);max-height:calc(100dvh - 24px)}:is(#crop-dialog,#document-detail) h2{font-size:20px}#crop-dialog .crop-actions>button{width:100%}.notice-settings .notice-admin-actions>*{width:100%;justify-content:center}}
