/* связываем переменные живого чата с палитрой нового сайта */
#chilsChatWrap,.chils-chat{--accent:var(--acc);--accent-mid:var(--acc2);--accent-soft:var(--acc-soft);--accent-ring:rgba(8,91,95,.28);--border:var(--line);--text:var(--fg);--text-secondary:var(--fg2);--text-tertiary:var(--fg2);--card:var(--card);--bg-subtle:var(--bg2);--shadow-sm:0 2px 8px rgba(0,0,0,.12);--shadow-md:0 12px 30px -10px rgba(0,0,0,.35);font-family:Geologica,system-ui,sans-serif}
/* Стили чата с живого сайта (main.css) */
@keyframes chilsPhoneFlashColor{
  0%{color:var(--accent); background:transparent; box-shadow:none}
  50%{color:#ffffff; background:transparent; box-shadow:none}
  100%{color:var(--accent); background:transparent; box-shadow:none}
}
/* Чат: в закрытом виде кликабельна только иконка (панель не занимает экран) */
.chils-chat{
  position:fixed;z-index:96;
  right:max(20px, calc(16px + env(safe-area-inset-right, 0px)));
  bottom:max(16px, calc(10px + env(safe-area-inset-bottom, 0px)));
  display:flex;flex-direction:column;align-items:flex-end;gap:8px;
  width:max-content;
  max-width:calc(100vw - 24px);
  pointer-events:none;
}
.chils-chat.is-open{pointer-events:auto}
.chils-chat-fab,
.chils-chat-docktab{pointer-events:auto}
.chils-chat-docktab{
  display:none;align-items:center;justify-content:center;
  padding:10px 16px;border-radius:980px;border:1px solid var(--border);
  background:var(--card);color:var(--accent);font-size:13px;font-weight:600;cursor:pointer;
  box-shadow:var(--shadow-md);
}
.chils-chat--min .chils-chat-panel{
  opacity:0;visibility:hidden;pointer-events:none;transform:translateY(16px) scale(0.12);
  max-height:0!important;padding:0!important;margin:0;border:none;overflow:hidden;
}
.chils-chat--min .chils-chat-docktab{display:inline-flex}
.chils-chat-panel{
  position:absolute;
  right:0;
  bottom:calc(76px + 8px);
  transform-origin:100% 100%;
  width:min(440px, calc(100vw - 24px - min(18vw, 120px)));
  max-height:min(74vh, 620px);
  padding:6px;
  border-radius:20px;
  border:2px solid var(--accent);
  background:var(--card);
  box-shadow:0 12px 40px rgba(0,0,0,.12);
  display:flex;flex-direction:column;
  transform:translate(calc(-1 * min(10vw, 72px)), calc(-1 * min(3vh, 36px))) translateY(12px) scale(0.94);
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .26s ease,transform .34s cubic-bezier(.18,.9,.22,1),visibility .26s ease,width .2s ease,max-height .2s ease;
  overscroll-behavior:contain;
}
/* Закрыто: панель вне потока и без «невидимой» зоны кликов (~440×600) */
.chils-chat:not(.is-open) .chils-chat-panel{
  width:0!important;
  height:0!important;
  min-width:0!important;
  min-height:0!important;
  max-width:0!important;
  max-height:0!important;
  padding:0!important;
  margin:0!important;
  border-width:0!important;
  overflow:hidden!important;
  box-shadow:none!important;
}
.chils-chat.is-open .chils-chat-panel{
  opacity:1;visibility:visible;pointer-events:auto;
  width:min(440px, calc(100vw - 24px - min(18vw, 120px)));
  max-height:min(74vh, 620px);
  transform:translate(calc(-1 * min(10vw, 72px)), calc(-1 * min(3vh, 36px))) translateY(0) scale(1);
}
/* Расширенное окно: не на всю ширину страницы; на десктопе — resize; колёсико не уходит в скролл сайта */
.chils-chat-panel.chils-chat-panel--imax{
  position:fixed!important;
  left:auto!important;
  top:auto!important;
  right:max(12px, env(safe-area-inset-right))!important;
  bottom:max(16px, calc(10px + env(safe-area-inset-bottom)))!important;
  transform:none!important;
  z-index:400!important;
  width:min(420px, calc(100vw - 28px))!important;
  height:min(520px, calc(100dvh - 120px))!important;
  min-width:280px;
  min-height:260px;
  max-width:min(640px, calc(100vw - 16px))!important;
  max-height:min(900px, calc(100dvh - 88px))!important;
  padding:6px;
  resize:both;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.chils-chat-panel__grip{
  display:none;
  position:absolute;
  left:8px;
  top:10px;
  width:18px;
  height:18px;
  z-index:8;
  pointer-events:none;
  opacity:.72;
  color:var(--text-secondary);
  background:
    linear-gradient(135deg, transparent 36%, currentColor 36%, currentColor 40%, transparent 40%),
    linear-gradient(135deg, transparent 54%, currentColor 54%, currentColor 58%, transparent 58%),
    linear-gradient(135deg, transparent 72%, currentColor 72%, currentColor 76%, transparent 76%);
}
@media (min-width:768px){.chils-chat-panel.chils-chat-panel--imax .chils-chat-panel__grip{display:block;}}
@media (max-width:767px){.chils-chat-panel.chils-chat-panel--imax{
    resize:none!important;
    left:max(8px, env(safe-area-inset-left))!important;
    right:max(8px, env(safe-area-inset-right))!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    height:min(76vh, calc(100dvh - 100px))!important;
  }}
.chils-chat-panel.chils-chat-panel--imax .chils-chat-head{
  flex-shrink:0;
  padding-left:26px;
  padding-right:8px;
  position:relative;
  z-index:3;
}
.chils-chat-panel.chils-chat-panel--imax .chils-chat-panel__grip{
  left:8px;
}
.chils-chat-panel.chils-chat-panel--imax .chils-chat-inner{
  flex:1 1 auto;
  min-height:0;
  overscroll-behavior:contain;
}
.chils-chat-panel.chils-chat-panel--imax .chils-chat-msglog{
  flex:1 1 auto;
  min-height:120px;
  max-height:none!important;
  overscroll-behavior:contain;
}
.chils-chat-panel.chils-chat-panel--imax #chilsSheetChat{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.chils-chat-panel.chils-chat-panel--imax #chilsSheetChat .chils-chat-composer{
  flex-shrink:0;
}
.chils-chat-panel.chils-chat-panel--imax #chilsSheetChat .chils-chat-rate{
  flex-shrink:0;
}
.chils-chat-panel.chils-chat-panel--imax .chils-chat-shell{
  flex:1 1 auto;
  min-height:0;
  overscroll-behavior:contain;
}
.chils-chat-panel.chils-chat-panel--imax .chils-chat-sheet{
  flex:1 1 auto;
  min-height:0;
  overscroll-behavior:contain;
}
.chils-chat-inner{
  display:flex;flex-direction:column;flex:1;min-height:0;border-radius:14px;
  overflow:hidden;background:var(--bg);
  border:1px solid var(--border);
  overscroll-behavior:contain;
}
.chils-chat-head{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  align-items:center;
  gap:6px 8px;
  flex-shrink:0;
  position:relative;
  min-height:48px;
  padding:8px 10px 6px;border-bottom:1px solid var(--border);
  background:var(--bg-subtle);
}
.chils-chat-head__lead{
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  z-index:2;
  background:var(--bg-subtle);
  align-self:center;
  justify-self:start;
  grid-column:1;
}
.chils-chat-back-head{
  box-sizing:border-box!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  max-width:44px!important;
  max-height:44px!important;
  aspect-ratio:1!important;
  padding:0!important;
  margin:0;
  border-radius:50%!important;
  border:2px solid rgba(0,113,227,.38);
  background:rgba(0,113,227,.1);
  color:var(--accent);
  cursor:pointer;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  line-height:0;
  -webkit-tap-highlight-color:transparent;
  transition:border-color .15s,background .15s,color .15s;
}
.chils-chat-back-head svg{display:block;width:20px;height:20px;flex-shrink:0;}
.chils-chat-back-head:hover,.chils-chat-back-head:focus-visible{background:var(--accent);border-color:var(--accent);color:#fff;}
html[data-theme="dark"] .chils-chat-back-head{background:rgba(64,156,255,.12);border-color:rgba(64,156,255,.4);}
.chils-chat:not(.chils-chat--msgs) .chils-chat-back-head{
  visibility:hidden;
  pointer-events:none;
}
.chils-chat-brand{
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-width:0;
  text-align:center;
  position:relative;
  left:auto;top:auto;transform:none;
  justify-self:center;
  pointer-events:none;
  z-index:1;
  max-width:100%;
  grid-column:2;
  grid-row:1;
}
.chils-chat-brand__logo{
  height:26px;width:auto;max-width:110px;object-fit:contain;display:block;
  filter:brightness(0) saturate(100%) invert(58%) sepia(61%) saturate(420%) hue-rotate(92deg) brightness(96%) contrast(92%);
}
.chils-chat-brand__cap{font-size:11px;font-weight:652;letter-spacing:.12em;text-transform:uppercase;color:var(--text-secondary);white-space:nowrap;}
.chils-chat-traffic{
  display:flex;flex-direction:row;align-items:center;gap:10px;flex-shrink:0;z-index:2;
  background:var(--bg-subtle);padding-left:4px;
  grid-column:3;
  grid-row:1;
  justify-self:end;
}
.chils-traffic{
  width:16px;height:16px;border-radius:50%;border:none;padding:0;margin:0;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:900;line-height:1;color:rgba(0,0,0,.68);
  box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);
  -webkit-tap-highlight-color:transparent;
  outline:1px solid transparent;outline-offset:1px;transition:outline-color .15s ease,filter .15s ease;
}
.chils-traffic:hover,.chils-traffic:focus-visible{outline-color:var(--accent);}
.chils-traffic--close{background:#ff5f57;color:#3d0a08}
.chils-traffic span{display:block}
.chils-chat-sub--hub{font-size:13px;line-height:1.45;color:var(--text-secondary);margin:10px 14px 4px;text-align:center;}
.chils-chat-hubicons{display:flex;flex-direction:row;gap:16px;justify-content:center;padding:8px 12px 18px;}
.chils-hub-icon{
  width:54px;height:54px;border-radius:50%;border:1px solid var(--border);background:var(--card);
  color:var(--accent);display:flex;align-items:center;justify-content:center;text-decoration:none;padding:0;
  box-shadow:var(--shadow-sm);cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.chils-hub-icon:hover{background:var(--accent-soft);border-color:var(--accent-mid)}
.chils-hub-icon:focus-visible{outline:2px solid var(--accent-ring);outline-offset:2px}
.chils-hub-icon svg{width:24px;height:24px;display:block}
.chils-hub-icon--bug{position:relative}
.chils-hub-tip{
  position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);
  padding:6px 10px;border-radius:8px;background:var(--text);color:var(--bg);
  font-size:12px;font-weight:500;line-height:1.25;white-space:nowrap;
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .15s ease,visibility .15s ease;
  box-shadow:var(--shadow-sm);
}
@media (hover:hover) and (min-width:768px){.chils-hub-icon--bug:hover .chils-hub-tip,
  .chils-hub-icon--bug:focus-visible .chils-hub-tip{opacity:1;visibility:visible}}
.chils-chat-fab{
  position:relative;z-index:97;
  width:76px;height:76px;border-radius:50%;
  border:1px solid rgba(0,113,227,.55);
  background:var(--card);box-shadow:var(--shadow-md);color:var(--accent);cursor:pointer;
  display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;
  overflow:visible;
}
.chils-chat-fab:hover{background:var(--accent-soft);border-color:rgba(0,113,227,.78)}
.chils-chat-fab:focus-visible{outline:2px solid var(--accent-ring);outline-offset:3px}
html[data-theme="dark"] .chils-chat-fab{border-color:rgba(118,192,255,.58)}
html[data-theme="dark"] .chils-chat-fab:hover{border-color:rgba(118,192,255,.85)}
@keyframes chilsFabOrbit{to{transform:rotate(360deg)}}
@keyframes chilsFabOrbitPulse{0%,100%{opacity:.45}50%{opacity:1}}
.chils-chat-shell{flex:1;min-height:0;display:flex;flex-direction:column}
.chils-chat-sheet{display:flex;flex-direction:column;flex:1;min-height:0}
.chils-chat-sheet.is-hidden{display:none!important}
.chils-chat-msglog{
  flex:1;overflow-y:auto;min-height:140px;max-height:min(46vh, 420px);
  margin:0 6px;padding:10px 10px;scroll-behavior:smooth;background:transparent;
  display:flex;flex-direction:column;gap:8px;align-items:stretch;
  border:2px solid var(--accent);border-radius:14px;
  box-shadow:none;
  overscroll-behavior:contain;
}
html[data-theme="dark"] .chils-chat-msglog{border-color:#5eb0ff;}
.chils-chat-composer{padding:10px;border-top:1px solid var(--border);background:var(--bg-subtle)}
.chils-chat-att-ready{
  font-size:13px;font-weight:600;line-height:1.35;
  color:var(--accent);
  margin:0 2px 6px;
  padding:8px 12px;
  border-radius:12px;
  background:rgba(0,113,227,.12);
  border:2px solid #0071e3;
}
.chils-chat-att-ready.is-hidden{display:none!important;}
html[data-theme="dark"] .chils-chat-att-ready{
  background:rgba(64,156,255,.12);
  border-color:rgba(64,156,255,.38);
}
.chils-chat-composer.chils--has-text .chils-tg-sendfly{
  background:var(--accent);color:#fff;border-color:var(--accent);
  box-shadow:0 4px 14px rgba(0,113,227,.32);
}
.chils-chat-send-hint{
  display:none;
  font-size:11px;
  line-height:1.35;
  color:var(--text-tertiary);
  margin:0 4px 8px;
  padding:0 6px;
  text-align:center;
}
@media (min-width:768px){.chils-chat--msgs .chils-chat-send-hint{display:block;}}
.chils-chat-privacy{font-size:11px;line-height:1.35;color:var(--text-tertiary);margin:8px 4px 0;padding:0 6px;}
.chils-chat-privacy__row2{display:block;margin-top:3px}
.chils-chat-rate{padding:10px 8px 12px;border-top:1px dashed var(--border);margin-top:4px;}
.chils-chat-rate.is-hidden{display:none!important}
.chils-chat-rate__ask{font-size:12px;color:var(--text-secondary);margin:0 0 10px;text-align:center;}
.chils-chat-rate__row{display:flex;gap:14px;justify-content:center;align-items:center;}
.chils-rate-ico{
  width:48px;height:48px;border-radius:50%;border:1px solid var(--border);background:var(--card);
  cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;color:var(--text-secondary);
}
.chils-rate-ico:hover{border-color:var(--accent-mid);color:var(--accent);}
.chils-rate-ico svg{width:24px;height:24px;display:block}
.chils-chat-rate-neg{margin-top:12px;padding-top:10px;border-top:1px solid var(--border);display:none;}
.chils-chat-rate-neg.is-on{display:block}
.chils-chat-rate-neg__title{font-size:12px;font-weight:600;margin:0 0 8px;color:var(--text);}
.chils-rate-reason{
  display:block;width:100%;text-align:left;padding:8px 10px;margin-bottom:6px;border-radius:10px;border:1px solid var(--border);
  background:var(--card);font:inherit;font-size:13px;cursor:pointer;color:var(--text);
}
.chils-rate-reason:hover{border-color:var(--accent-mid)}
.chils-rate-other-ta{width:100%;min-height:52px;margin-top:6px;font:inherit;font-size:13px;padding:8px;border-radius:10px;border:1px solid var(--border);background:var(--bg);}
.chils-rate-submit{margin-top:8px;width:100%;padding:10px;border-radius:12px;border:none;background:var(--accent);color:#fff;font-weight:600;cursor:pointer;}
@media (prefers-reduced-motion:reduce){.chils-chat-msglog{scroll-behavior:auto}}
.chils-chat-msglog.is-empty{border-style:solid;opacity:1;border-radius:14px;border-width:2px;border-color:var(--accent)}
html[data-theme="dark"] .chils-chat-msglog.is-empty{border-color:#5eb0ff;}
.chils-chat-mute{font-size:12px;line-height:1.5;color:#b44;margin:4px 10px 0;display:none}
.chils-chat-mute.is-on{display:block}

/* кнопка чата: стили, не перенесённые с живого сайта, — в палитре нового сайта */
.chils-fab-orbit{position:absolute;inset:-6px;border-radius:50%;pointer-events:none;border:2px solid color-mix(in srgb,var(--acc) 12%,transparent);border-top-color:var(--acc);opacity:.85;animation:chilsFabOrbit 4.8s linear infinite,chilsFabOrbitPulse 2.6s ease-in-out infinite}
.chils-fab-face{width:68px;height:68px;border-radius:50%;object-fit:cover;object-position:center 18%;display:block;border:1px solid color-mix(in srgb,var(--acc) 55%,transparent);position:relative;z-index:1;overflow:hidden;background:var(--card)}
.chils-fab-face img{width:100%;height:100%;object-fit:cover;object-position:center 22%;display:block}
.chils-fab-face .chils-user-avatar{width:100%;height:100%;display:block;color:var(--acc)}
.chils-fab-online{position:absolute;right:3px;bottom:5px;z-index:2;width:14px;height:14px;border-radius:50%;background:#3fb36b;border:2px solid var(--bg)}
@media (max-width:767px){.chils-chat.is-open{z-index:460}}
/* облачка-подсказки над всеми тремя кнопками */
.chils-hub-icon{position:relative}
.chils-hub-tip{position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);padding:6px 10px;border-radius:8px;background:var(--fg);color:var(--bg);font-size:12px;font-weight:500;line-height:1.25;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease,visibility .15s ease;box-shadow:0 4px 14px rgba(0,0,0,.18);z-index:5}
.chils-hub-tip::after{content:"";position:absolute;left:50%;top:100%;transform:translateX(-50%);border:5px solid transparent;border-top-color:var(--fg)}
@media (hover:hover){.chils-hub-icon:hover .chils-hub-tip,.chils-hub-icon:focus-visible .chils-hub-tip{opacity:1;visibility:visible}}
