/* Пошаговые подсказки поверх интерфейса: подсвеченная зона, размытие
   остального, пояснение рядом. Ничего из этого не влияет на сам интерфейс —
   файл подключается только на демонстрационной странице. */

:root{
  --tour-dim:rgba(9,17,33,.52);
  --tour-blur:2.6px;
}

/* --- затемнение четырьмя панелями, между которыми остаётся «окно» --- */
.tour-pane{
  position:fixed;background:var(--tour-dim);z-index:90;
  backdrop-filter:blur(var(--tour-blur));-webkit-backdrop-filter:blur(var(--tour-blur));
  transition:top .34s cubic-bezier(.4,0,.2,1),left .34s cubic-bezier(.4,0,.2,1),
             width .34s cubic-bezier(.4,0,.2,1),height .34s cubic-bezier(.4,0,.2,1);
}
.tour-ring{
  position:fixed;z-index:91;border-radius:13px;pointer-events:none;
  box-shadow:0 0 0 2px #fff,0 0 0 5px rgba(31,95,214,.55),0 22px 60px rgba(8,16,32,.4);
  transition:top .34s cubic-bezier(.4,0,.2,1),left .34s cubic-bezier(.4,0,.2,1),
             width .34s cubic-bezier(.4,0,.2,1),height .34s cubic-bezier(.4,0,.2,1);
}
.tour-ring.pulse::after{
  content:"";position:absolute;inset:-5px;border-radius:16px;
  border:2px solid rgba(31,95,214,.9);animation:tour-pulse 1.9s ease-out infinite;
}
@keyframes tour-pulse{
  0%{transform:scale(1);opacity:.9} 70%{transform:scale(1.045);opacity:0} 100%{opacity:0}
}

/* --- пояснение --- */
.tour-tip{
  position:fixed;z-index:92;width:430px;max-width:calc(100vw - 32px);
  background:#fff;border-radius:14px;padding:20px 22px 16px;
  box-shadow:0 26px 70px rgba(8,16,32,.34),0 2px 6px rgba(8,16,32,.12);
  transition:top .34s cubic-bezier(.4,0,.2,1),left .34s cubic-bezier(.4,0,.2,1);
}
.tour-tip .arrow{
  position:absolute;width:14px;height:14px;background:#fff;transform:rotate(45deg);
}
.tour-tip.center{
  width:600px;padding:30px 34px 24px;
  top:50%!important;left:50%!important;transform:translate(-50%,-50%);
}
.tour-tip.center .arrow{display:none}

