/* Visualizador interno de documentos do contrato (PDF, imagens e aviso de formato sem pré-visualização). */
.dv-backdrop { position: fixed; inset: 0; z-index: 170; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); background: rgba(3, 20, 37, .66); }
.dv { width: min(1100px, 100%); height: min(900px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(3, 20, 37, .35); color: #102d51; font-size: var(--text-sm); }
.dv-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #e2e9f2; min-width: 0; }
.dv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dv-name { max-width: 100%; font-size: var(--text-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-meta { color: #6b82a1; font-size: var(--text-xs); }
.dv-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.dv-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border: 1px solid #d4e2f0; border-radius: 9px; background: #fff; color: #28517d; cursor: pointer; }
.dv-icon svg { width: 16px; height: 16px; display: block; }
.dv-icon:hover:not(:disabled) { background: #eef5ff; color: #0766dc; border-color: #b9d6fa; }
.dv-icon:disabled { opacity: .4; cursor: default; }
.dv-icon:focus-visible, .dv-primary:focus-visible, .dv-secondary:focus-visible { outline: 2px solid #0766dc; outline-offset: 2px; }
.dv-pos { min-width: 52px; text-align: center; color: #6b82a1; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.dv-sep { width: 1px; height: 20px; background: #e2e9f2; margin: 0 2px; }
.dv-stage { overflow: auto; background: #2b3342; padding: 20px 16px; overscroll-behavior: contain; outline: none; }
.dv-pages { display: grid; justify-items: center; gap: 16px; width: max-content; min-width: 100%; }
.dv-page { position: relative; background: #fff; border-radius: 2px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.dv-page:not(.is-ready)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #f3f5f8, #fbfcfd, #f3f5f8); }
.dv-page canvas { display: block; width: 100%; height: 100%; }
/* Camada de texto do pdf.js (regras essenciais de web/pdf_viewer.css): texto transparente sobre o desenho, só para selecionar e copiar. */
.dv-text { position: absolute; top: 0; left: 0; overflow: clip; z-index: 1; text-align: initial; line-height: 1; letter-spacing: normal; word-spacing: normal; text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.dv-text :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0% 0%; -webkit-user-select: text; user-select: text; }
.dv-text > :not(.markedContent), .dv-text .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.dv-text[data-main-rotation="90"] { transform: rotate(90deg) translateY(-100%); }
.dv-text[data-main-rotation="180"] { transform: rotate(180deg) translate(-100%, -100%); }
.dv-text[data-main-rotation="270"] { transform: rotate(270deg) translateX(-100%); }
.dv-text .markedContent { display: contents; }
.dv-text span[role="img"] { -webkit-user-select: none; user-select: none; cursor: default; }
.dv-text ::selection { background: rgba(7, 102, 220, .3); color: transparent; }
.dv-text br::selection { background: transparent; }
.dv-text .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; -webkit-user-select: none; user-select: none; }
.dv-text.selecting .endOfContent { top: 0; }
.dv-image { display: block; margin: 0 auto; max-width: none; height: auto; border-radius: 4px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); background: #fff; }
.dv-loading, .dv-message { margin: 10vh auto 0; width: min(420px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; }
.dv-loading { color: #dfe7f2; }
.dv-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: dv-spin .8s linear infinite; }
@keyframes dv-spin { to { transform: rotate(360deg); } }
.dv-message { padding: 28px; background: #fff; border-radius: 14px; color: #102d51; }
.dv-message svg { width: 36px; height: 36px; color: #6b82a1; }
.dv-message p { margin: 0; color: #6b82a1; line-height: 1.5; }
.dv-message-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dv-primary, .dv-secondary { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 700; font-size: var(--text-sm); cursor: pointer; }
.dv-primary { border: 0; background: #0766dc; color: #fff; }
.dv-secondary { border: 1px solid #d4e2f0; background: #fff; color: #0766dc; }
.dv-primary svg, .dv-secondary svg { width: 16px; height: 16px; }
.dv-open-contract { height: 34px; padding: 0 12px; }
.dv-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 1px solid #e2e9f2; color: #6b82a1; font-size: var(--text-xs); }
.dv-portal [hidden] { display: none !important; }
@media (max-width: 720px) {
  .dv-backdrop { padding: 0; }
  .dv { width: 100%; height: 100%; border-radius: 0; }
  .dv-head { flex-wrap: wrap; padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .dv-title { flex-basis: 100%; }
  .dv-actions { width: 100%; justify-content: space-between; gap: 4px; }
  .dv-sep, .dv-hint { display: none; }
  .dv-open-contract span { display: none; }
  .dv-open-contract { width: 34px; padding: 0; justify-content: center; }
  .dv-stage { padding: 12px 8px; }
  .dv-foot { padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .dv-spinner { animation: none; } }
