/* Content protection (DRM-lite). Applied platform-wide via <body class="protected">.
   Blocks casual copy / selection / printing of study content. Form fields stay usable.
   Opt out per page by rendering without the class (context: allow_download=True). */
body.protected,
body.protected * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* keep inputs/textareas/selects and rich-text areas usable */
body.protected input,
body.protected textarea,
body.protected select,
body.protected [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* no dragging images/media out */
body.protected img,
body.protected svg,
body.protected canvas,
body.protected video {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

/* disable printing: blank the page and show a notice instead */
@media print {
  body.protected * {
    visibility: hidden !important;
  }
  body.protected::before {
    content: "Printing is disabled. This study content is licensed for on-screen use only.";
    visibility: visible !important;
    display: block;
    position: fixed;
    top: 40%;
    left: 0;
    right: 0;
    text-align: center;
    font: 600 15px/1.5 system-ui, Segoe UI, Arial, sans-serif;
    color: #12233d;
    padding: 0 24px;
  }
}
