.v2-contact-only { display: none; }
.contact-photo-short { display: none; }
[data-design="v2"] .masthead .header-request { display: none; }
[data-design="v2"] .mast-actions { margin-left: auto; gap: clamp(6px, .7vw, 14px); }
[data-design="v2"] .mast-actions .header-phone a {
  display: grid;
  align-content: center;
  gap: 1px;
  min-height: 52px;
  padding: 6px clamp(13px, 1.15vw, 21px);
  border-radius: 16px;
  background: var(--red);
  color: #fff;
  line-height: 1.1;
  font-size: clamp(17px, 1.2vw, 22px);
}
[data-design="v2"] .header-phone a::before {
  content: "Звоните круглосуточно";
  font-size: .75em;
  font-weight: 510;
  letter-spacing: 0;
}
[data-design="v2"] .contact-photo, .contact-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 48px;
  min-height: 50px;
  padding: 9px clamp(13px, 1.1vw, 22px);
  font-size: clamp(16px, 1.14vw, 21px);
  font-weight: 620;
  line-height: 1.15;
  letter-spacing: -.025em;
  border-radius: 16px;
  text-decoration: none;
  white-space: nowrap;
}
[data-design="v2"] .contact-photo { background:var(--v2-surface); color:var(--v2-blue); }
.contact-photo svg, .contact-menu svg, .master-launch svg, #master-chat svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[data-design="v2"] .contact-menu { display: block; position: relative; margin: 0; }
.contact-menu summary {
  list-style: none;
  color: #fff;
  background: var(--v2-blue);
  user-select: none;
}
.contact-menu summary::-webkit-details-marker { display:none; }
.contact-menu summary svg { width: 17px; height: 17px; }
.contact-menu[open] summary svg { transform: rotate(180deg); }
.contact-menu-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: min(250px, calc(100vw - 26px));
  max-height: min(500px, calc(100dvh - var(--header-height) - var(--dock-space, 20px) - 25px));
  overflow: auto;
  overscroll-behavior: contain;
  align-content: start;
  padding: 7px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 38px rgb(18 38 76 / 20%);
}
.contact-menu-list :is(a,button) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 48px;
  padding: 8px 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--v2-blue);
  font: inherit;
  font-size: 17px;
  font-weight: 560;
  line-height: 1.25;
  text-decoration: none;
  text-align: left;
}
.contact-menu-list .channel-mark {
  width: 30px;
  height: 30px;
  flex: none;
  object-fit: contain;
  stroke: none;
}
.contact-menu-list button:disabled {
  color: #566578;
  cursor: default;
  opacity: 1;
}
.contact-menu-list a {
  color: var(--v2-blue);
  font-weight: 680;
}
.contact-menu-list a:is(:hover,:focus-visible), [data-design="v2"] .contact-photo:hover {
  background: var(--v2-light-blue);
}
[data-design="v2"] .centers-socials {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 1em;
  margin-inline-start: auto;
}
@media (max-width: 719px) {
  [data-design="v2"] .centers-socials { width: 100%; margin-inline-start: 0; }
}
.master-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 6px 19px 6px 7px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--v2-blue);
  font: inherit;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.2;
}
body > .master-launch {
  position: fixed;
  z-index: 9;
  right: max(16px, calc((100% - var(--v2-width)) / 2));
  bottom: max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 3px 22px rgb(21 40 77 / 20%);
}
.master-chat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--v2-blue);
  color: white;
}
.hero-buttons .master-launch { display: none; }
body:has(dialog[open]) > .master-launch,
body:has(:is(input,textarea):focus) > .master-launch { visibility: hidden; }

