/* ============================================================
   PDF File Viewer - scoped under .pdv / .pdv-* (rebuilt 2026-10-11)
   Shared header, footer, FAQ and related pills come from custom_styles.css.
   Accent: blue #3399cc (viewers). Single colours, no gradients,
   no thick side borders. Light default, dark via [data-theme="dark"].
   Pages come from pdf.js (lib/pdfjs/pdf_viewer.min.css styles its layers).
   ============================================================ */
.pdv {
    --pdv-accent: #3399cc;
    --pdv-accent-strong: #237a9f;
    --pdv-accent-soft: rgba(51, 153, 204, 0.09);
    --pdv-accent-line: rgba(51, 153, 204, 0.45);
    --pdv-go: #237a9f;
    --pdv-go-hover: #1b6183;
    --pdv-card: var(--bg-elevated, #fff);
    --pdv-sunk: var(--card-tertiary, #f1f5f9);
    --pdv-open: var(--card-secondary, #f8f9fa);
    --pdv-line: var(--border-color, #e2e8f0);
    --pdv-text-1: var(--text-primary, #1e293b);
    --pdv-text-2: var(--text-secondary, #555);
    --pdv-muted: var(--text-muted, #64748b);
    --pdv-ok: #2f855a;
    --pdv-warn: #b45309;
    --pdv-red: #c23b3b;
    --pdv-red-soft: rgba(230, 78, 78, 0.08);
    --pdv-red-line: rgba(230, 78, 78, 0.35);
    --pdv-desk: #e8edf2;
    --pdv-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
[data-theme="dark"] .pdv {
    --pdv-accent: #60a5fa;
    --pdv-accent-strong: #93c5fd;
    --pdv-accent-soft: rgba(96, 165, 250, 0.12);
    --pdv-accent-line: rgba(96, 165, 250, 0.45);
    --pdv-go: #2563eb;
    --pdv-go-hover: #1d4ed8;
    --pdv-sunk: #172033;
    --pdv-open: #1a2438;
    --pdv-ok: #4ade80;
    --pdv-warn: #fbbf24;
    --pdv-red: #f87171;
    --pdv-red-soft: rgba(248, 113, 113, 0.1);
    --pdv-red-line: rgba(248, 113, 113, 0.4);
    --pdv-desk: #0f1626;
}

.pdv.tool-container { max-width: 1180px; margin: 0 auto; padding: 2rem; }
.pdv [hidden], .pdv-root [hidden] { display: none !important; }
.pdv .pdv-main { background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible; padding: 0; }
.pdv button { font: inherit; }
.pdv kbd {
    display: inline-block; padding: 0.05rem 0.4rem; border-radius: 5px; border: 1px solid var(--pdv-line); border-bottom-width: 2px;
    background: var(--pdv-card); font: 600 0.78em var(--pdv-mono); color: var(--pdv-text-1);
}
.pdv .pdv-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.pdv :focus-visible { outline: 3px solid var(--pdv-accent-line); outline-offset: 2px; }

/* ---------- title ---------- */
.pdv .tool-header { text-align: center; margin-bottom: 1.75rem; }
.pdv .pdv-title-row { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.pdv .pdv-title-icon {
    width: 56px; height: 56px; border-radius: 16px; background: var(--pdv-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .pdv .pdv-title-icon { color: #0b1e33; }
.pdv .pdv-title-icon svg { width: 30px; height: 30px; display: block; }
.pdv .tool-title { margin: 0; font-size: 2rem; font-weight: 700; color: var(--pdv-accent); line-height: 1.2; }
.pdv .tool-description { max-width: 800px; margin: 0 auto; font-size: 1.05rem; line-height: 1.65; color: var(--pdv-text-2); }
.pdv .tool-description a { color: var(--pdv-accent-strong); font-weight: 500; }
[data-theme="dark"] .pdv .tool-description a { color: var(--pdv-accent); }

/* ---------- error ---------- */
.pdv .pdv-error {
    display: flex; align-items: flex-start; gap: 0.7rem; margin: 0 0 1rem; padding: 0.9rem 1rem;
    border-radius: 12px; border: 1px solid var(--pdv-red-line); background: var(--pdv-red-soft); color: var(--pdv-text-1);
}
.pdv .pdv-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.pdv .pdv-error > div { flex: 1; min-width: 0; }
.pdv .pdv-error p { margin: 0; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; color: var(--pdv-text-1); }
.pdv .pdv-error p + p { margin-top: 0.3rem; color: var(--pdv-muted); font-size: 0.86rem; }
.pdv .pdv-error a { color: var(--pdv-red); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pdv .pdv-x {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0;
    border: none; border-radius: 8px; background: none; color: var(--pdv-muted); cursor: pointer; padding: 0; margin: 0;
}
.pdv .pdv-x:hover { background: rgba(100, 116, 139, 0.12); color: var(--pdv-text-1); }
.pdv .pdv-x svg { width: 17px; height: 17px; }

/* ---------- cards ---------- */
.pdv .pdv-card {
    background: var(--pdv-card); border: 1px solid var(--pdv-line); border-radius: 20px;
    padding: 1.25rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; min-width: 0;
}

/* ---------- buttons ---------- */
.pdv .pdv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; width: auto;
    min-height: 44px; padding: 0.6rem 1.1rem; margin: 0; border-radius: 12px; border: 1px solid transparent;
    font-size: 0.95rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pdv .pdv-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.pdv .pdv-go { background: var(--pdv-go); color: #fff; }
.pdv .pdv-go:hover:not(:disabled) { background: var(--pdv-go-hover); color: #fff; }
.pdv .pdv-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pdv .pdv-btn-lg { min-height: 48px; padding: 0.6rem 1.3rem; font-size: 0.98rem; }
.pdv .pdv-btn-sm { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 10px; }
.pdv .pdv-btn-sm svg { width: 16px; height: 16px; }
.pdv .pdv-btn-ghost { background: var(--pdv-sunk); color: var(--pdv-text-2); border-color: var(--pdv-line); }
.pdv .pdv-btn-ghost:hover:not(:disabled) { color: var(--pdv-text-1); border-color: var(--pdv-accent-line); }
.pdv .pdv-text-btn {
    display: inline-flex; align-items: center; gap: 0.35rem; width: auto; padding: 0.35rem 0.55rem; margin: 0; border: none; border-radius: 8px;
    background: none; color: var(--pdv-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
[data-theme="dark"] .pdv .pdv-text-btn { color: var(--pdv-accent); }
.pdv .pdv-text-btn:hover:not(:disabled) { background: var(--pdv-accent-soft); }
.pdv .pdv-text-btn svg { width: 15px; height: 15px; }
.pdv .pdv-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; margin: 0;
    border: none; border-radius: 8px; background: none; color: var(--pdv-text-2); cursor: pointer; flex-shrink: 0;
}
.pdv .pdv-icon-btn:hover:not(:disabled) { background: var(--pdv-accent-soft); color: var(--pdv-text-1); }
.pdv .pdv-icon-btn:disabled { opacity: 0.35; cursor: default; }
.pdv .pdv-icon-btn svg { width: 18px; height: 18px; }
.pdv .pdv-icon-btn[aria-pressed="true"] { background: var(--pdv-accent-soft); color: var(--pdv-accent-strong); }
[data-theme="dark"] .pdv .pdv-icon-btn[aria-pressed="true"] { color: var(--pdv-accent); }
.pdv .pdv-seg-btn {
    display: inline-flex; align-items: center; gap: 0.4rem; width: auto; min-height: 38px; padding: 0.35rem 0.95rem; margin: 0; border-radius: 999px;
    border: 1px solid var(--pdv-line); background: var(--pdv-card); color: var(--pdv-text-1); font-size: 0.88rem; font-weight: 700; cursor: pointer;
}
.pdv .pdv-seg-btn svg { width: 16px; height: 16px; color: var(--pdv-accent); }
.pdv .pdv-seg-btn:hover { border-color: var(--pdv-accent); }
.pdv .pdv-chip {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; width: auto; min-height: 34px; padding: 0.3rem 0.4rem; margin: 0;
    border-radius: 9px; border: 1px solid var(--pdv-line); background: var(--pdv-card); color: var(--pdv-text-2);
    font-size: 0.8rem; font-weight: 700; cursor: pointer; min-width: 0;
}
.pdv .pdv-chip:hover { border-color: var(--pdv-accent-line); }
.pdv .pdv-chip.is-active { border-color: var(--pdv-accent); background: var(--pdv-accent-soft); color: var(--pdv-accent-strong); }
[data-theme="dark"] .pdv .pdv-chip.is-active { color: var(--pdv-accent); }
.pdv .pdv-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(100, 116, 139, 0.45); }
.pdv .pdv-quick { display: grid; gap: 0.35rem; }
.pdv .pdv-quick > * { min-width: 0; }
.pdv .pdv-quick-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- upload ---------- */
.pdv .pdv-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center;
    min-height: 200px; padding: 1.5rem 1.25rem; border-radius: 16px; border: 2px dashed var(--pdv-accent-line);
    background: var(--pdv-accent-soft); cursor: pointer; color: var(--pdv-muted); font-size: 0.86rem; line-height: 1.5;
    transition: border-color 0.15s, background 0.15s; box-sizing: border-box; margin: 0;
}
.pdv .pdv-drop:hover, .pdv .pdv-drop.is-drag { border-color: var(--pdv-accent); background: rgba(51, 153, 204, 0.14); }
.pdv .pdv-drop:focus-within { outline: 3px solid var(--pdv-accent-soft); }
.pdv .pdv-drop strong { font-size: 1.1rem; color: var(--pdv-text-1); }
.pdv .pdv-drop-link { color: var(--pdv-accent-strong); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .pdv .pdv-drop-link { color: var(--pdv-accent); }
.pdv .pdv-drop-icon {
    width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem;
    background: var(--pdv-card); color: var(--pdv-accent); border: 1px solid var(--pdv-line);
}
.pdv .pdv-drop-icon svg { width: 28px; height: 28px; }
body.pdv-dragging .pdv .pdv-drop { border-color: var(--pdv-accent); background: rgba(51, 153, 204, 0.16); }
.pdv .pdv-sample-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.pdv .pdv-hint-text { font-size: 0.8rem; color: var(--pdv-muted); }
.pdv .pdv-under { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; margin-top: 1rem; }
.pdv .pdv-pill {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.65rem; border-radius: 999px;
    background: var(--pdv-sunk); border: 1px solid var(--pdv-line); font-size: 0.78rem; font-weight: 600; color: var(--pdv-text-2);
}
.pdv .pdv-pill svg { width: 14px; height: 14px; color: var(--pdv-accent); }

/* ---------- progress ---------- */
.pdv .pdv-prog { padding: 1rem 1.1rem; }
.pdv .pdv-prog-top { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.pdv .pdv-loader {
    display: block; width: 40px; height: 40px; flex-shrink: 0; overflow: visible;
    --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb;
}
[data-theme="dark"] .pdv .pdv-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.pdv .pdv-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.pdv .pdv-loader .bp { stroke: var(--cico-outer-soft); }
.pdv .pdv-loader .gp { stroke: var(--cico-mid-soft); }
.pdv .pdv-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: pdvSpinL 1.3s linear infinite; }
.pdv .pdv-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: pdvSpinR 2.1s linear infinite; }
.pdv .pdv-loader .r { stroke: var(--cico-inner); animation: pdvBreathe 1.3s ease-in-out infinite; }
@keyframes pdvSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes pdvSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes pdvBreathe { 50% { transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) {
    .pdv .pdv-loader .b { animation-duration: 4s; }
    .pdv .pdv-loader .g { animation-duration: 6s; }
    .pdv .pdv-loader .r { animation: none; }
}
.pdv .pdv-stages { display: flex; align-items: center; flex-wrap: wrap; row-gap: 0.4rem; }
.pdv .pdv-pstage { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700; color: var(--pdv-muted); }
.pdv .pdv-dot { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border-radius: 50%; background: var(--pdv-card); border: 1px solid var(--pdv-line); color: var(--pdv-muted); }
.pdv .pdv-dot svg { width: 18px; height: 18px; display: block; }
.pdv .pdv-pstage.active { color: var(--pdv-text-1); }
.pdv .pdv-pstage.active .pdv-dot { background: var(--pdv-go); border-color: var(--pdv-go); color: #fff; }
.pdv .pdv-pstage.done .pdv-dot { background: #339966; border-color: #339966; color: #fff; }
.pdv .pdv-pstage-line { width: 28px; height: 2px; margin: 0 0.5rem; border-radius: 2px; background: var(--pdv-line); flex-shrink: 0; }
.pdv .pdv-pstage-line.done { background: #339966; }
.pdv .pdv-prog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-top: 0.85rem; }
.pdv .pdv-prog-text { font-size: 0.86rem; color: var(--pdv-text-2); min-width: 0; overflow-wrap: anywhere; }
.pdv .pdv-prog-pct { font-size: 0.95rem; font-weight: 800; color: var(--pdv-text-1); font-variant-numeric: tabular-nums; }
.pdv .pdv-bar { position: relative; height: 8px; margin-top: 0.5rem; border-radius: 999px; background: var(--pdv-line); overflow: hidden; }
.pdv .pdv-bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--pdv-go); border-radius: 999px; transition: width 0.3s; }

/* ---------- viewer head ---------- */
.pdv .pdv-filehead { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.pdv .pdv-fileicon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--pdv-accent-soft); color: var(--pdv-accent); }
.pdv .pdv-fileicon svg { width: 22px; height: 22px; }
.pdv .pdv-filetext { flex: 1; min-width: 0; }
.pdv .pdv-filetext strong { display: block; font-size: 1.02rem; color: var(--pdv-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdv .pdv-filetext span { display: block; font-size: 0.82rem; color: var(--pdv-muted); overflow-wrap: anywhere; }
.pdv .pdv-kind { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; background: var(--pdv-accent-soft); border: 1px solid var(--pdv-accent-line); color: var(--pdv-accent-strong); }
[data-theme="dark"] .pdv .pdv-kind { color: var(--pdv-accent); }
.pdv .pdv-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.pdv .pdv-stat { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--pdv-sunk); border: 1px solid var(--pdv-line); font-size: 0.78rem; color: var(--pdv-text-2); }
.pdv .pdv-stat svg { width: 14px; height: 14px; color: var(--pdv-accent); }
.pdv .pdv-stat strong { color: var(--pdv-text-1); font-variant-numeric: tabular-nums; }
.pdv .pdv-note {
    display: flex; gap: 0.6rem; align-items: center; padding: 0.6rem 0.9rem; margin: 0.75rem 0 0; border-radius: 12px;
    font-size: 0.84rem; line-height: 1.5; color: var(--pdv-text-1); background: rgba(51, 153, 204, 0.08); border: 1px solid rgba(51, 153, 204, 0.3);
}
.pdv .pdv-note > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--pdv-accent); }
.pdv .pdv-note p { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--pdv-text-1); }
.pdv .pdv-note .pdv-text-btn { flex-shrink: 0; }

/* ---------- toolbar ---------- */
.pdv .pdv-toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.pdv .pdv-segs { display: inline-flex; padding: 0.2rem; gap: 0.2rem; border-radius: 10px; background: var(--pdv-sunk); border: 1px solid var(--pdv-line); max-width: 100%; }
.pdv .pdv-segs button { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; width: auto; min-height: 34px; padding: 0.2rem 0.8rem; margin: 0; border: none; border-radius: 8px; background: none; color: var(--pdv-muted); font-size: 0.84rem; font-weight: 700; cursor: pointer; }
.pdv .pdv-segs button svg { width: 16px; height: 16px; }
.pdv .pdv-segs button:hover { color: var(--pdv-text-1); }
.pdv .pdv-segs button.is-active { background: var(--pdv-card); color: var(--pdv-accent-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .pdv .pdv-segs button.is-active { color: var(--pdv-accent); background: #26334a; }
.pdv .pdv-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 0.25rem; height: 40px; padding: 0 0.3rem 0 0.7rem; border-radius: 10px; border: 1px solid var(--pdv-line); background: var(--input-bg, #fff); box-sizing: border-box; }
.pdv .pdv-search:focus-within { border-color: var(--pdv-accent); box-shadow: 0 0 0 3px var(--pdv-accent-soft); }
.pdv .pdv-search > svg { width: 16px; height: 16px; color: var(--pdv-muted); flex-shrink: 0; }
.pdv .pdv-search input { flex: 1; min-width: 0; width: auto; height: 100%; border: none; background: none; outline: none; box-shadow: none; color: var(--pdv-text-1); font-size: 0.9rem; padding: 0; margin: 0; }
.pdv .pdv-search .pdv-icon-btn { width: 30px; height: 30px; }
.pdv .pdv-flag { width: auto; min-width: 28px; height: 26px; padding: 0 0.3rem; margin: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--pdv-muted); font: 700 0.75rem var(--pdv-mono); cursor: pointer; flex-shrink: 0; }
.pdv .pdv-flag:hover { color: var(--pdv-text-1); }
.pdv .pdv-flag[aria-pressed="true"] { border-color: var(--pdv-accent); background: var(--pdv-accent-soft); color: var(--pdv-accent-strong); }
[data-theme="dark"] .pdv .pdv-flag[aria-pressed="true"] { color: var(--pdv-accent); }
.pdv .pdv-search-count { font-size: 0.76rem; color: var(--pdv-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pdv .pdv-search-count.is-none { color: var(--pdv-red); }

.pdv .pdv-tools { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; margin-top: 0.6rem; padding: 0.3rem; border-radius: 12px; background: var(--pdv-sunk); border: 1px solid var(--pdv-line); }
.pdv .pdv-group { display: inline-flex; align-items: center; gap: 0.1rem; }
.pdv .pdv-tool-sep { width: 1px; height: 22px; background: var(--pdv-line); margin: 0 0.25rem; }
.pdv .pdv-tool-spacer { flex: 1; }
.pdv .pdv-zoom-val { min-width: 56px; height: 30px; padding: 0 0.35rem; margin: 0; border: 1px solid var(--pdv-line); border-radius: 8px; background: var(--pdv-card); color: var(--pdv-text-1); font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.pdv .pdv-zoom-val.pdv-static { cursor: default; }
.pdv .pdv-pagenav { gap: 0.35rem; font-size: 0.82rem; color: var(--pdv-muted); }
.pdv .pdv-page-input {
    width: 58px; height: 30px; padding: 0 0.4rem; margin: 0; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--pdv-line);
    background: var(--input-bg, #fff); color: var(--pdv-text-1); font-size: 0.85rem; font-weight: 700; text-align: center; -moz-appearance: textfield;
}
.pdv .pdv-page-input::-webkit-outer-spin-button, .pdv .pdv-page-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdv .pdv-page-total { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- options (collapsed rows) ---------- */
.pdv .pdv-adv { border: 1px solid var(--pdv-line); border-radius: 12px; overflow: hidden; background: var(--pdv-card); margin-top: 0.75rem; }
.pdv .pdv-adv-row + .pdv-adv-row { border-top: 1px solid var(--pdv-line); }
.pdv .pdv-adv-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; min-height: 52px; box-sizing: border-box;
    padding: 0.55rem 1rem; margin: 0; border: none; background: none; cursor: pointer; text-align: left; color: var(--pdv-text-1); font-weight: 400;
}
.pdv .pdv-adv-left { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.pdv .pdv-adv-left > svg { width: 18px; height: 18px; color: var(--pdv-accent); flex-shrink: 0; }
.pdv .pdv-adv-text { display: flex; flex-direction: column; min-width: 0; }
.pdv .pdv-adv-title { font-size: 0.9rem; font-weight: 700; }
.pdv .pdv-adv-hint { font-size: 0.76rem; color: var(--pdv-muted); line-height: 1.35; }
.pdv .pdv-adv-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.pdv .pdv-adv-value {
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.2rem 0.55rem; border-radius: 999px;
    background: var(--pdv-accent-soft); color: var(--pdv-accent-strong); font-size: 0.76rem; font-weight: 700;
}
[data-theme="dark"] .pdv .pdv-adv-value { color: var(--pdv-accent); }
.pdv .pdv-chevron { width: 17px; height: 17px; color: var(--pdv-muted); transition: transform 0.2s; }
.pdv .pdv-adv-row.open .pdv-chevron { transform: rotate(180deg); }
.pdv .pdv-adv-row.open .pdv-adv-head, .pdv .pdv-adv-row.open .pdv-adv-body { background: var(--pdv-open); }
.pdv .pdv-adv-body { padding: 0.2rem 1rem 1rem; }
.pdv .pdv-switch-text { font-size: 0.74rem; font-weight: 800; color: var(--pdv-muted); min-width: 26px; text-align: right; }
.pdv .pdv-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; font-weight: 700; color: var(--pdv-text-2); }
.pdv .pdv-field b { color: var(--pdv-text-1); font-variant-numeric: tabular-nums; }
.pdv .pdv-select { width: 100%; height: 38px; padding: 0 0.5rem; margin: 0; border-radius: 9px; border: 1px solid var(--pdv-line); background: var(--input-bg, #fff); color: var(--pdv-text-1); font-size: 0.85rem; }
.pdv .pdv-range { width: 100%; margin: 0.45rem 0 0; accent-color: var(--pdv-go); }
/* switch - beats the global .tool-container checkbox rules */
.tool-container.pdv input[type="checkbox"].pdv-switch {
    -webkit-appearance: none !important; appearance: none !important; position: relative; flex-shrink: 0;
    width: 40px !important; height: 22px !important; margin: 0 !important; padding: 0 !important;
    border: none !important; border-radius: 999px !important; background: #cbd5e1 !important; box-shadow: none !important; cursor: pointer; transition: background 0.2s;
}
[data-theme="dark"] .tool-container.pdv input[type="checkbox"].pdv-switch { background: #475569 !important; }
.tool-container.pdv input[type="checkbox"].pdv-switch::after, .tool-container.pdv input[type="checkbox"].pdv-switch:checked::after {
    content: '' !important; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; border: none !important;
    background: #fff; transform: none !important; transition: left 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); font-size: 0; line-height: 0;
}
.tool-container.pdv input[type="checkbox"].pdv-switch:checked { background: var(--pdv-go) !important; }
.tool-container.pdv input[type="checkbox"].pdv-switch:checked::after { left: 21px; }
.tool-container.pdv input[type="checkbox"].pdv-switch:focus-visible { outline: 3px solid var(--pdv-accent-line); outline-offset: 2px; }
.pdv .pdv-adv-row.is-off { opacity: 0.55; }

.pdv .pdv-resume { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; padding: 0.4rem 0.5rem 0.4rem 0.8rem; border-radius: 10px; background: rgba(51, 153, 102, 0.09); border: 1px solid rgba(51, 153, 102, 0.3); font-size: 0.84rem; color: var(--pdv-text-1); }
.pdv .pdv-resume > svg { width: 17px; height: 17px; color: #339966; flex-shrink: 0; }
.pdv .pdv-resume > span { flex: 1; min-width: 0; }

/* ---------- work area: side panel + stage ---------- */
.pdv .pdv-work { display: grid; grid-template-columns: 284px minmax(0, 1fr); gap: 0.75rem; margin-top: 0.75rem; min-width: 0; }
.pdv .pdv-work.no-side { grid-template-columns: minmax(0, 1fr); }
.pdv .pdv-work.no-side .pdv-side { display: none; }
.pdv .pdv-side { display: flex; flex-direction: column; min-width: 0; height: var(--pdv-h, 78vh); max-height: 900px; min-height: 420px; border: 1px solid var(--pdv-line); border-radius: 14px; background: var(--pdv-card); overflow: hidden; box-sizing: border-box; }
.pdv .pdv-side-tabs { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(0, 0.85fr) 38px; border-bottom: 1px solid var(--pdv-line); background: var(--pdv-sunk); }
.pdv .pdv-side-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: 0; height: 40px; padding: 0 0.2rem; margin: 0; border: none; background: none; color: var(--pdv-muted); font-size: 0.76rem; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; }
.pdv .pdv-side-tabs button svg { width: 15px; height: 15px; flex-shrink: 0; }
.pdv .pdv-side-tabs button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdv .pdv-side-tabs button.is-active { color: var(--pdv-accent-strong); border-bottom-color: var(--pdv-accent); background: var(--pdv-card); }
[data-theme="dark"] .pdv .pdv-side-tabs button.is-active { color: var(--pdv-accent); }
.pdv .pdv-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--pdv-go); color: #fff; font-size: 0.68rem; box-sizing: border-box; }
.pdv .pdv-side-pane { flex: 1; min-height: 0; overflow: auto; padding: 0.5rem; }
.pdv .pdv-ol-item { display: block; width: 100%; padding: 0.35rem 0.5rem; margin: 0; border: none; border-radius: 7px; background: none; color: var(--pdv-text-2); font-size: 0.82rem; line-height: 1.35; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.pdv .pdv-ol-item:hover { background: var(--pdv-accent-soft); color: var(--pdv-text-1); }
.pdv .pdv-ol-item.is-cur { background: var(--pdv-accent-soft); color: var(--pdv-accent-strong); font-weight: 700; }
[data-theme="dark"] .pdv .pdv-ol-item.is-cur { color: var(--pdv-accent); }
.pdv .pdv-ol-item[data-l="1"] { font-weight: 700; color: var(--pdv-text-1); }
.pdv .pdv-empty { padding: 0.75rem 0.5rem; font-size: 0.82rem; color: var(--pdv-muted); line-height: 1.5; margin: 0; }
.pdv .pdv-side-h { display: flex; align-items: center; gap: 0.35rem; margin: 0.6rem 0.25rem 0.35rem; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pdv-muted); }
.pdv .pdv-side-h:first-child { margin-top: 0.15rem; }
.pdv .pdv-cm { display: block; width: 100%; box-sizing: border-box; margin: 0 0 0.45rem; padding: 0.55rem 0.65rem; border-radius: 10px; border: 1px solid var(--pdv-line); background: var(--pdv-open); text-align: left; cursor: pointer; color: var(--pdv-text-1); }
.pdv .pdv-cm:hover { border-color: var(--pdv-accent-line); }
.pdv .pdv-cm-head { display: flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; color: var(--pdv-muted); margin-bottom: 0.25rem; }
.pdv .pdv-cm-head b { color: var(--pdv-text-1); font-size: 0.8rem; }
.pdv .pdv-cm-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: #f2c94c; color: #3a2c00; font-size: 0.68rem; font-weight: 800; box-sizing: border-box; }
.pdv .pdv-cm-body { font-size: 0.82rem; line-height: 1.45; color: var(--pdv-text-2); overflow-wrap: anywhere; }
.pdv .pdv-cm-body .pdv-p { margin: 0; }
.pdv .pdv-cm-tag { margin-left: auto; font-size: 0.68rem; font-weight: 700; padding: 0 0.35rem; border-radius: 5px; background: var(--pdv-sunk); }
.pdv .pdv-cm-ins .pdv-cm-n { background: #339966; color: #fff; }
.pdv .pdv-cm-del .pdv-cm-n { background: #e64e4e; color: #fff; }
.pdv .pdv-kv { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 0.15rem 0.6rem; margin: 0 0.25rem 0.5rem; font-size: 0.8rem; line-height: 1.4; }
.pdv .pdv-kv dt { color: var(--pdv-muted); margin: 0; }
.pdv .pdv-kv dd { color: var(--pdv-text-1); margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.pdv .pdv-res { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.25rem; font-size: 0.78rem; color: var(--pdv-text-2); border-bottom: 1px solid var(--pdv-line); }
.pdv .pdv-res:last-child { border-bottom: none; }
.pdv .pdv-res img { width: 34px; height: 34px; object-fit: contain; border-radius: 5px; background: #fff; border: 1px solid var(--pdv-line); flex-shrink: 0; }
.pdv .pdv-res span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdv .pdv-res .pdv-icon-btn { width: 28px; height: 28px; }
.pdv .pdv-bmk { display: flex; align-items: center; gap: 0.25rem; }
.pdv .pdv-bmk .pdv-ol-item { flex: 1; }

.pdv .pdv-stage {
    position: relative; min-width: 0; height: var(--pdv-h, 78vh); max-height: 900px; min-height: 420px; overflow: auto; box-sizing: border-box;
    border: 1px solid var(--pdv-line); border-radius: 14px; background: var(--pdv-desk); overscroll-behavior: contain; scroll-behavior: auto;
}
.pdv .pdv-stage:focus-visible { outline: 3px solid var(--pdv-accent-line); outline-offset: 2px; }
.pdv .pdv-viewer.is-full { position: fixed; inset: 0; z-index: 10000; margin: 0; border-radius: 0; overflow: auto; display: flex; flex-direction: column; }
.pdv .pdv-viewer.is-full .pdv-work { flex: 1; min-height: 0; }
.pdv .pdv-viewer.is-full .pdv-stage, .pdv .pdv-viewer.is-full .pdv-side { height: auto; max-height: none; min-height: 0; }
.pdv .pdv-viewer.is-full .pdv-actionbar, .pdv .pdv-viewer.is-full .pdv-stats { display: none; }
body.pdv-noscroll { overflow: hidden; }

/* ---------- action bar ---------- */
.pdv .pdv-actionbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--pdv-line); }
.pdv .pdv-actionbar .pdv-btn-ghost { min-height: 40px; padding: 0.4rem 0.7rem; font-size: 0.86rem; gap: 0.35rem; }
.pdv .pdv-actionbar .pdv-btn-ghost svg { width: 16px; height: 16px; }
.pdv .pdv-actionbar .pdv-go { margin-left: auto; }

/* toast */
.pdv .pdv-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10003; max-width: calc(100vw - 32px); box-sizing: border-box;
    padding: 0.55rem 1rem; border-radius: 10px; background: #1e293b; color: #fff; font-size: 0.86rem; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); transition: opacity 0.25s; text-align: center;
}
[data-theme="dark"] .pdv .pdv-toast { background: #e2e8f0; color: #0f172a; }
.pdv .pdv-toast.is-out { opacity: 0; }


/* ---------- content ---------- */
.pdv .pdv-info { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.pdv .pdv-info > * { min-width: 0; }
.pdv .pdv-info-card { background: var(--bg-elevated, #fff); border: 1px solid var(--pdv-line); border-radius: var(--radius-md, 12px); padding: 1.4rem 1.5rem; }
.pdv .pdv-info-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.9rem; font-size: 1.25rem; color: var(--pdv-text-1); }
.pdv .pdv-info-card h2 svg { width: 22px; height: 22px; color: var(--pdv-accent); flex-shrink: 0; }
.pdv .pdv-info-card h3 { margin: 1.2rem 0 0.5rem; font-size: 1.05rem; color: var(--pdv-text-1); }
.pdv .pdv-info-card p, .pdv .pdv-info-card li { color: var(--pdv-text-2); line-height: 1.65; font-size: 0.97rem; }
.pdv .pdv-info-card p { margin: 0.8rem 0 0; }
.pdv .pdv-info-card h2 + p { margin-top: 0; }
.pdv .pdv-info a { color: var(--pdv-accent-strong); font-weight: 500; }
[data-theme="dark"] .pdv .pdv-info a { color: var(--pdv-accent); }
.pdv .pdv-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.45rem; }
.pdv .pdv-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.pdv .pdv-feature { padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--pdv-line); background: var(--pdv-open); min-width: 0; }
.pdv .pdv-feature > svg { width: 20px; height: 20px; color: var(--pdv-accent); }
.pdv .pdv-info-card .pdv-feature h3 { margin: 0.35rem 0 0.2rem; font-size: 0.95rem; }
.pdv .pdv-info-card .pdv-feature p { margin: 0; font-size: 0.88rem; line-height: 1.55; }
.pdv .pdv-table-wrap { overflow-x: auto; border: 1px solid var(--pdv-line); border-radius: 10px; margin-top: 0.9rem; }
.pdv .pdv-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 520px; margin: 0; }
.pdv .pdv-table th, .pdv .pdv-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--pdv-line); color: var(--pdv-text-2); vertical-align: top; }
.pdv .pdv-table th { background: var(--pdv-sunk); color: var(--pdv-text-1); font-weight: 700; font-size: 0.82rem; }
.pdv .pdv-table tr:last-child td { border-bottom: none; }
.pdv .pdv-table td:first-child { font-weight: 700; color: var(--pdv-text-1); white-space: nowrap; }
.pdv .pdv-faq .faq-question svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .pdv .pdv-work { grid-template-columns: minmax(0, 1fr); }
    .pdv .pdv-side { height: auto; max-height: 340px; min-height: 0; }
    .pdv .pdv-work.no-side .pdv-side { display: none; }
    .pdv .pdv-work:not(.no-side) .pdv-side { order: 0; }
}
@media (max-width: 600px) {
    .pdv.tool-container { padding: 1.1rem 16px; }
    .pdv .tool-title { font-size: 1.55rem; }
    .pdv .pdv-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .pdv .pdv-title-icon svg { width: 25px; height: 25px; }
    .pdv .tool-description { font-size: 0.98rem; }
    .pdv .pdv-card { padding: 0.85rem; border-radius: 16px; }
    .pdv .pdv-drop { min-height: 160px; }
    .pdv .pdv-hint-text { display: none; }
    .pdv .pdv-sample-row .pdv-seg-btn { flex: 1; justify-content: center; }
    .pdv .pdv-filehead #pdvNew span { display: none; }
    .pdv .pdv-segs { flex: 1; }
    .pdv .pdv-segs button { flex: 1; }
    .pdv .pdv-search { min-width: 0; flex-basis: 100%; order: 3; }
    .pdv .pdv-quick-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pdv .pdv-adv-head { padding: 0.55rem 0.75rem; }
    .pdv .pdv-adv-hint { display: none; }
    .pdv .pdv-tools { gap: 0.1rem; }
    .pdv .pdv-tool-sep { display: none; }
    .pdv .pdv-tools .pdv-icon-btn { width: 32px; }
    .pdv .pdv-zoom-val { min-width: 48px; }
    .pdv .pdv-page-input { width: 46px; }
    .pdv .pdv-stage { height: 70vh; min-height: 360px; border-radius: 12px; }
    .pdv .pdv-actionbar .pdv-go { flex: 1 1 100%; margin-left: 0; order: -1; }
    .pdv .pdv-actionbar .pdv-btn-ghost { flex: 1 1 calc(33% - 0.5rem); padding: 0.45rem 0.4rem; }
    .pdv .pdv-features { grid-template-columns: minmax(0, 1fr); }
    .pdv .pdv-info-card { padding: 1.1rem; }
    .pdv .pdv-stages .pdv-lbl-s { display: none; }
    .pdv .pdv-pstage-line { width: 20px; margin: 0 0.3rem; }
}

/* ============================================================
   Shared extras: small print, recent files, notes
   ============================================================ */
.pdv .pdv-small { margin: 0.6rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--pdv-muted); }
.pdv .pdv-small a { color: var(--pdv-accent-strong); font-weight: 600; }
[data-theme="dark"] .pdv .pdv-small a { color: var(--pdv-accent); }
.pdv .pdv-caption { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 0.45rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pdv-muted); }
.pdv .pdv-caption svg { width: 14px; height: 14px; }
.pdv .pdv-recent { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--pdv-line); }
.pdv .pdv-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pdv .pdv-recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
.pdv .pdv-recent-list li { min-width: 0; margin: 0; padding: 0; }
.pdv .pdv-recent-list button {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; min-width: 0; box-sizing: border-box; margin: 0;
    padding: 0.5rem 0.7rem; border-radius: 10px; border: 1px solid var(--pdv-line); background: var(--pdv-open); color: var(--pdv-text-1); text-align: left; cursor: pointer;
}
.pdv .pdv-recent-list button:hover { border-color: var(--pdv-accent-line); }
.pdv .pdv-recent-name { font-size: 0.86rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdv .pdv-recent-meta { font-size: 0.74rem; color: var(--pdv-muted); }
.pdv .pdv-info-card code { font: 600 0.86em var(--pdv-mono); padding: 0.05rem 0.35rem; border-radius: 5px; background: var(--pdv-sunk); border: 1px solid var(--pdv-line); color: var(--pdv-text-1); }
.pdv .pdv-side-tabs button .pdv-count { flex-shrink: 0; }
.pdv .pdv-warn-row { display: flex; gap: 0.4rem; align-items: flex-start; margin: 0 0.25rem 0.5rem; font-size: 0.78rem; line-height: 1.45; color: var(--pdv-text-2); }
.pdv .pdv-warn-row svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--pdv-warn); margin-top: 1px; }
.pdv .pdv-note.is-warn { background: rgba(180, 83, 9, 0.07); border-color: rgba(180, 83, 9, 0.3); }
.pdv .pdv-note.is-warn > svg { color: var(--pdv-warn); }


/* ============================================================
   PDF additions: password card, side panel, pdf.js stage,
   thumbnails, outline, attachments, page colors, print box.
   ============================================================ */
/* side tabs: Pages / Outline / clip / Info */
.pdv .pdv-side-tabs { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr) 46px minmax(0, 0.85fr); }

/* password */
.pdv .pdv-pass { display: flex; gap: 1rem; align-items: flex-start; }
.pdv .pdv-pass-icon { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--pdv-accent-soft); color: var(--pdv-accent); }
.pdv .pdv-pass-icon svg { width: 26px; height: 26px; }
.pdv .pdv-pass-body { flex: 1; min-width: 0; }
.pdv .pdv-pass-title { margin: 0 0 0.25rem; font-size: 1.15rem; color: var(--pdv-text-1); }
.pdv .pdv-pass-text { margin: 0 0 0.8rem; font-size: 0.9rem; color: var(--pdv-text-2); overflow-wrap: anywhere; }
.pdv .pdv-pass-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0; }
.pdv .pdv-pass-field { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; height: 44px; padding: 0 0.3rem 0 0.8rem; border-radius: 12px; border: 1px solid var(--pdv-line); background: var(--input-bg, #fff); box-sizing: border-box; }
.pdv .pdv-pass-field:focus-within { border-color: var(--pdv-accent); box-shadow: 0 0 0 3px var(--pdv-accent-soft); }
.pdv .pdv-pass-field input { flex: 1; min-width: 0; width: auto; height: 100%; border: none; background: none; outline: none; box-shadow: none; padding: 0; margin: 0; font-size: 0.95rem; color: var(--pdv-text-1); }
.pdv .pdv-pass-bad { margin: 0.6rem 0 0; font-size: 0.86rem; font-weight: 600; color: var(--pdv-red); }
.pdv .pdv-pass.is-shake { animation: pdvShake 0.35s; }
@keyframes pdvShake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* zoom select */
.pdv .pdv-zoom-sel {
    width: 112px; height: 30px; padding: 0 0.4rem; margin: 0; border-radius: 8px; border: 1px solid var(--pdv-line);
    background: var(--pdv-card); color: var(--pdv-text-1); font-size: 0.8rem; font-weight: 700; cursor: pointer; box-sizing: border-box;
}
.pdv .pdv-page-input { width: 52px; }

/* stage: pdf.js needs an absolutely positioned scroll container */
.pdv .pdv-stage { overflow: hidden; }
.pdv .pdv-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; outline: none; }
.pdv .pdv-scroll:focus-visible { box-shadow: inset 0 0 0 3px var(--pdv-accent-line); }
.pdv .pdv-scroll.is-hand { cursor: grab; }
.pdv .pdv-scroll.is-hand.is-dragging { cursor: grabbing; }
.pdv .pdv-scroll.is-hand .textLayer { pointer-events: none; }
.pdv .pdfViewer { padding: 12px 0 20px; }
.pdv .pdfViewer .page { box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 6px 18px rgba(15, 23, 42, 0.08); border: none; margin: 0 auto 14px; background-color: #fff; }
.pdv .pdfViewer.removePageBorders .page { margin-bottom: 14px; }
.pdv .pdfViewer.singlePageView .page { margin: 0 auto; }
.pdv .pdfViewer .spread .page { margin: 0 6px 14px; }
[data-theme="dark"] .pdv .pdfViewer .page { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.pdv .pdfViewer .page .loadingIcon { background: none; }
.pdv .pdfViewer .page .loadingIcon::after { content: ''; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 3px solid rgba(51, 153, 204, 0.25); border-top-color: #3399cc; animation: pdvRot 0.8s linear infinite; }
@keyframes pdvRot { to { transform: rotate(360deg); } }
/* search highlights in the brand colors */
.pdv .textLayer .highlight { --highlight-bg-color: rgba(255, 213, 79, 0.55); --highlight-selected-bg-color: rgba(51, 153, 102, 0.55); }
.pdv .textLayer ::selection { background: rgba(51, 153, 204, 0.35); }
/* page colors */
.pdv .pdv-pages-night .page .canvasWrapper, .pdv .pdv-thumbs.pdv-pages-night canvas { filter: invert(0.9) hue-rotate(180deg) brightness(1.05); }
.pdv .pdv-pages-night .page { background-color: #1f2430 !important; }
.pdv .pdv-pages-sepia .page .canvasWrapper, .pdv .pdv-thumbs.pdv-pages-sepia canvas { filter: sepia(0.38) saturate(1.15) brightness(0.97); }
.pdv .pdv-pages-sepia .page { background-color: #f4ecd8 !important; }

/* pdf.js form checkboxes - beat the global .tool-container checkbox look */
.tool-container.pdv .annotationLayer input[type="checkbox"], .tool-container.pdv .annotationLayer input[type="checkbox"]:checked, .tool-container.pdv .annotationLayer input[type="checkbox"]:hover {
    width: 100% !important; height: 100% !important; margin: 0 !important; border-radius: 0 !important;
    background-color: transparent !important; box-shadow: none !important; vertical-align: top;
}
.tool-container.pdv .annotationLayer input[type="checkbox"]::after, .tool-container.pdv .annotationLayer input[type="checkbox"]:checked::after { content: none !important; display: none !important; }
.tool-container.pdv .annotationLayer :is(input, textarea, select) { font-family: Helvetica, Arial, sans-serif; color: #000; }
.tool-container.pdv .annotationLayer .linkAnnotation > a:hover { background: rgba(51, 153, 204, 0.16); box-shadow: 0 0 0 1px rgba(51, 153, 204, 0.5); }

/* thumbnails */
.pdv .pdv-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.5rem; padding: 0.25rem; }
.pdv .pdv-thumb {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 0; width: 100%; padding: 0.35rem; margin: 0;
    border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--pdv-muted); font-size: 0.74rem; font-weight: 700;
    content-visibility: auto; contain-intrinsic-size: auto 170px;
}
.pdv .pdv-thumb:hover { background: var(--pdv-accent-soft); }
.pdv .pdv-thumb.is-cur { border-color: var(--pdv-accent); color: var(--pdv-accent-strong); background: var(--pdv-accent-soft); }
[data-theme="dark"] .pdv .pdv-thumb.is-cur { color: var(--pdv-accent); }
.pdv .pdv-thumb-box { position: relative; width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18); border-radius: 2px; overflow: hidden; }
.pdv .pdv-thumb-box canvas { display: block; width: 100%; height: 100%; }

/* outline */
.pdv .pdv-ol { list-style: none; margin: 0; padding: 0; }
.pdv .pdv-ol .pdv-ol { padding-left: 0.85rem; }
.pdv .pdv-ol-row { display: flex; align-items: flex-start; gap: 0.1rem; }
.pdv .pdv-ol-tog { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 26px; padding: 0; margin: 0; border: none; background: none; color: var(--pdv-muted); cursor: pointer; flex-shrink: 0; border-radius: 6px; }
.pdv .pdv-ol-tog svg { width: 14px; height: 14px; transition: transform 0.15s; }
.pdv .pdv-ol-tog[aria-expanded="false"] svg { transform: rotate(-90deg); }
.pdv .pdv-ol-tog:hover { background: var(--pdv-accent-soft); color: var(--pdv-text-1); }
.pdv .pdv-ol-pad { width: 22px; flex-shrink: 0; }
.pdv .pdv-ol-row .pdv-ol-item { flex: 1; min-width: 0; display: flex; gap: 0.4rem; align-items: baseline; }
.pdv .pdv-ol-item .pdv-ol-t { flex: 1; min-width: 0; }
.pdv .pdv-ol-item .pdv-ol-pg { flex-shrink: 0; font-size: 0.72rem; color: var(--pdv-muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.pdv .pdv-ol-item.is-b { font-weight: 700; color: var(--pdv-text-1); }
.pdv .pdv-ol-item.is-i { font-style: italic; }
.pdv .pdv-ol-item svg { width: 13px; height: 13px; flex-shrink: 0; align-self: center; color: var(--pdv-accent); }

/* attachments */
.pdv .pdv-att { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--pdv-line); }
.pdv .pdv-att:last-child { border-bottom: none; }
.pdv .pdv-att > svg { width: 18px; height: 18px; color: var(--pdv-accent); flex-shrink: 0; }
.pdv .pdv-att-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pdv .pdv-att-text b { font-size: 0.82rem; color: var(--pdv-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdv .pdv-att-text span { font-size: 0.74rem; color: var(--pdv-muted); overflow-wrap: anywhere; }
.pdv .pdv-att .pdv-icon-btn { width: 30px; height: 30px; }
.pdv .pdv-fonts { margin: 0 0.25rem 0.5rem; }
.pdv .pdv-font { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--pdv-line); font-size: 0.78rem; color: var(--pdv-text-2); }
.pdv .pdv-font:last-child { border-bottom: none; }
.pdv .pdv-font b { color: var(--pdv-text-1); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pdv .pdv-font span { flex-shrink: 0; color: var(--pdv-muted); white-space: nowrap; }
.pdv .pdv-font span.is-miss { color: var(--pdv-warn); }
.pdv .pdv-side-pane .pdv-text-btn { margin: 0 0 0.4rem 0.15rem; }

/* filled form save button */
.pdv .pdv-actionbar .pdv-btn-save { border-color: rgba(51, 153, 102, 0.5); color: #2f855a; background: rgba(51, 153, 102, 0.08); }
[data-theme="dark"] .pdv .pdv-actionbar .pdv-btn-save { color: #4ade80; }

body.pdv-dragging .pdv .pdv-drop { border-color: var(--pdv-accent); background: rgba(51, 153, 204, 0.16); }

@media (max-width: 900px) {
    .pdv .pdv-side { max-height: 300px; }
    .pdv .pdv-thumbs { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}
@media (max-width: 600px) {
    .pdv .pdv-wide-only { display: none; }
    .pdv .pdv-zoom-sel { width: 92px; }
    .pdv .pdv-pass { flex-direction: column; }
    .pdv .pdv-pass-form .pdv-btn { flex: 1; }
    .pdv .pdv-segs button { padding: 0.2rem 0.4rem; white-space: nowrap; }
    .pdv .pdv-segs button svg { display: none; }
    .pdv .pdfViewer { padding: 8px 0 14px; }
}

/* print: only page images (#pdvPrintBox is added to <body> while printing) */
#pdvPrintBox { display: none; }
@media print {
    @page { margin: 0; }
    body.pdv-printing > *:not(#pdvPrintBox) { display: none !important; }
    body.pdv-printing { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    body.pdv-printing #pdvPrintBox { display: block !important; }
    #pdvPrintBox .pdv-print-page { width: 100%; height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; break-after: page; page-break-after: always; }
    #pdvPrintBox .pdv-print-page:last-child { break-after: auto; page-break-after: auto; }
    #pdvPrintBox img { display: block; max-width: 100%; max-height: 100%; }
}
