/* Print & Fold PB Maker page */
.pf-page,
.pf-sheet-modal {
    --pf-accent: var(--accent-primary);
    --pf-accent-strong: var(--accent-hover);
    --pf-warm: var(--accent-secondary);
    --pf-line: rgba(50, 16, 79, 0.1);
    --pf-shadow: rgba(50, 16, 79, 0.1);
    --pf-tint: rgba(109, 40, 217, 0.07);
    --pf-tint-strong: rgba(109, 40, 217, 0.15);
    --pf-warm-tint: rgba(249, 115, 22, 0.1);
    --pf-art: #ece6f8;
    --pf-page-aspect: 0.8;
    --pf-book-aspect: 1.6;
}

/* Follow the site palette (including seasonal themes) where color-mix exists. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
    .pf-page,
    .pf-sheet-modal {
        --pf-line: color-mix(in srgb, var(--accent-dark) 11%, transparent);
        --pf-shadow: color-mix(in srgb, var(--accent-dark) 12%, transparent);
        --pf-tint: color-mix(in srgb, var(--accent-primary) 7%, transparent);
        --pf-tint-strong: color-mix(in srgb, var(--accent-primary) 15%, transparent);
        --pf-warm-tint: color-mix(in srgb, var(--accent-secondary) 11%, transparent);
        --pf-art: color-mix(in srgb, var(--accent-primary) 12%, white);
    }
}

.pf-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── Tool card ── */
#maker {
    scroll-margin-top: 96px;
}

.pf-tool .page-header {
    margin-bottom: 18px;
}

.pf-tool .page-header p {
    margin: 0;
    color: var(--text-secondary);
}

.pf-tool .page-header p + p {
    margin-top: 10px;
}

.pf-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 30px;
    padding: 10px 18px;
    color: var(--text-primary);
    background: var(--pf-tint);
    border: 1px solid var(--pf-line);
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.4;
}

.pf-privacy svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--pf-accent);
}

.pf-workspace {
    margin-top: 40px;
}

/* One step after another, top to bottom. */
.pf-workspace > .pf-step + .pf-step {
    margin-top: 44px;
}

.pf-step__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-size: 1.25rem;
    line-height: 1.3;
}

.pf-step__num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-strong));
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 5px 12px var(--pf-tint-strong);
}

