/* HelpRetouch · помощник «Мастер»: поведение — облачко, вкладка, подсветка, вопрос, место на экране.
   ВНЕШНИЙ ВИД И АНИМАЦИЯ ПЕРСОНАЖА — в helper-character.css / helper-character.js (их можно
   менять отдельно, этот файл для этого трогать не нужно). */
.hrh-root{position:fixed;left:0;top:0;z-index:1450;pointer-events:none;font:14px/1.45 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
.hrh-root[hidden]{display:none}
.hrh-char{position:absolute;left:0;top:0;pointer-events:auto;cursor:grab;touch-action:none;will-change:transform;filter:drop-shadow(0 6px 10px rgba(0,0,0,.35))}
.hrh-char:active{cursor:grabbing}
.hrh-char .hrh-flip{transition:transform .2s,opacity .25s,translate .25s}
.hrh-char.hrh-tucked{pointer-events:none}
.hrh-char.hrh-tucked .hrh-flip{opacity:.35;translate:-62% 0}
.hrh-char:focus-visible{outline:2px solid #f0c074;outline-offset:4px;border-radius:12px}
.hrh-flip{width:100%;height:100%;transform-origin:50% 50%;transition:transform .2s}
.hrh-flip.left{transform:scaleX(-1)}

/* Облачко — компактное, в тон платформы: графит и латунь (в светлой теме — слоновая кость) */
.hrh-bubble{--hb-bg:#1c232d;--hb-ink:#ece5d8;--hb-muted:#a99f8f;--hb-line:rgba(240,192,116,.28);--hb-accent:#f0c074;--hb-btn:#263040;--hb-btn-ink:#ece5d8;--hb-primary:#f0c074;--hb-primary-ink:#211809;
  position:absolute;left:0;top:0;width:min(252px,calc(100vw - 20px));pointer-events:auto;background:var(--hb-bg);color:var(--hb-ink);border:1px solid var(--hb-line);border-radius:12px;padding:9px 11px 9px;
  box-shadow:0 16px 36px -10px rgba(0,0,0,.6);opacity:0;transform:translateY(6px);transition:opacity .22s,transform .22s;visibility:hidden;font-size:13px;line-height:1.4}
html[data-theme="ivory"] .hrh-bubble{--hb-bg:#fffdf8;--hb-ink:#2a2520;--hb-muted:#7d7263;--hb-line:rgba(166,107,37,.35);--hb-accent:#a66b25;--hb-btn:#f3ede3;--hb-btn-ink:#2a2520;--hb-primary:#2a2f38;--hb-primary-ink:#fffdf8;box-shadow:0 14px 30px -12px rgba(43,34,23,.45)}
.hrh-bubble.show{opacity:1;transform:none;visibility:visible}
.hrh-bubble.important{border-color:var(--hb-accent)}
.hrh-bubble .hrh-tail{position:absolute;bottom:-7px;width:14px;height:7px;overflow:hidden}
.hrh-bubble .hrh-tail[hidden]{display:none}
.hrh-bubble .hrh-tail:before{content:"";position:absolute;left:2px;top:-6px;width:10px;height:10px;background:var(--hb-bg);border:1px solid var(--hb-line);transform:rotate(45deg)}
.hrh-bubble.important .hrh-tail:before{border-color:var(--hb-accent)}
.hrh-bubble .hrh-who{display:block;font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--hb-accent);font-weight:700;margin-bottom:2px}
.hrh-bubble .hrh-text{margin:0 0 7px;font-size:13px}
.hrh-bubble .hrh-actions[hidden]{display:none}
.hrh-bubble .hrh-actions{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.hrh-bubble button,.hrh-bubble .hrh-btn-link{font:inherit;font-size:12px;line-height:1.2;border-radius:8px;padding:5px 9px;min-height:28px;cursor:pointer;border:1px solid transparent;background:var(--hb-btn);color:var(--hb-btn-ink);text-decoration:none;display:inline-flex;align-items:center}
.hrh-bubble button.primary,.hrh-bubble .hrh-btn-link.primary{background:var(--hb-primary);color:var(--hb-primary-ink);font-weight:650}
.hrh-bubble button.hrh-link{background:transparent;color:var(--hb-muted);padding:5px 4px;text-decoration:underline;text-underline-offset:2px}
.hrh-bubble button:focus-visible,.hrh-bubble a:focus-visible{outline:2px solid var(--hb-accent);outline-offset:2px}
.hrh-bubble .hrh-menu-btn{margin-left:auto;background:transparent;color:var(--hb-muted);padding:3px 6px;min-height:24px;font-size:14px}
.hrh-bubble .hrh-menu{display:flex;flex-direction:column;gap:2px;margin-top:7px;padding-top:6px;border-top:1px solid var(--hb-line)}
.hrh-bubble .hrh-menu[hidden]{display:none}
.hrh-bubble .hrh-menu button,.hrh-bubble .hrh-menu a{text-align:left;justify-content:flex-start;background:transparent;padding:5px 4px;min-height:26px;color:var(--hb-ink);font-size:12.5px}
.hrh-bubble .hrh-menu a{color:var(--hb-accent);text-decoration:none}
.hrh-bubble .hrh-menu button[aria-pressed="true"]{font-weight:700;color:var(--hb-accent)}
.hrh-bubble .hrh-stage{display:block;margin-top:3px;font-weight:600;color:var(--hb-accent)}
.hrh-bubble .hrh-progress{display:block;height:2px;border-radius:2px;background:var(--hb-line);margin-top:7px;overflow:hidden}
.hrh-bubble .hrh-progress i{display:block;height:100%;width:30%;background:var(--hb-accent);border-radius:2px;animation:hrhRun 1.6s ease-in-out infinite}
@keyframes hrhRun{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}

/* Вопрос помощнику прямо в облачке */
.hrh-bubble .hrh-ask{display:flex;gap:5px;align-items:flex-end;margin:0 0 7px}
.hrh-bubble .hrh-ask textarea{flex:1 1 auto;min-width:0;min-height:34px;max-height:96px;resize:none;font:inherit;font-size:12.5px;line-height:1.35;color:var(--hb-ink);background:rgba(0,0,0,.18);border:1px solid var(--hb-line);border-radius:8px;padding:6px 8px}
html[data-theme="ivory"] .hrh-bubble .hrh-ask textarea{background:#fff}
.hrh-bubble .hrh-ask textarea::placeholder{color:var(--hb-muted)}
.hrh-bubble .hrh-ask textarea:focus{outline:1px solid var(--hb-accent);outline-offset:0}
.hrh-bubble .hrh-ask button{flex:0 0 auto}

/* Мастер заменяет круглую кнопку «Помощь»: окно помощника открывается щелчком по нему,
   на компьютере — с его стороны экрана. Выключили мастера — кнопка возвращается. */
html.hrh-active .support-launcher{display:none!important}
@media (min-width:900px){
  .support-root--from-master .support-panel{left:18px;right:auto;transform-origin:left bottom}
}
.support-avatar.hrh-avatar{padding:0;overflow:hidden;background:linear-gradient(145deg,#f3e6cf,#d9c3a0)}
.support-avatar.hrh-avatar svg{width:100%;height:100%;display:block}

/* Выключенный помощник — маленькая вкладка у края, чтобы включить обратно */
.hrh-tab{position:fixed;left:0;bottom:120px;z-index:1450;pointer-events:auto;border:1px solid rgba(240,192,116,.45);border-left:0;border-radius:0 10px 10px 0;background:rgba(26,32,41,.92);color:#f0c074;font:600 12px/1 Inter,system-ui,sans-serif;padding:8px 9px;cursor:pointer;opacity:.55;transition:opacity .2s}
.hrh-tab:hover,.hrh-tab:focus-visible{opacity:1}
.hrh-tab[hidden]{display:none}

/* Подсветка элемента, на который показывает мастер */
.hrh-focus{outline:2px solid #f0c074!important;outline-offset:3px;border-radius:10px;animation:hrhPulse 1.4s ease-in-out 3}
@keyframes hrhPulse{0%,100%{box-shadow:0 0 0 0 rgba(240,192,116,.0)}50%{box-shadow:0 0 0 8px rgba(240,192,116,.28)}}

@media (max-width:760px){
  .hrh-bubble{width:min(240px,calc(100vw - 20px))}
  .hrh-tab{bottom:150px}
}
@media (prefers-reduced-motion:reduce){
  .hrh-root *,.hrh-focus{animation:none!important;transition:none!important}
}
@media print{.hrh-root,.hrh-tab{display:none!important}}
