/* Proof Studio — one proofing page everywhere (owner, 2026-10-16).
 * Values are the approved mockup's (artifact CDA4TGBDUSoiYntbtbniNY): lilac
 * stage, white side panel, ONE bordered dock with flat buttons (active =
 * brand fill), standalone buttons bordered with a soft shadow, each face
 * card's checks attached under its thumbnail, line labels only on hover.
 * The host gives .pst a height (the overlay, the page section). */

.pst { --ps-brand: #7c3aed; --ps-brand-d: #6d28d9; --ps-ink: #1a1625; --ps-sub: #6b7280; --ps-line: #ece6f7; --ps-bd: #e2d8f5;
       display: grid; grid-template-columns: minmax(0, 1fr) var(--pst-side, 392px); height: 100%; min-height: 0; color: var(--ps-ink);
       background: #f1ebfb; font-family: inherit; outline: none; }
.pst *, .pst *::before, .pst *::after { box-sizing: border-box; }
.pst [hidden] { display: none !important; }
.pst button { font-family: inherit; cursor: pointer; }
.pst button:disabled { cursor: default; }
.pst svg { display: block; }

/* ── the stage column ─────────────────────────────────────────────── */
.pst-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 var(--pst-pad, 28px); }
/* the top row (owner 2026-10-16: "move the toolbar to the top… center the toolbar, keep Guides and Trim on
   the right"): the face's name left, the dock dead centre, Guides / Trim view right. A stage too narrow for
   one row puts the name + views on the first row and the dock, still centred, on its own row under them. */
.pst-top { min-height: 64px; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title views" "dock dock";
           align-items: center; gap: 10px 16px; padding: 10px 0; }
