.lbm-mdm-layer[hidden] { display: none !important; }
.lbm-mdm-layer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background: rgba(0, 2, 9, .04);
  opacity: 0;
  visibility: hidden;
  transition: opacity 340ms ease, visibility 340ms ease;
}
.lbm-mdm-layer.is-visible { opacity: 1; visibility: visible; }
.lbm-mdm-layer.is-leaving { opacity: 0; visibility: visible; }
.lbm-mdm-panel {
  position: relative;
  width: min(680px, 100%);
  min-height: min(510px, 72vw);
  aspect-ratio: 4 / 3;
  max-height: min(88vh, 760px);
  overflow: auto;
  box-sizing: border-box;
  padding: clamp(68px, 19%, 98px) clamp(44px, 10%, 64px) clamp(34px, 8%, 48px);
  color: #eef4ff;
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transform: translateY(14px);
  transition: transform 380ms cubic-bezier(.22, .75, .3, 1), opacity 340ms ease;
  opacity: 0;
}
.lbm-mdm-layer.is-visible .lbm-mdm-panel { transform: translateY(0); opacity: 1; }
.lbm-mdm-layer.is-leaving .lbm-mdm-panel { transform: translateY(7px); opacity: 0; }
.lbm-mdm-panel::before,
.lbm-mdm-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.lbm-mdm-panel::before {
  inset: 0;
  z-index: 0;
  background: url("panel-messaggio.png") center / 100% 100% no-repeat;
  opacity: .5;
}
.lbm-mdm-panel::after { display: none; }
.lbm-mdm-corner {
  display: none;
}
.lbm-mdm-close {
  position: absolute;
  z-index: 2;
  top: 15.5%;
  right: 6.8%;
  display: grid;
  place-items: center;
  width: clamp(34px, 9.5%, 50px);
  aspect-ratio: 1;
  height: auto;
  padding: 0;
  color: #eaf2ff;
  font: 300 28px/1 Georgia, serif;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  text-shadow: 0 0 9px #7c9dff, 0 0 18px rgba(97, 111, 255, .8);
  transition: text-shadow 180ms ease, color 180ms ease;
}
.lbm-mdm-close:hover,
.lbm-mdm-close:focus-visible { color: #fff; text-shadow: 0 0 12px #fff, 0 0 22px #779aff; outline: 2px solid rgba(223, 235, 255, .92); outline-offset: 2px; }
.lbm-mdm-kicker {
  position: relative;
  z-index: 1;
  margin: 0 42px 8px;
  color: #edf3ff;
  font: 600 clamp(11px, 2vw, 13px)/1.4 Georgia, serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(171, 196, 255, .8);
}
.lbm-mdm-sigil { display: none; }
.lbm-mdm-sigil span,
.lbm-mdm-sigil i { display: none; }
.lbm-mdm-panel h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: #fff;
  font: 400 clamp(24px, 4.6vw, 36px)/1.08 Georgia, "Times New Roman", serif;
  text-wrap: balance;
  text-shadow: 0 0 7px #516fc2, 0 0 17px rgba(133, 158, 255, .72);
}
.lbm-mdm-copy {
  position: relative;
  z-index: 1;
  margin: 0 auto 24px;
  max-width: 44ch;
  max-height: clamp(72px, 18vh, 150px);
  overflow-y: auto;
  color: #f2f6ff;
  font: 400 clamp(14px, 2.2vw, 16px)/1.5 Georgia, "Times New Roman", serif;
  text-align: center;
  text-shadow: 0 1px 4px #02050e, 0 0 9px rgba(66, 85, 149, .86);
}
.lbm-mdm-action {
  position: absolute;
  z-index: 1;
  left: 26%;
  right: 26%;
  top: 68%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 12%;
  padding: 9px 20px;
  color: #f7f9ff;
  font: 600 clamp(14px, 2.4vw, 17px)/1.2 Georgia, serif;
  letter-spacing: .04em;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 999px;
  text-shadow: 0 0 7px rgba(120, 146, 255, .85);
  transition: text-shadow 180ms ease, color 180ms ease;
}
.lbm-mdm-action:hover,
.lbm-mdm-action:focus-visible {
  color: #fff;
  background: transparent;
  text-shadow: 0 0 10px #fff, 0 0 20px #718cff;
  outline: 2px solid rgba(220, 232, 255, .92);
  outline-offset: 3px;
}
/* Narrow or short viewports need a reading area rather than a scaled
   desktop card. Nine-slice artwork retains the frame while its center grows. */
@media (max-width: 600px), (max-height: 600px) {
  .lbm-mdm-layer {
    --lbm-mdm-viewport: 100vh;
    padding: 16px;
    box-sizing: border-box;
    height: var(--lbm-mdm-viewport);
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  .lbm-mdm-panel {
    --lbm-mdm-frame-unit: min(calc((100vw - 32px) / 1448), calc((var(--lbm-mdm-viewport) - 32px) / 1600));
    display: flex;
    flex-direction: column;
    width: min(680px, 100%);
    min-width: 0;
    height: min(560px, calc(var(--lbm-mdm-viewport) - 32px));
    min-height: 0;
    max-height: calc(var(--lbm-mdm-viewport) - 32px);
    aspect-ratio: auto;
    padding: 0;
    overflow: visible;
    border-style: solid;
    border-width: calc(340 * var(--lbm-mdm-frame-unit)) calc(240 * var(--lbm-mdm-frame-unit)) calc(350 * var(--lbm-mdm-frame-unit));
    border-image-source: url('panel-messaggio.png');
    border-image-slice: 340 240 350 240 fill;
    border-image-width: 1;
    border-image-repeat: stretch;
  }
  .lbm-mdm-panel::before { display: none; }
  .lbm-mdm-kicker { flex: none; margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; overflow-wrap: anywhere; }
  .lbm-mdm-panel h2 { flex: none; margin: 0 0 12px; font-size: clamp(20px, 4.6vw, 28px); line-height: 1.12; overflow-wrap: anywhere; }
  .lbm-mdm-copy {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0 4px 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.45;
    scrollbar-width: thin;
  }
  .lbm-mdm-action {
    top: auto;
    bottom: calc(-150 * var(--lbm-mdm-frame-unit));
    left: calc(120 * var(--lbm-mdm-frame-unit));
    right: calc(120 * var(--lbm-mdm-frame-unit));
    min-height: 44px;
    height: calc(150 * var(--lbm-mdm-frame-unit));
    padding: 4px 8px;
    font-size: 14px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }
  .lbm-mdm-close {
    top: calc(-160 * var(--lbm-mdm-frame-unit));
    right: calc(-130 * var(--lbm-mdm-frame-unit));
    width: 44px;
    height: 44px;
    font-size: 28px;
  }
}
@supports (height: 100dvh) {
  @media (max-width: 600px), (max-height: 600px) {
    .lbm-mdm-layer { --lbm-mdm-viewport: 100dvh; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .lbm-mdm-layer,
  .lbm-mdm-panel { transition-duration: 20ms; }
}
