.site-contact-bar {
  position: fixed;
  top: calc(96px + env(safe-area-inset-top, 0px));
  right: max(24px, env(safe-area-inset-right));
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-contact-bar .site-phone-chip {
  width: 290px;
  position: static;
  opacity: .9;
}

.site-messengers {
  display: flex;
  align-items: center;
  gap: 7px;
}

.site-messenger {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(208, 192, 138, .58);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(58, 69, 48, .94), rgba(15, 22, 15, .96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 22px rgba(0, 0, 0, .18);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.site-messenger:hover,
.site-messenger:focus-visible {
  transform: translateY(-2px);
  border-color: #d0c08a;
  background: linear-gradient(145deg, rgba(83, 96, 65, .98), rgba(24, 33, 23, .98));
  box-shadow: 0 10px 26px rgba(0, 0, 0, .26), 0 0 0 3px rgba(208, 192, 138, .11);
  outline: none;
}

.site-messenger img { width: 22px; height: 22px; display: block; object-fit: contain; }
.site-messenger[data-messenger="max"] img { width: 23px; height: 23px; }

.consult-float {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 9999;
  color: #172117;
  font-family: Georgia, "Times New Roman", serif;
}

.consult-float-button {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 10px 18px 10px 10px;
  border: 1px solid rgba(208, 192, 138, .48);
  border-radius: 19px;
  color: #f7f5ed;
  background: linear-gradient(135deg, #3b482f, #182117 72%);
  box-shadow: 0 20px 54px rgba(7, 13, 8, .36), inset 0 1px 0 rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.consult-float-button:hover,
.consult-float-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(208, 192, 138, .86);
  box-shadow: 0 24px 62px rgba(7, 13, 8, .42), 0 0 0 4px rgba(208, 192, 138, .1);
  outline: none;
}

.consult-float-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #172117;
  background: linear-gradient(135deg, #e2d49f, #a8ad77);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .48);
  font-size: 25px;
  font-weight: 700;
}

.consult-float-label { display: grid; gap: 2px; text-align: left; }
.consult-float-label strong { font-size: 16px; line-height: 1.1; }
.consult-float-label small { color: #cbd2c4; font-size: 13px; }
.consult-float-mobile-label { display: none; }

.consult-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(376px, calc(100vw - 32px));
  max-height: calc(100dvh - 112px);
  padding: 25px;
  overflow: auto;
  border: 1px solid rgba(56, 68, 47, .2);
  border-radius: 25px;
  color: #172117;
  background:
    radial-gradient(circle at 94% 0, rgba(208, 192, 138, .22), transparent 29%),
    linear-gradient(180deg, #faf8f1, #eeebde);
  box-shadow: 0 30px 80px rgba(7, 13, 8, .36), inset 0 1px 0 rgba(255, 255, 255, .82);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.consult-float.is-open .consult-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.consult-popover-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.consult-popover-kicker {
  display: block;
  margin-bottom: 5px;
  color: #69734f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.consult-popover-head h2 { margin: 0; font-size: 27px; line-height: 1.03; letter-spacing: -.025em; }
.consult-popover-head p { margin: 9px 0 0; color: #64705e; font-size: 13px; line-height: 1.45; }

.consult-popover-close {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(23, 33, 23, .13);
  border-radius: 11px;
  color: #43503d;
  background: rgba(255, 255, 255, .58);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.consult-popover-form { display: grid; gap: 12px; }
.consult-popover-field { display: grid; gap: 6px; }
.consult-popover-field label { color: #596451; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.consult-popover-field input,
.consult-popover-field textarea {
  width: 100%;
  border: 1px solid rgba(23, 33, 23, .15);
  border-radius: 12px;
  padding: 12px 13px;
  outline: none;
  color: #172117;
  background: rgba(255, 255, 255, .86);
}
.consult-popover-field textarea { min-height: 84px; resize: vertical; }
.consult-popover-field input:focus,
.consult-popover-field textarea:focus { border-color: #7d875d; box-shadow: 0 0 0 3px rgba(100, 112, 79, .12); }

.consult-popover-submit {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  color: #172117;
  background: linear-gradient(135deg, #d4c48d, #a8ad77);
  font-weight: 800;
  cursor: pointer;
}
.consult-popover-submit:disabled { cursor: wait; opacity: .72; }

.consult-popover-note { margin: 0; color: #778171; font-size: 10px; line-height: 1.4; }
.consult-popover-message { display: none; padding: 11px 12px; border-radius: 11px; color: #274333; background: #e4eee3; font-size: 12px; line-height: 1.4; }
.consult-popover-message.show { display: block; }
.consult-popover-message.is-error { color: #71332d; background: #f6e3df; }

@media (max-width: 640px) {
  .site-contact-bar {
    width: min(370px, calc(100vw - 24px));
    top: calc(82px + env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }
  .site-contact-bar .site-phone-chip {
    width: auto;
    min-width: 0;
    padding: 6px 9px 6px 6px;
  }
  .site-contact-bar .site-phone-number {
    min-width: 0;
    white-space: nowrap;
    font-size: 13px;
  }
  .site-messengers { gap: 6px; }
  .site-messenger { width: 34px; height: 34px; flex-basis: 34px; }
  .site-messenger img { width: 20px; height: 20px; }

  .consult-float {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }
  .consult-float-button { min-height: 50px; padding: 6px 11px 6px 6px; gap: 8px; border-radius: 15px; }
  .consult-float-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; font-size: 22px; }
  .consult-float-label strong,
  .consult-float-label small { display: none; }
  .consult-float-mobile-label {
    display: block;
    max-width: 118px;
    color: #f4f0e4;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.05;
  }
  .consult-popover { width: calc(100vw - 24px); max-height: calc(100dvh - 96px); padding: 20px; border-radius: 21px; }
  .consult-popover-field input,
  .consult-popover-field textarea { font-size: 16px; }
  .site-guide summary strong,
  .site-guide summary small { display: none; }
  .site-guide summary > span:last-child::after {
    content: "Меню";
    color: #f4f0e4;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
  }
  body.pr-guide-open .consult-float,
  body.pr-consult-open .site-context-dock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
  }
}

@media (max-width: 360px) {
  .site-contact-bar .site-phone-chip { gap: 7px; padding-right: 6px; }
  .site-contact-bar .site-phone-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .site-contact-bar .site-phone-number { font-size: 12px; }
  .site-messengers { gap: 5px; }
  .site-messenger { width: 32px; height: 32px; flex-basis: 32px; }
  .site-messenger img { width: 19px; height: 19px; }
}

@media (hover: none) and (pointer: coarse) {
  .consult-float-button:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .consult-float,
  .consult-float-button,
  .consult-popover { transition: none; }
}