@container pstmain (min-width: 1210px) {
    .pst-top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "title dock views"; }
}
.pst-title { grid-area: title; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--ps-sub); }
.pst-title-b { font-size: 16px; font-weight: 900; color: var(--ps-ink); }
.pst-tools { display: contents; }
.pst-views { grid-area: views; justify-self: end; display: flex; align-items: center; gap: 6px; flex: none; padding: 5px; background: #fff; border: 1.3px solid var(--ps-bd); border-radius: 14px; box-shadow: 0 4px 14px rgba(60, 30, 130, .07); }
.pst-tb { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 1.3px solid var(--ps-bd); border-radius: 9px; background: #fff;
          box-shadow: 0 3px 9px rgba(60, 30, 130, .10); font-size: 12px; font-weight: 700; color: #374151; }
.pst-tb svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pst-tb.on { background: var(--ps-brand); color: #fff; border-color: var(--ps-brand); box-shadow: 0 4px 12px rgba(124, 58, 237, .4); }

.pst-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.pst-sheet { flex: 1; min-width: 0; min-height: 0; cursor: zoom-in; touch-action: none; user-select: none; -webkit-user-select: none; }
.pst-sheet > svg { width: 100%; height: 100%; }
.pst-zoomed .pst-sheet { cursor: grab; }
.pst-zoomed .pst-sheet:active { cursor: grabbing; }
.pst-pos .pst-sheet, .pst-pos.pst-zoomed .pst-sheet { cursor: move; }
.pst-marking .pst-sheet, .pst-marking.pst-zoomed .pst-sheet { cursor: crosshair; }
.pst-pin { pointer-events: none; }
.pst-paper { fill: #fff; }
.pst-lbl { opacity: 0; transition: opacity .15s; pointer-events: none; }
.pst-stage:hover .pst-lbl { opacity: 1; }
.pst-zchip { position: absolute; left: 12px; top: 10px; padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, .95); font-size: 11px; font-weight: 800;
             box-shadow: 0 4px 12px rgba(0, 0, 0, .14); pointer-events: none; }
.pst-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ps-sub); }
/* a file the browser cannot draw: the message, then its Download button under it */
.pst-msg:has(.pst-dl) { flex-direction: column; gap: 14px; }
.pst-msg br { display: none; }
.pst-msg .pst-dl { flex: none; text-decoration: none; padding: 0 22px; }
a.pst-ghost { text-decoration: none; }

.pst-warn { align-self: center; display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fcd34d;
            font-size: 12px; font-weight: 700; color: #92400e; max-width: 100%; }
.pst-warn svg { width: 16px; height: 16px; flex: none; stroke: #d97706; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── the dock: one bordered bar, flat buttons inside ──────────────── */
.pst-dock { grid-area: dock; justify-self: center; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 0; padding: 5px; max-width: 100%; min-width: 0; flex: 0 1 auto;
            background: #fff; border: 1.3px solid var(--ps-bd); border-radius: 14px; box-shadow: 0 4px 14px rgba(60, 30, 130, .07); }
/* a narrower desktop stage: the tools go icon-only (the names stay as tooltips + for screen readers) so the
   row never scrolls a tool out of sight; the dock wraps only as a last resort */
.pst-main { container: pstmain / inline-size; }
@media (min-width: 901px) {
    @container pstmain (max-width: 980px) {
        .pst-dk span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
        .pst-dk { padding: 0 10px; }
    }
}
.pst-dk { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; flex: none;
          font-size: 12px; font-weight: 700; color: #374151; white-space: nowrap; transition: background .12s, color .12s; }
.pst-dk svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pst-dk:hover:not(:disabled) { background: #f6f2fd; }
.pst-dk.on, .pst-dk.on:hover { background: var(--ps-brand); color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, .4); }
.pst-dk:disabled { opacity: .4; }
.pst-dv { width: 1px; height: 22px; background: var(--ps-line); margin: 0 4px; flex: none; }
.pst-size { display: flex; align-items: center; gap: 6px; padding: 0 6px; flex: none; }
.pst-sl { font-size: 12px; font-weight: 700; color: #374151; }
.pst-szv { min-width: 44px; text-align: center; font-size: 13px; font-weight: 900; }
.pst-sz { width: 28px; height: 28px; border: 0; border-radius: 8px; background: #f4f0fb; color: #5b21b6; font-size: 16px; font-weight: 800; line-height: 1; padding: 0;
          touch-action: manipulation; user-select: none; }
.pst-sz:hover:not(:disabled) { background: #ebe3fb; }
.pst-sz:disabled { opacity: .4; }
.pst-str { display: flex; flex-direction: column; gap: 3px; padding: 0 6px; flex: none; }
.pst-sr { display: grid; grid-template-columns: 46px 24px 44px 24px; align-items: center; gap: 5px; }
.pst-sr .pst-sl { font-size: 11px; }
.pst-sr .pst-sz { width: 24px; height: 22px; border-radius: 7px; font-size: 15px; }
.pst-sr b { font-size: 12px; font-weight: 900; text-align: center; }

.pst-foot { flex: none; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 6px 0;
            font-size: 11px; font-weight: 800; }
.pst-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.pst-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pst-legend i { display: inline-block; width: 16px; border-top: 2px dashed #60a5fa; }
.pst-legend .t i { border-top: 2px solid #ef4444; }
.pst-legend .s i { border-top: 2px dashed #059669; }
.pst-hint { font-weight: 600; color: var(--ps-sub); }

/* ── the side panel ───────────────────────────────────────────────── */
.pst-side { background: #fff; border-left: 1px solid var(--ps-line); display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; min-height: 0; overflow-y: auto; }
.pst-slot-top:empty, .pst-slot-bottom:empty { display: none; }
.pst-slot-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.pst-cards { display: flex; flex-direction: column; gap: 12px; }
.pst-card { border: 1.5px solid var(--ps-line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.pst-card.on { border-color: var(--ps-brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .14); }
.pst-th { height: 96px; width: 100%; border: 1px solid var(--ps-line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #faf8ff; padding: 8px;
          display: flex; align-items: center; justify-content: center; }
.pst-th svg { height: 100%; width: 100%; }
.pst-th + .pst-cks { margin-top: -10px; }
.pst-cks { border: 1px solid var(--ps-line); border-radius: 0 0 12px 12px; background: #f6fbf8; padding: 8px 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
.pst-cks.warn { background: #fffaf0; }
.pst-ck { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; font-weight: 700; color: #065f46; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-ck svg { width: 14px; height: 14px; flex: none; fill: none; stroke: #10b981; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pst-ck.warn { color: #92400e; } .pst-ck.warn svg { stroke: #f59e0b; }
.pst-ck.bad { color: #b91c1c; } .pst-ck.bad svg { stroke: #ef4444; }
/* a face no check ran on: said plainly, across the box, no green */
.pst-ck.none { grid-column: 1 / -1; color: var(--ps-sub); white-space: normal; }
.pst-cks:has(.pst-ck.none) { background: #faf8ff; }
.pst-ch { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pst-cn { min-width: 0; }
.pst-cn b { display: block; font-size: 14px; font-weight: 900; }
.pst-cn small { display: block; font-size: 11px; font-weight: 600; color: var(--ps-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pst-pill { flex: none; font-size: 10px; font-weight: 800; padding: 4px 9px; border-radius: 99px; color: #047857; background: #dcf5ea; }
.pst-pill.warn { color: #92400e; background: #fdf0d5; }
.pst-ca { display: flex; gap: 8px; }

/* standalone buttons: bordered, soft shadow; primary = brand */
.pst-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 11px; background: #fff;
             border: 1.3px solid var(--ps-bd); box-shadow: 0 3px 9px rgba(60, 30, 130, .10); color: #5b21b6; font-size: 12px; font-weight: 800; }
.pst-ghost svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pst-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 11px; border: 0;
           background: var(--ps-brand-d); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 8px 20px -8px rgba(109, 40, 217, .6); }
.pst-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pst-btn.done { background: #059669; box-shadow: 0 8px 20px -8px rgba(5, 150, 105, .6); }
.pst-btn:disabled { opacity: .5; }
.pst-btn-lg { width: 100%; height: 48px; font-size: 15px; border-radius: 12px; }

/* ── phones / narrow: one column ──────────────────────────────────── */
@media (max-width: 900px) {
    .pst { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
    .pst-main { padding: 0 12px; }
    /* a phone keeps the dock under the artwork (a thumb's reach): the top row's boxes dissolve and the
       pieces are ordered title · views · stage · dock · legend */
    .pst-top, .pst-tools { display: contents; }
    .pst-title { order: 1; flex: none; padding-top: 10px; }
    .pst-views { order: 2; align-self: flex-start; margin: 8px 0 10px; }
    .pst-stage { order: 3; }
    .pst-warn { order: 4; }
    .pst-dock { order: 5; align-self: center; margin-top: 12px; }
    .pst-foot { order: 6; }
    .pst-stage { height: 58vh; min-height: 300px; }
    /* the seven tools in one row, the Size (or Width / Height) stepper on its own row under them */
    .pst-dock { flex-wrap: wrap; justify-content: center; overflow: visible; row-gap: 4px; }
    .pst-dock .pst-dv { display: none; }
    .pst-size, .pst-str { order: 10; flex-basis: 100%; justify-content: center; padding: 4px 0 2px; border-top: 1px solid var(--ps-line); }
    .pst-str { flex-direction: row; gap: 14px; }
    .pst-dk { flex-direction: column; gap: 2px; height: 46px; padding: 0 4px; font-size: 9px; min-width: 42px; }
    .pst-dk svg { width: 18px; height: 18px; }
}
@media (max-width: 560px) {
    /* the phone mockup's seven: Fit · Fill · Stretch · Position · Rotate · Undo (+ Size below) — Undo covers Reset */
    .pst-dk[data-a="reset"] { display: none; }
    .pst-dock { padding: 4px; }
    .pst-str { gap: 8px; }
    .pst-sr { grid-template-columns: auto 26px 38px 26px; gap: 3px; }
    .pst-legend { gap: 10px; font-size: 10px; }   /* no hover on a phone: the legend names the lines */
    .pst-side { border-left: 0; border-top: 1px solid var(--ps-line); padding: 14px 12px; }
    /* many cards (a booklet's pages, several designs): one sideways strip, so Approve is not
       a dozen card-heights down; the picked card keeps its checks and buttons */
    .pst-cards.pst-many { flex-direction: row; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
    .pst-many .pst-card { flex: 0 0 132px; scroll-snap-align: start; }
    .pst-many .pst-card.on { flex-basis: 260px; }
    .pst-many .pst-card:not(.on) .pst-cks, .pst-many .pst-card:not(.on) .pst-ca, .pst-many .pst-card:not(.on) .pst-cn small, .pst-many .pst-card:not(.on) .pst-pill { display: none; }
    .pst-many .pst-th { height: 84px; }
}

/* ── buttons that answer (the busy spinner + takeover: assets/css/shared/confirm-takeover.css) ── */
.pst-btn, .pst-ghost, .pst-dk, .pst-tb, .pst-sz { transition: transform .12s ease, background .12s, color .12s, box-shadow .12s; }
.pst-btn:active:not(:disabled), .pst-ghost:active, .pst-tb:active, .pst-dk:active:not(:disabled), .pst-sz:active:not(:disabled) { transform: scale(.96); }
.pst-btn.pst-pop { animation: pstpop .4s cubic-bezier(.2, 1.4, .4, 1); }
.pst-btn.pst-pop svg path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pstto-draw .35s ease-out .12s forwards; }
.pst-btn.pst-pop svg path + path { animation-delay: .4s; }
@keyframes pstpop { 0% { transform: scale(1); } 35% { transform: scale(.93); } 100% { transform: scale(1); } }
@keyframes pstto-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    .pst-btn.pst-pop { animation: none; }
    .pst-btn.pst-pop svg path { animation: none; stroke-dashoffset: 0; }
}
