body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog{width:min(1180px,calc(100vw - 48px))!important;max-width:none!important;height:min(820px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);border-radius:14px!important}
body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>.smart-archive-modal-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;padding:24px!important;overflow:hidden!important;min-height:0}
.smart-archive-form-fields{display:flex;flex-direction:column;gap:18px;overflow-y:auto;min-width:0;min-height:0;padding:2px 8px 8px 0;scrollbar-width:thin}
.smart-archive-form-fields>div,.smart-archive-form-fields>template{min-width:0}
.smart-archive-form-fields label{font-size:12px!important;font-weight:500!important;text-transform:none!important;letter-spacing:0!important;line-height:1.6}
.smart-archive-form-fields :is(input:not([type=checkbox]),select,textarea){font-size:13px;background:#fff!important;border-color:#e4e4e7!important;border-radius:7px!important}
.smart-archive-form-fields>.smart-archive-mode-note{display:none}
.smart-archive-input{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;background:#f4f4f5;border-radius:10px;overflow:hidden;color:#303036}
.smart-archive-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;background:#eeeef0}
.smart-archive-file{position:relative;display:flex;align-items:center;gap:8px;min-width:0;flex:1;cursor:pointer;font-size:13px}
.smart-archive-file span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.smart-archive-file input{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}
.smart-archive-open{display:grid;place-items:center;width:28px;height:28px;color:#71717a;text-decoration:none}
.smart-archive-open:hover{color:#880422}
.smart-archive-preview{display:flex;align-items:center;justify-content:center;flex:1;overflow:hidden;min-height:0;padding:18px}
.smart-archive-preview img{width:100%;height:100%;object-fit:contain;display:block;min-height:0}
.smart-archive-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:28px;max-width:100%}
.smart-archive-placeholder>iconify-icon{font-size:42px;color:#a1a1aa}
.smart-archive-placeholder strong{font-size:15px;font-weight:550;letter-spacing:-.02em}
.smart-archive-placeholder>span{font-size:12px;color:#71717a;overflow-wrap:anywhere}
.smart-archive-status{padding:14px 16px;background:#eeeef0;display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between}
.smart-archive-status-line{display:flex;align-items:center;gap:10px;font-size:12px;min-width:0;flex:1}
.smart-archive-status button{background:transparent!important;border:0;color:#71717a!important;box-shadow:none!important;padding:0 6px!important;min-height:28px!important;height:28px!important;font-size:12px}
.smart-archive-status small{font-size:11px;color:#71717a}
.smart-archive-pages{font-size:11px;display:flex;align-items:center;gap:6px;color:#71717a}
.smart-archive-pages select{height:28px!important;min-height:28px!important;padding:2px 22px 2px 7px!important;min-width:54px;background:#fff;color:#303036;border-radius:5px;font-size:12px}
.smart-archive-progress{width:100%;font-size:12px}
.smart-archive-progress>div{display:flex;justify-content:space-between;align-items:center;gap:12px}
.smart-archive-progress progress{width:100%;height:4px;margin-top:9px;accent-color:#880422}
.smart-archive-error{font-size:12px;line-height:1.6;color:#a21d35;width:100%}
.smart-archive-input :is(button,input,select,a):focus-visible,.smart-archive-file:focus-within{outline:2px solid #a5425b;outline-offset:3px;border-radius:4px}
.archive-drop-overlay{position:fixed;inset:14px;z-index:500;display:flex;align-items:center;justify-content:center;pointer-events:none;background:rgb(255 255 255 / 94%);border:2px dashed #880422;border-radius:16px;color:#880422}
.archive-drop-overlay>div{display:flex;flex-direction:column;align-items:center;gap:18px;padding:24px;text-align:center}
.archive-drop-overlay iconify-icon{font-size:52px}
.archive-drop-overlay strong{font-size:24px;font-weight:600;letter-spacing:-.03em}
.archive-drop-overlay span{font-size:13px;color:#71717a}
.archive-dragging iframe{pointer-events:none!important}
.dark .smart-archive-input{background:#242427;color:#eee}.dark .smart-archive-toolbar,.dark .smart-archive-status{background:#2b2b2f}.dark .smart-archive-form-fields :is(input:not([type=checkbox]),select,textarea){background:#252528!important;border-color:#44444a!important}
@media(max-width:860px){body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog{width:calc(100vw - 24px)!important;height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>.smart-archive-modal-body{grid-template-columns:minmax(0,1fr);overflow-y:auto!important;gap:24px;padding:18px!important}.smart-archive-modal-body>.smart-archive-input{height:340px;min-height:340px}.smart-archive-form-fields{overflow:visible;padding:0}.archive-drop-overlay strong{font-size:20px}}
@media(prefers-reduced-motion:reduce){.smart-archive-input *{animation:none!important;transition:none!important}}

.smart-archive-modal-body>.smart-archive-form-fields{margin-top:0!important}

.smart-archive-form-fields>*{margin-top:0!important}

/* Preview spans the entire left side; title, fields and actions belong to the right. */
body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:0;}
body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>.smart-archive-modal-body{display:contents!important;}
body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>div:first-child{grid-column:2;grid-row:1;border-bottom:0!important;padding:28px 28px 22px!important;min-width:0;}
body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>div:first-child :is(h2,h3){font-size:22px!important;font-weight:600;letter-spacing:-.03em;line-height:1.3;}
body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>div:last-child{grid-column:2;grid-row:3;padding:20px 28px!important;border-top:0!important;}
.smart-archive-dialog .smart-archive-input{grid-column:1;grid-row:1 / 4;border-radius:0;}
.smart-archive-dialog .smart-archive-toolbar{padding:26px 24px;background:transparent;min-height:80px;}
.smart-archive-dialog .smart-archive-status{padding:20px 24px;background:transparent;min-height:64px;}
.smart-archive-dialog .smart-archive-form-fields{grid-column:2;grid-row:2;padding:0 28px 12px;}
.disposition-picker{padding:0;margin:4px 0 0;border:0;min-width:0;}
.disposition-picker legend{font-size:13px;font-weight:500;color:#3f3f46;display:flex;align-items:center;gap:12px;margin-bottom:12px;}
.disposition-picker legend>span{font-size:11px;color:#880422;font-weight:500;}
.disposition-search{display:flex;align-items:center;gap:9px;padding:0 12px;min-height:40px;background:#f4f4f5;border-radius:7px;margin-bottom:10px;}
.disposition-search>iconify-icon{font-size:16px;color:#71717a;flex-shrink:0;}
.smart-archive-form-fields .disposition-search input{border:0!important;background:transparent!important;box-shadow:none!important;padding:8px 0!important;min-width:0;width:100%;min-height:40px;outline:none!important;font-size:12px;}
.disposition-search:focus-within{outline:2px solid #a5425b;outline-offset:2px;}
.disposition-search button{border:0!important;background:transparent!important;box-shadow:none!important;color:#71717a!important;font-size:11px!important;font-weight:500!important;padding:0 2px!important;height:32px!important;min-height:32px!important;white-space:nowrap;}
.disposition-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 8px;max-height:226px;overflow-y:auto;scrollbar-width:thin;padding:3px 3px 3px 0;}
.smart-archive-form-fields .disposition-options>label{display:flex;align-items:center;gap:9px;min-width:0;min-height:40px;margin:0!important;padding:9px 10px;border-radius:6px;cursor:pointer;font-size:12px!important;color:#52525b;transition:background .15s ease,color .15s ease;}
.disposition-options>label:hover{background:#f4f4f5;}
.smart-archive-form-fields .disposition-options>label.is-selected{background:#f7e9ee;color:#880422;}
.disposition-options input[type=checkbox]{width:15px;height:15px;min-width:15px;margin:0;accent-color:#880422;}
.disposition-options>label>span{min-width:0;line-height:1.5;flex:1;}
.disposition-options>label>iconify-icon{font-size:14px;flex-shrink:0;}
.disposition-options>label:focus-within{outline:2px solid #a5425b;outline-offset:-2px;}
.disposition-empty{font-size:12px;color:#71717a;grid-column:1/-1;padding:12px;}
.dark .disposition-picker legend{color:#e4e4e7;}.dark .disposition-search,.dark .disposition-options>label:hover{background:#303034;}.dark .disposition-options>label.is-selected{background:#432631;color:#f1bccb;}
@media(max-width:860px){
 body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog{display:flex!important;flex-direction:column;}
 body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>div:first-child{padding:20px!important;flex-shrink:0;}
 body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>.smart-archive-modal-body{display:flex!important;flex-direction:column;overflow-y:auto!important;padding:0 18px 18px!important;gap:22px;}
 body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>div:last-child{padding:16px 20px!important;flex-shrink:0;}
 .smart-archive-dialog .smart-archive-input{border-radius:8px;height:300px;min-height:300px;flex-shrink:0;}
 .smart-archive-dialog .smart-archive-toolbar{padding:14px;min-height:48px;}.smart-archive-dialog .smart-archive-status{padding:12px 14px;min-height:42px;}
 .smart-archive-dialog .smart-archive-form-fields{padding:0;overflow:visible;flex-shrink:0;}
}
@media(max-width:420px){.disposition-options{grid-template-columns:minmax(0,1fr);max-height:220px;}}

/* Edge-to-edge document viewport with floating controls. */
.smart-archive-dialog .smart-archive-input{position:relative;padding:0!important;border:0!important;margin:0!important;background:#e6e6e8;}
.smart-archive-dialog .smart-archive-preview{display:block;position:absolute;inset:0;padding:0!important;margin:0;border:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;}
.smart-archive-dialog .smart-archive-preview img{display:block;height:auto;max-width:none!important;min-height:0;margin:0 auto;object-fit:initial;}
.smart-archive-dialog .smart-archive-toolbar{position:absolute;inset:0 0 auto;z-index:2;min-height:76px;padding:16px 18px 30px;background:linear-gradient(180deg,rgba(15,15,18,.72),rgba(15,15,18,0));color:#fff;pointer-events:none;}
.smart-archive-dialog .smart-archive-toolbar>*{pointer-events:auto;}
.smart-archive-dialog .smart-archive-status{position:absolute;inset:auto 0 0;z-index:2;min-height:0;padding:42px 18px 14px;background:linear-gradient(0deg,rgba(15,15,18,.85),rgba(15,15,18,0));color:#fff;pointer-events:none;}
.smart-archive-dialog .smart-archive-status>*{pointer-events:auto;}
.smart-archive-dialog .smart-archive-status :is(button,small,.smart-archive-pages),.smart-archive-dialog .smart-archive-open{color:#fff!important;}
.smart-archive-dialog .smart-archive-status button,.smart-archive-dialog .smart-archive-open{border-radius:5px!important;}
.smart-archive-dialog .smart-archive-status button:hover,.smart-archive-dialog .smart-archive-open:hover{background:rgba(255,255,255,.17)!important;}
.smart-archive-dialog .smart-archive-status button:disabled{opacity:.35;cursor:default;}
.smart-archive-dialog .smart-archive-error{color:#ffd5df;text-shadow:0 1px 3px #000;}
.smart-archive-dialog .smart-archive-placeholder{height:100%;max-width:none;box-sizing:border-box;}
.smart-preview-controls{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;font-size:12px;margin-bottom:8px;}
.smart-preview-controls button{display:inline-flex;align-items:center;justify-content:center;min-width:28px;white-space:nowrap;}
.smart-preview-controls iconify-icon{font-size:16px;}
.smart-preview-separator{height:16px;width:1px;background:rgba(255,255,255,.3);margin:0 7px;}
.smart-archive-dialog .smart-archive-input :is(button,input,select,a):focus-visible,.smart-archive-dialog .smart-archive-file:focus-within{outline-color:#fff;}
@media(max-width:860px){body.dense-ui.ui-refresh .ui-dialog.smart-archive-dialog>.smart-archive-modal-body{padding:0 0 18px!important;}.smart-archive-dialog .smart-archive-input{border-radius:0;}.smart-archive-dialog .smart-archive-form-fields{padding:0 20px;}}

/* Keep the document unobstructed until its controls are requested. */
.smart-archive-dialog .smart-archive-input.has-preview :is(.smart-archive-toolbar,.smart-archive-status){opacity:0;transition:opacity .18s ease;}
.smart-archive-dialog .smart-archive-input.has-preview :is(.smart-archive-toolbar,.smart-archive-status)>*{pointer-events:none;}
.smart-archive-dialog .smart-archive-input.has-preview:is(.controls-revealed,:has(:focus-visible)) :is(.smart-archive-toolbar,.smart-archive-status){opacity:1;}
.smart-archive-dialog .smart-archive-input.has-preview:is(.controls-revealed,:has(:focus-visible)) :is(.smart-archive-toolbar,.smart-archive-status)>*{pointer-events:auto;}
@media(hover:hover){
 .smart-archive-dialog .smart-archive-input.has-preview:hover :is(.smart-archive-toolbar,.smart-archive-status){opacity:1;}
 .smart-archive-dialog .smart-archive-input.has-preview:hover :is(.smart-archive-toolbar,.smart-archive-status)>*{pointer-events:auto;}
}

body.dense-ui.ui-refresh .smart-archive-form-fields input.archive-number-warning{border:2px solid #d97706!important;background:#fffbeb!important;box-shadow:0 0 0 2px rgb(217 119 6 / 10%)!important;}
.archive-number-message{margin-top:6px!important;font-size:12px;line-height:1.5;color:#92400e;}
.dark .archive-number-message{color:#fcd34d;}
body.dense-ui.ui-refresh.dark .smart-archive-form-fields input.archive-number-warning,.dark body.dense-ui.ui-refresh .smart-archive-form-fields input.archive-number-warning{background:#332914!important;border-color:#fbbf24!important;}

body.dense-ui.ui-refresh .smart-archive-form-fields input.archive-number-warning:focus{outline:2px solid #f59e0b!important;outline-offset:2px!important;}

.research-participants{display:flex;flex-direction:column;gap:18px;}
.research-participant-group>label{display:block;margin-bottom:6px;color:#52525b;}
.research-participant-group>label>span{color:#880422;margin-left:4px;}
.research-participant-rows{margin-top:8px;display:flex;flex-direction:column;gap:4px;}
.research-participant-row{display:flex;align-items:center;gap:8px;background:#f8f8f8;border-radius:6px;padding:8px 10px;}
.research-participant-row>span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px;line-height:1.5;}
.smart-archive-form-fields .research-participant-row>select{width:104px;min-width:84px;flex-shrink:0;padding:4px 8px!important;min-height:30px!important;height:30px!important;font-size:11px!important;}
.research-participant-row>button{padding:4px!important;min-width:26px;height:28px!important;min-height:28px!important;background:transparent!important;box-shadow:none!important;border:0!important;color:#71717a!important;}
.dark .research-participant-row{background:#27272a;}
