/* MediaHouse99 preview protection — base CSS (applies before JS runs) */
html.mh-protect, html.mh-protect body{
  -webkit-user-select:none;user-select:none;
  -webkit-touch-callout:none;
}
html.mh-protect img, html.mh-protect video, html.mh-protect canvas, html.mh-protect svg{
  -webkit-user-drag:none;user-drag:none;-webkit-touch-callout:none;
}
html.mh-protect input, html.mh-protect textarea, html.mh-protect [contenteditable="true"]{
  -webkit-user-select:text;user-select:text;
}
@media print{
  html, body{background:#000!important}
  body *{visibility:hidden!important}
  html::after{
    content:"MediaHouse99 — الطباعة غير مسموحة";
    visibility:visible;position:fixed;inset:0;display:grid;place-items:center;
    color:#fff;font:700 24px Cairo,Tahoma,sans-serif;background:#000;
  }
}
.mh-shield{
  position:fixed;inset:0;z-index:2147483646;background:#000;
  display:none;align-items:center;justify-content:center;flex-direction:column;gap:10px;
  color:#fff;font:700 18px/1.6 Cairo,Tahoma,sans-serif;text-align:center;direction:rtl;padding:24px;
}
.mh-shield.on{display:flex}
.mh-shield small{font-weight:400;opacity:.55;font-size:12px}

/* Tiled wordmark: stronger on the board around the phone, faint inside the app */
.mh-wm, .mh-wm-in{
  pointer-events:none;background-repeat:repeat;
  transition:background-position 1.6s linear;
}
.mh-wm{
  position:fixed;inset:-60%;z-index:2147483640;opacity:.2;
}
.mh-wm-in{
  position:absolute;inset:0;z-index:20;opacity:.07;border-radius:inherit;overflow:hidden;
}

/* Session badge: pinned to a corner / bottom edge — never across mid-content */
.mh-tag{
  position:absolute;z-index:21;pointer-events:none;
  inset:auto auto 8px 50%;
  transform:translateX(-50%);
  padding:3px 9px;border-radius:999px;
  background:rgba(0,0,0,.4);color:rgba(255,255,255,.62);
  font:600 9px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;
  white-space:nowrap;letter-spacing:.02em;
  max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;
}
html.mh-framed .mh-tag, .stage.mh-tag-host .mh-tag{
  /* sits just under the phone frame on the board */
}
html.mh-blur body > *:not(.mh-shield):not(.mh-wm):not(.mh-tag):not(.mh-lock):not(.mh-fs-btn){
  filter:blur(16px)!important;
}
.mh-lock{
  position:fixed;inset:0;z-index:2147483645;background:rgba(5,8,20,.95);
  display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px;
  color:#fff;font:700 20px/1.6 Cairo,Tahoma,sans-serif;text-align:center;direction:rtl;padding:28px;
}
.mh-lock a{
  display:inline-block;padding:12px 26px;border-radius:12px;background:#2563eb;color:#fff;
  text-decoration:none;font-weight:800;
}
.mh-lock small{font-weight:400;opacity:.7;font-size:13px}
.mh-frame-notice{
  margin:0;min-height:100vh;background:#0f172a;color:#fff;
  display:grid;place-items:center;font:700 16px/1.7 Cairo,Tahoma,sans-serif;
  text-align:center;direction:rtl;padding:32px;
}

/* Standalone framed preview board */
html.mh-framed, html.mh-framed body{
  height:100%;margin:0;background:#0f172a;overflow:hidden;
}
html.mh-framed body{display:block}
.mh-fs-btn{
  position:fixed;z-index:2147483642;top:12px;left:12px;
  width:40px;height:40px;border:0;border-radius:12px;cursor:pointer;
  background:rgba(255,255,255,.1);color:#fff;display:grid;place-items:center;
  backdrop-filter:blur(8px);
}
.mh-fs-btn:hover{background:rgba(255,255,255,.18)}
.mh-fs-btn svg{width:20px;height:20px}

/* Host (store Live Preview modal): watermark on the dark board, not over the app */
.pv-media{position:relative}
.pv-media::after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
  background-image:var(--mh-wm);background-repeat:repeat;opacity:.16;
}
.pv-modes,.pv-stage,.pv-thumbs,.pv-device{position:relative;z-index:1}
.pv-media.mh-blur .pv-stage > *{filter:blur(16px)}
#pv.open, #pv.open *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#pv.open img{-webkit-user-drag:none;user-drag:none}

html.mh-preview, html.mh-preview body{height:100%;width:100%;margin:0;overflow:hidden}
html.mh-framed, html.mh-framed body{background:#0f172a}
html.mh-preview.appmode, html.mh-preview.appmode body,
html.mh-fs, html.mh-fs body{background:#000}

.mh-host-shield{
  position:absolute;inset:0;z-index:20;background:#000;display:none;
  align-items:center;justify-content:center;flex-direction:column;gap:10px;
  color:#fff;font:700 16px/1.6 Cairo,Tahoma,sans-serif;text-align:center;direction:rtl;padding:20px;
}
.mh-host-shield.on{display:flex}
.mh-host-shield small{font-weight:400;opacity:.55;font-size:12px}
html.appmode:not(.mh-fs) .mh-fs-btn{display:none}
