/* In-app PDF viewer with row highlight + "Explain" panel (viewer.js).
   Ported from agentforge-clinical-copilot copilot-pane.html.twig preview modal + bbox overlay. */
.pv-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 24, 22, .45); display: flex; align-items: stretch; justify-content: center; padding: 24px; }
.pv-backdrop[hidden] { display: none; }
.pv { background: var(--surface); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.25); display: grid; grid-template-rows: auto 1fr; width: min(1400px, 100%); overflow: hidden; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pv-head h3 { margin: 0; font-size: 15px; }
.pv-head .muted { font-size: 12px; color: var(--ink-3); }
.pv-head .spacer { flex: 1; }
.pv-head a { color: var(--accent); font-weight: 600; font-size: 12px; text-decoration: none; }
.pv-close { border: 0; background: var(--surface-2); border-radius: 8px; width: 30px; height: 30px; font-size: 16px; cursor: pointer; color: var(--ink-2); }
.pv-main { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.pv-main.with-panel { grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); }
.pv-doc { overflow: auto; background: #e9e6df; padding: 16px; min-height: 0; }
.pv-page { position: relative; margin: 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,.15); background: #fff; }
.pv-page canvas { display: block; }
.pv-hl { position: absolute; pointer-events: none; background: rgba(255, 196, 0, .28); outline: 2px solid #e0a100; border-radius: 3px; animation: pv-pulse 1.4s ease-out 2; }
@keyframes pv-pulse { 0% { box-shadow: 0 0 0 0 rgba(224,161,0,.55); } 100% { box-shadow: 0 0 0 12px rgba(224,161,0,0); } }
.pv-explain-btn { position: absolute; transform: translateY(-50%); max-width: 210px; text-align: left; line-height: 1.25; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.pv-explain-btn:hover { filter: brightness(1.08); }
.pv-explain-btn.in-head { position: static; transform: none; max-width: none; }
.pv-note { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; }
.pv-loading { color: var(--ink-3); font-size: 13px; padding: 40px; text-align: center; }
.pv-panel { border-left: 1px solid var(--line); overflow: auto; padding: 16px 18px; min-height: 0; display: none; }
.pv-main.with-panel .pv-panel { display: block; }
.pv-panel h4.pv-q { margin: 0 0 4px; font-size: 13px; }
.pv-panel .pv-question { font-size: 12px; color: var(--ink-3); margin: 0 0 12px; border-left: 3px solid var(--line); padding-left: 8px; }
.pv-panel .wu-meta { flex-wrap: wrap; }
.pv-panel .refused-note { font-size: 12px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }

/* dashboard marker rows: explain affordance */
.marker { position: relative; }
.marker .name.pv-open { cursor: pointer; text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; }
.marker .pv-mk-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 11px; font-weight: 600; color: var(--accent); cursor: pointer; }
.marker .pv-mk-btn:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .pv-backdrop { padding: 0; }
  .pv { border-radius: 0; }
  .pv-main.with-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .pv-panel { border-left: 0; border-top: 1px solid var(--line); }
}
