/* Visitor chat — WhatsApp-like bubbles, ticks, typing */
.apl-vc-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 99990;
  min-width: 88px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font: 700 15px/1.2 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #313133;
  background: #4FD1C5;
  background: linear-gradient(90deg, rgba(129, 230, 217, 1) 0%, rgba(79, 209, 197, 1) 100%);
  border: none;
  border-radius: 1000px;
  box-shadow: 8px 8px 20px rgba(79, 209, 197, 0.55);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, color 0.3s ease-in-out;
  cursor: pointer;
  outline: none;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.apl-vc-fab[hidden] {
  display: none !important;
}

/* Mobile bottom dock: site chat | Telegram 50/50 */
.apl-vc-dock.navbar-fixed-bottom {
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  height: 52px;
  padding: 0;
  margin: 0;
  border: 0;
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1030;
  background: transparent !important;
  background-image: none !important;
}
.apl-vc-dock-btn {
  flex: 1 1 50%;
  width: 50%;
  max-width: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  border: 0;
  border-radius: 0;
  color: #fff !important;
  text-decoration: none !important;
  font: 600 14px/1.2 system-ui, -apple-system, sans-serif;
  height: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.apl-vc-dock-btn .fa {
  font-size: 22px;
  padding: 0;
}
.apl-vc-dock-chat {
  background: #0f766e !important;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}
.apl-vc-dock-tg {
  background: #37AFE2 !important;
  background-image: none !important;
}
.apl-vc-dock-tg .container-fluid {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 0 !important;
  color: #fff;
}
body.apl-vc-open .apl-vc-dock {
  display: none !important;
}

/* Desktop header: oval volumetric chat button (same as styazhka365) */
.apl-vc-header-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-right: 8px;
  margin-top: 0;
  padding: 8px 18px 9px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3a07a 0%, #ED875E 48%, #d96f45 100%);
  color: #fff !important;
  font: 600 15px/1.2 system-ui, -apple-system, sans-serif;
  letter-spacing: .01em;
  text-decoration: none !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
  cursor: pointer;
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;
  box-shadow:
    0 1px 0 rgba(255,255,255,.35) inset,
    0 -2px 0 rgba(0,0,0,.12) inset,
    0 4px 0 #b85a35,
    0 6px 14px rgba(184,90,53,.35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.apl-vc-header-chat .fa {
  font-size: 15px;
  color: #fff;
}
.apl-vc-header-chat:hover,
.apl-vc-header-chat:focus {
  background: linear-gradient(180deg, #f3a07a 0%, #ED875E 48%, #d96f45 100%);
  color: #fff !important;
  text-decoration: none !important;
  outline: none;
  filter: brightness(1.04);
  box-shadow:
    0 1px 0 rgba(255,255,255,.4) inset,
    0 -2px 0 rgba(0,0,0,.1) inset,
    0 5px 0 #b85a35,
    0 8px 18px rgba(184,90,53,.4);
}
.apl-vc-header-chat:active {
  transform: translateY(3px);
  filter: brightness(.98);
  box-shadow:
    0 1px 0 rgba(255,255,255,.2) inset,
    0 1px 0 #b85a35,
    0 2px 6px rgba(184,90,53,.3);
}
.apl-vc-header-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-right: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: #37AFE2;
  color: #fff !important;
  font: 600 14px/1.2 system-ui, -apple-system, sans-serif;
  text-decoration: none !important;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: none;
}
.apl-vc-header-tg:hover,
.apl-vc-header-tg:focus {
  background: #2b9fd0;
  color: #fff !important;
  text-decoration: none !important;
}
.apl-vc-header-tg .fa {
  padding: 0 !important;
  margin: 0;
  font-size: 16px;
}
@media (max-width: 767px) {
  .apl-vc-header-tg {
    display: none !important;
  }
}
@media (max-width: 767px) {
  .apl-vc-header-chat {
    display: none !important;
  }
}
@media (min-width: 768px) {
  .apl-vc-dock,
  .apl-vc-dock.navbar-fixed-bottom {
    display: none !important;
  }
  /* desk: hide brand+menu in chat */
  .apl-vc-brand {
    display: none !important;
  }
  .apl-vc-menu-btn {
    display: none !important;
  }
  #apl-vc-site-menu {
    display: none !important;
  }
}
.apl-vc-fab::before {
  content: '';
  border-radius: 1000px;
  min-width: calc(100% + 12px);
  min-height: calc(100% + 12px);
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  border: 5px solid #00FFCB;
  box-shadow: 0 0 40px rgba(0, 255, 203, 0.55);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
  box-sizing: border-box;
}
.apl-vc-fab::after {
  content: '';
  width: 24px;
  height: 24px;
  border-radius: 100%;
  border: 5px solid #00FFCB;
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: apl-vc-fab-ring 1.5s infinite;
  pointer-events: none;
  box-sizing: border-box;
}
.apl-vc-fab:hover,
.apl-vc-fab:focus {
  color: #313133;
  transform: translateY(-4px);
}
.apl-vc-fab:hover::before,
.apl-vc-fab:focus::before {
  opacity: 1;
}
.apl-vc-fab:hover::after,
.apl-vc-fab:focus::after,
.apl-vc-fab:active::after {
  animation: none;
  display: none;
}
.apl-vc-fab:focus-visible {
  outline: 2px solid #00FFCB;
  outline-offset: 4px;
}
@keyframes apl-vc-fab-ring {
  0% {
    width: 24px;
    height: 24px;
    opacity: 1;
  }
  100% {
    width: 160px;
    height: 160px;
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .apl-vc-fab::after {
    animation: none;
    display: none;
  }
  .apl-vc-fab:hover,
  .apl-vc-fab:focus {
    transform: none;
  }
}
.apl-vc-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 72px));
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 100px));
  z-index: 99991;
  background: #ece5dd;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 16px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.apl-vc-panel[hidden] {
  display: none !important;
}

