/* Proofs and pins (BUILD M5; FEATURES 10): the latest proof large, one file at a time with "1 of 4", a PDF page by
   page, a video with its controls, pasted text as numbered lines, the yellow pins on top, the notes under it, and the
   sheet that adds a proof. A pin sits where it was tapped: its place is set from the script, never an inline style. */

.pv { display: grid; gap: 14px; min-width: 0; }
.pv-stage { display: grid; gap: 10px; min-width: 0; scroll-margin: 16px; }
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-count { flex: 1; min-width: 0; display: grid; text-align: center; }
.pv-count b { font-weight: 900; }
.pv-count span { color: var(--slate); overflow-wrap: anywhere; }
.pv-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.pv-foot .link-btn { margin-left: auto; }

/* The picture with its pins: as big as it fits, on ice, the pins measured against the picture itself. */
.pinbox { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; isolation: isolate; }
.pv-frame, .pv-page, .pv-other { border-radius: 14px; background: var(--ice); border: 1px solid var(--hair); }
.pv-frame { display: grid; place-items: center; padding: 10px; min-width: 0; }
.pv-img, .pv-video { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; border-radius: 6px; }
.pv-video { background: var(--panel); }
.pv-other { display: grid; gap: 10px; padding: 16px; justify-items: start; }
.pv-pdf { display: grid; gap: 10px; }
.pv-page { position: relative; min-height: 240px; overflow: hidden; }
.pv-page .pinbox { width: 100%; }
.pv-canvas { display: block; width: 100%; height: auto; background: var(--white); }
.pv-wait { position: absolute; inset: 0; display: grid; place-items: center; background: var(--off); color: var(--slate); font-weight: 800; }
.pv-pager { display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; }
.pv-link { justify-self: start; }
.pv-link b { font-weight: 900; }

/* Tapping the picture drops a pin there; on a video the bottom stays free for its controls. */
.pin-layer { position: absolute; inset: 0; z-index: 1; border: 0; padding: 0; background: none; cursor: crosshair; border-radius: inherit; }
.pinbox.video .pin-layer { bottom: 64px; }
.pin-layer:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }

/* A pin: bright yellow with a navy edge and a white ring, on light or dark designs; white once fixed. 44px to tap. */
.pin {
  position: absolute; z-index: 2; width: 44px; height: 44px; transform: translate(-50%, -50%); isolation: isolate;
  display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--navy); font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums;
}
.pin::before {
  content: ""; position: absolute; inset: 6px; z-index: -1; border-radius: 50%; background: var(--pin);
  border: 2px solid var(--navy); box-shadow: 0 0 0 3px var(--white), var(--shadow);
}
.pin.fixed::before { background: var(--white); }
.pin.focus::before { box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--navy); }
.pin.flat { position: relative; transform: none; flex: none; }

/* Pasted text: numbered lines; tap a line to pin it. */
.tp { display: grid; gap: 8px; min-width: 0; }
.tp-lines { list-style: none; padding: 0; margin: 0; border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; }
.tp-line { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; align-items: start; gap: 4px 10px; padding: 0 12px; }
.tp-line + .tp-line { border-top: 1px solid var(--hair); }
.tp-line.blank { min-height: 14px; }
.tp-no { padding-top: 10px; color: var(--slate); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.tp-line.blank .tp-no { padding: 4px 0; }
.tp-text {
  display: block; width: 100%; min-height: 44px; padding: 10px 0; border: 0; background: none; text-align: left;
  color: var(--navy); font: inherit; overflow-wrap: anywhere; white-space: pre-wrap;
}
button.tp-text { cursor: pointer; }
.tp-line:has(button.tp-text:hover) { background: var(--off); }
.tp-who { font-weight: 900; }
.tp-pins { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 2px; }

/* The notes under the proof. */
.pins { display: grid; gap: 6px; }
.pinlist { list-style: none; padding: 0; margin: 0; display: grid; }
.pinrow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 10px; align-items: start; padding: 8px; }
.pinrow + .pinrow { border-top: 1px solid var(--hair); }
.pinrow.focus { background: var(--off); }
.pin-main { display: grid; gap: 2px; padding-top: 9px; min-width: 0; }
.pin-where { color: var(--slate); font-weight: 600; overflow-wrap: anywhere; }
.pin-where b { color: var(--navy); font-weight: 800; }
.pin-where b::first-letter { text-transform: uppercase; }
.pin-where b { display: inline-block; }
.pin-note { overflow-wrap: anywhere; white-space: pre-line; }
.pinrow.fixed .pin-note { color: var(--slate); }
.pin-fixed { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 800; }
.pin-fixed .ic { width: 18px; height: 18px; }
.pin-acts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 16px; }
.pin-acts .link-btn { padding: 0; }

/* The sheet that adds a proof: the files in order, then text, then a link. */
.pa-files { border-radius: 14px; }
.pa-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; }
.pa-list li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; padding: 2px 4px 2px 12px; }
.pa-list li + li { border-top: 1px solid var(--hair); }
.pa-n { color: var(--slate); font-weight: 800; }
.pa-name { overflow-wrap: anywhere; font-weight: 700; }
.pa-list small { color: var(--slate); white-space: nowrap; }
.pa-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
