.fp-cert-img-modal .modal-dialog { width: fit-content; max-width: calc(100% - 32px); margin-inline: auto; }

.fp-cert-modal .modal-dialog { width: min(calc(100% - 24px), max(360px, calc((92dvh - 174px) * var(--cert-page-ratio, .707) + 24px))); max-width: none; margin-inline: auto; }
.fp-cert-modal .modal-content { border-radius: 16px; overflow: hidden; box-shadow: rgba(0, 0, 0, 0.25) 0px 24px 60px; display: flex; flex-direction: column; }

.fp-cert-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid rgb(226, 232, 240); flex-shrink: 0; }

.fp-cert-modal__title { margin: 0px; font-size: var(--fs-body); font-weight: 700; color: rgb(15, 23, 42); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fp-cert-modal__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.fp-cert-modal__open { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--dabaco-blue); font-size: var(--fs-small); font-weight: 600; text-decoration: none; transition: background 0.2s; color: var(--bg-white) !important; }

.fp-cert-modal__open:hover { background: var(--dabaco-blue-hover); }

.fp-cert-modal__open[hidden] { display: none !important; }

.fp-cert-modal .fp-cert-modal__body { position: relative; width: 100%; height: calc(92dvh - 150px); min-height: 160px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: rgb(248, 250, 252); }

.fp-cert-modal__frame { position: absolute; inset: 0px; z-index: 1; width: 100%; height: 100%; border: 0px; display: block; }

.fp-cert-modal__loading { position: absolute; inset: 0px; display: grid; place-items: center; }

.fp-cert-modal__loading span { width: 36px; height: 36px; border-width: 3px; border-style: solid; border-right-color: rgb(203, 213, 225); border-bottom-color: rgb(203, 213, 225); border-left-color: rgb(203, 213, 225); border-image: none; border-top-color: var(--dabaco-blue); border-radius: 50%; animation: 0.8s linear 0s infinite normal none running fp-cert-spin; }

@keyframes fp-cert-spin { 
  100% { transform: rotate(360deg); }
}


.fp-cert-modal [hidden] { display: none !important; }
.fp-cert-modal canvas { flex: none; box-shadow: 0 2px 12px #0002; }
.fp-cert-modal__pages { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 10px; background: white; }
.fp-cert-modal__pages button { border: 1px solid var(--dabaco-blue); border-radius: 8px; padding: 6px 12px; color: var(--dabaco-blue); background: white; }
.fp-cert-modal__pages button:disabled { opacity: .45; }
#cert-pdf-error { padding: 24px; }
