/* pdf-page-numbers.css – Add Page Numbers to PDF (loaded after /assets/css/site.css). */

/* Liberation fonts (SIL OFL, see /assets/fonts/editor/LICENSE-Liberation.txt): same widths as the PDF standard fonts */
@font-face { font-family: "PE Sans"; src: url(/assets/fonts/editor/pe-sans-regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PE Sans"; src: url(/assets/fonts/editor/pe-sans-bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PE Sans"; src: url(/assets/fonts/editor/pe-sans-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "PE Sans"; src: url(/assets/fonts/editor/pe-sans-bolditalic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "PE Serif"; src: url(/assets/fonts/editor/pe-serif-regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PE Serif"; src: url(/assets/fonts/editor/pe-serif-bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PE Serif"; src: url(/assets/fonts/editor/pe-serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "PE Serif"; src: url(/assets/fonts/editor/pe-serif-bolditalic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "PE Mono"; src: url(/assets/fonts/editor/pe-mono-regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PE Mono"; src: url(/assets/fonts/editor/pe-mono-bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PE Mono"; src: url(/assets/fonts/editor/pe-mono-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "PE Mono"; src: url(/assets/fonts/editor/pe-mono-bolditalic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

.pn { --pn-line: #e2e8f0; --pn-ink: #1a202c; --pn-muted: #4a5568; --pn-soft: #718096; --pn-bg: #eef2f7; --pn-acc: var(--accent, #3666d1); --pn-acc-soft: var(--accent-soft, #eef3fc);
      position: relative; max-width: 1300px; margin: 0 auto 2.5rem; padding: 0 12px; }
.pn [hidden] { display: none !important; }

.pn-start { max-width: 860px; margin: 0 auto; }
.pn.is-loaded .pn-start { display: none; }
.pn-start-points { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; margin: .9rem 0 0; padding: 0; list-style: none; color: var(--pn-muted); font-size: .9rem; }
.pn-start-points li::before { content: "✓ "; color: #38a169; font-weight: 700; }
.pn-error { max-width: 860px; margin: .8rem auto 0; padding: .75rem 1rem; border: 1px solid #feb2b2; border-radius: 10px; background: #fff5f5; color: #9b2c2c; }

/* workspace: preview | settings */
.pn-work { display: none; height: calc(100vh - var(--header-h, 64px) - 24px); min-height: 600px; border: 1px solid var(--pn-line); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 8px 30px rgba(15, 23, 42, .08); scroll-margin-top: calc(var(--header-h, 64px) + 12px); }
.pn.is-loaded .pn-work { display: flex; }
.pn-previewcol { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--pn-bg); }
.pn-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--pn-line); }
.pn-tb { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #2d3748; cursor: pointer; }
.pn-tb svg { width: 20px; height: 20px; }
.pn-tb:hover:not(:disabled) { background: #f1f5f9; }
.pn-tb:disabled { opacity: .35; cursor: default; }
.pn-filename { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; color: var(--pn-soft); }
.pn-nav { display: flex; align-items: center; gap: 4px; font-size: .86rem; color: var(--pn-muted); }
.pn-pageinput { width: 52px; height: 32px; padding: 0 4px; border: 1px solid #cbd5e0; border-radius: 7px; text-align: center; font: inherit; }
.pn-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
.pn-sheet { position: relative; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .18), 0 8px 24px rgba(15, 23, 42, .1); flex: none; }
.pn-sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pn-sheet.is-skipped { opacity: .75; }
.pn-pagenote { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: #1a202c; color: #fff; font-size: .8rem; white-space: nowrap; }
.pn-hint { margin: 0; padding: 0 12px 10px; text-align: center; font-size: .8rem; color: var(--pn-soft); }

.pn-panel { width: 330px; flex: none; overflow-y: auto; border-left: 1px solid var(--pn-line); background: #fff; display: flex; flex-direction: column; }
.pn-sec { padding: 14px 16px; border-bottom: 1px solid var(--pn-line); display: flex; flex-direction: column; gap: 12px; }
.pn-f { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--pn-muted); }
.pn-f small { display: block; margin-top: 2px; font-weight: 400; color: var(--pn-soft); }
.pn-f output { color: var(--pn-ink); font-variant-numeric: tabular-nums; }
.pn-f select, .pn-f input[type=text], .pn-f input[type=number] { min-height: 36px; padding: 6px 9px; border: 1px solid #cbd5e0; border-radius: 8px; background: #fff; font: inherit; font-weight: 500; color: var(--pn-ink); }
.pn-f input[type=range] { width: 100%; accent-color: var(--pn-acc); }
.pn-row2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.pn-seg { display: flex; border: 1px solid #cbd5e0; border-radius: 9px; overflow: hidden; }
.pn-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 0; border-right: 1px solid #e2e8f0; background: #fff; font: inherit; font-size: .84rem; font-weight: 600; color: #2d3748; cursor: pointer; }
.pn-seg button:last-child { border-right: 0; }
.pn-seg button svg { width: 17px; height: 17px; }
.pn-seg button.is-on { background: var(--pn-acc-soft); color: var(--accent-dark, #2b4c94); }
.pn-seg-sm button { min-width: 38px; flex: none; }
.pn-inks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pn-ink { width: 28px; height: 28px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px #cbd5e0; cursor: pointer; }
.pn-ink.is-on { box-shadow: 0 0 0 2px var(--pn-acc); }
.pn-inks input[type=color] { width: 34px; height: 30px; padding: 2px; border: 1px solid #cbd5e0; border-radius: 8px; background: #fff; cursor: pointer; }
.pn-check { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--pn-muted); cursor: pointer; }
.pn-check input { width: 17px; height: 17px; accent-color: var(--pn-acc); }
.pn-note { margin: 0; font-size: .78rem; line-height: 1.45; color: var(--pn-soft); }
.pn-foot { position: sticky; bottom: 0; margin-top: auto; padding: 14px 16px; background: #fff; border-top: 1px solid var(--pn-line); display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.pn-download { height: 46px; border: 0; border-radius: 10px; background: var(--brand, #3666d1); color: #fff; font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pn-download svg { width: 19px; height: 19px; }
.pn-download:hover:not(:disabled) { background: var(--brand-dark, #2b4c94); }
.pn-download:disabled { opacity: .45; cursor: default; }
.pn-summary { margin: 0; text-align: center; font-size: .8rem; color: var(--pn-soft); }
.pn-link { align-self: center; border: 0; background: none; font: inherit; font-size: .78rem; color: var(--pn-soft); text-decoration: underline; cursor: pointer; }

.pn-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3100; max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 10px; background: #1a202c; color: #fff; font-size: .9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.pn-toast.is-warn { background: #9b2c2c; }
.pn-busy { position: fixed; inset: 0; z-index: 3200; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .7); }
.pn-busy span { padding: 14px 20px; border-radius: 12px; background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .15); font-weight: 600; color: var(--pn-ink); display: flex; align-items: center; gap: 10px; }
.pn-busy span::before { content: ""; width: 18px; height: 18px; border: 3px solid #cbd5e0; border-top-color: var(--pn-acc); border-radius: 50%; animation: pn-spin .8s linear infinite; }
@keyframes pn-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .pn { padding: 0; }
    .pn-work { flex-direction: column; height: auto; min-height: 0; border-radius: 0; border-left: 0; border-right: 0; overflow: visible; }
    .pn-stage { height: 62vh; min-height: 340px; flex: none; padding: 12px; }
    .pn-panel { width: auto; border-left: 0; border-top: 1px solid var(--pn-line); overflow: visible; }
    .pn-foot { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 16px rgba(15, 23, 42, .08); }
}

/* page-number specific */
.pn-f input[type=number] { width: 100%; }
.pn-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pn-pos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px; border: 1px solid #cbd5e0; border-radius: 10px; background: #f8fafc; }
.pn-pos-gap { grid-column: 1 / -1; height: 34px; margin: 2px 6px; border: 1px dashed #cbd5e0; border-radius: 6px; background: repeating-linear-gradient(180deg, transparent 0 7px, #e2e8f0 7px 8px); }
.pn-pos button { height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; font: inherit; font-size: .72rem; font-weight: 700; color: var(--pn-soft); cursor: pointer; }
.pn-pos button i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; padding: 0 4px; border-radius: 4px; background: #e2e8f0; color: #4a5568; }
.pn-pos button.is-on { border-color: var(--pn-acc); background: var(--pn-acc-soft); }
.pn-pos button.is-on i { background: var(--pn-acc); color: #fff; }
.pn-fmts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pn-fmt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 44px; padding: 6px 10px; border: 1px solid #cbd5e0; border-radius: 9px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.pn-fmt span { font-size: .9rem; font-weight: 700; color: var(--pn-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pn-fmt small { font-size: .7rem; color: var(--pn-soft); }
.pn-fmt.is-on { border-color: var(--pn-acc); background: var(--pn-acc-soft); box-shadow: inset 0 0 0 1px var(--pn-acc); }
.pn-custom-row { display: none; }
.pn[data-format=custom] .pn-custom-row { display: flex; }
.pn-digits-row { display: none; }
.pn[data-style=arabic] .pn-digits-row { display: flex; }
.pn-quick { align-self: flex-start; height: 30px; padding: 0 12px; border: 1px solid #cbd5e0; border-radius: 999px; background: #fff; font: inherit; font-size: .78rem; font-weight: 600; color: var(--pn-muted); cursor: pointer; }
.pn-quick:hover { border-color: var(--pn-acc); color: var(--accent-dark, #2b4c94); }
.pn-warn { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fffaf0; border: 1px solid #fbd38d; color: #7b341e; font-size: .78rem; line-height: 1.4; }
.pn-sheet.is-skipped { opacity: .8; }
.pn-check { flex-wrap: wrap; line-height: 1.35; }
.pn-check small { font-weight: 400; color: var(--pn-soft); }
.pn-row2 { align-items: end; }
.pn-ink[data-ink="#ffffff"] { box-shadow: 0 0 0 1px #94a3b8; }
/* inside the Android app the bottom tab bar is fixed; keep the download button above it */
html.app-mode .pn-foot { bottom: calc(var(--apx-tabs, 62px) + env(safe-area-inset-bottom, 0px)); }
html.app-mode .pn-toast { bottom: calc(var(--apx-tabs, 62px) + 16px); }
/* custom position: drag on the preview */
.pn-pos-custom { grid-column: 1 / -1; gap: 6px; font-size: .8rem !important; color: var(--pn-muted) !important; }
.pn-pos-custom svg { width: 16px; height: 16px; }
.pn-pos button.pn-pos-custom.is-on { color: var(--accent-dark, #2b4c94) !important; }
.pn-overlay { cursor: crosshair; outline: none; }
.pn-overlay:focus-visible { box-shadow: inset 0 0 0 2px var(--pn-acc); }
.pn[data-pos=custom] .pn-overlay { touch-action: none; }
.pn-sheet.is-dragging .pn-overlay { cursor: grabbing !important; }
.pn[data-pos=custom] .pn-not-custom, .pn:not([data-pos=custom]) .pn-only-custom { display: none !important; }
