.spa-tw-floating,
.spa-tw-modal,
.spa-tw-max-card {
  box-sizing: border-box;
  font-family: inherit;
}

.spa-tw-floating *,
.spa-tw-modal *,
.spa-tw-max-card * {
  box-sizing: border-box;
}

.spa-tw-floating {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.spa-tw-float-button {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(55, 35, 24, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.spa-tw-float-button:hover,
.spa-tw-float-button:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 11px 28px rgba(55, 35, 24, 0.3);
  outline: none;
  filter: brightness(1.04);
}

.spa-tw-vk {
  background: #0077ff;
}

.spa-tw-vk-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -1.7px;
  line-height: 1;
}

.spa-tw-request {
  background: linear-gradient(145deg, #6d4a35, #3f281b);
}

.spa-tw-request svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spa-tw-tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  width: max-content;
  max-width: 240px;
  padding: 8px 11px;
  border-radius: 8px;
  background: #2f2119;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
}

.spa-tw-float-button:hover .spa-tw-tooltip,
.spa-tw-float-button:focus-visible .spa-tw-tooltip {
  opacity: 1;
  transform: translate(0, -50%);
}

.spa-tw-max-card {
  position: fixed;
  right: 20px;
  bottom: 174px;
  z-index: 99980;
  display: flex;
  width: 238px;
  min-height: 92px;
  padding: 12px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(79, 91, 255, 0.16);
  border-radius: 17px;
  background: rgba(255, 253, 250, 0.97);
  color: #33231c;
  box-shadow: 0 10px 30px rgba(55, 35, 24, 0.16);
  backdrop-filter: blur(8px);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.spa-tw-max-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 34px rgba(55, 35, 24, 0.22);
}

.spa-tw-max-icon {
  display: inline-flex;
  width: 51px;
  height: 51px;
  flex: 0 0 51px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #6257ff, #18b9e8);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.6px;
  box-shadow: 0 6px 15px rgba(71, 91, 230, 0.27);
}

.spa-tw-max-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.18;
}

.spa-tw-max-copy strong {
  color: #33231c;
  font-size: 15px;
  font-weight: 750;
}

.spa-tw-max-copy small {
  margin-top: 3px;
  color: #74655d;
  font-size: 11px;
}

.spa-tw-max-actions {
  display: flex;
  margin-top: 7px;
  gap: 6px;
}

.spa-tw-max-actions a {
  display: inline-flex;
  min-height: 27px;
  padding: 5px 8px;
  align-items: center;
  border: 1px solid rgba(79, 91, 231, 0.2);
  border-radius: 7px;
  background: #f1f2ff;
  color: #4f5be7;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.spa-tw-max-actions a:hover,
.spa-tw-max-actions a:focus-visible {
  border-color: #4f5be7;
  background: #4f5be7;
  color: #fff;
  outline: none;
  text-decoration: none;
}

.spa-tw-modal[hidden] {
  display: none !important;
}

.spa-tw-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  overflow-y: auto;
  padding: 18px;
  place-items: center;
}

.spa-tw-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 24, 18, 0.58);
  backdrop-filter: blur(3px);
}

.spa-tw-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 30px;
  border: 1px solid #e8ddd3;
  border-radius: 22px;
  background: #fffdfa;
  color: #37251c;
  box-shadow: 0 22px 70px rgba(31, 20, 14, 0.3);
  outline: none;
}

.spa-tw-close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  width: 36px;
  height: 36px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #76645a;
  cursor: pointer;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.spa-tw-close:hover,
.spa-tw-close:focus-visible {
  background: #f3ebe4;
  color: #3f281b;
  outline: none;
}

.spa-tw-dialog-mark {
  display: inline-flex;
  min-width: 52px;
  height: 30px;
  padding: 0 11px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eee2d7;
  color: #5d3d2b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.spa-tw-dialog h2 {
  margin: 14px 42px 8px 0;
  color: #332119;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.15;
}

.spa-tw-intro {
  margin: 0 0 21px;
  color: #6e5d54;
  font-size: 14px;
  line-height: 1.5;
}

.spa-tw-form {
  display: grid;
  gap: 15px;
}

.spa-tw-form > label:not(.spa-tw-consent):not(.spa-tw-honeypot) {
  display: grid;
  gap: 7px;
}

.spa-tw-form label > span {
  color: #4b382f;
  font-size: 13px;
  font-weight: 650;
}

.spa-tw-form label b {
  color: #9a5b38;
}

.spa-tw-form input[type="text"],
.spa-tw-form input[type="tel"],
.spa-tw-form textarea {
  width: 100%;
  margin: 0;
  padding: 12px 13px;
  border: 1px solid #d9cbc0;
  border-radius: 10px;
  background: #fff;
  color: #302018;
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.spa-tw-form textarea {
  min-height: 84px;
  resize: vertical;
}

.spa-tw-form input:focus,
.spa-tw-form textarea:focus {
  border-color: #8f684f;
  outline: none;
  box-shadow: 0 0 0 3px rgba(143, 104, 79, 0.13);
}

.spa-tw-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.spa-tw-consent {
  display: grid;
  grid-template-columns: 19px 1fr;
  gap: 9px;
  align-items: start;
  cursor: pointer;
}

.spa-tw-consent input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: #5d3d2b;
}

.spa-tw-consent span {
  color: #75645b !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.42;
}

.spa-tw-consent a {
  color: #5d3d2b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.spa-tw-submit {
  width: 100%;
  min-height: 48px;
  margin: 1px 0 0;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #6d4a35, #442c1f);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 7px 18px rgba(79, 50, 33, 0.2);
  transition: transform 160ms ease, filter 160ms ease;
}

.spa-tw-submit:hover,
.spa-tw-submit:focus-visible {
  color: #fff;
  filter: brightness(1.06);
  outline: none;
  transform: translateY(-1px);
}

.spa-tw-submit:disabled {
  cursor: wait;
  filter: grayscale(0.25);
  opacity: 0.7;
  transform: none;
}

.spa-tw-status {
  min-height: 0;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.spa-tw-status:empty {
  display: none;
}

.spa-tw-status.is-success {
  color: #247247;
}

.spa-tw-status.is-error {
  color: #a2392f;
}

body.spa-tw-modal-open {
  overflow: hidden;
}

@media (max-width: 782px) {
  .spa-tw-floating {
    right: 13px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .spa-tw-float-button {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
  }

  .spa-tw-vk-text {
    font-size: 18px;
  }

  .spa-tw-request svg {
    width: 24px;
    height: 24px;
  }

  .spa-tw-tooltip {
    display: none;
  }

  .spa-tw-max-card {
    right: 13px;
    bottom: calc(142px + env(safe-area-inset-bottom, 0px));
    width: min(238px, calc(100vw - 26px));
    min-height: 88px;
    padding: 10px;
    gap: 9px;
    border-radius: 15px;
  }

  .spa-tw-max-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    font-size: 12px;
  }

  .spa-tw-max-copy strong {
    font-size: 14px;
  }

  .spa-tw-max-copy small {
    font-size: 10px;
  }

  .spa-tw-max-actions {
    margin-top: 6px;
    gap: 5px;
  }

  .spa-tw-max-actions a {
    min-height: 26px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .spa-tw-modal {
    padding: 10px;
    align-items: end;
  }

  .spa-tw-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 25px 20px 22px;
    border-radius: 20px 20px 14px 14px;
  }

  .spa-tw-dialog h2 {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spa-tw-float-button,
  .spa-tw-tooltip,
  .spa-tw-max-card,
  .spa-tw-submit {
    transition: none;
  }
}
