/* Print-proof viewer — shared by the team page (app/pages/approvals.js)
   and the public customer link (/freigabe/:token). Uses the LWNA tokens. */

.pv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; height: 100%; min-height: 0; font-family: var(--font-sans); color: var(--text-body); }
.pv * { box-sizing: border-box; }

/* ── Document pane ─────────────────────────────────────────── */
.pv-doc { display: flex; flex-direction: column; min-height: 0; background: var(--surface-sunk); border: .5px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.pv-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: .5px solid var(--border); flex-wrap: wrap; }
.pv-toolbar .pv-spacer { flex: 1; }
.pv-select { height: 34px; padding: 0 34px 0 12px; border: .5px solid var(--border); border-radius: var(--r-control); background-color: var(--surface); color: var(--text-strong); font: inherit; font-size: 13px; cursor: pointer;
  /* Own chevron with breathing room (the native one sits on the edge). */
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23877f72' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
.pv-select:disabled { cursor: default; opacity: .7; }
.pv-pageinfo { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pv-iconbtn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: .5px solid var(--border); border-radius: var(--r-control); background: var(--surface); color: var(--text-strong); cursor: pointer; font-size: 16px; line-height: 1; }
.pv-iconbtn:hover { background: var(--surface-2); }
.pv-banner { display: none; padding: 9px 14px; font-size: 13px; border-bottom: .5px solid var(--border); }
.pv-banner.is-on { display: block; }
.pv-banner.is-ok { background: var(--st-active-tint); color: var(--st-active-on); }
.pv-banner.is-info { background: var(--st-warn-tint); color: var(--st-warn-on); }
.pv-pages { flex: 1; min-height: 0; overflow: auto; padding: 20px 16px 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.pv-pages.is-commentable .pv-page { cursor: crosshair; }
.pv-page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(20,20,35,.12), 0 8px 24px rgba(20,20,35,.08); flex: none; margin: 0 auto; }
.pv-page canvas { display: block; width: 100%; height: 100%; }
.pv-page-label { position: absolute; top: -16px; left: 0; font-size: 11px; color: var(--text-subtle); }
.pv-state { margin: auto; font-size: 14px; color: var(--text-muted); text-align: center; padding: 40px 16px; }

/* Pins */
.pv-pin { position: absolute; transform: translate(-50%, -100%); width: 28px; height: 28px; border-radius: 50% 50% 50% 0; rotate: -45deg; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(20,20,35,.3); cursor: pointer; background: var(--st-offer); color: #fff; padding: 0; transform-origin: center; }
.pv-pin span { rotate: 45deg; font-size: 11px; font-weight: 600; }
.pv-pin.st-question { background: var(--st-warn); }
.pv-pin.st-done { background: var(--st-done); opacity: .75; }
.pv-pin.is-active { outline: 3px solid var(--accent-ring); outline-offset: 2px; z-index: 2; }
.pv-pin.is-pending { background: var(--ink); animation: pv-pop .18s ease-out; }
.pv-pin.is-draft, .pv-area.is-draft { opacity: .8; }
/* Text marker: marked area */
.pv-pages { user-select: none; -webkit-user-select: none; }
.pv-area { position: absolute; padding: 0; border: 1.5px solid rgba(214,160,0,.9); background: rgba(255,214,0,.28); border-radius: 3px; cursor: pointer; mix-blend-mode: multiply; }
.pv-area span { position: absolute; top: -10px; left: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--st-offer); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; mix-blend-mode: normal; }
.pv-area.st-question span { background: var(--st-warn); }
.pv-area.st-done { opacity: .5; }
.pv-area.st-done span { background: var(--st-done); }
.pv-area.is-active { outline: 3px solid var(--accent-ring); outline-offset: 2px; z-index: 2; }
.pv-area.is-pending { border-style: dashed; border-color: var(--ink); background: rgba(255,214,0,.22); pointer-events: none; }
@keyframes pv-pop { from { scale: .6; } to { scale: 1; } }

/* ── Side panel ────────────────────────────────────────────── */
.pv-side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: .5px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-content); overflow: hidden; }
.pv-side-head { padding: 14px 16px 10px; border-bottom: .5px solid var(--border); }
.pv-side-title { font-size: 15px; font-weight: 600; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.pv-counts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pv-filter { border: .5px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: var(--r-pill); padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.pv-filter.is-on { background: var(--ink); color: var(--ink-on); border-color: var(--ink); }
.pv-filter b { font-weight: 600; }
.pv-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-top: 8px; cursor: pointer; }

.pv-composer { padding: 12px 16px 14px; border-bottom: .5px solid var(--border); background: var(--surface-2); }
.pv-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.pv-row label { font-size: 12px; color: var(--text-muted); }
.pv-input, .pv-textarea { width: 100%; border: .5px solid var(--border); border-radius: var(--r-control); background: var(--surface); color: var(--text-strong); font: inherit; font-size: 14px; padding: 9px 12px; outline: none; }
.pv-input:focus, .pv-textarea:focus, .pv-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.pv-textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.pv-hint { font-size: 12px; color: var(--text-subtle); }
.pv-pinchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--ink); color: var(--ink-on); border-radius: var(--r-pill); padding: 3px 4px 3px 10px; }
.pv-pinchip button { border: none; background: rgba(255,255,255,.18); color: inherit; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; line-height: 1; padding: 0; }
.pv-btn { height: 36px; padding: 0 16px; border: none; border-radius: var(--r-control); background: var(--ink); color: var(--ink-on); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.pv-btn:disabled { opacity: .5; cursor: default; }
.pv-btn.is-secondary { background: var(--surface); color: var(--text-strong); border: .5px solid var(--border); }
.pv-btn.is-ok { background: var(--st-active); color: #fff; }
.pv-linkbtn { border: none; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.pv-error { color: var(--st-warn-on); font-size: 12px; margin-top: 6px; }

.pv-list { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.pv-empty { font-size: 13px; color: var(--text-subtle); text-align: center; padding: 28px 8px; }
.pv-group { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle); margin: 8px 4px 0; }
.pv-thread { border: .5px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pv-thread:hover { border-color: var(--border-strong); }
.pv-thread.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.pv-thread.st-done .pv-body { color: var(--text-muted); }
.pv-thread-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.pv-num { min-width: 20px; height: 20px; border-radius: 10px; background: var(--st-offer); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.pv-thread.st-question .pv-num { background: var(--st-warn); }
.pv-thread.st-done .pv-num { background: var(--st-done); }
.pv-num.is-general { background: var(--warm-400); }
.pv-chip { margin-left: auto; font-size: 11px; font-weight: 500; border-radius: var(--r-pill); padding: 2px 8px; }
.pv-chip.st-open { background: var(--st-offer-tint); color: var(--st-offer-on); }
.pv-chip.st-question { background: var(--st-warn-tint); color: var(--st-warn-on); }
.pv-chip.st-done { background: var(--st-active-tint); color: var(--st-active-on); }
.pv-chip.st-draft { background: var(--surface-sunk); color: var(--text-muted); border: .5px dashed var(--border-strong); }
.pv-thread.is-draft { border-style: dashed; background: var(--surface-2); }
/* Attachments */
.pv-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.pv-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 9px; border-radius: 8px; background: var(--surface-sunk); border: .5px solid var(--border); font: inherit; font-size: 12px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-file small { color: var(--text-subtle); }
.pv-file button { display: inline-flex; border: none; background: none; color: var(--text-muted); cursor: pointer; padding: 2px; border-radius: 4px; }
.pv-file button:hover { background: var(--surface); color: var(--text-strong); }
.pv-file.is-link { padding: 0; gap: 0; }
.pv-file-open { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 9px; border: none; background: none; font: inherit; color: inherit; text-decoration: none; cursor: pointer; }
.pv-file-open:hover { color: var(--accent); }
.pv-file.is-link > button { margin-right: 4px; }
.pv-ico { flex: none; display: block; }
.pv-attach { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 8px; border-radius: var(--r-control); color: var(--text-muted); font-size: 13px; cursor: pointer; }
.pv-attach:hover { background: var(--surface-sunk); color: var(--text-strong); }
.pv-where { display: inline-flex; align-items: center; gap: 5px; }
.pv-where .pv-ico { color: var(--text-subtle); }
.pv-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pv-file .pv-ico { color: var(--text-subtle); }
.pv-body { font-size: 14px; color: var(--text-strong); margin: 6px 0 4px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.pv-meta { font-size: 11px; color: var(--text-subtle); }
.pv-meta .is-team { color: var(--pop); font-weight: 600; }
.pv-replies { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.pv-replies .pv-body { font-size: 13px; margin: 0 0 2px; }
.pv-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pv-seg { display: inline-flex; border: .5px solid var(--border); border-radius: var(--r-pill); overflow: hidden; }
.pv-seg button { border: none; background: var(--surface); color: var(--text-muted); font: inherit; font-size: 11px; padding: 4px 9px; cursor: pointer; }
.pv-seg button + button { border-left: .5px solid var(--border); }
.pv-seg button.is-on.st-open { background: var(--st-offer-tint); color: var(--st-offer-on); font-weight: 600; }
.pv-seg button.is-on.st-question { background: var(--st-warn-tint); color: var(--st-warn-on); font-weight: 600; }
.pv-seg button.is-on.st-done { background: var(--st-active-tint); color: var(--st-active-on); font-weight: 600; }
.pv-actions { gap: 12px; }
.pv-done { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 5px; border: .5px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text-strong); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.pv-done:hover { border-color: var(--st-active); }
.pv-done-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.pv-done:hover .pv-done-dot { border-color: var(--st-active); color: var(--st-active); }
.pv-done.is-on { background: var(--st-active-tint); border-color: transparent; color: var(--st-active-on); }
.pv-done.is-on .pv-done-dot { background: var(--st-active); border-color: var(--st-active); color: #fff; }
.pv-linkbtn.is-muted { color: var(--text-muted); }
.pv-linkbtn.is-muted:hover { color: var(--accent); }
.pv-replyform { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pv-replyform .pv-textarea { min-height: 54px; font-size: 13px; }
.pv-replyform-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pv-callout { font-size: 12px; color: var(--st-warn-on); background: var(--st-warn-tint); border-radius: 8px; padding: 6px 8px; margin-top: 8px; }

.pv-approve { padding: 12px 16px; border-top: .5px solid var(--border); background: var(--surface-2); }
.pv-approve:empty { display: none; }
.pv-approve p { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); }
.pv-approve .pv-btn { width: 100%; }

@media (max-width: 900px) {
  .pv { grid-template-columns: 1fr; grid-template-rows: minmax(60vh, auto) auto; height: auto; }
  .pv-doc { height: 70vh; }
  .pv-side { max-height: none; }
  .pv-list { max-height: none; overflow: visible; }
}