.pf-step__intro {
    max-width: 760px;
    margin: -4px 0 18px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ── Choosing a file ── */
.pf-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 220px;
    padding: 32px 24px;
    color: var(--pf-accent);
    text-align: center;
    background: linear-gradient(180deg, #ffffff, var(--pf-tint));
    border: 2px dashed var(--pf-tint-strong);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.pf-dropzone:hover,
.pf-dropzone:focus-within,
body.pf-dragging .pf-dropzone {
    border-color: var(--pf-accent);
    background: var(--pf-tint);
}

body.pf-dragging .pf-dropzone {
    transform: scale(1.01);
}

.pf-dropzone:focus-within {
    outline: 3px solid var(--pf-tint-strong);
    outline-offset: 3px;
}

.pf-dropzone[hidden],
.pf-file-bar[hidden],
.pf-progress[hidden],
.pf-error[hidden],
.pf-workspace[hidden],
.pf-notes[hidden] {
    display: none;
}

.pf-dropzone__icon {
    width: 56px;
    height: 56px;
}

.pf-dropzone__title {
    color: var(--text-primary);
    font-family: var(--font-headings);
    font-size: 1.2rem;
    font-weight: 700;
}

.pf-dropzone__browse {
    color: var(--pf-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pf-dropzone__hint {
    max-width: 420px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.pf-file-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--pf-accent);
    background: var(--pf-tint);
    border: 1px solid var(--pf-line);
    border-radius: var(--border-radius-sm);
}

body.pf-dragging .pf-file-bar {
    outline: 2px dashed var(--pf-accent);
    outline-offset: 3px;
}

.pf-file-bar__icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
}

.pf-file-bar__text {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.pf-file-bar__text strong {
    overflow: hidden;
    color: var(--text-primary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-file-bar__text span {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.btn.pf-btn-small {
    padding: 8px 16px;
    font-size: 0.95rem;
}

.pf-progress {
    margin-top: 14px;
}

.pf-progress__track {
    height: 8px;
    overflow: hidden;
    background: var(--pf-tint);
    border-radius: 999px;
}

.pf-progress__bar {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--pf-accent), var(--pf-warm));
    border-radius: inherit;
    transition: width 0.25s ease;
}

.pf-progress__text {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.pf-error {
    margin: 14px 0 0;
    padding: 12px 16px;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
}

/* ── Settings ── */
.pf-detect {
    margin: -4px 0 16px;
    padding: 12px 14px;
    color: var(--text-primary);
    background: var(--pf-warm-tint);
    border-radius: var(--border-radius-sm);
    font-size: 0.96rem;
    line-height: 1.55;
}

.pf-layout-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
}

.pf-layout-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: #ffffff;
    border: 2px solid var(--pf-line);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.pf-layout-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pf-layout-card:hover {
    border-color: var(--pf-tint-strong);
}

.pf-layout-card:has(input:checked) {
    background: var(--pf-tint);
    border-color: var(--pf-accent);
    box-shadow: 0 6px 16px var(--pf-tint-strong);
}

.pf-layout-card:has(input:focus-visible) {
    outline: 3px solid var(--pf-tint-strong);
    outline-offset: 3px;
}

.pf-layout-card__art {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    height: 46px;
    margin-bottom: 4px;
}

.pf-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: #ffffff;
    border: 1.5px solid #cfc7de;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.pf-mini--page {
    width: 30px;
    height: 40px;
}

.pf-mini--spread {
    width: 62px;
    height: 40px;
}

.pf-mini--spread span {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.pf-mini--spread span + span {
    border-left: 1.5px dashed var(--pf-warm);
}

.pf-layout-card:has(input:checked) .pf-mini {
    border-color: var(--pf-accent);
    color: var(--pf-accent);
}

/* Binding choices: a glue line down the fold, or staples beside it. */
.pf-mini--glue {
    width: 76px;
}

.pf-mini--glue span + span {
    border-left: 3px solid var(--pf-warm);
}

.pf-mini--stapled {
    position: relative;
    width: 36px;
}

.pf-mini--stapled i {
    position: absolute;
    left: 5px;
    width: 3px;
    height: 9px;
    background: #8b929c;
    border-radius: 1px;
}

.pf-mini--stapled i:first-child {
    top: 7px;
}

.pf-mini--stapled i:last-child {
    bottom: 7px;
}

.pf-layout-card__title {
    color: var(--text-primary);
    font-family: var(--font-headings);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.pf-layout-card__desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.pf-stepper-row,
.pf-setup-check {
    margin-top: 16px;
    padding: 14px 0 0;
    border-top: 1px solid var(--pf-line);
}

.pf-stepper-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
}

.pf-stepper-row[hidden] {
    display: none;
}

.pf-stepper-row__text {
    display: flex;
    flex: 1 1 160px;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

/* One label style for every setting and check in the steps. */
.pf-stepper-row__label,
.pf-row-label {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.pf-stepper-row__desc,
.pf-row-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.pf-setup-check .pf-row-desc {
    margin-top: 3px;
}

.pf-setup-check .pf-strip {
    margin-top: 10px;
}

.pf-stepper {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--pf-tint);
    border-radius: 999px;
}

.pf-stepper button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--pf-accent);
    background: #ffffff;
    border: 1px solid var(--pf-line);
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pf-stepper button:hover:not(:disabled) {
    color: #ffffff;
    background: var(--pf-accent);
}

.pf-stepper button:focus-visible {
    outline: 3px solid var(--pf-tint-strong);
    outline-offset: 2px;
}

.pf-stepper button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pf-stepper output {
    min-width: 28px;
    color: var(--text-primary);
    font-family: var(--font-headings);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.pf-select {
    min-width: 220px;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 36px 8px 12px;
    color: var(--text-primary);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236c757d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px,
        #ffffff;
    border: 1px solid #d4cde2;
    border-radius: var(--border-radius-sm);
    font: inherit;
    font-size: 0.95rem;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.pf-select:focus-visible {
    border-color: var(--pf-accent);
    outline: 3px solid var(--pf-tint-strong);
    outline-offset: 1px;
}

/* Paper size and marks sit with the print sheets they change. */
.pf-sheet-options {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 28px;
    margin-bottom: 18px;
}

.pf-sheet-options__paper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pf-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.pf-check input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--pf-accent);
    cursor: pointer;
}

/* ── Book pages (shared by the flipbook and the reading strip) ── */
.pf-face {
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

.pf-face::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.pf-face--right::after {
    background: linear-gradient(90deg, rgba(30, 20, 50, 0.16), rgba(30, 20, 50, 0.04) 6%, transparent 14%);
}

.pf-face--left::after {
    background: linear-gradient(270deg, rgba(30, 20, 50, 0.16), rgba(30, 20, 50, 0.04) 6%, transparent 14%);
}

.pf-art {
    position: absolute;
    overflow: hidden;
    background: #ffffff;
}

.pf-art img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    -webkit-user-select: none;
    user-select: none;
}

.pf-art .pf-art__img--left,
.pf-art .pf-art__img--right {
    width: 200%;
}

.pf-art .pf-art__img--right {
    left: -100%;
}

.pf-art.is-loading {
    background: linear-gradient(110deg, #f4f1f9 30%, #ebe6f4 50%, #f4f1f9 70%) 0 0 / 300% 100%;
    animation: pfShimmer 1.4s linear infinite;
}

.pf-art.is-loading img {
    visibility: hidden;
}

@keyframes pfShimmer {
    to {
        background-position: -150% 0;
    }
}

/* ── Flipbook ── */
.pf-flipbook {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3vw, 28px) clamp(10px, 2vw, 20px);
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 22% at 50% 92%, rgba(30, 20, 50, 0.16), transparent 70%),
        linear-gradient(180deg, #ffffff, var(--pf-tint));
    border: 1px solid var(--pf-line);
    border-radius: var(--border-radius-sm);
}

.pf-flipbook:focus-visible {
    outline: 3px solid var(--pf-tint-strong);
    outline-offset: 3px;
}

.pf-flipbook__book {
    position: relative;
    width: min(100%, 880px, calc(46vh * var(--pf-book-aspect)));
    aspect-ratio: var(--pf-book-aspect);
    perspective: 2400px;
    cursor: pointer;
    transition: transform 0.7s cubic-bezier(0.45, 0.05, 0.25, 1);
}

.pf-flipbook__book.is-closed-front {
    transform: translateX(-25%);
}

.pf-flipbook__book.is-closed-back {
    transform: translateX(25%);
}

/* One shadow per stack of pages. A shadow on every leaf would pile up
   into a dark halo, since all the leaves on a side sit on top of each other. */
.pf-flipbook__book::before,
.pf-flipbook__book::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(30, 20, 50, 0.14), 0 10px 22px rgba(30, 20, 50, 0.16);
    transition: opacity 0.3s ease;
}

.pf-flipbook__book::before {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.pf-flipbook__book::after {
    right: 0;
    border-radius: 0 3px 3px 0;
}

.pf-flipbook__book.is-closed-front::before,
.pf-flipbook__book.is-closed-back::after {
    opacity: 0;
    transition-delay: 0.45s;
}

.pf-leaf {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.45, 0.05, 0.25, 1);
}

.pf-leaf.is-turned {
    transform: rotateY(-180deg);
}

.pf-leaf.is-buried {
    visibility: hidden;
}

.pf-leaf .pf-face {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.pf-leaf .pf-leaf__back {
    transform: rotateY(180deg);
}

/* Side staples on the covers when a stapling gutter is on (preview only). */
.pf-staple {
    position: absolute;
    width: 3px;
    height: 11%;
    background: linear-gradient(90deg, #8b929c, #eef0f3 50%, #8b929c);
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(30, 20, 50, 0.3);
    transform: translateX(-50%);
}

.pf-face--left .pf-staple {
    transform: translateX(50%);
}

.pf-flip-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.pf-flip-controls__label {
    min-width: 128px;
    color: var(--text-primary);
    font-family: var(--font-headings);
    font-weight: 700;
    text-align: center;
}

.pf-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--pf-accent);
    background: #ffffff;
    border: 1px solid var(--pf-line);
    border-radius: 50%;
    box-shadow: 0 2px 6px var(--pf-shadow);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.pf-icon-btn svg {
    width: 20px;
    height: 20px;
}

.pf-icon-btn:hover:not(:disabled) {
    color: #ffffff;
    background: var(--pf-accent);
}

.pf-icon-btn:focus-visible {
    outline: 3px solid var(--pf-tint-strong);
    outline-offset: 2px;
}

.pf-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pf-icon-btn--play {
    margin-left: 6px;
}

.pf-icon-btn--play .pf-icon-pause,
.pf-icon-btn--play.is-playing .pf-icon-play {
    display: none;
}

.pf-icon-btn--play.is-playing .pf-icon-pause {
    display: block;
}

/* ── Reading strip ── */
.pf-strip {
    position: relative;
    display: flex;
    gap: 6px;
    padding: 4px 2px 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.pf-strip__item {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 4px;
    color: var(--text-secondary);
}

.pf-strip__spread {
    display: flex;
    height: 58px;
    box-shadow: 0 2px 6px rgba(30, 20, 50, 0.16);
}

.pf-strip__spread .pf-face {
    height: 100%;
    aspect-ratio: var(--pf-page-aspect);
}

.pf-strip__label {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.pf-summary {
    margin: 12px 0 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

.pf-notes {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--pf-warm-tint);
    border-radius: var(--border-radius-sm);
}

.pf-notes p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.5;
}

.pf-notes p + p {
    margin-top: 6px;
}

/* ── Print sheets ── */
.pf-sheets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.pf-sheet-card {
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--pf-line);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 6px 16px var(--pf-shadow);
}

.pf-sheet-card__title {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 1rem;
}

.pf-sheet-card__title span {
    color: var(--text-secondary);
    font-weight: 600;
}

.pf-sheet-card__sides {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pf-sheet-side {
    margin: 0;
}

.pf-sheet-side figcaption {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.3;
    text-align: center;
}

.pf-sheet-side figcaption strong {
    color: var(--text-primary);
}

.pf-sheet {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #d8d1e4;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(30, 20, 50, 0.1);
    font: inherit;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pf-sheet:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(30, 20, 50, 0.16);
}

.pf-sheet:focus-visible {
    outline: 3px solid var(--pf-tint-strong);
    outline-offset: 2px;
}

.pf-sheet__page {
    position: absolute;
    box-shadow: inset 0 0 0 1px rgba(30, 20, 50, 0.08);
}

.pf-sheet__page.is-blank {
    background: repeating-linear-gradient(135deg, rgba(30, 20, 50, 0.05) 0 5px, transparent 5px 10px);
}

.pf-sheet__badge {
    position: absolute;
    bottom: 4%;
    padding: 1px 6px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.94);
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(30, 20, 50, 0.25);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.4;
}

.pf-sheet__badge--left {
    left: 4%;
}

.pf-sheet__badge--right {
    right: 4%;
}

.pf-sheet__fold {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px dashed rgba(30, 20, 50, 0.14);
    pointer-events: none;
}

.pf-sheet__mark {
    position: absolute;
    height: 1px;
    background: #6b6478;
    pointer-events: none;
}

.pf-sheet__mark.is-vertical {
    width: 1px;
}

.pf-sheet__mark.is-fold {
    background: repeating-linear-gradient(180deg, #8d869a 0 2px, transparent 2px 4px);
}

/* ── Download ── */
.pf-print-note {
    max-width: 760px;
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}

.pf-download__action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 20px;
}

.pf-download__action .btn {
    padding: 15px 28px;
}

.pf-download__action .btn:disabled {
    opacity: 0.7;
    cursor: progress;
    transform: none;
}

.pf-download__status {
    flex: 1 1 260px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.pf-download__status:empty {
    display: none;
}

/* ── Fold and bind ── */
.pf-assembly {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pf-assembly__item {
    padding: 0 18px 18px;
    background: #ffffff;
    border: 1px solid var(--pf-line);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 6px 16px var(--pf-shadow);
}

.pf-assembly__art {
    margin: 0 -18px 4px;
    padding: 8px 32px 0;
    background: linear-gradient(180deg, var(--pf-tint), rgba(255, 255, 255, 0));
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.pf-assembly__item h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    line-height: 1.3;
}

.pf-assembly__item p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.55;
}

.pf-assembly__trim {
    margin: 14px 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.pf-ill {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

.pf-ill-paper {
    fill: #ffffff;
    stroke: #c7bfd6;
    stroke-width: 2;
    stroke-linejoin: round;
}

.pf-ill-art {
    fill: var(--pf-art);
}

.pf-ill-sun {
    fill: #fbbf24;
}

.pf-ill-hill {
    fill: #86c98a;
}

.pf-ill-fold {
    stroke: var(--pf-accent);
    stroke-width: 2;
    stroke-dasharray: 5 5;
}

.pf-ill-sheet {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pf-ill-sheet--1 {
    stroke: var(--pf-accent);
}

.pf-ill-sheet--2 {
    stroke: var(--pf-warm);
}

.pf-ill-sheet--3 {
    stroke: #6fbf73;
}

.pf-ill-glue {
    stroke: var(--pf-warm);
    stroke-width: 5;
    stroke-linecap: round;
    opacity: 0.85;
}

.pf-ill-stick-body {
    fill: var(--pf-accent);
}

.pf-ill-staple {
    fill: #9aa1ab;
    stroke: #6b7280;
    stroke-width: 1;
}

.pf-ill-stick-cap {
    fill: #ffffff;
    stroke: var(--pf-accent);
    stroke-width: 2;
}

.pf-ill-slide {
    animation: pfSlideIn 3.2s ease-in-out infinite alternate;
}

.pf-ill-stick {
    animation: pfGlue 2.8s ease-in-out infinite alternate;
}

@keyframes pfSlideIn {
    0%,
    15% {
        transform: translateX(34px);
        opacity: 0.35;
    }

    85%,
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pfGlue {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(58px);
    }
}

/* ── Troubleshooting ── */
.pf-troubleshooting {
    margin-top: 36px;
    padding-top: 26px;
    border-top: 1px solid var(--pf-line);
}

.pf-troubleshooting__title {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.pf-troubleshooting dl {
    margin: 0;
}

.pf-troubleshooting dt {
    color: var(--text-primary);
    font-weight: 700;
}

.pf-troubleshooting dd {
    margin: 2px 0 16px;
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.55;
}

.pf-troubleshooting dd:last-child {
    margin-bottom: 0;
}

/* ── Enlarged sheet ── */
body.modal-open {
    overflow: hidden;
}

.pf-sheet-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4vw, 48px);
    background: rgba(6, 12, 24, 0.9);
}

.pf-sheet-modal[hidden] {
    display: none;
}

.pf-sheet-modal__figure {
    width: min(100%, 1100px, calc((100vh - 140px) * 1.4));
    margin: 0;
}

.pf-sheet-modal__frame .pf-sheet {
    cursor: default;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.pf-sheet-modal__frame .pf-sheet:hover {
    transform: none;
}

.pf-sheet-modal__frame .pf-sheet__badge {
    font-size: 0.85rem;
}

.pf-sheet-modal figcaption {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

.pf-sheet-modal__close {
    position: fixed;
    top: clamp(14px, 3vw, 26px);
    right: clamp(14px, 3vw, 26px);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.pf-sheet-modal__close:hover,
.pf-sheet-modal__close:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: 3px solid rgba(255, 255, 255, 0.32);
    outline-offset: 3px;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .pf-assembly {
        grid-template-columns: minmax(0, 1fr);
    }

    .pf-assembly__art {
        padding-inline: 25%;
    }
}

@media (max-width: 640px) {
    .pf-privacy {
        border-radius: var(--border-radius-sm);
        font-size: 0.92rem;
    }

    .pf-layout-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .pf-stepper-row {
        align-items: flex-start;
    }

    .pf-sheets {
        grid-template-columns: minmax(0, 1fr);
    }

    .pf-file-bar .btn {
        width: 100%;
    }

    .pf-download__action .btn {
        width: 100%;
    }

    .pf-dropzone {
        min-height: 180px;
        padding: 26px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pf-leaf,
    .pf-flipbook__book,
    .pf-dropzone,
    .pf-sheet,
    .pf-progress__bar {
        transition: none;
    }

    .pf-art.is-loading,
    .pf-ill-slide,
    .pf-ill-stick {
        animation: none;
    }
}
