.mxul-lb {
  --mxul-gold: #faae60;
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  box-sizing: border-box;
  background: rgba(0,0,0,var(--mxul-overlay, 0.85));
  backdrop-filter: blur(var(--mxul-blur, 10px));
  -webkit-backdrop-filter: blur(var(--mxul-blur, 10px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--mxul-fade, 280ms) ease, visibility var(--mxul-fade, 280ms) ease;
  -webkit-tap-highlight-color: transparent;
}
.mxul-lb.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.mxul-lb__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: min(92vw, 1600px);
  max-height: min(92vh, 1100px);
  transform: scale(.985);
  opacity: 0;
  transition: transform var(--mxul-fade, 280ms) ease, opacity var(--mxul-fade, 280ms) ease;
}
.mxul-lb.is-open .mxul-lb__panel { transform: scale(1); opacity: 1; }
.mxul-lb.is-image .mxul-lb__panel { background: transparent; }
.mxul-lb.is-note .mxul-lb__panel {
  width: min(90vw, var(--mxul-note-max, 500px));
  max-width: min(90vw, var(--mxul-note-max, 500px));
  max-height: 80vh;
}
.mxul-lb.has-note-frame.is-note .mxul-lb__panel {
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid rgba(250, 174, 96, 0.28);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.mxul-lb__media {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
}
.mxul-lb__media[hidden],
.mxul-lb.is-note .mxul-lb__media,
.mxul-lb.is-note .mxul-lb__media img {
  display: none !important;
}
.mxul-lb.is-image .mxul-lb__note,
.mxul-lb.is-video .mxul-lb__note {
  display: none !important;
}
.mxul-lb__media img {
  max-width: min(92vw, 1600px);
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--mxul-radius, 12px);
  display: block;
}
.mxul-lb__caption {
  display: none;
  margin: 0;
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--mxul-text, #fff);
  font-family: Cabin, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--mxul-cap-size, 19px);
  line-height: 1.25;
}
.mxul-lb__caption.is-on { display: block; }
.mxul-lb__caption a { color: var(--mx-link, #faae60); text-decoration: underline; text-underline-offset: 2px; pointer-events: auto; cursor: pointer; }
.mxul-lb__caption a:hover { color: var(--mx-link-hover, #ffd08a); }
html.mxul-scroll-lock,
html.mxul-scroll-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.mxul-lb__note {
  color: var(--mxul-text, var(--mx-body-color, var(--mx-text, #e8e8e8)));
  text-align: left;
  font-family: var(--mx-font-body, Cabin, 'Helvetica Neue', Helvetica, Arial, sans-serif);
  font-size: var(--mxul-note-size, 1.1rem);
  line-height: var(--mxul-note-lh, 1.6);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 28px 22px 24px;
  max-height: 80vh;
  overflow-x: hidden;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--mx-link, #faae60) transparent;
}
.mxul-lb__note.is-plain { text-align: center; }
.mxul-lb .mxul-lb__note p,
.mxul-lb .mxul-lb__note li,
.mxul-lb .mxul-lb__note p.small {
  color: var(--mxul-text, var(--mx-body-color, inherit));
}
.mxul-lb__note::-webkit-scrollbar { width: 8px; }
.mxul-lb__note::-webkit-scrollbar-track { background: transparent; }
.mxul-lb__note::-webkit-scrollbar-thumb {
  background: #faae60;
  border-radius: 99px;
}
@media (max-width: 720px) {
  .mxul-lb__note { padding: 16px 16px 16px 14px; }
}
.mxul-lb__note a {
  color: #faae60 !important;
  color: var(--mxul-link, #faae60) !important;
  font-weight: inherit;
  text-decoration: underline !important;
  text-decoration-color: var(--mxul-link, #faae60) !important;
  text-underline-offset: 0.18em;
}
.mxul-lb__note a:hover { color: var(--mxul-link-hover, #ffd08a) !important; }
.mxul-lb .mxul-lb__note h1, .mxul-lb .mxul-lb__note h2, .mxul-lb .mxul-lb__note h3, .mxul-lb .mxul-lb__note h4 {
  font-family: var(--mx-font-heading, inherit);
  color: var(--mxul-text, var(--mx-heading-color, #fff));
  font-weight: var(--mx-heading-weight, 600);
}
.mxul-lb__note a img { cursor: pointer; }
.mxul-lb__note img {
  display: inline-block;
  margin: 12px 0;
  max-width: 100%;
  height: auto;
  vertical-align: top;
  border-radius: 8px;
}
.mxul-lb__note [style*="text-align: left"] img,
.mxul-lb__note [style*="text-align:left"] img,
.mxul-lb__note .mx-left img,
.mxul-lb__note .alignleft img { margin-left: 0; margin-right: auto; }
.mxul-lb__note [style*="text-align: right"] img,
.mxul-lb__note [style*="text-align:right"] img,
.mxul-lb__note .mx-right img,
.mxul-lb__note .alignright img { margin-left: auto; margin-right: 0; }
.mxul-lb__note ul, .mxul-lb__note ol { text-align: left; padding-left: 10%; margin: 20px auto; }
.mxul-lb__tools {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000001;
  overflow: visible;
}
.mxul-lb__close,
.mxul-lb__dl,
.mxul-lb__share {
  width: 44px;
  height: 44px;
  border: 0;
  background: rgba(0,0,0,.35);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  place-items: center;
}
.mxul-lb__close { display: grid; }
.mxul-lb__dl.is-on,
.mxul-lb__share.is-on { display: grid; }
.mxul-lb__close svg, .mxul-lb__dl svg, .mxul-lb__share svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.mxul-lb__close:hover, .mxul-lb__dl:hover, .mxul-lb__share:hover,
.mxul-lb__share.is-copied { background: rgba(250,174,96,.25); color: var(--mxul-gold); }
@media (max-width: 700px) {
  .mxul-lb__tools { flex-direction: row-reverse; align-items: center; }
}

/* Builder mobile preview: lightbox lives inside the phone frame */
.mxul-lb.is-builder-phone {
  border-radius: 0;
  overflow: hidden;
}
.mxul-lb.is-builder-phone .mxul-lb__panel {
  max-width: 100%;
  max-height: 100%;
}
.mxul-lb.is-builder-phone .mxul-lb__media img {
  max-width: min(100%, 100vw);
  max-height: min(70%, 70vh);
}


.mxul-lb.is-video { background: rgba(0,0,0,var(--mxul-overlay, 0.85)); }
.mxul-lb.is-video .mxul-lb__panel {
  background: transparent;
  max-width: 90vw;
  max-height: 80vh;
  align-items: center;
}
.mxul-lb.is-video .mxul-lb__media {
  background: transparent;
  width: auto;
  max-width: 90vw;
}
.mxul-lb.is-video .mxul-mxnv-host {
  width: auto;
  max-width: 90vw;
  background: transparent;
}
.mxul-lb.is-video .mx-video-shell {
  width: auto;
  height: auto;
  min-height: 0;
  max-height: 80vh;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mxul-lb.is-video .mx-video-frame {
  max-width: 90vw;
  max-height: 80vh;
  background: transparent;
}
.mxul-lb.is-video .mx-video-frame video,
.mxul-lb.is-video .mx-video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  display: block;
}

.mxul-lb.is-video .mxul-lb__media > img {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.mxul-lb.is-video .mxul-lb__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: 90vh;
}
.mxul-lb.is-video .mxul-lb__media {
  flex: 0 1 auto;
  min-height: 0;
}
.mxul-lb.is-video .mxul-lb__caption {
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  padding: 8px 12px 4px;
  max-width: 90vw;
  pointer-events: auto;
}
.mxul-lb.is-video .mxul-lb__caption.is-on { display: block; }

.mxul-lb .mx-video-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; z-index: 5; cursor: pointer; background: transparent;
}
.mxul-lb .mxnv-hit { position: absolute; inset: 0; z-index: 6; cursor: pointer; }
.mxul-lb .mxnv-dock {
  position: absolute; z-index: 80;
  left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
}
.mxul-lb .mxnv-dock > * { pointer-events: auto; }
.mxul-lb .mxnv-scrub {
  flex: 1 1 auto; height: 18px;
  display: flex; align-items: center; cursor: pointer;
  opacity: 0.5; transition: opacity .18s ease;
}
.mxul-lb .mxnv-dock:hover .mxnv-scrub,
.mxul-lb .mxnv-scrub:hover { opacity: 0.9; }
.mxul-lb .mxnv-scrub-track {
  width: 100%; height: 3px; border-radius: 99px;
  background: rgba(180,184,192,0.42); overflow: hidden;
}
.mxul-lb .mxnv-scrub-fill {
  height: 100%; width: 0%; border-radius: inherit; background: #faae60;
}
.mxul-lb .mxnv-btn {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(10,12,16,0.55); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.mxul-lb .mxnv-btn:hover { border-color: #faae60; color: #faae60; }
.mxul-lb .mxnv-btn svg { width: 18px; height: 18px; fill: currentColor; }
.mxul-lb .mxnv-play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8; width: 56px; height: 56px; padding: 0;
  border-radius: 50%; border: 2px solid #faae60;
  background: rgba(0,0,0,0.48);
  box-shadow: 0 0 16px rgba(0,0,0,0.7);
  cursor: pointer; display: grid; place-items: center;
}
.mxul-lb .mxnv-play svg { width: 22px; height: 22px; margin-left: 1px; fill: #fff; }
.mxul-lb .mxnv-flash {
  position: absolute; left: 50%; top: 50%; z-index: 9;
  width: 64px; height: 64px; margin: 0; padding: 0; border: 0;
  background: none; pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
  animation: mxnv-flash 0.55s ease-out forwards;
}
.mxul-lb .mxnv-flash svg { width: 64px; height: 64px; fill: #fff; filter: drop-shadow(0 0 10px rgba(0,0,0,0.55)); }
.mxul-lb .mxnv-loading {
  position: absolute; inset: 0; z-index: 7;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
}
.mxul-lb .mxnv-loading-ring {
  position: relative;
  width: 168px; height: 168px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mxul-lb .mxnv-loading-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(250,174,96,0.22);
  border-top-color: #faae60;
  animation: mxnv-spin 1.05s linear infinite;
}
.mxul-lb .mxnv-loading span {
  position: relative; z-index: 1;
  max-width: 130px;
  color: #faae60;
  letter-spacing: 0.08em;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
}
@keyframes mxnv-spin { to { transform: rotate(360deg); } }

.mxul-lb .mxnv-btn.mute svg { width: 20px; height: 20px; }

.mxul-lb__share { position: relative; overflow: visible; }
.mxul-lb__copied {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  white-space: nowrap;
  background: rgba(20,16,18,.94);
  color: #faae60;
  border: 1px solid rgba(250,174,96,.45);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.mxul-lb__share.is-copied .mxul-lb__copied {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
@media (max-width: 700px) {
  .mxul-lb__copied {
    right: 50%;
    top: calc(100% + 8px);
    transform: translateX(50%) translateY(-6px);
  }
  .mxul-lb__share.is-copied .mxul-lb__copied {
    transform: translateX(50%) translateY(0);
  }
}

/* Image lightbox: pinch / wheel zoom, drag to pan. Never below fitted size. */
.mxul-lb.is-image {
  touch-action: none;
}
.mxul-lb.is-image .mxul-lb__panel,
.mxul-lb.is-image .mxul-lb__media {
  overflow: visible;
}
.mxul-lb.is-image .mxul-lb__media img {
  touch-action: none;
  transform-origin: center center;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.mxul-lb.is-image.is-zoomed .mxul-lb__media img {
  cursor: grab;
  will-change: transform;
}
.mxul-lb.is-image.is-panning .mxul-lb__media img {
  cursor: grabbing;
}
.mxul-lb.is-zoomed .mxul-lb__tools {
  z-index: 1000003;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.85));
}
