.trsn-popup {
  --trsn-radius: 2px;
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  font-family: "Avenir", sans-serif;
  color: #020027;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.trsn-popup--open {
  display: block;
  opacity: 1;
}

.trsn-popup__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 128, 1, 0.28), rgba(19, 39, 73, 0.78));
  backdrop-filter: blur(4px);
}

.trsn-popup__dialog {
  position: relative;
  max-width: 520px;
  margin: 8vh auto;
  background: #ffffff;
  border-radius: var(--trsn-radius);
  padding: 18px 28px 28px;
  box-shadow: 0 22px 60px rgba(19, 39, 73, 0.35);
  text-align: left;
  overflow: hidden;
  transform: translateY(24px);
  opacity: 0;
  animation: trsn-popup-dialog-out 0.28s ease forwards;
}

.trsn-popup--center .trsn-popup__dialog {
  text-align: center;
}

.trsn-popup--open .trsn-popup__dialog {
  animation: trsn-popup-dialog-in 0.32s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.trsn-popup__toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 -8px 10px 0;
}

.trsn-popup__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(19, 39, 73, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #132749;
  box-shadow: 0 6px 16px rgba(19, 39, 73, 0.12);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.trsn-popup__close:hover,
.trsn-popup__close:focus-visible {
  background: #ff8001;
  border-color: #ff8001;
  color: #ffffff;
  transform: translateY(-1px);
  outline: none;
}

.trsn-popup__close:focus-visible {
  box-shadow: 0 0 0 3px rgba(73, 134, 237, 0.45);
}

.trsn-popup__image-wrap {
  margin: 0 0 18px;
}

.trsn-popup__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: max(0px, calc(var(--trsn-radius) - 2px));
}

.trsn-popup__title {
  margin: 0 0 12px;
  color: #132749;
  font-family: "Hero New", "Avenir", sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0;
  animation: trsn-popup-fade-up 0.28s ease forwards;
  animation-delay: 0.12s;
}

.trsn-popup__desc {
  margin: 0 0 22px;
  color: #020027;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0;
  animation: trsn-popup-fade-up 0.28s ease forwards;
  animation-delay: 0.16s;
}

.trsn-popup__button {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  padding: 0.55rem 1.25rem;
  border: 1px solid #132749;
  border-radius: 1px;
  background: #132749;
  color: #ffffff;
  font-family: "Hero New", "Avenir", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  animation: trsn-popup-fade-up 0.28s ease forwards;
  animation-delay: 0.2s;
}

.trsn-popup__button:hover,
.trsn-popup__button:focus {
  background: #ff8001;
  border-color: #ff8001;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
}

@keyframes trsn-popup-dialog-in {
  0% {
    transform: translateY(24px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes trsn-popup-dialog-out {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(24px);
    opacity: 0;
  }
}

@keyframes trsn-popup-fade-up {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .trsn-popup__dialog {
    margin: 4vh 16px;
    padding: 14px 18px 22px;
  }

  .trsn-popup__title {
    font-size: 24px;
  }
}

.trsn-popup-admin {
  max-width: 1180px;
  margin-top: 12px;
}

.trsn-popup-admin__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.trsn-popup-admin__header h1 {
  margin: 0 0 4px;
  padding: 0;
  color: #132749;
  font-size: 26px;
  line-height: 1.2;
}

.trsn-popup-admin__header p {
  margin: 0;
  color: #5c6770;
  font-size: 14px;
}

.trsn-popup-admin__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.trsn-popup-admin__card,
.trsn-popup-admin__preview-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(19, 39, 73, 0.04);
}

.trsn-popup-admin__card {
  padding: 18px 20px 8px;
  margin-bottom: 16px;
}

.trsn-popup-admin__card h2,
.trsn-popup-admin__preview-head h2 {
  margin: 0 0 14px;
  color: #132749;
  font-size: 15px;
  font-weight: 600;
}

.trsn-popup-admin__field,
.trsn-popup-admin__card fieldset {
  display: block;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.trsn-popup-admin__field > span,
.trsn-popup-admin__card legend {
  display: block;
  margin-bottom: 6px;
  color: #132749;
  font-size: 13px;
  font-weight: 600;
}

.trsn-popup-admin__field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.trsn-popup-admin__field-head strong {
  color: #ff8001;
  font-size: 13px;
}

.trsn-popup-admin__field small,
.trsn-popup-admin__toggle small {
  display: block;
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.trsn-popup-admin input[type="text"],
.trsn-popup-admin input[type="url"],
.trsn-popup-admin input[type="number"],
.trsn-popup-admin textarea {
  width: 100%;
  max-width: none;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: none;
  color: #132749;
}

.trsn-popup-admin input:focus,
.trsn-popup-admin textarea:focus {
  border-color: #4986ed;
  box-shadow: 0 0 0 3px rgba(73, 134, 237, 0.18);
}

.trsn-popup-admin__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.trsn-popup-admin__segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trsn-popup-admin__segment label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #132749;
  font-weight: 600;
  cursor: pointer;
}

.trsn-popup-admin__segment input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
}

.trsn-popup-admin__segment label.is-selected {
  border-color: #132749;
  background: #132749;
  color: #fff;
}

.trsn-popup-admin__align-icon {
  width: 16px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) left 0 / 16px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 5px / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 10px / 13px 2px no-repeat;
}

