/* Phase 44T: Enhanced Secure View / Copy Guard
   Browser-side deterrent layer with dynamic watermark, shortcut blocking, print blocking,
   tab-switch cover, and official copy-button exceptions. */
html.secure-view,
html.secure-view body {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html.secure-view body,
html.secure-view body *:not(input):not(textarea):not(select):not(option):not([contenteditable="true"]):not(.allow-select):not(.copy-allowed):not([data-copy-allowed]) {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}
html.secure-view img,
html.secure-view svg,
html.secure-view canvas,
html.secure-view video {
  -webkit-user-drag: none !important;
  user-drag: none !important;
}
html.secure-screen-covered body > *:not(#secureViewOverlay):not(#secureViewToast) {
  filter: blur(10px) saturate(0.75) brightness(0.72) !important;
  pointer-events: none !important;
}
#secureViewOverlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.92);
  color: #eaf7ff;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-family: 'Inter', system-ui, sans-serif;
}
#secureViewOverlay.is-visible { display: flex; }
.secure-view-card {
  max-width: 560px;
  width: min(92vw, 560px);
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(8, 47, 73, 0.88));
  box-shadow: 0 0 38px rgba(14, 165, 233, 0.28), inset 0 1px 0 rgba(255,255,255,0.14);
}
.secure-view-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: 'Rajdhani', 'Inter', sans-serif;
  font-size: 1.65rem;
  letter-spacing: 0.7px;
  color: #7dd3fc;
  text-transform: uppercase;
}
.secure-view-card small { color: #c7e5f8; line-height: 1.58; }
#secureViewToast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(24px);
  z-index: 2147483601;
  max-width: min(92vw, 520px);
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(2, 6, 23, 0.94);
  color: #eaf7ff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 12px 34px rgba(2, 6, 23, 0.38), 0 0 24px rgba(14, 165, 233, 0.17);
  transition: opacity .18s ease, transform .18s ease;
}
#secureViewToast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.secure-watermark-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  opacity: 0.082;
  color: #38bdf8;
  background-image:
    repeating-linear-gradient(-28deg,
      transparent 0 72px,
      rgba(14, 165, 233, 0.7) 74px 76px,
      transparent 78px 152px),
    radial-gradient(circle at 50% 50%, rgba(56,189,248,0.16), transparent 42%);
  mix-blend-mode: normal;
}
.secure-watermark-layer::before,
.secure-watermark-layer::after {
  content: attr(data-watermark);
  position: absolute;
  left: -22vw;
  width: 150vw;
  color: currentColor;
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  font-size: clamp(14px, 1.7vw, 28px);
  letter-spacing: 2px;
  text-transform: uppercase;
  transform: rotate(-24deg);
  white-space: pre-wrap;
  line-height: 4.6;
  text-shadow: 0 0 10px rgba(56,189,248,0.28);
}
.secure-watermark-layer::before { top: 4vh; }
.secure-watermark-layer::after { top: 48vh; opacity: 0.82; }
html[data-theme="pearl"] .secure-watermark-layer,
html[data-theme="sky"] .secure-watermark-layer,
html[data-theme="mint"] .secure-watermark-layer,
html[data-theme="sunset"] .secure-watermark-layer {
  opacity: 0.06;
  color: #0f172a;
  background-image: repeating-linear-gradient(-28deg,
    transparent 0 72px,
    rgba(15, 23, 42, 0.55) 74px 76px,
    transparent 78px 152px);
}
html[data-theme="pearl"] .secure-watermark-layer::before,
html[data-theme="sky"] .secure-watermark-layer::before,
html[data-theme="mint"] .secure-watermark-layer::before,
html[data-theme="sunset"] .secure-watermark-layer::before,
html[data-theme="pearl"] .secure-watermark-layer::after,
html[data-theme="sky"] .secure-watermark-layer::after,
html[data-theme="mint"] .secure-watermark-layer::after,
html[data-theme="sunset"] .secure-watermark-layer::after {
  text-shadow: none;
}
@media print {
  body > *:not(#secureViewOverlay) { display: none !important; }
  #secureViewOverlay {
    display: flex !important;
    position: fixed !important;
    background: #fff !important;
    color: #111827 !important;
    backdrop-filter: none !important;
  }
  #secureViewOverlay .secure-view-card {
    background: #fff !important;
    color: #111827 !important;
    border: 2px solid #111827 !important;
    box-shadow: none !important;
  }
  #secureViewOverlay .secure-view-card strong { color: #111827 !important; }
  #secureViewOverlay .secure-view-card small { color: #374151 !important; }
}
