.mltp-root {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  box-sizing: border-box;
  font-family: inherit;
}

.mltp-root[hidden] {
  display: none !important;
}

.mltp-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.mltp-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 700px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.mltp-media-area {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #f7f7f7;
}

.mltp-panel {
  display: none;
  width: 100%;
}

.mltp-media-area.is-single .mltp-panel:first-child,
.mltp-panel.is-active {
  display: block;
}

.mltp-media-link,
.mltp-media-link.is-static {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  background: #f7f7f7;
}

.mltp-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.mltp-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 320px;
  background: linear-gradient(135deg, #fafafa 0%, #efefef 100%);
  color: #333;
  font-size: 22px;
  font-weight: 600;
}

.mltp-tabs {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  border-top: 1px solid #f1f1f1;
  border-bottom: 1px solid #f1f1f1;
  background: #fff;
  flex: 0 0 auto;
}

.mltp-tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 58px;
  padding: 16px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #999;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mltp-tab:hover,
.mltp-tab:focus,
.mltp-tab:focus-visible,
.mltp-tab:active {
  background: #fafafa !important;
  color: #333 !important;
  outline: none;
  box-shadow: none !important;
}

.mltp-tab.is-active,
.mltp-tab.is-active:hover,
.mltp-tab.is-active:focus,
.mltp-tab.is-active:focus-visible,
.mltp-tab.is-active:active {
  background: transparent !important;
  color: #333 !important;
  outline: none;
  box-shadow: none !important;
}

.mltp-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #333 !important;
}

.mltp-tab,
.mltp-tab:visited,
.mltp-tab:hover,
.mltp-tab:focus,
.mltp-tab:focus-visible,
.mltp-tab:active,
.mltp-tab.is-active,
.mltp-tab.is-active:visited,
.mltp-tab.is-active:hover,
.mltp-tab.is-active:focus,
.mltp-tab.is-active:focus-visible,
.mltp-tab.is-active:active {
  text-decoration: none;
}

.mltp-tab-text {
  display: block;
  width: 100%;
  word-break: keep-all;
}

.mltp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: rgba(249, 249, 249, 0.7);
  flex: 0 0 auto;
}

.mltp-dismiss-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mltp-dismiss {
  border: 0;
  background: transparent;
  color: #666;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0;
}

.mltp-dismiss:hover,
.mltp-dismiss:focus,
.mltp-dismiss:focus-visible,
.mltp-dismiss:active {
  background: transparent !important;
  color: #333 !important;
  outline: none;
  box-shadow: none !important;
}

.mltp-close {
  min-width: 96px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: #333;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mltp-close:hover,
.mltp-close:focus,
.mltp-close:focus-visible,
.mltp-close:active {
  background: #f1f1f1 !important;
  color: #333 !important;
  outline: none;
  box-shadow: none !important;
}

@media (max-width: 1300px) {
  .mltp-root {
    padding: 20px;
  }
}

@media (max-width: 1024px) {
  .mltp-dialog {
    max-width: 640px;
  }

  .mltp-tab {
    font-size: 14px !important;
    min-height: 54px;
    padding: 14px 8px;
  }

  .mltp-image-placeholder {
    min-height: 280px;
  }
}

@media (max-width: 880px) {
  .mltp-root {
    padding: 16px;
    align-items: center;
  }

  .mltp-dialog {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
  }

  .mltp-tabs {
    flex-wrap: wrap;
  }

  .mltp-tab {
    flex: 0 0 33.333333%;
    font-size: 14px !important;
    min-height: 50px;
    padding: 12px 8px;
  }

  .mltp-actions {
    padding: 16px;
    gap: 12px;
  }

  .mltp-image-placeholder {
    min-height: 220px;
  }
}

@media (max-width: 500px) {
  .mltp-root {
    padding: 12px;
  }

  .mltp-dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .mltp-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .mltp-dismiss-group {
    gap: 10px;
    flex-wrap: wrap;
  }

  .mltp-dismiss,
  .mltp-close {
    font-size: 12px;
  }

  .mltp-close {
    min-width: 84px;
    padding: 10px 22px;
  }

  .mltp-image-placeholder {
    min-height: 180px;
  }
}