#master-chat {
  position: fixed;
  inset: auto max(16px, calc((100% - var(--v2-width)) / 2)) 18px auto;
  width: min(420px, calc(100% - 24px));
  max-width: none;
  max-height: min(620px, calc(100dvh - 32px));
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 24px;
  background: white;
  color: var(--v2-blue);
  box-shadow: 0 10px 54px rgb(10 33 67 / 24%);
}
#master-chat::backdrop { background: rgb(14 31 64 / 35%); }
html:has(#master-chat[open]) { overflow: hidden; }
.master-chat-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(530px, calc(100dvh - 32px));
}
.master-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  padding: 16px 18px 17px 22px;
  background: var(--v2-blue);
  color: white;
}
.master-chat-head h2 { margin: 0; color: inherit; font-size: clamp(24px, 5vw, 29px); line-height: 1.1; letter-spacing: -.035em; }
.master-chat-head p { margin: 4px 0 0; color: #fff; font-size: 16px; line-height: 1.25; }
.master-chat-head .master-close {
  padding: 0;
  width: 48px;
  height: 48px;
  flex: none;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  color: #fff;
  background: transparent;
}
.master-chat-scroll {
  overflow: auto;
  scrollbar-color: #b7c8e3 transparent;
  padding: 20px;
}
.master-intro { margin: 0 0 14px; color: #374c68; font-size: 17px; line-height: 1.4; max-width: 34ch; }
.master-messages { display: grid; align-content: start; gap: 9px; margin: 0; padding: 0; list-style: none; }
.master-messages li {
  justify-self: start;
  max-width: 91%;
  padding: 9px 13px;
  margin: 0;
  border-radius: 15px 15px 15px 4px;
  background: var(--v2-surface);
  color: #152b4a;
  overflow-wrap: anywhere;
}
.master-messages li[data-role="driver"] {
  justify-self: end;
  border-radius: 15px 15px 4px 15px;
  background: var(--v2-blue);
  color: white;
}
.master-messages b { display: block; font-size: 15px; }
.master-messages p { margin: 1px 0 0; white-space: pre-wrap; font-size: 17px; line-height: 1.4; }
.master-compose { margin: 0; padding: 14px 18px 18px; background:var(--v2-surface); }
.master-compose label { margin: 0 0 6px; font-size: 17px; font-weight: 620; }
.master-compose-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 6px; }
.master-compose textarea {
  border: 1px solid #8797aa;
  border-radius: 14px;
  padding: 9px 11px;
  color: #152b4a;
  background: white;
  resize: none;
  font: inherit;
  font-size: 17px;
  line-height: 1.3;
}
.master-compose textarea::placeholder { color: #5b697e; }
.master-compose .master-send {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:var(--red);
  color: white;
}
.master-compose .master-send:disabled { background:#516072; }
.master-status { margin: 8px 0 0; color:#465772; font-size: 15px; line-height:1.35; }
.master-status a { color:inherit; font-weight:640; text-underline-offset:.15em; }
.master-status[data-error] { color:#942035; }
#master-chat :focus-visible, .contact-menu :focus-visible, .contact-photo:focus-visible, .master-launch:focus-visible {
  outline: 3px solid var(--v2-blue);
  outline-offset: 3px;
}
#master-chat .master-close:focus-visible { outline-color:white; }
@media (min-width: 951px) and (max-width: 1250px) {
  [data-design="v2"] .masthead .brand-service { display:none; }
  [data-design="v2"] .masthead .mast-top { gap:14px; }
  [data-design="v2"] .masthead .mast-nav { gap:14px; }
}
@media (max-width: 767px), (max-width:960px) and (max-height:500px) {
  [data-design="v2"] .masthead .contact-photo { padding:0; width:48px; min-height:48px; }
  [data-design="v2"] .masthead .contact-photo span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  [data-design="v2"] .masthead .contact-menu summary { min-height:48px; padding:8px 11px; gap:4px; }
  [data-design="v2"] .masthead .mast-top { gap:6px; }
  body > .master-launch { display:none; }
  [data-design="v2"] .hero-buttons .master-launch {
    display:inline-flex; min-height:48px; padding:8px 0; border-radius:7px; color:white; background:transparent;
    font-size:17px; font-weight:550;
  }
  .hero-buttons .master-chat-icon { width:24px; height:24px; }
  .hero-buttons .master-launch:focus-visible { outline-color:white; }
  #master-chat {
    inset: var(--chat-visible-top, 0px) max(8px,env(safe-area-inset-right)) auto max(8px,env(safe-area-inset-left));
    width:auto;
    max-width: 480px;
    margin: 0 auto;
    max-height: calc(var(--chat-visible-height, 100dvh) - 16px);
    top: calc(var(--chat-visible-top, 0px) + 8px + max(0px, (var(--chat-visible-height, 100dvh) - 586px) / 2));
  }
  .master-chat-inner { height:min(570px, calc(var(--chat-visible-height, 100dvh) - 16px)); min-height:165px; }
  .master-chat-head { padding: 10px 14px; }
  .master-chat-scroll { padding:14px; }
  .master-compose { padding:9px 12px max(11px,env(safe-area-inset-bottom)); }
  body:has(#master-chat[open]) .mobile-dock { visibility:hidden; }
}
@media (max-height:500px) {
  .master-chat-head { padding:5px 12px; }
  .master-chat-head p { display:none; }
  .master-compose { padding:6px 12px; }
  .master-compose label { font-size:16px; margin-bottom:3px; }
  .master-status { margin:4px 0 0; }
}
@media (min-width: 386px) and (max-width: 767px) {
  [data-design="v2"] .masthead .contact-photo { width: auto; gap: 5px; padding-inline: 8px; }
  [data-design="v2"] .masthead .contact-photo .contact-photo-short {
    display: inline;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}
@media (prefers-reduced-motion:no-preference) {
  .contact-menu[open] > .contact-menu-list, #master-chat[open] { animation:contact-enter .19s cubic-bezier(.16,1,.3,1); }
  .contact-menu summary svg { transition:transform .18s ease; }
  .master-launch:hover .master-chat-icon { transform: translateY(-1px); }
  .master-chat-icon { transition:transform .16s ease; }
  @keyframes contact-enter { from { opacity:.65; transform:translateY(5px); } to { opacity:1; transform:none; } }
}
