/* Shared document viewer: public portal and Customer Zone use the same shell. */
.document-viewer-overlay { position:fixed; inset:0; z-index:1055; display:grid; pointer-events:none; visibility:hidden; }
.document-viewer-overlay.is-open { visibility:visible; pointer-events:auto; }
.document-viewer-backdrop { position:absolute; inset:0; border:0; background:rgba(11,13,16,.6); }
.document-viewer-overlay.is-open .document-viewer-backdrop { background:rgba(11,13,16,.6); }
.document-viewer-shell { position:absolute; inset:24px; display:grid; grid-template-rows:auto minmax(0,1fr); padding:0; border:1px solid rgba(255,255,255,.2); border-radius:20px; overflow:hidden; background:#f7f7f4; box-shadow:0 28px 80px rgba(11,13,16,.3); }
.document-viewer-overlay.is-open .document-viewer-shell { opacity:1; transform:none; }
.document-viewer-header { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:16px; min-height:72px; padding:16px 24px; background:#fff; border-bottom:1px solid #e8e7e1; }
.document-viewer-header h2,.document-viewer-header h5 { margin:0; color:#171b1a; font-size:20px; font-weight:600; overflow-wrap:anywhere; }
.document-viewer-eyebrow { display:block; font-size:10px; letter-spacing:1px; text-transform:uppercase; color:#777b75; }
.document-viewer-header-actions { display:flex; width:auto; flex:0 0 auto; margin-left:auto; align-items:center; gap:12px; }
.document-viewer-close { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; flex:0 0 44px; padding:0; border:1px solid #e3e4df; border-radius:12px; background:#fff; color:#222; font-size:24px; cursor:pointer; }
.document-viewer-body { display:grid; grid-template-columns:minmax(0,1fr) 280px; min-height:0; overflow:hidden; }
.document-viewer-body>.pdf-container { position:relative; min-width:0; min-height:0; height:100%; margin:0; padding:0; overflow:hidden; background:#eaece8; }
.document-viewer-body #pdfViewer { width:100%; height:100% !important; border:0; }
.document-viewer-body .k-pdf-viewer .k-toolbar { border-bottom:1px solid #e1e3dd; background:#fff; }
.document-viewer-rail,.customer-zone__invoice-rail { display:flex; flex-direction:column; gap:20px; min-width:0; min-height:0; padding:24px; overflow:auto; background:linear-gradient(130deg,rgba(255,237,0,.1),transparent 55%),#fafaf7; border-left:1px solid #e3e4de; }
.document-viewer-rail .document-viewer-actions,.document-viewer-rail .document-viewer-action-group { display:flex; flex-direction:column; align-items:stretch; width:100%; gap:12px; }
.document-viewer-rail .document-viewer-action { display:flex; align-items:center; justify-content:flex-start; gap:10px; min-height:44px; width:100%; padding:12px 16px; border:1px solid #e3e4de; border-radius:10px; background:#fff; color:#171b1a; font-size:13px; text-decoration:none; cursor:pointer; }
.document-viewer-rail .document-viewer-action--primary { background:var(--color-primary,#ffed00); border-color:transparent; }
.document-viewer-rail .document-viewer-action--danger { color:#ad302c; }
.document-viewer-rail .document-viewer-action-separator { width:100%; height:1px; background:#e3e4de; }
.customer-zone__invoice-rail h2 { font-size:18px; margin:0; }
.customer-zone__invoice-rail>p { margin:0; font-size:13px; overflow-wrap:anywhere; }
.customer-zone__invoice-rail .customer-zone__invoice-amount,.customer-zone__invoice-rail .customer-zone__data-list { margin:0; }
.customer-zone__invoice-rail-actions { display:flex; flex-direction:column; gap:12px; margin-top:4px; }
.customer-zone__invoice-rail-actions .mvc-btn { display:flex; justify-content:center; gap:10px; min-height:44px; font-size:13px; padding:12px; }
.document-preview-loader { position:absolute; inset:0; display:none; align-items:center; justify-content:center; flex-direction:column; gap:16px; padding:24px; text-align:center; background:rgba(250,250,247,.97); z-index:3; }
.pdf-container.is-loading .document-preview-loader,.document-preview-loader.has-error { display:flex; }
.document-preview-loader.has-error .customer-zone__spinner { display:none; }
.document-preview-boot { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:16px; min-height:0; padding:24px; text-align:center; }
.document-viewer-overlay-open { overflow:hidden; }
.document-viewer-shell :focus-visible { outline:2px solid #857a00; outline-offset:3px; }
@media(max-width:991px) {
    .document-viewer-shell { inset:8px; border-radius:14px; }
    .document-viewer-header { min-height:60px; padding:10px 14px; gap:8px; }
    .document-viewer-header h2,.document-viewer-header h5 { font-size:16px; }
    .document-viewer-body { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; }
    .document-viewer-rail,.customer-zone__invoice-rail { border-left:0; border-top:1px solid #e3e4de; padding:12px 16px; gap:10px; max-height:28vh; overflow:auto; }
    .document-viewer-rail .document-viewer-actions,.document-viewer-rail .document-viewer-action-group,.customer-zone__invoice-rail-actions { flex-direction:row; flex-wrap:wrap; gap:8px; margin:0; }
    .document-viewer-rail .document-viewer-action,.customer-zone__invoice-rail-actions .mvc-btn { width:auto; flex:1 1 auto; }
    .document-viewer-rail .document-viewer-action-separator { display:none; }
    .customer-zone__invoice-rail .customer-zone__data-list { display:none; }
    .customer-zone__invoice-rail .customer-zone__invoice-amount { flex-direction:row; align-items:center; justify-content:space-between; gap:12px; }
    .customer-zone__invoice-rail .customer-zone__invoice-amount strong { font-size:20px; }
    .document-viewer-body .k-toolbar { overflow-x:auto; flex-wrap:nowrap; }
}
@media(prefers-reduced-motion:reduce) {
    .document-viewer-shell,.document-viewer-backdrop { transition:none; }
    .document-preview-loader-spinner { animation:none; }
}
@media(max-width:991px) {
    .customer-zone__invoice-rail { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; }
    .customer-zone__invoice-rail>h2,.customer-zone__invoice-rail>p { display:none; }
    .customer-zone__invoice-rail .customer-zone__invoice-amount { flex-direction:column; align-items:flex-end; gap:2px; }
    .customer-zone__invoice-rail-actions { grid-column:1 / -1; }
}
.document-viewer-rail .document-viewer-actions .document-viewer-action > span:not(.lnr):not(.document-options-modified-dot):not(.document-options-modified-label) { display:inline; }
.document-viewer-rail .document-viewer-action { height:auto; font-weight:600; }
.document-viewer-body .pdf-container.is-loading .k-loading-mask { display:none; }
.document-preview-boot [hidden] { display:none; }

/* Keep the same viewer frame in the public portal and in Customer Zone. */
.document-viewer-shell #pdfViewer { width:100% !important; max-width:100%; min-width:0; position:relative; }
.document-viewer-shell .k-pdf-viewer .k-toolbar { position:absolute; top:auto; bottom:0; left:0; width:100%; z-index:4; }
.document-viewer-shell .k-pdf-viewer .k-pdf-viewer-pages { padding-bottom:58px; }
.document-viewer-shell .k-pdf-viewer .k-blank-page { display:none; }
.document-viewer-rail .document-viewer-action-separator { min-height:0; flex:0 0 1px; margin:4px 0; }
.document-viewer-rail .document-viewer-action { transition:background .15s,border-color .15s; line-height:1.35; }
.document-viewer-rail .document-viewer-action:hover { background:#f5f5ee; border-color:#c8c9bf; }
.document-viewer-rail .document-viewer-action--primary:hover { background:#f1df00; border-color:transparent; }
.document-viewer-rail .document-viewer-action--danger { background:#fff5f3; border-color:#edc7c2; }
.document-viewer-rail .document-viewer-action--danger:hover { background:#ffe7e3; border-color:#ce8278; }
@media(max-width:991px) {
    .document-viewer-overlay { height:100dvh; }
    .document-viewer-shell { inset:0; border:0; border-radius:0; }
    .document-viewer-shell .document-viewer-header { padding-top:calc(10px + env(safe-area-inset-top)); }
    .document-viewer-rail { max-height:none; padding:12px 14px calc(12px + env(safe-area-inset-bottom)); gap:0; }
    .document-viewer-rail .document-viewer-actions { display:flex; flex-direction:column; gap:10px; }
    .document-viewer-rail .document-viewer-action-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .document-viewer-rail .document-viewer-action-group--decision { order:-1; }
    .document-viewer-rail .document-viewer-action { width:100%; min-width:0; min-height:46px; justify-content:center; padding:10px 8px; white-space:normal; font-size:13px; }
    .document-viewer-rail .document-viewer-action-group--decision .document-viewer-action { min-height:52px; font-weight:700; }
    .document-viewer-rail .document-viewer-action-group--secondary .document-viewer-action { background:transparent; border-color:transparent; color:#555b53; }
    .document-viewer-rail .document-viewer-action--primary { box-shadow:0 3px 10px rgba(126,114,0,.12); }
    .customer-zone__invoice-rail { padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
    .document-viewer-shell .k-pdf-viewer .k-toolbar { min-height:48px; }
    .document-viewer-shell .k-pdf-viewer .k-pdf-viewer-pages { padding-bottom:58px; }
}
@media(prefers-reduced-motion:reduce) {
    .document-viewer-rail .document-viewer-action { transition:none; }
}

/* Explicit shared metrics prevent host-page heading and form styles leaking in. */
.document-viewer-shell { font-family:Poppins,sans-serif; }
.document-viewer-shell .document-viewer-header .document-viewer-title { margin:0; font-family:inherit; font-size:20px; font-weight:600; line-height:1.3; letter-spacing:normal; }
.document-viewer-shell .document-viewer-eyebrow { font-weight:600; line-height:1.5; }
.document-viewer-shell .document-viewer-close svg { width:20px; height:20px; }
.document-viewer-shell .k-pdf-viewer .k-toolbar { font-family:inherit; font-size:13px; line-height:1.4; color:#333; padding:8px; gap:8px; background:#fff; }
.document-viewer-shell .k-pdf-viewer .k-toolbar .k-pager-input .k-input { width:64px; }
.document-viewer-shell .k-pdf-viewer .k-toolbar input { min-width:0; font:inherit; }
@media(max-width:991px) {
    .document-viewer-shell .document-viewer-header .document-viewer-title { font-size:16px; }
    .customer-zone__invoice-rail-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .customer-zone__invoice-rail-actions > :only-child { grid-column:1 / -1; }
}