/* --- вступительный слайд: схема работы агента --- */
.tour-tip.slide{
  width:min(1000px,calc(100vw - 40px));padding:26px 30px 20px;
  max-height:calc(100vh - 32px);overflow-y:auto;
}
/* Два главных абзаца идут первыми — до схемы. */
.slide-top{display:grid;grid-template-columns:1fr 1fr;gap:10px 24px;margin-bottom:16px}
.slide-top p{font-size:14px;line-height:1.58;color:#33415c;margin:0}
.slide-top b{color:var(--ink);font-weight:650}

/* подпись к схеме — тише основного текста */
.slide-lead{font-size:13px;line-height:1.55;color:var(--muted);margin:0 0 12px}
.slide-foot{
  margin-top:16px;padding-top:14px;border-top:1px solid var(--line);
  font-size:12.5px;line-height:1.55;color:var(--muted);
}
@media (max-width:760px){
  .slide-top{grid-template-columns:1fr;gap:9px}
}

.scheme{display:block;width:100%;height:auto}
.scheme rect{fill:#fff;stroke:var(--line);stroke-width:1}
.scheme .io rect{fill:#f7f9fc}
.scheme .out rect{fill:#f3f7fe;stroke:#bcd0f0}
.scheme .warn rect{fill:#fdf7e9;stroke:#e6d5a8}
.scheme text{
  text-anchor:middle;font-family:"Segoe UI",system-ui,-apple-system,sans-serif;
}
.scheme text.t{font-size:14px;font-weight:600;fill:var(--ink)}
.scheme text.s{font-size:11.5px;fill:var(--muted)}
.scheme line{stroke:#9fb0cb;stroke-width:1.5}
.scheme marker path{fill:#9fb0cb}

/* вертикальный вариант схемы — только для узких экранов */
.scheme-list{display:none;margin:0;padding:0;list-style:none;counter-reset:sc}
.scheme-list li{
  position:relative;counter-increment:sc;padding:0 0 16px 38px;
}
.scheme-list li::before{
  content:counter(sc);position:absolute;left:0;top:0;
  width:25px;height:25px;border-radius:8px;background:var(--accent);color:#fff;
  display:grid;place-items:center;font-size:12.5px;font-weight:700;
}
.scheme-list li::after{
  content:"";position:absolute;left:12px;top:29px;bottom:3px;width:1.5px;background:#c9d5e8;
}
.scheme-list li:last-child{padding-bottom:0}
.scheme-list li:last-child::after{display:none}
.scheme-list b{display:block;font-size:14px;font-weight:650;line-height:1.3}
.scheme-list span{display:block;font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.45}

@media (max-width:760px){
  .scheme{display:none}
  .scheme-list{display:block}
}

.tour-count{
  font:12px/1 var(--mono);color:var(--muted);letter-spacing:.04em;
  display:flex;align-items:center;gap:10px;margin-bottom:9px;
}
.tour-track{flex:1;height:3px;background:#e8edf5;border-radius:3px;overflow:hidden}
.tour-track i{display:block;height:100%;background:var(--accent);transition:width .3s}
.tour-tip h3{font-size:17px;margin-bottom:8px;letter-spacing:-.015em}
.tour-tip.center h3{font-size:23px;margin-bottom:12px}
.tour-body{font-size:14px;line-height:1.62;color:#33415c}
.tour-body p{margin:0 0 9px}
.tour-body p:last-child{margin-bottom:0}
.tour-body b{color:var(--ink);font-weight:650}
.tour-body ul{margin:8px 0 0;padding-left:19px;color:#33415c}
.tour-body li{margin-bottom:5px}

.tour-tz{
  margin-top:12px;padding:9px 12px;background:#f3f7fe;border-left:3px solid var(--accent);
  border-radius:0 8px 8px 0;font-size:12.5px;color:#2d4a80;
}
.tour-tz b{color:var(--accent-dark)}

.tour-nav{display:flex;align-items:center;gap:9px;margin-top:16px}
.tour-nav .sp{flex:1}
.tour-btn{
  border:1px solid var(--line);background:#fff;color:var(--ink);
  padding:9px 16px;border-radius:9px;font:inherit;font-size:13.5px;font-weight:550;
  cursor:pointer;transition:.12s;
}
.tour-btn:hover:not(:disabled){background:#f2f5fa;border-color:#c6d2e4}
.tour-btn:disabled{opacity:.45;cursor:default}
.tour-btn.go{background:var(--accent);border-color:var(--accent);color:#fff}
.tour-btn.go:hover:not(:disabled){background:var(--accent-dark);border-color:var(--accent-dark)}
.tour-btn.plain{border-color:transparent;color:var(--muted);padding-left:8px;padding-right:8px}
.tour-btn.plain:hover{background:#f2f5fa;color:var(--ink)}
.tour-btn.big{padding:13px 24px;font-size:15px;border-radius:10px}

/* состояние «идёт операция» */
.tour-tip.busy .tour-body::after{
  content:"";display:inline-block;width:9px;height:9px;margin-left:7px;border-radius:50%;
  background:var(--accent);animation:tour-blink 1s steps(2,end) infinite;
}
@keyframes tour-blink{50%{opacity:.2}}

/* кнопка возврата к подсказкам */
.tour-resume{
  position:fixed;right:22px;bottom:22px;z-index:80;
  background:var(--accent);color:#fff;border:none;border-radius:26px;
  padding:13px 21px;font:inherit;font-size:14px;font-weight:600;cursor:pointer;
  box-shadow:0 12px 34px rgba(31,95,214,.4);
}
.tour-resume:hover{background:var(--accent-dark)}

/* плашка «это демонстрация» */
.demo-note{
  background:#12203a;color:#c3d2ea;font-size:13px;
  border-top:1px solid rgba(255,255,255,.09);
}
.demo-note .wrap{padding:10px 24px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.demo-note b{color:#fff}
.demo-note .dot{width:7px;height:7px;border-radius:50%;background:#6ee7a8;flex:none}

@media (max-width:760px){
  .tour-tip{
    width:auto;left:12px!important;right:12px;
    top:auto!important;bottom:12px;max-height:64vh;overflow-y:auto;
  }
  .tour-tip.center{
    width:auto;left:12px!important;right:12px;top:auto!important;bottom:12px;
    transform:none;padding:22px 20px 16px;
  }
  /* Схему на телефоне показываем во весь экран: под неё нужна вся высота.
     Селектор из трёх классов — чтобы наверняка перебить .tour-tip.center,
     который тоже задан через !important. */
  .tour-tip.center.slide{
    width:auto!important;left:12px!important;right:12px!important;
    top:12px!important;bottom:12px!important;
    transform:none!important;padding:20px 18px 14px;max-height:calc(100vh - 24px);
  }
  .tour-tip .arrow{display:none}
  .tour-tip.center h3{font-size:19px}
  .tour-nav{flex-wrap:wrap}
}
