.msf {
  display: block;
  width: fit-content;
  margin: 10px 0 14px;
  color: #28231f;
}

.msf * {
  box-sizing: border-box;
}

.msf[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

.msf-modal-open {
  overflow: hidden;
}

.msf__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #d9cec5;
  border-radius: 6px;
  background: #ffffff;
  color: #2f7066;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.msf__trigger:hover,
.msf__trigger:focus {
  border-color: #2f7066;
  color: #275f57;
  box-shadow: 0 0 0 3px rgba(47, 112, 102, 0.12);
  outline: none;
}

.msf__trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #eef8f5;
  font-size: 13px;
  line-height: 1;
}

.msf__overlay[hidden] {
  display: none;
}

.msf__overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(37, 31, 28, 0.48);
}

.msf__dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border: 1px solid #e6e1dc;
  border-radius: 8px;
  background: #fffaf6;
  box-shadow: 0 24px 70px rgba(30, 24, 20, 0.26);
}

.msf__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.msf__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #ded3ca;
  border-radius: 999px;
  background: #ffffff;
  color: #4b4039;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.msf__close:hover,
.msf__close:focus {
  border-color: #a66a55;
  outline: none;
}

.msf__eyebrow {
  margin: 0 0 4px;
  color: #8b5f4d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.msf__title {
  margin: 0;
  color: #28231f;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.msf__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.msf__field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #3d3630;
  font-size: 13px;
  font-weight: 700;
}

.msf__field select,
.msf__field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d9cec5;
  border-radius: 6px;
  background: #ffffff;
  color: #26211d;
  font-size: 15px;
  line-height: 1.2;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.msf__field select {
  padding: 0 12px;
}

.msf__field input {
  padding: 0 46px 0 12px;
}

.msf__field select:focus,
.msf__field input:focus {
  border-color: #a66a55;
  box-shadow: 0 0 0 3px rgba(166, 106, 85, 0.15);
}

.msf__input-wrap {
  position: relative;
}

.msf__input-wrap b {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #8a7b70;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.msf[dir="rtl"] .msf__field input {
  padding: 0 12px 0 46px;
}

.msf[dir="rtl"] .msf__input-wrap b {
  right: auto;
  left: 12px;
}

.msf__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.msf__button,
.msf__link {
  min-height: 44px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.msf__button {
  flex: 1 1 auto;
  border: 0;
  padding: 0 18px;
  background: #2f7066;
  color: #ffffff;
}

.msf__button:hover,
.msf__button:focus {
  background: #275f57;
}

.msf__link {
  flex: 0 0 auto;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: #765547;
}

.msf__result {
  display: block;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
}

.msf__result--success {
  border: 1px solid #b9d6ce;
  background: #eef8f5;
}

.msf__result--error {
  border: 1px solid #e0bab0;
  background: #fff2ee;
  color: #7a2f21;
  font-weight: 700;
}

.msf__result-text {
  margin: 0;
  color: #253d38;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
}

.msf__size {
  display: inline-block;
  min-width: 46px;
  margin: 0 2px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #2f7066;
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

.msf__result small {
  display: block;
  margin-top: 8px;
  color: #5b534c;
  font-size: 13px;
}

@media (max-width: 640px) {
  .msf__overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .msf__dialog {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .msf__header {
    align-items: flex-start;
  }

  .msf__grid {
    grid-template-columns: 1fr;
  }

  .msf__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .msf__button,
  .msf__link {
    width: 100%;
  }

  .msf__result {
    padding: 13px;
  }
}
