.doumi-mobile-ui .paper-entry, #doll-paper nav > * {
    pointer-events: auto;
    cursor: pointer;
    background: #fff0fa;
    border: 1px solid #80588f;
    border-radius: 14px;
    color: #594365;
    padding: 6px 13px;
    font: 600 14px/1.25 system-ui, sans-serif;
}
.paper-entry { position: absolute; left: 118px; top: 0; }
.doumi-toolbar .paper-entry {
    min-height: 25px; padding: 3px 10px; border-radius: 5px 5px 12px 12px;
    font: 13px Georgia, Dotum, serif; color: #4f297d;
}
.doumi-mobile-ui .paper-entry {
    background: linear-gradient(155deg, #fff0fa, #eee8ff);
    min-height: 44px;
    left: calc(max(14px, env(safe-area-inset-left)) + 78px);
    top: max(4px, env(safe-area-inset-top));
}
.paper-entry:focus-visible, #doll-paper nav > :focus-visible { outline: 3px solid #4f236d; outline-offset: 2px; }
#doll-paper {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: white;
    overflow: auto;
}
#doll-paper::backdrop { background: white; }
#doll-paper[open] { display: grid; place-items: center; }
.paper-sheet { width: min(100%, calc((100dvh - 50px) * 3508 / 2480)); }
.paper-board { position: relative; }
.paper-board > img { display: block; width: 100%; height: auto; }
.paper-board svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pinch-zoom; }
.paper-lighting {
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease-in-out;
}
.paper-lighting.is-lit { opacity: 1; }
.paper-lighting > div {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse var(--light-rx) var(--light-ry) at var(--light-x) var(--light-y),
            rgba(255, 182, 217, .5), rgba(255, 221, 244, .36) 60%, transparent),
        radial-gradient(ellipse at center, transparent 30%, rgba(217, 182, 255, .20));
}
@media (prefers-reduced-motion: reduce) {
    .paper-lighting { transition: none; }
}
.paper-board [role=button] { cursor: grab; }
.paper-board [role=button]:focus-visible .paper-hit { stroke: #79449a; stroke-width: 4px; }
.paper-board [role=button]:active { cursor: grabbing; }
#doll-paper nav { height: 50px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 3px; }
#doll-paper nav > * { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
#doll-paper nav [hidden] { display: none; }
#doll-paper nav :disabled { opacity: .6; cursor: default; }
#doll-paper nav label { gap: 4px; white-space: nowrap; }
#doll-paper nav input { margin: 0; accent-color: #80588f; }
.paper-print-canvas { display: none; }
@media screen and (max-width: 440px) {
    #doll-paper nav { justify-content: center; gap: 2px; }
    #doll-paper nav > * { padding: 3px 6px; font-size: 12px; }
}
/* A landscape A4 sheet leaves room for tools between the artwork title and date. */
@media screen and (min-width: 870px) and (min-height: 530px) {
    .paper-sheet {
        position: relative;
        width: min(100%, calc(100dvh * 3508 / 2480));
        container-type: inline-size;
    }
    #doll-paper nav {
        position: absolute;
        z-index: 1;
        top: 3.1%;
        right: 9%;
        height: auto;
        padding: 0;
    }
    #doll-paper nav > * {
        min-width: 44px;
        min-height: clamp(26px, 4cqw, 44px);
        padding: 2px clamp(6px, 1cqw, 13px);
        font-size: clamp(12px, 1.6cqw, 14px);
    }
}
@media screen {
    .paper-board[aria-busy=true] > img { visibility: hidden; }
    .paper-board[aria-busy=true]::after {
        content: "종이인형을 준비하고 있어요.";
        position: absolute; inset: 0; display: grid; place-items: center; color: #594365;
    }
}
@page paperDoll { size: A4 landscape; margin: 0; }
@media print {
    body:has(#doll-paper[open]) { page: paperDoll; }
    body:has(#doll-paper[open]), body:has(#doll-paper[open]) .doumi-app {
        height: auto; width: auto; overflow: visible; background: white;
    }
    .doumi-app:has(#doll-paper[open]) > :not(#doll-paper), #doll-paper nav { display: none; }
    #doll-paper[open] { position: static; overflow: visible; width: 297mm; height: auto; }
    #doll-paper .paper-board svg { display: none; }
    #doll-paper .paper-board.is-manual > img { display: none; }
    #doll-paper .paper-board.is-manual .paper-print-canvas { display: block; width: 297mm; height: 210mm; }
    #doll-paper .paper-sheet { width: 297mm; }
    #doll-paper .paper-sheet img { width: 297mm; height: 210mm; }
}
