/* Scoped to secondary dialogs; main workflows and print documents retain their styles. */
body.resiro-common-workspace #overlay .secondary-dialog{width:min(920px,calc(100vw - 32px));max-height:calc(100dvh - 32px)}
body.resiro-common-workspace #overlay .secondary-dialog>.modal-body{padding:18px;min-width:0;background:var(--work-paper)}
body.resiro-common-workspace #overlay .secondary-dialog :is(h3,h4){color:var(--work-ink);font-weight:600;letter-spacing:0;overflow-wrap:anywhere}
body.resiro-common-workspace #overlay .secondary-dialog :is(p,dd,a,.hint,.muted-note){overflow-wrap:anywhere}
body.resiro-common-workspace #overlay .secondary-dialog .hint{background:var(--work-soft);color:var(--work-sub);border:1px solid var(--work-line);border-radius:4px;padding:12px;line-height:1.55}
body.resiro-common-workspace #overlay .secondary-history .audit-history{gap:12px}
body.resiro-common-workspace #overlay .secondary-history .audit-entry{border:1px solid var(--work-line);border-radius:4px;background:var(--work-paper);overflow:hidden}
body.resiro-common-workspace #overlay .secondary-history .audit-entry>header{padding:12px 14px;background:var(--work-soft);border-bottom:1px solid var(--work-line)}
body.resiro-common-workspace #overlay .secondary-history .audit-entry h3{font-size:15px;margin:0 0 6px}
body.resiro-common-workspace #overlay .secondary-history .audit-meta{gap:6px 18px;color:var(--work-sub);line-height:1.5;font-variant-numeric:tabular-nums}
body.resiro-common-workspace #overlay .secondary-history .audit-fields{padding:14px;grid-template-columns:minmax(120px,180px) minmax(0,1fr);gap:9px 16px;line-height:1.5}
body.resiro-common-workspace #overlay .secondary-history .audit-fields .audit-fields{padding:0;grid-template-columns:minmax(90px,130px) minmax(0,1fr)}
body.resiro-common-workspace #overlay .secondary-history .audit-fields dt{color:var(--work-sub)}
body.resiro-common-workspace #overlay .secondary-history .audit-fields dd{color:var(--work-ink)}
body.resiro-common-workspace #overlay .secondary-history .audit-changes{padding:0 14px}
body.resiro-common-workspace #overlay .secondary-history .audit-change{padding:12px 0;border-color:var(--work-line)}
body.resiro-common-workspace #overlay .secondary-history .audit-comparison{gap:12px}
body.resiro-common-workspace #overlay .secondary-history .audit-comparison>div{border:1px solid var(--work-line);border-radius:3px;background:var(--work-soft);padding:12px;color:var(--work-ink)}
body.resiro-common-workspace #overlay .secondary-history :is(.audit-caption,.audit-note,.procedure-note){color:var(--work-sub);line-height:1.55}
body.resiro-common-workspace #overlay .secondary-history .procedure-note{padding:12px 14px;margin:0;white-space:pre-wrap}
body.resiro-common-workspace #overlay .secondary-files .attachment-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:12px}
body.resiro-common-workspace #overlay .secondary-files :is(.attachment-photo,.attachment-document){border:1px solid var(--work-line);border-radius:4px;min-width:0;background:var(--work-paper);overflow:hidden;box-shadow:none}
body.resiro-common-workspace #overlay .secondary-files .attachment-photo>button{width:100%;padding:0;display:flex;flex-direction:column;text-align:left;background:var(--work-paper);border:0;color:var(--work-ink);border-radius:0}
body.resiro-common-workspace #overlay .secondary-files .attachment-photo img{width:100%;height:160px;object-fit:contain;background:var(--work-soft)}
body.resiro-common-workspace #overlay .secondary-files .attachment-photo span{padding:10px 12px;font-size:14px;line-height:1.45;overflow-wrap:anywhere}
body.resiro-common-workspace #overlay .secondary-files .attachment-photo>a{display:block;padding:10px 12px;border-top:1px solid var(--work-line);font-size:13px;min-height:44px}
body.resiro-common-workspace #overlay .secondary-files .attachment-document{padding:14px;display:flex;flex-direction:column;gap:8px;align-items:flex-start}
body.resiro-common-workspace #overlay .secondary-files :is(.attachment-document a,.attachment-photo a){color:var(--work-key);text-decoration:underline;text-underline-offset:3px}
body.resiro-common-workspace #overlay .secondary-files .attachment-document small{color:var(--work-sub)}
body.resiro-common-workspace #overlay .secondary-dialog input[type=file]{max-width:100%;width:100%;color:var(--work-sub);border:1px solid var(--work-line);background:var(--work-paper);padding:8px;border-radius:4px;font-size:14px}
body.resiro-common-workspace #overlay .secondary-dialog input[type=file]::file-selector-button{font:inherit;color:var(--work-ink);background:var(--work-soft);border:1px solid var(--work-line);border-radius:3px;padding:9px 12px;margin-right:10px;cursor:pointer}
body.resiro-common-workspace #overlay .secondary-gallery{width:min(1120px,calc(100vw - 32px))}
body.resiro-common-workspace #overlay .secondary-gallery .photo-viewer{background:var(--work-soft);border:1px solid var(--work-line);border-radius:4px;padding:12px;display:flex;flex-direction:column;gap:10px;min-height:240px;align-items:center;color:var(--work-ink)}
body.resiro-common-workspace #overlay .secondary-gallery .photo-viewer p{margin:0;align-self:stretch;font-size:13px;color:var(--work-sub)}
body.resiro-common-workspace #overlay .secondary-gallery .photo-viewer img{display:block;max-width:100%;max-height:calc(100dvh - 260px);width:auto;height:auto;object-fit:contain;margin:auto}
body.resiro-common-workspace #overlay .secondary-gallery .photo-viewer [hidden]{display:none}
body.resiro-common-workspace #overlay :is(.secondary-removal,.secondary-import){width:min(720px,calc(100vw - 32px))}
body.resiro-common-workspace #overlay .secondary-removal .modal-foot button[type=submit]{background:#a5263b;border-color:#a5263b;color:white}
body.resiro-common-workspace #overlay .secondary-removal .modal-foot button[type=submit]:hover{background:#861f30}
body.resiro-common-workspace #overlay .secondary-removal :is(.dm-delete,.dr-icon,.dm-icon){border-radius:4px;box-shadow:none;background:var(--work-soft);color:var(--work-ink)}
body.resiro-common-workspace #overlay .secondary-archive .dr-duty-card{border:1px solid var(--work-line);border-radius:4px;box-shadow:none;margin-bottom:12px;background:var(--work-paper)}
body.resiro-common-workspace #overlay .secondary-archive .dr-card-heading{padding:14px;gap:12px;flex-wrap:wrap}
body.resiro-common-workspace #overlay .secondary-archive .grow{min-width:0;flex:1 1 230px}
body.resiro-common-workspace #overlay .secondary-backups .note{background:var(--work-paper);border:1px solid var(--work-line);border-radius:4px;padding:14px;margin-bottom:10px}
@media(max-width:650px){
 body.resiro-common-workspace #overlay .secondary-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
 body.resiro-common-workspace #overlay .secondary-dialog>.modal-body{padding:12px}
 body.resiro-common-workspace #overlay .secondary-history .audit-fields,body.resiro-common-workspace #overlay .secondary-history .audit-fields .audit-fields{grid-template-columns:1fr;gap:3px}
 body.resiro-common-workspace #overlay .secondary-history .audit-fields dd{margin-bottom:10px}
 body.resiro-common-workspace #overlay .secondary-history .audit-comparison{grid-template-columns:1fr}
 body.resiro-common-workspace #overlay .secondary-history .audit-meta{flex-direction:column}
 body.resiro-common-workspace #overlay .secondary-dialog>.modal-foot :is(button,a){flex:1 1 130px;justify-content:center;min-height:44px;text-align:center;white-space:normal}
 body.resiro-common-workspace #overlay .secondary-gallery .photo-viewer img{max-height:calc(100dvh - 340px)}
 body.resiro-common-workspace #overlay .secondary-dialog input[type=file]{font-size:16px}
}
body.resiro-common-workspace #overlay .secondary-files .task-drop{background:var(--work-soft);border:1px dashed var(--work-sub);border-radius:4px;padding:18px;box-shadow:none;color:var(--work-ink)}
body.resiro-common-workspace #overlay .secondary-files .task-drop.drag-active{background:var(--work-select);border-color:var(--work-key)}
body.resiro-common-workspace #overlay .secondary-files .task-drop h3{font-size:17px;margin:0 0 8px}
body.resiro-common-workspace #overlay .secondary-files .task-drop p{font-size:14px;line-height:1.55;margin:8px 0}
body.resiro-common-workspace #overlay .secondary-files .task-drop .actions{gap:8px;flex-wrap:wrap;margin:14px 0}
body.resiro-common-workspace #overlay .secondary-files .task-drop .file-input{width:100%;height:100%;padding:0;border:0}
@media(max-width:650px){body.resiro-common-workspace #overlay .secondary-files .task-drop{padding:12px}body.resiro-common-workspace #overlay .secondary-files .task-drop .actions>.btn{flex:1 1 130px;justify-content:center}}

body.resiro-common-workspace #overlay .secondary-dialog{display:flex;flex-direction:column}
body.resiro-common-workspace #overlay .secondary-dialog>.modal-body{flex:1 1 auto;min-height:0;overflow:auto}
body.resiro-common-workspace #overlay .secondary-dialog>.modal-head,body.resiro-common-workspace #overlay .secondary-dialog>.modal-foot{flex:0 0 auto}
body.resiro-common-workspace #overlay .secondary-dialog .modal-head h2{background:transparent;border:0;box-shadow:none}
body.resiro-common-workspace #overlay .secondary-dialog #edit-form{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
body.resiro-common-workspace #overlay .secondary-gallery .photo-viewer img{max-height:calc(100dvh - 320px)}
@media(max-width:650px){body.resiro-common-workspace #overlay .secondary-gallery .photo-viewer img{max-height:calc(100dvh - 340px)}}
body.resiro-common-workspace #overlay .secondary-dialog>.modal-body{max-height:none}
body.resiro-common-workspace #overlay .secondary-dialog>.modal-head,body.resiro-common-workspace #overlay .secondary-dialog>.modal-foot{width:100%;box-sizing:border-box}
body.resiro-common-workspace #overlay .secondary-dialog.secondary-removal{width:min(720px,calc(100vw - 32px))}
@media(max-width:650px){body.resiro-common-workspace #overlay .secondary-dialog.secondary-removal{width:calc(100vw - 16px)}}
