/* In-app document preview (public/assets/js/doc-preview.js). Flat, like the rest of the app; full screen on phones. */
html.docprev-open { overflow: hidden; }

.docprev { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 23, 42, .62); }
.docprev[hidden] { display: none; }
.docprev__panel { display: flex; flex-direction: column; width: min(1000px, 100%); height: 100%; /* the overlay's padding is the margin; 100% (not vh) stays right under the desktop page zoom */ background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.docprev__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #E2E8F0; background: #fff; }
.docprev__title { margin: 0; min-width: 0; font-size: 15px; font-weight: 600; color: #0F172A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docprev__tools { display: flex; align-items: center; gap: 8px; flex: none; }
.docprev__zoom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; font-variant-numeric: tabular-nums; }
.docprev__zoom[hidden] { display: none; }
.docprev__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid #CBD5E1; border-radius: 8px; background: #fff; color: #1E293B; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.docprev__btn:hover { background: #F1F5F9; color: #1E293B; }
.docprev__btn[hidden] { display: none; }
.docprev__btn--close { font-size: 22px; line-height: 1; }
.docprev__btn--primary { margin-top: 12px; background: #1E40AF; border-color: #1E40AF; color: #fff; }
.docprev__btn--primary:hover { background: #1E3A8A; color: #fff; }
.docprev__body { flex: 1 1 auto; min-height: 0; overflow: auto; background: #E2E8F0; -webkit-overflow-scrolling: touch; outline: none; }
.docprev__pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; }
.docprev__page { display: flex; align-items: center; justify-content: center; width: fit-content; max-width: none; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .15); color: #64748B; font-size: 13px; }
.docprev__page canvas { display: block; }
.docprev__count { margin: 0 0 14px; text-align: center; font-size: 12px; color: #64748B; }
.docprev__img { display: block; max-width: 100%; height: auto; margin: 12px auto; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.docprev__msg { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 32px 20px; text-align: center; color: #334155; font-size: 15px; }
.docprev__msg p { margin: 0; max-width: 46ch; }
.docprev__spin { width: 22px; height: 22px; margin-bottom: 10px; border-radius: 50%; border: 2px solid #CBD5E1; border-top-color: #1E40AF; animation: docprev-spin .7s linear infinite; }
@keyframes docprev-spin { to { transform: rotate(360deg); } }

/* Word: .docx drawn by docx-preview (pages like the PDF ones), .doc converted on the server and shown in a sandboxed frame */
.docprev__word .docx-wrapper { background: #E2E8F0 !important; padding: 12px !important; gap: 0; }
.docprev__word .docx-wrapper > section.docx { margin: 0 auto 12px !important; box-shadow: 0 1px 3px rgba(15, 23, 42, .15) !important; }
.docprev__word a[href] { color: #1E40AF; }
.docprev__body:has(> .docprev__frame) { overflow: hidden; }
.docprev__frame { display: block; width: 100%; height: 100%; border: 0; background: #E2E8F0; }

@media (max-width: 640px) {
  .docprev { padding: 0; }
  .docprev__panel { width: 100%; height: 100%; border-radius: 0; }
  .docprev__btn--text { padding: 0 8px; font-size: 13px; }
}

/* The "Preview:" line under a file field once files are chosen */
.docprev-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.docprev-picked:empty { display: none; }
.docprev-picked__label { color: #64748B; }
.docprev-picked__file { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 10px; border: 1px solid #CBD5E1; border-radius: 999px; background: #fff; color: #1E40AF; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docprev-picked__file:hover { background: #EFF6FF; border-color: #93C5FD; }
.docprev-picked__remove { margin-left: -4px; margin-right: 6px; width: 26px; height: 26px; border: 1px solid #CBD5E1; border-radius: 50%; background: #fff; color: #64748B; font-size: 16px; line-height: 1; cursor: pointer; }
.docprev-picked__remove:hover { background: #FEF2F2; border-color: #FCA5A5; color: #B91C1C; }
