/* Client chat refinement: a single invitation, compact composer, named AI and optional contacts. */
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.chat-header { min-height:74px; padding:13px 18px; }
.participant-avatar,.message-avatar { flex-shrink:0; display:grid; place-items:center; overflow:hidden; background:#e3f3ef; color:#008e85; border:1px solid #e0ece9; border-radius:50%; }
.participant-avatar { width:46px; height:46px; }
.participant-avatar img,.message-avatar img { width:100%; height:100%; object-fit:cover; object-position:center 42%; }
.chat-brand>strong { font-size:21px; letter-spacing:-.35px; }
.chat-brand>span { font-size:11px; }
.voice-invitation {
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
  padding:10px 18px;
  background:linear-gradient(105deg,#e6f2ee 0%,#f1f7f4 75%,#eef5f1);
  border-bottom:1px solid #d7e7e1;
}
.voice-invitation-icon {
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  flex-shrink:0;
  border:1px solid #c3ddd2;
  border-radius:11px;
  background:#f5faf7;
  color:#207164;
}
.voice-invitation-copy { flex:1; min-width:0; }
.voice-invitation strong { display:block; color:#1b3c37; font-size:14px; line-height:1.3; letter-spacing:-.15px; }
.voice-invitation-copy>span { display:block; color:#47685f; font-size:11px; line-height:1.3; margin-top:3px; }
.callback-cta {
  position:relative;
  overflow:hidden;
  isolation:isolate;
  min-height:38px;
  flex-shrink:0;
  padding:7px 13px;
  border:1px solid #235d50;
  border-radius:9px;
  background:linear-gradient(135deg,#367464,#256253);
  box-shadow:0 1px 2px #1e473727;
  color:#fff;
  font-size:12px;
  line-height:1.2;
  font-weight:650;
}
.callback-cta:not(:disabled):hover { background:#225c4f; }
.callback-cta:not(:disabled):active { background:#194a3e; }
.callback-cta:focus-visible { outline-color:#277969; }
@media (prefers-reduced-motion:no-preference) {
  .voice-invitation-icon>svg {
    transform-origin:58% 60%;
    animation:callback-ring 24s 3s 2 both;
  }
  .callback-cta::after {
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background:linear-gradient(110deg,transparent 28%,#ffffff26 49%,transparent 69%);
    animation:callback-sweep 24s 3.25s 2 both;
  }
  .voice-invitation:hover .voice-invitation-icon>svg,
  .voice-invitation:focus-within .voice-invitation-icon>svg,
  .voice-invitation:has(.callback-cta:disabled) .voice-invitation-icon>svg,
  .callback-cta:is(:hover,:focus-visible,:disabled)::after { animation-play-state:paused; }
  .callback-cta:disabled::after { visibility:hidden; }
}
@keyframes callback-ring {
  0%,3.4%,100% { transform:rotate(0); }
  .6%,1.8% { transform:rotate(-9deg); }
  1.2%,2.4% { transform:rotate(7deg); }
}
@keyframes callback-sweep {
  0% { opacity:0; transform:translateX(-110%); }
  1% { opacity:1; }
  3.8%,100% { opacity:0; transform:translateX(110%); }
}
.chat-scroll { padding:15px 19px 20px; }
.demo-label { font-size:9px; margin-bottom:18px; }
.message { margin-bottom:13px; }
.message:not(.visitor) { position:relative; }
.visitor-bubble { padding:8px 12px; font-size:14.5px; line-height:1.45; }
.message-author { display:flex; align-items:center; gap:7px; margin:0 0 5px; color:#798a99; font-size:10px; }
.message-avatar { width:24px; height:24px; }
.message-author strong { font-weight:600; color:#435b6b; font-size:11px; }
.message-author .author-role { font-size:10px; color:#8c9ba6; }
.answer-body { font-size:14px; line-height:1.53; }
.answer-body>p { margin:0 0 10px; }
.answer-body h3 { font-size:16px; line-height:1.35; letter-spacing:-.15px; margin:15px 0 7px; }
.answer-body h4 { font-size:14px; line-height:1.4; margin:13px 0 6px; }
.answer-body h3:first-child,.answer-body h4:first-child { margin-top:0; }
.answer-body ul,.answer-body ol { margin:7px 0 11px; padding-left:21px; }
.answer-body li { margin:4px 0; padding-left:2px; }
.answer-body li>p { margin:0; }
.answer-body strong { font-weight:650; }
.answer-body blockquote { border-left:3px solid #a9d8d0; margin:14px 0; padding:7px 12px; background:#f5faf8; color:#52716b; border-radius:0 6px 6px 0; }
.answer-body code { font: .87em Consolas,"Cascadia Code",monospace; background:#f1f5f6; padding:2px 5px; border-radius:4px; overflow-wrap:anywhere; }
.answer-body pre { overflow:auto; padding:12px; border:1px solid #e3ecee; border-radius:8px; background:#f7f9fa; }
.answer-body pre code { padding:0; background:none; font-size:12px; white-space:pre; }
.answer-body a:not(.product-link) { color:#008e86; text-decoration:underline; text-underline-offset:3px; }
.answer-body .choices { margin-top:14px; }
.answer-body .product-card { margin:15px 0 17px; }
.answer-body .product-copy h4 { font-size:16px; margin:0 0 8px; }
.answer-body>:last-child { margin-bottom:0; }
.message-meta { display:flex; align-items:center; gap:10px; margin-top:3px; line-height:1.25; }
.message-meta .message-time { margin:0; font-size:9px; color:#98a6b1; }
.message-actions { display:flex; align-items:center; gap:3px; }
.message-action { display:grid; place-items:center; width:29px; height:28px; border:0; border-radius:6px; background:none; color:#75868d; padding:5px; }
.message-action:hover { color:#008f84; background:#edf8f4; }
.message-action[aria-pressed=true] { color:#008b7c; background:#e4f5ef; }
.message-action:disabled { opacity:.45; }
.message.visitor .message-meta { justify-content:flex-end; }
.chat-date { margin:13px 0 8px; text-align:center; font-size:11px; line-height:1.25; color:#6c8288; }
.older-messages { display:block; margin:0 auto 10px; border:0; background:none; color:#087f76; text-decoration:underline; font-size:12px; padding:8px; }
.contact-nudge {
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  align-items:start;
  gap:12px;
  margin:16px 0 8px;
  padding:15px 16px;
  border:1px solid #d3e6dc;
  border-radius:13px;
  background:linear-gradient(135deg,#f1f8f4,#f8fbf9);
}
.contact-nudge-icon {
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#dfefe7;
  color:#2a6a5b;
}
.contact-nudge strong { display:block; color:#21463e; font-weight:650; font-size:16px; line-height:1.25; }
.contact-nudge p { color:#465f58; font-size:13px; line-height:1.5; margin:5px 0 0; max-width:48ch; }
.contact-nudge-actions { display:flex; align-items:center; flex-wrap:wrap; gap:3px 12px; margin-top:10px; }
.contact-nudge-actions button { min-height:38px; padding:6px 9px; border:1px solid transparent; border-radius:8px; background:none; color:#415e55; font-size:12px; font-weight:550; }
.contact-nudge-actions button:first-child { border-color:#a9cbbc; background:#fff; color:#205c4e; font-weight:650; }
.contact-nudge-actions button:first-child:hover { border-color:#538c79; background:#f2f8f4; }
.contact-nudge-actions button:last-child:hover { background:#e8f3ed; color:#234e43; }
.composer { padding:11px 15px 9px; background:#f1faf7; border-top:1px solid #dfede8; }
.input-wrap { border-width:1.5px; border-radius:12px; box-shadow:none; }
.input-wrap textarea { min-height:69px; padding:11px 55px 11px 13px; font-size:14px; line-height:1.5; }
.input-wrap button { width:35px; height:35px; bottom:9px; }
.composer-actions { margin-top:9px; gap:8px; }
.composer-actions .quiet-button { font-size:11px; padding:7px 10px; border-radius:8px; color:#57716f; background:#fff; border-color:#dce9e4; }
.expert-button { display:flex; align-items:center; justify-content:center; gap:8px; border:1px solid #008d80; border-radius:8px; background:linear-gradient(125deg,#00a28f,#008d86); color:white; box-shadow:0 3px 9px #008e811a; font-size:11px; font-weight:650; padding:8px 13px; }
.expert-button:hover { background:#00897e; box-shadow:0 4px 12px #008e8129; }
.expert-button:disabled { box-shadow:none; }
.privacy-line { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:7px; color:#a0b1b0; font-size:9px; line-height:1.5; margin-top:9px; }
.privacy-line a,.privacy-line button { color:#5a7774; text-decoration:none; text-underline-offset:2px; }
.privacy-line button { background:none; border:0; font:inherit; padding:0; }
.privacy-line a:hover,.privacy-line button:hover { color:#087f76; text-decoration:underline; }
.new-message-hint { bottom:178px; }
.contact-sheet { position:absolute; inset:74px 0 0; z-index:8; background:#fff; overflow:auto; overscroll-behavior:contain; padding:24px 27px 25px; box-shadow:0 -10px 25px #173c3d08; }
.contact-sheet-heading { display:flex; justify-content:space-between; align-items:center; color:#00998a; }
.contact-sheet-heading>span { display:grid; place-items:center; width:44px; height:44px; background:#edf8f4; border-radius:13px; }
.contact-sheet h2 { font-size:23px; line-height:1.25; letter-spacing:-.5px; margin:18px 0 10px; }
.contact-sheet>p { font-size:13px; line-height:1.65; color:#7e9296; max-width:400px; margin:0 0 23px; }
.contact-sheet form>label:not(.contact-consent-row) { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:#435c64; font-weight:550; margin:16px 0 7px; }
.contact-sheet label>span { font-size:10px; color:#a0adb2; font-weight:400; }
.contact-sheet input:not([type=checkbox]) { display:block; width:100%; border:1px solid #d8e5e3; border-radius:9px; background:#fbfdfc; padding:12px 13px; font-size:14px; color:#193a43; }
.contact-sheet input::placeholder { color:#acb7be; }
.contact-sheet input:focus { outline:2px solid #5dc8b98c; outline-offset:1px; background:white; }
.contact-sheet .contact-consent-row { display:flex; gap:9px; align-items:flex-start; margin:20px 0 17px; cursor:pointer; }
.contact-consent-row input { margin:2px 0 0; width:15px; height:15px; flex-shrink:0; accent-color:#009b89; }
.contact-sheet .contact-consent-row>span { color:#819590; font-size:11px; line-height:1.6; }
.contact-consent-row a { color:#608c84; text-decoration:underline; text-underline-offset:2px; }
.contact-sheet .primary-button { width:100%; padding:12px; background:#00998b; }
.contact-test-note { display:block; color:#a0afae; font-size:10px; line-height:1.5; text-align:center; margin-top:16px; }
.contact-form-status { font-size:12px; line-height:1.6; color:#8d6a43; margin:10px 0 0; }
.contact-form-status:empty { display:none; }
.contact-sheet-open .chat-header { pointer-events:none; }
.history-dialog { width:min(430px,calc(100% - 28px)); max-height:calc(100dvh - 30px); overflow:auto; padding:23px; border:1px solid #dce9e6; border-radius:16px; box-shadow:0 12px 60px #0c263535; color:#173240; }
.history-dialog::backdrop { background:#102c3866; }
.history-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.history-heading h2 { margin:0; font-size:22px; }
.history-dialog p { color:#526d72; font-size:13px; line-height:1.6; }
.history-dialog label { display:block; font-size:13px; font-weight:600; margin:17px 0 6px; }
.history-dialog input { width:100%; border:1px solid #b8d2cb; border-radius:8px; background:#f5fbf9; padding:11px; margin:5px 0 9px; }
.history-dialog #history-code-output { font-family:monospace; }
.history-dialog #history-status:empty { display:none; }
@media(max-width:760px) {
  .chat-header { min-height:69px; padding:11px 16px; }
  .participant-avatar { width:43px; height:43px; }
  .composer { padding:10px 13px max(9px,env(safe-area-inset-bottom)); }
  .composer-actions .quiet-button,.expert-button { font-size:10px; padding:8px 9px; }
  .composer-actions .quiet-button { flex:1; justify-content:center; }
  .expert-button { flex:1; }
  .contact-sheet { top:69px; padding:20px 22px; }
}
@container(max-width:430px) {
  .voice-invitation { padding:9px 12px; gap:8px; }
  .voice-invitation-icon { width:33px; height:33px; border-radius:9px; }
  .voice-invitation-icon svg { width:18px; height:18px; }
  .voice-invitation strong { font-size:12px; }
  .voice-invitation-copy>span { font-size:10px; }
  .callback-cta { font-size:11px; padding:6px 9px; }
  .contact-nudge { gap:9px; padding:13px 12px; grid-template-columns:32px minmax(0,1fr); }
  .contact-nudge-icon { width:32px; height:32px; }
  .contact-nudge-actions { gap:3px 6px; }
  .contact-nudge-actions button { min-height:40px; padding-inline:7px; }
}
@media(max-height:650px) {
  .chat-header { min-height:62px; padding-top:9px; padding-bottom:9px; }
  .voice-invitation { padding-block:7px; }
  .composer { padding-top:9px; }
  .input-wrap textarea { min-height:57px; }
  .contact-sheet { top:62px; padding-top:15px; }
  .contact-sheet h2 { margin-top:12px; font-size:21px; }
}

/* Visually distinguish available choices from completed steps in the transcript. */
.chat-column { container-type:inline-size; }
.chat-column .choices {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.chat-column .choice {
  min-height:44px;
  padding:8px 9px 8px 11px;
  border:1px solid #70ad9f;
  border-radius:10px;
  background:#eaf6f0;
  box-shadow:inset 0 1px #fff,0 1px 2px #20453512;
  color:#17473f;
  font-size:13px;
  font-weight:650;
  line-height:1.35;
  overflow-wrap:anywhere;
  transition:background-color .15s,border-color .15s,box-shadow .15s,color .15s;
}
.chat-column .choice svg { color:#0d7161; }
.chat-column .choice:enabled:hover { background:#d8eee4; border-color:#448f7e; box-shadow:0 2px 5px #244e4426; }
.chat-column .choice:enabled:active { background:#c4e5d8; box-shadow:none; }
.chat-column .choice:focus-visible { outline:2px solid #0f7464; outline-offset:2px; }
.chat-column :is(.scenario-choice,.answer-choices .choice) { justify-content:space-between; gap:8px; }
.chat-column :is(.scenario-choice,.answer-choices .choice)>svg {
  box-sizing:border-box;
  width:23px;
  height:23px;
  padding:4px;
  border-radius:7px;
  background:#d6ebe2;
}
.chat-column :is(.scenario-choice,.answer-choices .choice):enabled:hover>svg { background:#1f6b5c; color:#fff; }
.chat-column :is(.scenario-choice,.answer-choices .choice):disabled { opacity:.65; }
.chat-column :is(.scenario-choice,.answer-choices .choice)[data-available=false] {
  background:#f6f8f7;
  border-color:#e2e9e5;
  color:#506760;
  box-shadow:none;
  cursor:default;
  opacity:1;
}
.chat-column :is(.scenario-choice,.answer-choices .choice)[data-available=false] svg { visibility:hidden; }
.chat-column .welcome>p.start-prompt { margin-bottom:12px; color:#172f3d; font-size:17px; font-weight:650; line-height:1.4; }
.chat-column .start-choices { grid-template-columns:minmax(0,1fr); max-width:375px; margin-top:0; }
.chat-column .start-choices .choice { min-height:47px; }
.answer-body.has-scenario-choices>p { color:#233d4a; }

.chat-column .product-list { display:grid; gap:7px; margin:10px 0 13px; }
.chat-column .product-card-compact {
  display:block;
  padding:0;
  margin:0;
  border:1px solid #d6e5df;
  border-radius:10px;
  background:#fbfdfc;
}
.chat-column .product-card-compact .product-link {
  display:grid;
  grid-template-columns:30px minmax(0,1fr) max-content 24px;
  align-items:center;
  gap:10px;
  min-height:54px;
  padding:9px 10px;
  color:#17352e;
  border-radius:inherit;
  text-decoration:none;
}
.chat-column .product-card-compact .product-link:hover { background:#edf7f2; }
.chat-column .product-card-compact .product-link:focus-visible { outline:2px solid #0f7464; outline-offset:2px; }
.chat-column .product-card-compact .word-icon { width:30px; height:33px; border-radius:7px; background:#e3f2ea; color:#176c59; }
.chat-column .product-card-compact .product-copy { border:0; padding:0; align-self:center; }
.chat-column .product-card-compact .product-copy h4 { color:#183a32; font-size:13.5px; font-weight:650; line-height:1.36; margin:0; }
.chat-column .product-card-compact .product-copy p { color:#506961; font-size:12px; line-height:1.4; margin:3px 0 0; }
.chat-column .product-card-compact .product-meta {
  display:grid;
  gap:2px;
  max-width:80px;
  margin:0;
  text-align:right;
}
.chat-column .product-card-compact .product-meta strong { font-size:14px; line-height:1.3; font-variant-numeric:tabular-nums; }
.chat-column .product-card-compact .format-tag { font-size:10.5px; line-height:1.35; color:#526f65; padding:0; background:none; }
.chat-column .product-action { display:grid; width:24px; height:24px; border-radius:7px; place-items:center; color:#166652; background:#e2f0e9; }
.chat-column .product-link:hover .product-action { color:white; background:#226a58; }
.chat-column .related-docs { margin:10px 0 12px; }
.chat-column .related-docs>summary {
  min-height:42px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid #dbe7e1;
  border-radius:8px;
  background:#f7faf8;
  cursor:pointer;
  color:#315a4e;
  font-weight:650;
}
.chat-column .related-docs>summary::after {
  content:"";
  width:7px;
  height:7px;
  margin-right:4px;
  border:solid currentColor;
  border-width:0 1.5px 1.5px 0;
  transform:rotate(45deg) translateY(-2px);
}
.chat-column .related-docs[open]>summary::after { transform:rotate(225deg) translateY(-2px); }
.chat-column .related-docs>summary:hover { background:#edf5ef; }
.chat-column .related-docs>summary::-webkit-details-marker { display:none; }
.chat-column .related-docs .product-list { margin:7px 0 0; }
.chat-column .product-card-related { background:#fff; }
.chat-column .answer-body .product-delivery { color:#526b64; font-size:12.5px; line-height:1.5; margin:0 0 9px; }
.chat-column .answer-body .product-payment-link {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:42px;
  max-width:100%;
  padding:7px 11px;
  border:1px solid #97bfb2;
  border-radius:8px;
  color:#1c6353;
  background:#eaf6ef;
  font-weight:650;
  text-decoration:none;
}
.chat-column .answer-body .product-payment-link:hover { background:#dbeee3; border-color:#649c8b; }
.chat-column .answer-body .product-payment-link:focus-visible { outline:2px solid #0f7464; outline-offset:2px; }
@container (max-width:425px) {
  .chat-column .choices { grid-template-columns:minmax(0,1fr); }
  .chat-column .start-choices { max-width:none; }
}
@container (max-width:380px) {
  .chat-column .product-card-compact .product-link { grid-template-columns:27px minmax(0,1fr) 24px; gap:4px 8px; }
  .chat-column .product-card-compact .word-icon { width:27px; height:30px; grid-column:1; grid-row:1 / span 2; }
  .chat-column .product-card-compact .product-copy { grid-column:2; grid-row:1; }
  .chat-column .product-card-compact .product-meta { grid-column:2; grid-row:2; display:flex; max-width:none; gap:8px; text-align:left; }
  .chat-column .product-card-compact .product-action { grid-column:3; grid-row:1 / span 2; }
}

/* The sidebar starts at full height. Its compact layout uses the same chat. */
body.chat-open { --chat-width:min(var(--chat-width-size,560px),calc(100vw - 230px)); }
body.chat-open.chat-compact #site-page { padding-right:0; }
body.chat-resizing #site-page { transition:none; }
body.chat-compact .chat-column {
  inset:auto 16px 16px auto;
  width:min(var(--chat-width-size,480px),calc(100vw - 230px));
  height:min(var(--chat-height-size,620px),calc(100dvh - 32px));
  border:1px solid #cddedb;
  border-radius:17px;
  box-shadow:0 14px 50px #17384933;
}
.chat-compact .chat-header,.chat-compact .composer { border-radius:inherit; }
.chat-compact .chat-header { border-bottom-right-radius:0; border-bottom-left-radius:0; }
.chat-compact .composer { border-top-left-radius:0; border-top-right-radius:0; }
.chat-compact .contact-sheet { border-radius:0 0 16px 16px; }
.chat-compact #chat-expand { background:#e9f6f1; color:#0b766b; }
.chat-resize {
  position:absolute;
  z-index:4;
  display:grid;
  place-items:center;
  touch-action:none;
  user-select:none;
  border-radius:8px;
}
.chat-resize::before { content:""; border-radius:12px; background:#8bb2ae; }
.chat-resize:hover::before,.chat-resize:focus-visible::before { background:#0e8277; }
.chat-resize-width { left:-9px; top:50%; width:18px; height:62px; transform:translateY(-50%); cursor:ew-resize; }
.chat-resize-width::before { width:4px; height:34px; }
.chat-resize-height { left:50%; top:-4px; width:65px; height:16px; transform:translateX(-50%); cursor:ns-resize; }
.chat-resize-height::before { width:32px; height:4px; }
@media(max-width:1100px) {
  body.chat-open { --chat-width:min(var(--chat-width-size,520px),calc(100vw - 230px)); }
}
/* On a phone the chat is always a full-screen sheet with one clear way out: «Закрыть», 44px.
   Compact view, «Свернуть» (same effect here — auto-open is off on narrow screens) and the resize
   grip that looked like a swipe handle are gone; a compact state saved on desktop is ignored. */
@media(max-width:760px) {
  .chat-header :is(#chat-expand, #chat-minimize), .chat-resize { display:none !important; }
  .chat-header #chat-close { width:44px; height:44px; }
  body.chat-compact .chat-column, body.widget-v2.chat-compact .chat-column {
    inset:0; width:100vw; height:auto; border:0; border-radius:0; box-shadow:none;
  }
}

/* Readability floor: clinic staff often read this on a phone during work, and the privacy and terms
   links are legally meaningful. Service text never drops below 12px, form labels below 13px, and
   muted text keeps at least 4.5:1 contrast on white (#5b6f7c is ~5.2:1). */
.demo-label, .chat-brand>span, .message-author, .message-author strong, .message-author .author-role,
.message-meta .message-time, .chat-date, .composer-actions .quiet-button, .expert-button, .callback-cta,
.voice-invitation-copy>span, .chat-column .product-card-compact .format-tag { font-size:12px; }
.privacy-line, .contact-test-note, .contact-sheet .contact-consent-row>span { font-size:12px; color:#5b6f7c; }
.contact-sheet label>span { font-size:13px; color:#3f5563; }
.message-meta .message-time, .message-author .author-role, .demo-label { color:#5b6f7c; }

/* Компактная карточка контакта: две строки текста и кнопки в одну линию. */
.contact-nudge { grid-template-columns:28px minmax(0,1fr); gap:10px; margin:10px 0 6px; padding:10px 12px; }
.contact-nudge-icon { width:28px; height:28px; border-radius:8px; }
.contact-nudge-icon svg { width:15px; height:15px; }
.contact-nudge strong { font-size:14px; }
.contact-nudge p { margin-top:2px; max-width:none; font-size:13px; line-height:1.4; }
.contact-nudge-actions { margin-top:6px; gap:4px 8px; }
.contact-nudge-actions button { min-height:34px; padding:4px 10px; }
@media (max-width:520px) { .contact-nudge-actions button { min-height:40px; } }
.answer-choices .choice-pay-note { grid-column:1 / -1; margin:-2px 0 4px; color:#506961; font-size:12px; }

.chat-teaser { position:fixed; right:20px; bottom:92px; z-index:60; display:flex; gap:4px; max-width:330px; padding:12px 8px 12px 14px; border-radius:16px; background:#fff; box-shadow:0 14px 40px #17384933; }
.chat-teaser-body { display:flex; gap:10px; padding:0; border:0; background:none; text-align:left; font:inherit; cursor:pointer; }
.teaser-avatar { flex:none; width:40px; height:40px; overflow:hidden; border-radius:999px; display:grid; place-items:center; background:#e3f2ea; }
.teaser-avatar img { width:100%; height:100%; object-fit:cover; }
.chat-teaser-copy { display:grid; gap:2px; font-size:14px; line-height:1.4; }
.chat-teaser-close { flex:none; width:32px; height:32px; border:0; border-radius:999px; background:none; }
body.chat-peek .chat-column { width:min(400px,calc(100vw - 32px)); height:min(560px,max(440px,55dvh)); }

/* Телефон и планшет (mobile-sheet.mjs). Телефон: окно снизу на ~90% высоты, сверху видна полоска сайта,
   «ручка» для свайпа вниз, затемнённая полоска закрывает чат по нажатию. Пока клиент печатает — окно
   на весь видимый экран над клавиатурой. Вырезы iPhone учитываются через env(safe-area-inset-*).
   Планшет: плавающее окно в углу, как на компьютере. */
.chat-grabber, .chat-backdrop { display:none; }
.chat-column:focus { outline:none; }
@keyframes chat-sheet-in { from { transform:translateY(100%); } to { transform:translateY(0); } }
@keyframes chat-backdrop-in { from { opacity:0; } to { opacity:1; } }
@media (max-width:760px), (max-height:500px) and (pointer:coarse) {
  body.chat-open { overflow:hidden; }
  body.chat-open #site-page { padding-right:0; }
  .chat-header :is(#chat-expand, #chat-minimize), .chat-resize { display:none !important; }
  .chat-header #chat-close { width:44px; height:44px; }
  body.chat-open .chat-backdrop {
    display:block; position:fixed; inset:0; z-index:19;
    background:rgb(9 24 34 / 48%);
    animation:chat-backdrop-in .25s ease-out;
    -webkit-tap-highlight-color:transparent;
  }
  body.chat-open .chat-column,
  body.chat-compact .chat-column, body.widget-v2.chat-compact .chat-column,
  body.chat-peek .chat-column, body.widget-v2.chat-peek .chat-column {
    inset:auto 0 0 0;
    width:100%; max-width:100%;
    height:min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 44px));
    padding-inline:env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
    border:0; border-radius:18px 18px 0 0; overflow:hidden;
    box-shadow:0 -10px 40px rgb(16 36 52 / 24%);
    animation:chat-sheet-in .28s cubic-bezier(.2,.8,.2,1);
    will-change:transform;
  }
  .chat-column > .chat-grabber {
    display:flex; flex-shrink:0; justify-content:center; align-items:center;
    width:100%; height:18px; padding:0; border:0; background:inherit;
    touch-action:none; cursor:grab;
  }
  .widget-v2 .chat-column > .chat-grabber { background:var(--v2-paper); }
  .chat-grabber::before { content:""; width:40px; height:5px; border-radius:3px; background:#b4c2cb; }
  .chat-grabber:focus-visible { outline:none; }
  .chat-grabber:focus-visible::before { background:#0f7464; box-shadow:0 0 0 3px #0f746433; }
  .chat-column .chat-header { touch-action:none; }
  body.chat-open .chat-column .contact-sheet { margin-top:18px; }
  body.chat-dragging .chat-column { animation:none; }

  /* Клиент печатает: окно на весь видимый экран, ровно над клавиатурой. */
  body.chat-open.chat-keyboard .chat-column {
    top:var(--chat-visible-top, 0px); bottom:auto;
    height:var(--chat-visible-height, 100dvh);
    padding-top:env(safe-area-inset-top, 0px);
    border-radius:0; box-shadow:none; animation:none;
  }
  body.chat-keyboard .chat-column > .chat-grabber, body.chat-keyboard .chat-backdrop { display:none; }
  body.chat-keyboard .chat-column .contact-sheet { margin-top:0; }
  body.chat-keyboard .chat-column .composer { padding-bottom:8px; }
}
/* Телефон, повёрнутый боком: экран низкий, полоска сайта заняла бы место переписки — окно на всю высоту. */
@media (max-height:500px) and (pointer:coarse) {
  body.chat-open .chat-column { height:100dvh; border-radius:0; }
}
@media (max-width:760px) and (prefers-reduced-motion:reduce), (max-height:500px) and (pointer:coarse) and (prefers-reduced-motion:reduce) {
  body.chat-open .chat-column, body.chat-open .chat-backdrop { animation:none !important; }
}
@media (min-width:761px) and (max-width:1100px) and (min-height:501px) and (pointer:coarse) {
  body.chat-open #site-page { padding-right:0; }
  .chat-header #chat-expand, .chat-resize { display:none !important; }
  body.chat-open .chat-column, body.chat-compact .chat-column, body.widget-v2.chat-compact .chat-column {
    inset:auto calc(20px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) auto;
    width:min(420px, calc(100vw - 40px));
    height:min(680px, calc(100dvh - 40px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    border:1px solid #cddedb; border-radius:18px; overflow:hidden;
    box-shadow:0 14px 50px #17384933;
  }
  body.widget-v2.chat-open .chat-column { border:0; border-radius:22px; box-shadow:0 16px 50px rgb(25 44 60 / 18%); }
  body.chat-open.chat-keyboard .chat-column {
    top:calc(var(--chat-visible-top, 0px) + 12px); bottom:auto;
    height:min(680px, calc(var(--chat-visible-height, 100dvh) - 24px));
  }
}
