.ep-modal-trigger {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(var(--ep-trigger-bottom, 18px), env(safe-area-inset-bottom));
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid rgba(214, 181, 83, .55);
  border-radius: 999px;
  padding: .55rem .9rem .55rem .55rem;
  background: linear-gradient(145deg, #0d2b52, #071a33);
  color: #fff;
  box-shadow: 0 16px 36px -16px rgba(7, 26, 51, .85), 0 2px 0 rgba(255, 255, 255, .08) inset;
  font-weight: 800;
  font-size: .84rem;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, bottom .18s ease;
}
.ep-modal-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px -18px rgba(7, 26, 51, .95);
  color: #fff;
}
.ep-modal-trigger:focus-visible {
  outline: 3px solid rgba(214, 181, 83, .65);
  outline-offset: 3px;
}
.ep-modal-trigger__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f2dc9a, #d6b553);
  color: #1b2433;
  font-size: .95rem;
}
.ep-modal-trigger__text { white-space: nowrap; }

dialog.ep-modal {
  width: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #10233f;
}
dialog.ep-modal::backdrop {
  background: rgba(3, 11, 24, .66);
  backdrop-filter: blur(7px);
}
.ep-modal__panel {
  width: min(980px, 94vw);
  height: min(88vh, 900px);
  max-height: 92vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: #f5f7fb;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .75);
  animation: epModalIn .22s ease-out both;
}
@keyframes epModalIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ep-modal__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1.1rem;
  background:
    radial-gradient(500px 140px at 10% 0%, rgba(214, 181, 83, .22), transparent 65%),
    linear-gradient(145deg, #0d2b52, #071a33);
  color: #fff;
}
.ep-modal__identity { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.ep-modal__mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(214, 181, 83, .18);
  border: 1px solid rgba(214, 181, 83, .38);
  color: #f1dfa4;
  font-size: 1rem;
}
.ep-modal__kicker {
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .64rem;
  font-weight: 800;
  color: #f1dfa4;
  margin-bottom: .12rem;
}
.ep-modal__head h2 {
  margin: 0;
  font-size: clamp(.92rem, 1.5vw, 1.08rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ep-modal__tools { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.ep-modal__lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
}
.ep-modal__lang button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-size: .68rem;
  font-weight: 800;
  padding: .32rem .55rem;
  border-radius: 999px;
  cursor: pointer;
}
.ep-modal__lang button.is-active { background: #d6b553; color: #1b2433; }
.ep-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.ep-modal__close:hover { background: rgba(255, 255, 255, .16); transform: rotate(4deg); }
.ep-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  background: #f5f7fb;
  position: relative;
}
.ep-modal__body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f5f7fb;
}
.ep-modal__body.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #eef3f9 20%, #f8fbff 40%, #eef3f9 60%);
  background-size: 220% 100%;
  animation: epModalShimmer 1.1s linear infinite;
}
@keyframes epModalShimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
.ep-modal__foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem 1.1rem;
  border-top: 1px solid rgba(16, 35, 63, .1);
  background: #fff;
  color: #5b6b82;
  font-size: .72rem;
}
.ep-modal__foot a { color: #0d2b52; text-decoration: none; font-weight: 800; display: inline-flex; align-items: center; gap: .35rem; }
.ep-modal__foot a:hover { text-decoration: underline; text-underline-offset: 2px; }
body.ep-modal-open { overflow: hidden; }

@media (max-width: 720px) {
  .ep-modal__panel {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .ep-modal__head { padding: .8rem .9rem; }
  .ep-modal__mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
  .ep-modal__head h2 { font-size: .92rem; }
  .ep-modal__foot { font-size: .68rem; padding: .55rem .9rem; }
  .ep-modal__foot span { display: none; }
  .ep-modal-trigger { font-size: .78rem; padding: .45rem .75rem .45rem .45rem; gap: .45rem; }
  .ep-modal-trigger__icon { width: 30px; height: 30px; font-size: .85rem; }
}
@media (max-width: 420px) {
  .ep-modal-trigger__text { display: none; }
  .ep-modal-trigger { padding: .42rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ep-modal__panel { animation: none !important; }
  .ep-modal-trigger, .ep-modal__close { transition: none !important; }
  .ep-modal__body.is-loading::after { animation: none !important; }
}