/* Mobile: full-page chat — keep visual design, change layout/position only */
@media (max-width: 767px) {
  html.apl-vc-open,
  html.apl-vc-open body {
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
  }
  .apl-vc-fab {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  #apl-vc-root.is-chat-open .apl-vc-fab,
  #apl-vc-root:has(#apl-vc-panel.apl-vc-panel--open) .apl-vc-fab {
    display: none;
  }
  .apl-vc-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100000;
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* Sheet: open from bottom / close downward */
    transform: translate3d(0, 105%, 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform .32s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .32s;
    will-change: transform;
  }
  .apl-vc-panel.apl-vc-panel--open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .32s cubic-bezier(.32, .72, 0, 1), visibility 0s;
  }
  /* Keyboard open: pin to visualViewport via top/height, no transform quirks */
  .apl-vc-panel.apl-vc-kb-open {
    transform: none !important;
    transition: none !important;
    overflow: hidden;
  }
  .apl-vc-panel.apl-vc-kb-open .apl-vc-msgs {
    flex: 1 1 0;
    min-height: 48px;
    max-height: 28%;
  }
  .apl-vc-panel.apl-vc-kb-open .apl-vc-wizard {
    flex: 0 1 auto;
    max-height: min(58%, calc(var(--apl-vc-vvh, 100dvh) * 0.58));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .apl-vc-panel.apl-vc-kb-open .apl-vc-composer {
    flex-shrink: 0;
  }
  .apl-vc-panel.apl-vc-kb-open .apl-vc-params-fields .apl-vc-field input[type=number],
  .apl-vc-panel.apl-vc-kb-open .apl-vc-form textarea {
    font-size: 16px; /* prevent iOS zoom */
  }
  .apl-vc-panel.apl-vc-panel--closing {
    transform: translate3d(0, 105%, 0);
    visibility: visible;
    pointer-events: none;
    transition: transform .32s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .32s;
  }
  .apl-vc-panel[hidden] {
    display: none !important;
    transform: none !important;
    transition: none !important;
  }
  .apl-vc-head {
    flex: 0 0 auto;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    gap: 8px;
    position: relative;
    z-index: 2;
  }
  .apl-vc-brand img {
    height: 26px;
  }
  .apl-vc-phone {
    font-size: 12.5px;
  }
  .apl-vc-menu-btn,
  .apl-vc-head #apl-vc-close {
    width: 44px;
    height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 3;
  }
  .apl-vc-msgs {
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .apl-vc-composer {
    flex: 0 0 auto;
    background: #f0f2f5;
    border-top: 1px solid #d1d7db;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .apl-vc-form {
    flex: 0 0 auto;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    gap: 10px;
    align-items: flex-end;
    background: #f0f2f5;
    border-top: 0;
  }
  .apl-vc-form textarea {
    font-size: 16px; /* no iOS zoom on focus */
    line-height: 1.35;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 14px;
    border-radius: 22px;
  }
  .apl-vc-emoji {
    width: 44px;
    height: 44px;
    font-size: 26px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .apl-vc-form .apl-vc-send,
  .apl-vc-form button[type=submit] {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
  }
  .apl-vc-wizard {
    flex: 0 0 auto;
    max-height: min(48vh, 380px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .apl-vc-params-go {
    min-height: 48px;
    font-size: 16px;
  }
  .apl-vc-choice-btn {
    min-height: 52px;
    font-size: 14px;
  }
  .apl-vc-head button,
  .apl-vc-head-btn,
  .apl-vc-form button,
  .apl-vc-qbtn,
  .apl-vc-choice-btn,
  .apl-vc-params-go {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .apl-vc-typing-dots span {
    animation: none;
  }
  .apl-vc-panel,
  .apl-vc-panel.apl-vc-panel--open,
  .apl-vc-panel.apl-vc-panel--closing {
    transition: none !important;
  }
}
.apl-vc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #111;
  flex: 0 0 auto;
  border-bottom: 1px solid #e5e5e5;
}
.apl-vc-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
  line-height: 0;
}
.apl-vc-brand img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 118px;
}
.apl-vc-phone {
  flex: 1 1 auto;
  min-width: 0;
  color: #111 !important;
  text-decoration: none !important;
  font: 600 13px/1.2 system-ui, -apple-system, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.apl-vc-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: 0 0 auto;
}

/* Round messenger buttons in chat header (right) */
.apl-vc-head-msg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  text-decoration: none !important;
  color: #fff !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.apl-vc-head-msg .apl-vc-qico {
  width: 18px;
  height: 18px;
  display: block;
}
.apl-vc-head-msg--wa {
  background: #25D366;
}
.apl-vc-head-msg--tg {
  background: #229ED9;
}
.apl-vc-head-msg:hover,
.apl-vc-head-msg:focus {
  color: #fff !important;
  filter: brightness(1.06);
  outline: none;
}
.apl-vc-head-msg:active {
  transform: scale(0.96);
}
@media (max-width: 767px) {
  .apl-vc-head-msg {
    width: 40px;
    height: 40px;
  }
  .apl-vc-head-msg .apl-vc-qico {
    width: 20px;
    height: 20px;
  }
  .apl-vc-head-actions {
    gap: 6px;
  }
}
.apl-vc-head button {
  background: transparent;
  border: 0;
  color: #111;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.apl-vc-menu-btn {
  width: 40px;
  height: 40px;
  padding: 8px !important;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.apl-vc-menu-btn span {
  display: block;
  height: 2px;
  background: #111;
  border-radius: 1px;
  transition: transform .15s ease, opacity .15s ease;
}
.apl-vc-menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.apl-vc-menu-btn.is-open span:nth-child(2) {
  opacity: 0;
}
.apl-vc-menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.apl-vc-site-menu {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  max-height: min(55vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.apl-vc-site-menu[hidden] {
  display: none !important;
}
.apl-vc-site-menu a,
.apl-vc-site-menu .apl-vc-menu-clear {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  color: #111 !important;
  text-decoration: none !important;
  font: 500 15px/1.3 system-ui, -apple-system, sans-serif;
  border: 0;
  border-bottom: 1px solid #eee;
  background: transparent;
  cursor: pointer;
}
.apl-vc-site-menu a:active,
.apl-vc-site-menu .apl-vc-menu-clear:active {
  background: #f5f5f5;
}
.apl-vc-menu-clear {
  color: #c62828 !important;
  font-weight: 600 !important;
}
.apl-vc-head-btn {
  font: 600 12px/1.2 system-ui, sans-serif !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  border: 1px solid #ccc !important;
  background: #f5f5f5 !important;
  color: #111 !important;
}
.apl-vc-head-btn:active {
  background: #eee !important;
}
.apl-vc-msgs {
  flex: 1;
  overflow: auto;
  padding: 12px 10px 8px;
  background: #ece5dd;
}
.apl-vc-msg {
  margin: 4px 0 8px;
  display: flex;
}
.apl-vc-msg--visitor { justify-content: flex-end; }
.apl-vc-msg--manager,
.apl-vc-msg--system {
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
.apl-vc-msg--in {
  animation: apl-vc-msg-in .38s ease both;
}
@keyframes apl-vc-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .apl-vc-msg--in { animation: none; }
  .apl-vc-step.is-in,
  .apl-vc-wizard.is-out,
  .apl-vc-step.is-out,
  .apl-vc-choice-btn {
    animation: none !important;
    transition: none !important;
  }
}
.apl-vc-bubble {
  max-width: 85%;
  padding: 6px 8px 4px 10px;
  border-radius: 8px;
  background: #fff;
  font: 14.5px/1.35 system-ui, -apple-system, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  position: relative;
}
.apl-vc-msg--visitor .apl-vc-bubble { background: #dcf8c6; }
.apl-vc-msg--system .apl-vc-bubble {
  background: #fff3cd;
  color: #555;
  font-size: 13px;
  text-align: center;
  max-width: 92%;
  margin: 0 auto;
  box-shadow: none;
}
.apl-vc-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  min-height: 15px;
}
.apl-vc-time {
  font-size: 11px;
  color: #667781;
  line-height: 1;
}
.apl-vc-ticks {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  letter-spacing: -1px;
  color: #8696a0;
  font-weight: 600;
}
.apl-vc-ticks.is-read { color: #53bdeb; }
.apl-vc-ticks.is-sent { color: #8696a0; }

.apl-vc-typing {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 8px;
  color: #667781;
  font-size: 13px;
}
.apl-vc-typing.is-on { display: flex; }
.apl-vc-typing-dots {
  display: inline-flex;
  gap: 3px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.apl-vc-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: apl-vc-bounce 1.2s infinite ease-in-out;
}
.apl-vc-typing-dots span:nth-child(2) { animation-delay: .15s; }
.apl-vc-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes apl-vc-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.apl-vc-form {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #d1d7db;
  background: #f0f2f5;
  align-items: flex-end;
}
.apl-vc-composer {
  flex: 0 0 auto;
  background: #f0f2f5;
}
.apl-vc-composer .apl-vc-form {
  border-top: 0;
}
.apl-vc-emoji {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 2px;
}
.apl-vc-emoji-bar {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}
.apl-vc-emoji-bar.is-on { display: flex; }
.apl-vc-emoji-bar button {
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  padding: 2px;
}
.apl-vc-form textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 20px;
  padding: 8px 12px;
  font: 14.5px/1.3 system-ui, "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  resize: none;
  background: #fff;
  min-height: 40px;
  max-height: 100px;
  overflow-y: auto;
}
.apl-vc-form button[type=submit],
.apl-vc-form .apl-vc-send {
  background: #25d366;
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.apl-vc-form button[type=submit]:disabled,
.apl-vc-form .apl-vc-send:disabled {
  opacity: 0.55;
  cursor: default;
}

.apl-vc-err {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: #b71c1c;
  background: #ffebee;
  border-top: 1px solid #ffcdd2;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.apl-vc-err.is-show {
  opacity: 1;
  transform: translateY(0);
}
.apl-vc-err[hidden] {
  display: none !important;
}
.apl-vc-field input.is-invalid,
.apl-vc-step.is-invalid .apl-vc-choice-btn {
  border-color: #e53935 !important;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.25);
}

#visitorChatBtn.vc-has-unread {
  box-shadow: 0 0 0 2px #e53935;
}
#visitorChatBtn.vc-has-hot {
  box-shadow: 0 0 0 2px #ff6d00;
  position: relative;
}
#visitorChatBtn.vc-has-hot.vc-has-unread {
  box-shadow: 0 0 0 2px #e53935, 0 0 0 4px #ff6d00;
}
#visitorChatBtn {
  position: relative;
}
#visitorChatHot.vc-hot-dial {
  display: none;
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font: 700 10px/18px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  z-index: 2;
  pointer-events: none;
}
#visitorChatBtn.vc-has-hot #visitorChatHot.vc-hot-dial {
  display: inline-block;
}
#visitorChatHot.vc-hot-dial::before {
  content: '☎';
  margin-right: 1px;
  font-size: 9px;
}
#visitorChatCount {
  font-weight: 700;
}
.vc-inbox-row.is-hot {
  background: #fff8e1 !important;
}
.vc-inbox-hot {
  display: inline-block;
  margin-left: 4px;
  color: #e53935;
  font-size: 14px;
  vertical-align: middle;
}

