/* Documenti: viewer persistente a tutta finestra, con fullscreen nativo opzionale. */
body.nd-viewer-open{overflow:hidden!important;}
#ndViewerDialog{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#08131c;color:#eef7fa;overflow:hidden;box-sizing:border-box;z-index:2147483647;color-scheme:dark;}
#ndViewerDialog:not([open]){display:none!important;}
#ndViewerDialog[open]{display:block;}
#ndViewerDialog::backdrop{background:#08131c;}
#ndViewerDialog [hidden]{display:none!important;}
#ndViewerDialog *{box-sizing:border-box;}
#ndViewerDialog .nd-viewer-surface{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-height:0;background:#08131c;}
#ndViewerDialog .nd-viewer-surface:fullscreen,#ndViewerDialog .nd-viewer-surface:-webkit-full-screen{width:100vw;height:100vh;}
#ndViewerDialog .nd-viewer-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 10px max(14px,env(safe-area-inset-left));margin:0;border-bottom:1px solid #30424e;background:#101f2a;}
#ndViewerDialog .nd-viewer-head h2{min-width:0;margin:0;padding:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#eef7fa;font:650 15px/1.4 system-ui,sans-serif;}
#ndViewerDialog .nd-viewer-tools,#ndViewerDialog .nd-viewer-downloads{display:flex;align-items:center;gap:8px;flex:0 0 auto;}
#ndViewerDialog .nd-viewer-close,#ndViewerDialog .nd-viewer-download{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;margin:0;padding:9px 14px;border:1px solid #4b6575;border-radius:9px;background:#183040;color:#f4fbff;font:650 13px/1.3 system-ui,sans-serif;text-decoration:none;cursor:pointer;white-space:nowrap;}
#ndViewerDialog .nd-viewer-close{background:#d8f2f4;border-color:#d8f2f4;color:#092c3b;}
#ndViewerDialog .nd-viewer-close span{font-size:22px;line-height:1;}
#ndViewerDialog :is(a,button,video,audio,iframe):focus-visible{outline:3px solid #53d8ef;outline-offset:2px;}
#ndViewerDialog .nd-viewer-stage{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;width:100%;height:100%;overflow:auto;background:#070c12;}
#ndViewerDialog .nd-viewer-stage>iframe{display:block;flex:1 1 auto;width:100%;height:100%;margin:0;padding:0;border:0;background:#fff;}
#ndViewerDialog .nd-viewer-stage>video{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;background:#000;}
#ndViewerDialog .nd-viewer-stage>audio{display:block;width:min(720px,calc(100% - 40px));}
#ndViewerDialog .nd-viewer-status{position:absolute;z-index:2;left:50%;top:86px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);margin:0;padding:10px 14px;border:1px solid #547483;border-radius:10px;background:#102837ed;color:#eef7fa;font:500 13px/1.5 system-ui,sans-serif;text-align:center;pointer-events:none;}
@media(max-width:600px){
  #ndViewerDialog .nd-viewer-head{flex-wrap:wrap;gap:8px;}
  #ndViewerDialog .nd-viewer-head h2{flex:1 1 100%;font-size:13px;}
  #ndViewerDialog .nd-viewer-tools{width:100%;justify-content:space-between;}
  #ndViewerDialog .nd-viewer-close,#ndViewerDialog .nd-viewer-download{min-height:42px;padding:8px 11px;font-size:12px;}
  #ndViewerDialog .nd-viewer-status{top:122px;}
}
