/* Fitting affects only the visible preview, never the exported paper. */
@media screen {
  html body #pdfModal.wf-invoice-preview > .modal {inline-size:min(1060px,100%);display:flex;flex-direction:column;min-block-size:0;max-block-size:calc(100dvh - 24px);padding:0!important;overflow:hidden!important;}
  html body #pdfModal.wf-invoice-preview .pdf-bar {display:grid!important;grid-template-areas:none!important;grid-template-columns:minmax(0,1fr) auto 44px!important;gap:6px 10px!important;min-block-size:58px!important;padding:7px 12px!important;border-radius:var(--wf-header-radius,0 0 20px 20px)!important;}
  html body #pdfModal.wf-invoice-preview .wf15-preview-title {min-inline-size:0;margin:0!important;grid-column:1!important;grid-row:1!important;}
  html body #pdfModal.wf-invoice-preview .wf15-preview-title-main {font-size:16px!important;line-height:1.35!important;}
  html body #pdfModal.wf-invoice-preview .wf15-preview-title-badge {inline-size:32px!important;block-size:32px!important;background:var(--gold-light)!important;color:var(--brand-primary,var(--gold2))!important;flex:none;}
  html body #pdfModal.wf-invoice-preview .pdf-bar > .close {grid-column:3;grid-row:1;margin:0!important;inline-size:44px!important;block-size:44px!important;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--text2);display:grid;place-items:center;}
  html body #pdfModal.wf-invoice-preview .wf-preview-language-toggle {grid-column:2;grid-row:1;min-block-size:44px;max-inline-size:100%;padding:6px 9px;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--text);font-family:inherit;font-size:13px;font-weight:700;line-height:1.3;white-space:nowrap;}
  html body #pdfModal.wf-invoice-preview #wf14PreviewLangControl {grid-column:1/-1!important;grid-row:2!important;inline-size:100%!important;min-inline-size:0!important;min-block-size:0!important;max-inline-size:100%;margin:0!important;padding:0!important;background:transparent!important;border:0!important;}
  html body #pdfModal.wf-invoice-preview #wf14PreviewLangControl[hidden] {display:none!important;}
  html body #pdfModal.wf-invoice-preview .wf14-preview-lang-label {display:none;}
  html body #pdfModal.wf-invoice-preview .wf14-preview-lang-buttons {display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;inline-size:100%;gap:4px!important;}
  html body #pdfModal.wf-invoice-preview .wf14-preview-lang-btn {min-inline-size:0!important;inline-size:100%!important;min-block-size:44px!important;padding:5px 2px!important;font-size:12px!important;background:var(--card)!important;color:var(--text)!important;border-color:var(--border)!important;}
  html body #pdfModal.wf-invoice-preview .wf14-preview-lang-btn[aria-checked="true"] {background:var(--gold-light)!important;color:var(--gold2)!important;border-color:var(--gold)!important;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-toolbar {display:flex;align-items:center;justify-content:center;gap:4px;flex:none;padding:5px 10px;background:var(--card);border-block-end:1px solid var(--border);}
  html body #pdfModal.wf-invoice-preview .wf-preview-control {display:inline-flex;align-items:center;justify-content:center;gap:5px;min-inline-size:40px;min-block-size:44px;padding:5px 9px;border:1px solid var(--border);border-radius:10px;background:var(--input);color:var(--text);font-family:inherit;font-size:13px;line-height:1.3;white-space:nowrap;touch-action:manipulation;}
  html body #pdfModal.wf-invoice-preview .wf-preview-control[aria-pressed="true"] {background:var(--gold-light);border-color:var(--gold);color:var(--gold2);}
  html body #pdfModal.wf-invoice-preview .wf-preview-control:disabled {opacity:.4;cursor:default;}
  html body #pdfModal.wf-invoice-preview .wf-preview-percent {min-inline-size:40px;text-align:center;direction:ltr;font-size:12px;font-variant-numeric:tabular-nums;color:var(--text2);}
  html body #pdfModal.wf-invoice-preview .wf-preview-glyph {display:inline-flex;align-items:center;justify-content:center;flex:none;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-viewport {flex:1 1 auto;min-inline-size:0;min-block-size:0;max-block-size:none!important;padding:12px!important;overflow:auto!important;direction:ltr;background:color-mix(in srgb,var(--bg) 88%,var(--text) 12%)!important;scrollbar-gutter:stable;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
  html body #pdfModal.wf-invoice-preview #invoicePaperWrap {position:relative;inline-size:var(--wf-invoice-preview-width,794px);block-size:var(--wf-invoice-preview-height,auto);margin-inline:auto;max-inline-size:none;overflow:hidden!important;overflow:clip!important;direction:ltr;}
  html body #pdfModal.wf-invoice-preview #invoicePaperWrap > :first-child {position:absolute;left:0;top:0;right:auto;inline-size:794px!important;width:794px!important;max-inline-size:none!important;max-width:none!important;margin:0!important;transform:scale(var(--wf-invoice-preview-scale,1));transform-origin:left top;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-footer {flex:none;padding:8px 12px max(8px,env(safe-area-inset-bottom));border-block-start:1px solid var(--border);background:var(--card);}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-actions {display:grid!important;grid-area:auto!important;grid-template-areas:none!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;inline-size:100%;margin:0!important;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-actions > button {display:flex!important;align-items:center;justify-content:center;gap:6px!important;min-inline-size:0!important;max-inline-size:100%;min-block-size:44px!important;block-size:auto!important;padding:8px 7px!important;border-radius:12px!important;font-family:inherit;font-size:14px!important;line-height:1.3!important;white-space:normal!important;overflow-wrap:anywhere;box-shadow:none!important;transform:none!important;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-actions .wf-preview-primary {background:var(--brand-primary,var(--gold))!important;color:var(--brand-on-primary,#fff)!important;border-color:var(--brand-primary,var(--gold))!important;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-actions .btn-s {background:var(--input)!important;border-color:var(--border)!important;color:var(--text)!important;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-metadata {display:flex;align-items:start;justify-content:space-between;flex-wrap:wrap;gap:4px 10px;margin-block-start:4px;font-size:12px;color:var(--muted);}
  html body #pdfModal.wf-invoice-preview .wf-preview-page-count:empty {display:none;}
  html body #pdfModal.wf-invoice-preview .wf-preview-export-note {margin-inline-start:auto;max-inline-size:100%;font-size:12px;}
  html body #pdfModal.wf-invoice-preview .wf-preview-export-note summary {cursor:pointer;min-block-size:28px;padding:4px;}
  html body #pdfModal.wf-invoice-preview .wf-preview-export-note [data-i18n="excel_hint"] {padding:5px 0!important;font-size:12px!important;line-height:1.5;}
  html body #pdfModal.wf-invoice-preview button:focus-visible,html body #pdfModal.wf-invoice-preview summary:focus-visible {outline:2px solid var(--gold);outline-offset:2px;}
}
@media screen and (max-width:620px) {
  html:root body #pdfModal.wf-invoice-preview > .modal {inline-size:100%!important;block-size:100dvh!important;max-block-size:100dvh!important;border-radius:0!important;}
  html body #pdfModal.wf-invoice-preview .pdf-bar {padding-block-start:max(6px,env(safe-area-inset-top))!important;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-viewport {padding:8px!important;}
  html body #pdfModal.wf-invoice-preview .wf15-preview-title-main {font-size:14px!important;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-footer {padding-inline:8px;}
  html body #pdfModal.wf-invoice-preview .wf-invoice-preview-toolbar {gap:3px;padding-inline:7px;}
  html body #pdfModal.wf-invoice-preview .wf-preview-control {padding-inline:6px;}
}