/* Admin modal header: title left, actions right (override Bootstrap absolute close) */
#visitorChatModal .vc-admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 0;
  position: relative;
  z-index: 1;
}
#visitorChatModal .vc-admin-modal-head .modal-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
#visitorChatModal .vc-admin-modal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}
#visitorChatModal .vc-admin-modal-actions .close {
  position: static !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 4px;
  font-size: 24px;
  line-height: 1;
  opacity: 0.55;
}
#visitorChatModal .vc-admin-modal-actions .close:hover {
  opacity: 0.9;
}
#visitorChatModal .vc-admin-auto-calc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font: 600 12px/1.2 system-ui, sans-serif;
  color: #333;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
#visitorChatModal .vc-admin-auto-calc input {
  margin: 0;
  vertical-align: middle;
}
#visitorChatModal .vc-admin-discount-pct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font: 600 12px/1.2 system-ui, sans-serif;
  color: #333;
  white-space: nowrap;
}
#visitorChatModal .vc-admin-discount-pct select {
  height: 28px;
  padding: 2px 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: 600 12px/1.2 system-ui, sans-serif;
  background: #fff;
  min-width: 58px;
}
#visitorChatModal .vc-admin-discount-pct select:disabled {
  opacity: 0.55;
  cursor: default;
}
#visitorChatModal .vc-visit-badge {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 11px/1 system-ui, sans-serif;
  color: #fff;
}
#visitorChatModal .vc-visit-badge.is-unique {
  background: #2e7d32;
}
#visitorChatModal .vc-visit-badge.is-returning {
  background: #ef6c00;
}

