body.is-modal-open {
  overflow: hidden;
}

.c-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
}

.c-modal.is-open {
  display: flex;
}

.c-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(8, 14, 22, 0.72);
  backdrop-filter: blur(6px);
}

.c-modal__panel {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100vh - 160px);
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--color-surface);
  border-radius: 20px;
  box-shadow: 0 32px 80px -12px rgba(8, 14, 22, 0.55);
}

.c-modal__panel--preview {
  width: min(100%, 960px);
}

.c-modal__header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 18px 24px;
  background: linear-gradient(120deg, var(--color-accent-dark) 0%, var(--color-accent) 100%);
}

.c-modal__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.c-modal__header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.c-modal__header-right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.c-modal__tabs {
  display: none;
  flex-wrap: nowrap;
  gap: 6px;
}

.c-modal__tabs.is-visible {
  display: flex;
}

.c-modal__tab {
  padding: 5px 13px;
  background-color: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.85);
}

@media (any-hover: hover) {
  .c-modal__tab:not(.is-active):hover {
    background-color: rgba(255, 255, 255, 0.22);
  }
}

.c-modal__tab.is-active {
  background-color: #ffffff;
  border-color: #ffffff;
  color: var(--color-accent-dark);
}

.c-modal__header-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background-color: rgba(255, 255, 255, 0.16);
  color: var(--color-accent-ink);
}

.c-modal__header-icon svg {
  width: 19px;
  height: 19px;
}

.c-modal__body {
  padding: 44px;
  background-color: var(--color-accent-soft);
}

.c-modal__close {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.16);
  color: var(--color-accent-ink);
}

.c-modal__close svg {
  width: 16px;
  height: 16px;
}

@media (any-hover: hover) {
  .c-modal__close:hover {
    background-color: rgba(255, 255, 255, 0.3);
  }
}

.c-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-accent-ink);
}

@media (max-width: 600px) {
  .c-modal__header-top {
    flex-wrap: wrap;
    padding-right: 44px;
  }

  .c-modal__header-right {
    flex-basis: 100%;
  }

  .c-modal__close {
    position: absolute;
    top: 16px;
    right: 20px;
    margin-left: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --modal-preview-chrome-x: 64px;
  }

  .c-modal {
    padding: 40px 16px;
  }

  .c-modal__panel {
    max-height: calc(100vh - 80px);
  }

  .c-modal__header {
    padding: 16px 20px;
  }

  .c-modal__body {
    padding: 32px 16px;
  }
}
