.bcw {
  --bcw-accent: #b6242b;
  --bcw-accent-ink: #fff;
  --bcw-text: #241e20;
  --bcw-muted: #665c5f;
  --bcw-line: #eee5e5;
  --bcw-side: max(18px, env(safe-area-inset-right));
  position: fixed;
  z-index: 2147482000;
  inset: auto var(--bcw-side) max(18px, env(safe-area-inset-bottom)) auto;
  display: grid;
  justify-items: end;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - var(--bcw-side) - max(12px, env(safe-area-inset-left)));
  color: var(--bcw-text);
  font: 14px/1.45 system-ui, -apple-system, Arial, sans-serif;
  text-align: start;
}
.bcw.bcw-left {
  --bcw-side: max(18px, env(safe-area-inset-left));
  inset-inline: var(--bcw-side) auto;
  justify-items: start;
}
.bcw *, .bcw *::before, .bcw *::after { box-sizing: border-box; }
.bcw[hidden], .bcw [hidden] { display: none !important; }
.bcw button, .bcw input { font: inherit; margin: 0; text-transform: none; letter-spacing: normal; box-shadow: none; }
.bcw button { cursor: pointer; }
.bcw button:disabled { cursor: progress; opacity: .6; }
.bcw :focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.bcw .bcw-launcher {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  max-width: 100%;
  padding: 9px 17px 9px 11px;
  color: var(--bcw-accent-ink);
  background: var(--bcw-accent);
  border: 0;
  border-radius: 13px;
  box-shadow: 0 8px 22px #200a132e;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.bcw .bcw-chat-icon, .bcw .bcw-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 10px;
  font-weight: 750;
}
.bcw .bcw-chat-icon { color: var(--bcw-accent); background: var(--bcw-accent-ink); }
.bcw .bcw-chat-icon::before, .bcw .bcw-mark--chat::before {
  content: '';
  width: 19px;
  height: 18px;
  background: currentColor;
  border-radius: 7px;
  clip-path: polygon(0 0, 100% 0, 100% 81%, 51% 81%, 22% 100%, 22% 81%, 0 81%);
}
.bcw .bcw-menu, .bcw .bcw-panel {
  min-width: 0;
  overflow: hidden;
  color: var(--bcw-text);
  background: #fff;
  border: 1px solid var(--bcw-line);
  border-radius: 17px 17px 8px 17px;
  box-shadow: 0 16px 48px #290b1533, 0 3px 8px #290b150a;
}
.bcw.bcw-left :is(.bcw-menu,.bcw-panel) { border-radius: 17px 17px 17px 8px; }
.bcw .bcw-menu { width: min(316px, calc(100vw - 36px)); max-width: 100%; }
.bcw .bcw-menu-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 15px 15px 9px; }
.bcw .bcw-menu-head strong { display: block; font-size: 15px; font-weight: 750; }
.bcw .bcw-menu-subtitle, .bcw .bcw-stage { display: block; font-size: 12px; }
.bcw .bcw-menu-subtitle { color: var(--bcw-muted); margin-top: 2px; }
.bcw .bcw-channels { padding: 0 10px 10px; overflow: auto; max-height: min(310px, calc(100dvh - 180px)); }
.bcw .bcw-channel {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 50px;
  padding: 7px;
  border: 0;
  border-top: 1px solid var(--bcw-line);
  border-radius: 0;
  background: #fff;
  color: var(--bcw-text);
  font-weight: 650;
  text-align: start;
  text-decoration: none;
}
.bcw .bcw-channel:hover { background: #f9f5f6; }
.bcw .bcw-channel-name { flex: 1; min-width: 0; }
.bcw .bcw-arrow { color: var(--bcw-muted); font-size: 16px; margin-inline-end: 5px; }
.bcw .bcw-mark { background: center / 28px 28px no-repeat; }
.bcw .bcw-mark--telegram { background-image: url("./assets/channels/telegram.png"); }
.bcw .bcw-mark--max { background-image: url("./assets/channels/max.png"); }
.bcw .bcw-mark--vk { background-image: url("./assets/channels/vk.png"); }
.bcw .bcw-mark--avito { background-image: url("./assets/channels/avito.png"); }
.bcw .bcw-mark--chat { background-color: var(--bcw-accent); color: var(--bcw-accent-ink); }
.bcw .bcw-panel {
  width: min(380px, calc(100vw - 36px));
  max-width: 100%;
  height: min(550px, calc(100dvh - 104px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.bcw .bcw-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 19px 15px;
  color: var(--bcw-accent-ink);
  background: var(--bcw-accent);
}
.bcw .bcw-labels { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bcw .bcw-title { display: block; font-size: 16px; font-weight: 750; }
.bcw .bcw-stage { opacity: .9; }
.bcw .bcw-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--bcw-accent-ink);
  color: var(--bcw-accent);
  font-weight: 800;
}
.bcw .bcw-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.bcw .bcw-icon-button {
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  display: grid;
  place-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 9px;
  font-size: 22px;
  line-height: 1;
}
.bcw .bcw-menu-close { border-color: var(--bcw-line); }
.bcw .bcw-scroll {
  display: flex;
  flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  background: #fff;
}
.bcw .bcw-history { display: grid; gap: 9px; }
.bcw .bcw-message {
  justify-self: start;
  max-width: 91%;
  padding: 10px 12px;
  background: #f0e9e7;
  border-radius: 13px 13px 13px 4px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.bcw .bcw-mine {
  justify-self: end;
  background: color-mix(in srgb, var(--bcw-accent) 14%, white);
  border-radius: 13px 13px 4px 13px;
}
.bcw .bcw-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: auto; padding-top: 15px; }
.bcw .bcw-quick {
  max-width: 100%;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--bcw-accent) 75%, #aaa);
  border-radius: 99px;
  background: #fff;
  color: var(--bcw-text);
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  overflow-wrap: anywhere;
}
.bcw .bcw-quick:hover { background: color-mix(in srgb, var(--bcw-accent) 10%, white); }
.bcw .bcw-feedback {
  margin: 0;
  padding: 5px 14px;
  color: var(--bcw-muted);
  background: #faf0e6;
  font-size: 12px;
}
.bcw .bcw-form { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0; border-top: 1px solid var(--bcw-line); }
.bcw .bcw-form input {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  padding: 8px;
  color: var(--bcw-text);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 16px;
}
.bcw .bcw-form button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--bcw-accent-ink);
  background: var(--bcw-accent);
  border: 0;
  border-radius: 10px;
  font-size: 21px;
}
.bcw .bcw-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 481px) {
  .bcw.bcw-side-tab .bcw-launcher {
    position: fixed;
    inset: 50% 0 auto auto;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 12px;
    width: 46px;
    padding: 12px 5px 16px;
    border-radius: 14px 0 0 14px;
  }
  .bcw.bcw-side-tab .bcw-chat-icon { width: 30px; height: 30px; flex-basis: auto; border-radius: 9px; }
  .bcw.bcw-side-tab .bcw-launcher-label { writing-mode: vertical-rl; transform: rotate(180deg); }
  .bcw.bcw-side-tab .bcw-menu { position: fixed; inset: 50% 57px auto auto; transform: translateY(-50%); }
  .bcw.bcw-side-tab .bcw-panel { height: min(550px, calc(100dvh - 45px)); }
  .bcw.bcw-side-tab[data-view="chat"] .bcw-launcher { display: none; }
  .bcw.bcw-left.bcw-side-tab .bcw-launcher { inset-inline: 0 auto; border-radius: 0 14px 14px 0; }
  .bcw.bcw-left.bcw-side-tab .bcw-menu { inset-inline: 57px auto; }
}
@media (max-width: 480px) {
  .bcw { --bcw-side: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .bcw.bcw-left { --bcw-side: max(12px, env(safe-area-inset-left)); }
  .bcw .bcw-panel { width: min(380px, calc(100vw - 24px)); height: min(540px, calc(100dvh - 86px)); }
}
.bcw .bizon-booking-form {
  margin: 8px 0;
  padding: 12px;
  border: 1px solid #dce2eb;
  border-radius: 8px;
  background: #fff;
  color: #192231;
  font-size: 13px;
}

.bcw .bizon-booking-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; margin-block: 9px; }
.bcw .bizon-booking-fields label { display: grid; gap: 3px; min-width: 0; }
.bcw .bizon-booking-fields label:first-child, .bizon-booking-fields label:last-child { grid-column: 1 / -1; }
.bcw .bizon-booking-fields :is(input, textarea, select) {
  box-sizing: border-box;
  padding: 5px 7px;
  width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
}
.bcw .bizon-booking-form button { padding: 7px 10px; background: #335ca6; color: #fff; border: 0; border-radius: 5px; font: inherit; }
.bcw .bizon-booking-error { color: #8e2e33; font-size: 12px; margin: 0 0 6px; }
.bcw .bizon-booking-error:empty { display: none; }