/* Admin modal WhatsApp meta */
#vcAdminMsgs .vc-wa-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}
#vcAdminMsgs .vc-wa-time { font-size: 11px; color: #667781; }
#vcAdminMsgs .vc-wa-ticks { font-size: 13px; color: #9e9e9e; letter-spacing: -2px; }
#vcAdminMsgs .vc-wa-ticks.is-read { color: #53bdeb; }
#vcAdminTyping {
  display: none;
  padding: 4px 12px;
  font-size: 13px;
  color: #667781;
}
#vcAdminTyping.is-on { display: block; }

.apl-vc-quote-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 10px 0 4px;
  width: 100%;
  max-width: 92%;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .45s ease, transform .45s ease;
}
.apl-vc-quote-actions.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .apl-vc-quote-actions {
    transition: none;
    transform: none;
  }
  .apl-vc-quote-actions.is-visible {
    opacity: 1;
  }
}
.apl-vc-qbtn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  font: 600 13px/1.2 system-ui, sans-serif;
  cursor: pointer;
  background: #075e54;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.apl-vc-qbtn--alt {
  background: #fff;
  color: #075e54;
  border: 1px solid #075e54;
}
.apl-vc-qbtn--social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
}
.apl-vc-qbtn--social:hover {
  text-decoration: none;
  opacity: 0.92;
}
.apl-vc-qico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}
.apl-vc-qbtn--tg {
  background: #229ED9;
  color: #fff !important;
  border: 0;
}
.apl-vc-qbtn--tg:hover { color: #fff !important; }
.apl-vc-qbtn--wa {
  background: #25D366;
  color: #fff !important;
  border: 0;
}
.apl-vc-qbtn--wa:hover { color: #fff !important; }
.apl-vc-qbtn--call {
  background: #34B7F1;
  color: #fff !important;
  border: 0;
}
.apl-vc-qbtn--call:hover {
  color: #fff !important;
  background: #2aa6dc;
}
.apl-vc-qbtn--price {
  background: #fff;
  color: #0d47a1;
  border: 1px solid #0d47a1;
}
.apl-vc-qbtn--price:hover {
  background: #e3f2fd;
  color: #0d47a1;
}
.apl-vc-qbtn:disabled {
  opacity: .55;
  cursor: default;
}
.apl-vc-phone-capture {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
}
.apl-vc-phone-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cfd8dc;
  border-radius: 999px;
  padding: 9px 12px;
  font: 14px/1.2 system-ui, sans-serif;
  background: #fff;
}

.apl-vc-price-modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.apl-vc-price-modal[hidden] {
  display: none !important;
}
.apl-vc-price-dialog {
  width: min(100%, 340px);
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  animation: apl-vc-price-in .22s ease both;
}
@keyframes apl-vc-price-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .apl-vc-price-dialog { animation: none; }
}
.apl-vc-price-title {
  font: 700 17px/1.25 system-ui, -apple-system, sans-serif;
  color: #111;
  margin: 0 0 6px;
}
.apl-vc-price-hint {
  margin: 0 0 14px;
  font: 400 13px/1.4 system-ui, sans-serif;
  color: #667781;
}
.apl-vc-price-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cfd8dc;
  border-radius: 12px;
  padding: 4px 12px;
  background: #fafafa;
  margin-bottom: 14px;
}
.apl-vc-price-field:focus-within {
  border-color: #25d366;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}
.apl-vc-price-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 0;
  font: 600 18px/1.2 system-ui, sans-serif;
  color: #111;
  outline: none;
}
.apl-vc-price-rub {
  font: 700 16px/1 system-ui, sans-serif;
  color: #667781;
}
.apl-vc-price-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.apl-vc-price-cancel,
.apl-vc-price-send {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 10px;
  font: 600 14px/1.2 system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.apl-vc-price-cancel {
  background: #f0f2f5;
  color: #333;
}
.apl-vc-price-send {
  background: #25d366;
  color: #fff;
}
.apl-vc-price-send:disabled {
  opacity: .55;
  cursor: default;
}

.apl-vc-wizard {
  padding: 10px 12px 12px;
  background: #f0f2f5;
  border-top: 1px solid #d1d7db;
  transition: opacity .36s ease, transform .36s ease;
}
.apl-vc-wizard.is-out {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
.apl-vc-wizard[hidden] { display: none !important; }
.apl-vc-step {
  transition: opacity .36s ease, transform .36s ease;
}
.apl-vc-step.is-out {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.apl-vc-step.is-in {
  animation: apl-vc-step-in .34s ease both;
}
@keyframes apl-vc-step-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.apl-vc-choice-note {
  text-align: center;
  font: 600 13px/1.35 system-ui, sans-serif;
  color: #1a1a1a;
  margin: 0 0 10px;
}
.apl-vc-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.apl-vc-choice-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 14px 8px;
  font: 700 12px/1.2 system-ui, sans-serif;
  cursor: pointer;
  background: #075e54;
  color: #fff;
  transition: opacity .22s ease, transform .22s ease, filter .22s ease;
}
.apl-vc-choice-btn.is-picked {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(7, 94, 84, 0.35);
}
.apl-vc-choice-btn.is-dim {
  opacity: 0.35;
  transform: scale(0.96);
  filter: grayscale(0.2);
}
.apl-vc-params-go.is-picked {
  transform: scale(0.98);
  opacity: 0.85;
}
.apl-vc-msg--choice .apl-vc-bubble {
  font-weight: 600;
}
.apl-vc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
  font: 600 12px/1.2 system-ui, sans-serif;
  color: #333;
}
.apl-vc-params-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: 160px;
  margin: 0 auto 12px;
}
.apl-vc-params-fields .apl-vc-field {
  width: 100%;
}
.apl-vc-params-fields .apl-vc-field input[type=number] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 7px 10px;
  font: 16px/1.2 system-ui, sans-serif; /* 16px = no iOS zoom */
  text-align: center;
  background: #fff;
}
.apl-vc-field input[type=number] {
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px 12px;
  font: 15px/1.2 system-ui, sans-serif;
}
.apl-vc-layer-block {
  margin: 0 0 12px;
  padding: 0 4px;
}
.apl-vc-layer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 600 12px/1.2 system-ui, sans-serif;
  margin-bottom: 6px;
  color: #333;
}
#apl-vc-layer-block input[type=range] {
  width: 100%;
  margin: 0;
}
.apl-vc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 13px/1.2 system-ui, sans-serif;
  margin-bottom: 8px;
}
.apl-vc-layer-head {
  display: flex;
  justify-content: space-between;
  font: 600 13px/1.2 system-ui, sans-serif;
  margin-bottom: 4px;
}
.apl-vc-field-label {
  font: 600 13px/1.2 system-ui, sans-serif;
  color: #333;
  margin: 0 0 8px;
}
.apl-vc-object-wrap { margin: 10px 0; }
.apl-vc-obj-btn.is-active {
  background: #25d366 !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.9);
}
#apl-vc-layer-block {
  margin-bottom: 10px;
}
#apl-vc-layer-block input[type=range] { width: 100%; }
.apl-vc-params-go {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font: 700 14px/1.2 system-ui, sans-serif;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  margin-top: 4px;
}
.apl-vc-form[hidden], .apl-vc-step[hidden], .apl-vc-object-wrap[hidden], #apl-vc-floor-wrap[hidden], #apl-vc-layer-block[hidden], #apl-vc-layer-known-wrap[hidden] {
  display: none !important;
}

/* Mobile messenger composer — after base rules so font/size win over desktop shorthand */
@media (max-width: 767px) {
  .apl-vc-composer {
    flex: 0 0 auto;
    background: #f0f2f5;
    border-top: 1px solid #d1d7db;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .apl-vc-form {
    flex: 0 0 auto;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    gap: 10px;
    align-items: flex-end;
    background: #f0f2f5;
    border-top: 0;
  }
  .apl-vc-form textarea {
    font-size: 16px !important;
    line-height: 1.35;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 14px;
    border-radius: 22px;
  }
  .apl-vc-emoji {
    width: 44px;
    height: 44px;
    font-size: 26px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .apl-vc-form .apl-vc-send,
  .apl-vc-form button[type=submit] {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
  }
  .apl-vc-params-go {
    min-height: 48px;
    font-size: 16px;
  }
  .apl-vc-choice-btn {
    min-height: 52px;
  }
}