.trsn-popup-admin__align-icon--center {
  background:
    linear-gradient(currentColor, currentColor) center 0 / 16px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 5px / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 10px / 13px 2px no-repeat;
}

.trsn-popup-admin input[type="range"] {
  width: 100%;
  accent-color: #ff8001;
}

.trsn-popup-admin__media {
  display: flex;
  gap: 14px;
  align-items: center;
}

.trsn-popup-admin__media-preview {
  width: 112px;
  height: 76px;
  flex: 0 0 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #d0d5dd;
  border-radius: 8px;
  background: #f8fafc;
  color: #98a2b3;
  font-size: 11px;
}

.trsn-popup-admin__media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.trsn-popup-admin__media.has-image .trsn-popup-admin__media-preview {
  border-style: solid;
}

.trsn-popup-admin__media.has-image .trsn-popup-admin__media-preview img {
  display: block;
}

.trsn-popup-admin__media.has-image .trsn-popup-admin__media-preview span {
  display: none;
}

.trsn-popup-admin__media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.trsn-popup-admin__toggle {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f8fafc;
}

.trsn-popup-admin__toggle input {
  margin-top: 3px;
}

.trsn-popup-admin__toggle strong {
  display: block;
  color: #132749;
}

.trsn-popup-admin__toggle--quiet {
  background: #fff;
}

.trsn-popup-admin__inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trsn-popup-admin__inline input[type="number"] {
  width: 96px;
}

.trsn-popup-admin__inline em {
  color: #667085;
  font-style: normal;
}

.trsn-popup-admin .button-primary.trsn-popup-admin__save {
  background: #132749;
  border-color: #132749;
  border-radius: 8px;
  padding: 6px 18px;
  height: auto;
  line-height: 1.7;
}

.trsn-popup-admin .button-primary.trsn-popup-admin__save:hover,
.trsn-popup-admin .button-primary.trsn-popup-admin__save:focus {
  background: #ff8001;
  border-color: #ff8001;
}

.trsn-popup-admin__preview-card {
  position: sticky;
  top: 42px;
  padding: 16px;
}

.trsn-popup-admin__preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trsn-popup-admin__preview-head h2 {
  margin-bottom: 0;
}

#trsn-popup-admin-status {
  border-radius: 999px;
  padding: 3px 8px;
  background: #f2f4f7;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
}

#trsn-popup-admin-status.is-on {
  background: #fff4ea;
  color: #c2410c;
}

#trsn-popup-admin-status.is-off {
  background: #fef3f2;
  color: #b42318;
}

.trsn-popup-admin__master {
  margin-bottom: 16px;
}

.trsn-popup-admin__master:has(input:not(:checked)) {
  border-color: #fecdca;
  background: #fef3f2;
}

.trsn-popup-admin__stage.is-disabled {
  opacity: 0.45;
}

.trsn-popup-admin__stage {
  margin-top: 14px;
  padding: 28px 16px;
  border-radius: 8px;
  background: radial-gradient(circle at top, rgba(255, 128, 1, 0.35), #132749 72%);
}

.trsn-popup-admin__stage-dialog {
  position: relative;
  background: #fff;
  padding: 12px 16px 16px;
  text-align: left;
  box-shadow: 0 16px 36px rgba(19, 39, 73, 0.28);
}

.trsn-popup-admin__stage-dialog.is-center {
  text-align: center;
}

.trsn-popup-admin__stage-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 -4px 8px 0;
}

.trsn-popup-admin__stage-image {
  display: none;
  margin-bottom: 12px;
  overflow: hidden;
  min-height: 72px;
  background: linear-gradient(135deg, #132749, #4986ed);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trsn-popup-admin__stage-image.is-visible {
  display: grid;
  place-items: center;
}

.trsn-popup-admin__stage-image img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.trsn-popup-admin__stage-image img[hidden] {
  display: none;
}

.trsn-popup-admin__stage-image.is-visible img:not([hidden]) + span {
  display: none;
}

.trsn-popup-admin__stage-dialog h3 {
  margin: 0 0 6px;
  color: #132749;
  font-size: 20px;
  line-height: 1.25;
}

.trsn-popup-admin__stage-dialog p {
  margin: 0 0 14px;
  color: #020027;
  font-size: 13px;
  line-height: 1.5;
}

.trsn-popup-admin__stage-button {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 1px;
  background: #132749;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.trsn-popup-admin__preview-note {
  margin: 12px 0 0;
  color: #667085;
  font-size: 12px;
}

@media (max-width: 960px) {
  .trsn-popup-admin__layout,
  .trsn-popup-admin__split {
    grid-template-columns: 1fr;
  }

  .trsn-popup-admin__preview-card {
    position: static;
  }

  .trsn-popup-admin__header {
    align-items: flex-start;
    flex-direction: column;
  }
}
