/* Тур по сайту — сторис на весь экран (public/tour.js).
   Фирменная палитра — та же, что у баннеров главной (.hb-slide.tone-brand /
   .tone-wine в public.css): бордовые градиенты, золото, белый текст.
   На телефоне — во весь экран, на компьютере — карточка 1100×660 в две
   колонки: слева текст, справа живое демо. Шаг настройки профиля — в
   токенах приложения, поэтому работает и в светлой, и в тёмной теме. */
body.tr-open{ overflow:hidden; }
.tr{ position:fixed; inset:0; z-index:190; background:rgba(12,6,8,.86); display:grid; place-items:center;
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); animation:trFade .25s ease; }
@keyframes trFade{ from{ opacity:0; } }
.tr-shell{ position:relative; width:100vw; height:100vh; height:100dvh; overflow:hidden; color:#fff;
  background:linear-gradient(160deg,#2A1A17 0%,#4A1E27 55%,#6E1B2E 100%); user-select:none; -webkit-user-select:none;
  transition:background .4s ease; }
.tr-shell.tone-brand{ background:radial-gradient(120% 90% at 85% 0%, #6E1B2E 0%, #4A1E27 45%, #2A1A17 100%); }
.tr-shell.tone-wine{ background:radial-gradient(120% 90% at 90% 0%, #B0283F 0%, #8E1F32 55%, #5A1422 100%); }
.tr-shell.tone-deep{ background:radial-gradient(120% 90% at 80% 0%, #4A1E27 0%, #2A1A17 60%, #170D0C 100%); }
.tr-shell.tone-paper{ background:var(--bg); color:var(--text); user-select:auto; -webkit-user-select:auto; }

.tr-bars{ position:absolute; top:12px; left:12px; right:60px; z-index:5; display:flex; gap:4px; }
.tr-bars i{ flex:1; height:3px; border-radius:3px; background:rgba(255,255,255,.28); }
.tr-bars i.done{ background:rgba(255,255,255,.9); }
.tr-bars i.on{ background:#E8B865; }
.tone-paper .tr-bars i{ background:var(--border); }
.tone-paper .tr-bars i.done{ background:var(--accent); }
.tone-paper .tr-bars i.on{ background:var(--gold); }
.tr-x{ position:absolute; top:22px; right:12px; z-index:6; width:38px; height:38px; border:0; border-radius:50%;
  background:rgba(255,255,255,.14); color:#fff; display:grid; place-items:center; cursor:pointer; }
.tr-x:hover{ background:rgba(255,255,255,.22); }
.tone-paper .tr-x{ background:var(--surface-hover); color:var(--text); }
.tr-skipall{ position:absolute; top:24px; right:60px; z-index:6; height:34px; padding:0 12px; border:0; border-radius:999px;
  background:none; color:rgba(255,255,255,.78); font:500 13px/1 var(--font); cursor:pointer; }
.tr-skipall:hover{ color:#fff; background:rgba(255,255,255,.1); }
.tr-skipall[hidden]{ display:none; }

.tr-stage{ position:absolute; inset:0; overflow:hidden; }
.tone-paper .tr-stage{ overflow-y:auto; -webkit-overflow-scrolling:touch; }
.tr-loading{ position:absolute; inset:0; display:grid; place-items:center; }
.tr-loading .tr-crest{ width:96px; height:96px; animation:trPulse 1.6s ease-in-out infinite; }

.tr-slide{ position:absolute; inset:0; padding:72px 24px 28px; display:flex; flex-direction:column; justify-content:flex-end; gap:20px;
  animation:trIn .45s cubic-bezier(.2,.7,.2,1); }
@keyframes trIn{ from{ opacity:0; transform:translateY(16px) scale(.985); } }
.tr-txt{ display:flex; flex-direction:column; gap:12px; position:relative; z-index:2; }
.tr-vis{ display:flex; flex-direction:column; gap:12px; order:-1; flex:1; min-height:0; justify-content:flex-end; position:relative; }
.tr-eyebrow{ font:600 12px/1.3 var(--font); letter-spacing:.08em; text-transform:uppercase; color:#E8B865; }
.tone-paper .tr-eyebrow{ color:var(--accent-text); }
.tr-h{ margin:0; font:600 30px/1.12 var(--font); letter-spacing:-.02em; color:inherit; text-wrap:balance; }
.tr-h.sm{ font-size:24px; }
.tr-gold{ color:#E8B865; }
.tr-p{ margin:0; font:400 15px/1.5 var(--font); opacity:.9; max-width:520px; }
.tr-p.muted{ color:var(--text-muted); opacity:1; }
.tr-crest{ width:84px; height:84px; object-fit:contain; filter:drop-shadow(0 8px 24px rgba(0,0,0,.35)); }
.tr-crest.big{ width:120px; height:120px; animation:trPulse 2.4s ease-in-out infinite; }
@keyframes trPulse{ 50%{ transform:scale(1.05); } }

/* Кнопки «Назад / Далее» */
.tr-ctrl{ display:flex; align-items:center; gap:10px; margin-top:6px; }
.tr-next{ height:48px; padding:0 22px; border:0; border-radius:12px; background:#fff; color:#6E1B2E;
  font:600 15px/1 var(--font); display:inline-flex; align-items:center; gap:8px; cursor:pointer; transition:transform .12s; }
.tr-next:hover{ transform:translateX(2px); }
.tr-next:active{ transform:scale(.97); }
.tr-back{ width:48px; height:48px; border-radius:12px; border:1px solid rgba(255,255,255,.35); background:rgba(255,255,255,.06);
  color:#fff; display:grid; place-items:center; cursor:pointer; }
.tr-back:hover{ background:rgba(255,255,255,.14); }
.tr-count{ margin-left:auto; font:500 13px var(--font); opacity:.6; font-variant-numeric:tabular-nums; }
.tr-next:focus-visible, .tr-back:focus-visible, .tr-x:focus-visible, .tr-skipall:focus-visible, .tr-go:focus-visible, .tr-ghost:focus-visible{
  outline:2px solid #E8B865; outline-offset:2px; }

/* 1. Лица и счётчики */
.tr-faces{ position:absolute; inset:0 0 auto 0; height:100%; }
.tr-face{ width:46px; height:46px; border-radius:50%; object-fit:cover; border:2px solid rgba(232,184,101,.85);
  background:#4A1E27; color:#fff; display:inline-grid; place-items:center; font:600 17px var(--font); flex-shrink:0; }
.tr-face.ph{ background:linear-gradient(135deg,#8E1F32,#4A1E27); }
.tr-faces .tr-face{ position:absolute;
  animation:trFloat 5s ease-in-out infinite, trPop .5s cubic-bezier(.2,1.4,.4,1) both; animation-delay:calc(var(--i) * -0.4s), calc(var(--i) * 70ms); }
.tr-faces .tr-face:nth-child(3n){ width:58px; height:58px; }
.tr-faces .tr-face:nth-child(4n){ width:38px; height:38px; opacity:.8; }
.tr-faces .tr-crest{ position:absolute; left:50%; top:46%; transform:translate(-50%,-50%); width:110px; height:110px; z-index:1; }
@keyframes trFloat{ 50%{ translate:0 -10px; } }
@keyframes trPop{ from{ transform:scale(0); opacity:0; } }
.tr-stats{ display:flex; gap:8px; margin-top:4px; }
.tr-stats div{ flex:1; min-width:0; background:rgba(255,255,255,.08); border:1px solid rgba(232,184,101,.22); border-radius:14px; padding:12px; }
.tr-stats b{ display:block; font:600 24px/1.1 var(--font); letter-spacing:-.02em; color:#E8B865; font-variant-numeric:tabular-nums; }
.tr-stats span{ font-size:12.5px; line-height:1.3; opacity:.78; }

/* 2. Каталог и интересы */
.tr-filter{ display:flex; flex-wrap:wrap; gap:6px; }
.tr-filter span{ display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 12px; border-radius:10px;
  background:#fff; color:#4A1E27; font:500 13.5px var(--font); animation:trIn .4s both; }
.tr-filter span:nth-child(2){ animation-delay:.12s; } .tr-filter span:nth-child(3){ animation-delay:.24s; }
.tr-chips{ display:flex; flex-wrap:wrap; gap:7px; }
.tr-chips span{ padding:7px 12px; border-radius:999px; background:rgba(255,255,255,.14); font:500 13.5px var(--font);
  animation:trPop .4s cubic-bezier(.2,1.4,.4,1) both; animation-delay:calc(var(--i) * 80ms + .35s); }
.tr-chips span:nth-child(4n+1){ background:#E8B865; color:#2A1A17; }
.tr-match{ display:flex; align-items:center; gap:12px; font:500 14px var(--font); }
.tr-stack{ display:flex; }
.tr-stack .tr-face{ width:36px; height:36px; margin-left:-10px; font-size:14px; animation:trPop .4s both; animation-delay:calc(var(--i) * 120ms + 1.5s); }
.tr-stack .tr-face:first-child{ margin-left:0; }

/* 3. Чат с ИИ */
.tr-demo{ align-self:flex-start; font:600 10.5px/1 var(--font); letter-spacing:.1em; text-transform:uppercase; padding:5px 9px;
  border-radius:999px; background:rgba(232,184,101,.18); color:#E8B865; }
.tr-chat{ display:flex; flex-direction:column; gap:10px; }
.tr-bub{ max-width:90%; padding:12px 14px; border-radius:18px; font:400 14.5px/1.45 var(--font); min-height:20px; }
.tr-bub.me{ align-self:flex-end; background:#fff; color:#2A1A17; border-bottom-right-radius:6px; min-width:40px; }
.tr-bub.ai{ background:rgba(255,255,255,.1); border:1px solid rgba(232,184,101,.25); border-bottom-left-radius:6px; display:flex; gap:8px; align-items:flex-start;
  opacity:0; transform:translateY(6px); transition:opacity .3s, transform .3s; }
.tr-bub.ai.typing, .tr-bub.ai.show{ opacity:1; transform:none; }
.tr-ai-mark{ color:#E8B865; flex-shrink:0; display:inline-flex; margin-top:2px; }
.tr-bub.ai .tr-ans{ display:none; }
.tr-bub.ai.show .tr-ans{ display:inline; animation:trIn .4s; }
.tr-bub.ai.show .tr-dots{ display:none; }
.tr-ref{ display:inline-flex; align-items:center; gap:5px; height:24px; padding:0 8px 0 3px; margin:2px 2px; border-radius:12px;
  background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.18); font:500 13px/1 var(--font); vertical-align:-6px; white-space:nowrap; }
.tr-ref .tr-face{ width:18px; height:18px; font-size:10px; border-width:1px; }
.tr-dots{ display:inline-flex; gap:4px; padding:6px 0; }
.tr-dots i{ width:7px; height:7px; border-radius:50%; background:#E8B865; animation:trDot 1s infinite; }
.tr-dots i:nth-child(2){ animation-delay:.15s; } .tr-dots i:nth-child(3){ animation-delay:.3s; }
@keyframes trDot{ 50%{ opacity:.3; transform:translateY(-3px); } }

/* 4. Telegram */
.tr-phone{ background:#17212B; border-radius:22px; padding:12px; border:1px solid rgba(255,255,255,.08); max-width:420px; width:100%; }
.tr-tghead{ display:flex; align-items:center; gap:10px; padding:2px 4px 10px; border-bottom:1px solid rgba(255,255,255,.06); margin-bottom:10px; }
.tr-tghead img{ width:34px; height:34px; border-radius:50%; background:#fff; object-fit:contain; }
.tr-tghead b{ display:block; font:600 14px/1.2 var(--font); }
.tr-tghead span{ font-size:12px; opacity:.55; }
.tr-tg{ display:flex; flex-direction:column; gap:6px; }
.tr-tgmsg{ background:#2B5278; color:#fff; padding:12px 14px; border-radius:16px 16px 16px 4px; font:400 14.5px/1.45 var(--font); animation:trIn .5s .3s both; }
.tr-tgic{ display:inline-flex; vertical-align:-4px; margin-right:6px; color:#E8B865; }
.tr-tgic svg{ width:18px; height:18px; }
.tr-tgbtns{ display:flex; gap:6px; animation:trIn .5s .7s both; }
.tr-tgbtns span{ flex:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; background:rgba(255,255,255,.08);
  color:#8CC8FF; padding:10px 4px; border-radius:10px; font:500 13.5px var(--font); }
.tr-tgbtns span svg{ display:none; }
.tr-tgbtns span.on{ animation:trTap .7s 1.7s both; }
.tr-tgbtns span.on svg{ display:inline; animation:trPop .3s 2.1s both; }
@keyframes trTap{ 0%{ background:rgba(255,255,255,.08); color:#8CC8FF; transform:scale(1); } 40%{ transform:scale(.92); } 100%{ background:#B0283F; color:#fff; } }

/* 5. Карта */
.tr-mapwrap{ position:relative; width:100%; flex:1; min-height:200px; display:flex; align-items:center; }
.tr-map{ width:100%; height:100%; max-height:46vh; overflow:visible; }
.tr-map-kz{ fill:rgba(255,255,255,.07); stroke:rgba(232,184,101,.55); stroke-width:1.6; stroke-linejoin:round;
  stroke-dasharray:3200; stroke-dashoffset:3200; animation:trDraw 1.8s ease forwards; }
@keyframes trDraw{ to{ stroke-dashoffset:0; } }
.tr-pin{ animation:trPop .45s cubic-bezier(.2,1.4,.4,1) both; animation-delay:calc(var(--i) * 140ms + .9s); transform-box:fill-box; transform-origin:center; }
.tr-pin-dot{ fill:#E8B865; stroke:#2A1A17; stroke-width:2; }
.tr-pin-pulse{ fill:rgba(232,184,101,.25); transform-box:fill-box; transform-origin:center; animation:trRing 2.4s ease-out infinite; animation-delay:calc(var(--i) * 200ms + 1.4s); }
@keyframes trRing{ 0%{ transform:scale(.6); opacity:.9; } 100%{ transform:scale(1.8); opacity:0; } }
.tr-pin text{ fill:#fff; font:500 24px var(--font); paint-order:stroke; stroke:rgba(42,26,23,.85); stroke-width:5px; }

/* 6. Помочь своим */
.tr-cards{ display:grid; gap:8px; }
.tr-card{ display:flex; gap:12px; align-items:center; background:rgba(255,255,255,.08); border:1px solid rgba(232,184,101,.22);
  border-radius:14px; padding:12px 14px; animation:trIn .5s both; animation-delay:calc(var(--i) * 200ms + .3s); }
.tr-card-ic{ width:40px; height:40px; flex-shrink:0; border-radius:10px; background:rgba(232,184,101,.16); color:#E8B865; display:grid; place-items:center; }
.tr-card-ic svg{ width:22px; height:22px; }
.tr-card b{ display:block; font:600 15px/1.3 var(--font); }
.tr-card b em{ font-style:normal; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:#E8B865; margin-left:4px; }
.tr-card span{ font-size:13px; opacity:.75; }

/* Настройка профиля — токены приложения */
.tr-setup{ padding:72px 20px 28px; display:flex; flex-direction:column; gap:12px; min-height:100%; max-width:640px; margin:0 auto; animation:trIn .45s; }
.tr-step{ display:flex; gap:14px; align-items:flex-end; }
.tr-ava{ width:84px; height:84px; flex-shrink:0; border-radius:50%; background:var(--surface-hover); display:grid; place-items:center;
  overflow:hidden; position:relative; cursor:pointer; border:2px dashed var(--border); }
.tr-ava:hover{ border-color:var(--accent); }
.tr-ava img{ width:100%; height:100%; object-fit:cover; }
.tr-ava span{ font:600 28px var(--font); color:var(--text-muted); }
.tr-ava em{ position:absolute; right:2px; bottom:2px; width:28px; height:28px; border-radius:50%; background:var(--accent); color:#fff;
  display:grid; place-items:center; font-style:normal; box-shadow:0 0 0 2px var(--bg); }
.tr-ava em svg{ width:15px; height:15px; }
.tr-fields{ flex:1; display:grid; gap:6px; min-width:0; }
.tr-lab{ font:500 13px var(--font); color:var(--text-muted); }
.tr-in{ width:100%; height:44px; padding:0 13px; border-radius:var(--r-control); border:1px solid var(--border); background:var(--surface);
  font:400 15px var(--font); color:var(--text); outline:none; }
.tr-ta{ height:auto; min-height:64px; padding:10px 13px; line-height:1.45; resize:vertical; }
.tr-in:focus{ border-color:var(--accent); }
.tr-in::placeholder{ color:var(--text-faint); }
.tr-pick{ display:flex; flex-wrap:wrap; gap:6px; }
.tr-pick button{ height:32px; padding:0 12px; border-radius:999px; border:1px solid var(--border); background:var(--surface); color:var(--text);
  font:500 13px var(--font); cursor:pointer; }
.tr-pick button:hover{ border-color:var(--accent); }
.tr-pick button.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
.tr-privacy{ display:flex; gap:8px; align-items:flex-start; font-size:12.5px; line-height:1.4; color:var(--text-muted); }
.tr-privacy svg{ flex-shrink:0; margin-top:1px; }
.tr-tog{ min-height:46px; border-radius:var(--r-control); border:1px solid var(--border); background:var(--surface); color:var(--text);
  font:500 14.5px var(--font); cursor:pointer; text-align:left; padding:10px 14px; display:flex; align-items:center; gap:10px; margin-top:4px; }
.tr-tog svg{ flex-shrink:0; color:var(--accent-text); }
.tr-tog.done{ background:var(--good-bg); border-color:transparent; color:var(--good); }
.tr-tog.done svg{ color:var(--good); }
.tr-setup-btns{ display:grid; gap:4px; margin-top:auto; padding-top:8px; }
.tr-go{ height:50px; border:0; border-radius:12px; background:var(--accent, #B0283F); color:#fff; font:600 16px var(--font); cursor:pointer; }
.tr-go:hover{ opacity:.9; }
.tr-go:disabled{ opacity:.55; cursor:default; }
.tr-skip{ height:44px; border:0; background:none; color:var(--text-muted); font:500 14px var(--font); cursor:pointer; }
.tr-skip:hover{ color:var(--text); }

/* Финал */
.tr-finish{ position:absolute; inset:0; padding:72px 24px 36px; display:flex; flex-direction:column; justify-content:center; align-items:center;
  text-align:center; gap:16px; animation:trIn .45s; }
.tr-finish .tr-p{ max-width:440px; }
.tr-fin-btns{ display:grid; gap:10px; width:100%; max-width:360px; margin-top:8px; }
.tr-finish .tr-go{ background:#fff; color:#6E1B2E; }
.tr-ghost{ height:48px; border-radius:12px; border:1px solid rgba(255,255,255,.35); background:rgba(255,255,255,.08); color:#fff;
  font:500 15px var(--font); cursor:pointer; }
.tr-ghost:hover{ background:rgba(255,255,255,.16); }
.tr-confetti{ position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.tr-confetti i{ position:absolute; top:-24px; left:var(--x); width:8px; height:14px; background:var(--c); border-radius:2px;
  transform:rotate(var(--r)); animation:trConf 2.8s var(--d) cubic-bezier(.3,.6,.6,1) forwards; }
@keyframes trConf{ to{ transform:translateY(110vh) rotate(calc(var(--r) + 720deg)); } }

/* Десктоп: карточка 1100×660, две колонки */
@media (min-width:900px){
  .tr-shell{ width:min(1100px, 94vw); height:min(660px, 90vh); border-radius:28px; box-shadow:0 30px 80px -20px rgba(0,0,0,.6); }
  .tr-bars{ top:18px; left:28px; right:28px; }
  .tr-x{ top:32px; right:24px; }
  .tr-skipall{ top:auto; bottom:24px; right:28px; font-size:14px; }
  .tr-slide{ display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:48px; padding:72px 56px 56px; }
  .tr-vis{ order:0; height:100%; justify-content:center; }
  .tr-h{ font-size:42px; }
  .tr-h.sm{ font-size:32px; }
  .tr-p{ font-size:16.5px; }
  .tr-faces .tr-face{ width:66px; height:66px; }
  .tr-faces .tr-face:nth-child(3n){ width:88px; height:88px; }
  .tr-faces .tr-face:nth-child(4n){ width:52px; height:52px; }
  .tr-faces .tr-crest{ width:160px; height:160px; }
  .tr-stats b{ font-size:30px; }
  .tr-chips span{ font-size:15px; padding:9px 15px; }
  .tr-bub{ font-size:15.5px; }
  .tr-map{ max-height:none; }
  .tr-card{ padding:16px 18px; }
  .tr-card b{ font-size:16.5px; }
  .tr-phone{ padding:18px; }
  .tr-setup{ padding-top:80px; }
  .tr-finish .tr-h{ font-size:46px; }
}
/* Низкие экраны телефона: меньше воздуха, демо не наезжает на текст */
@media (max-width:899px) and (max-height:700px){
  .tr-h{ font-size:25px; } .tr-p{ font-size:14px; } .tr-slide{ gap:14px; padding-top:64px; }
  .tr-stats b{ font-size:20px; } .tr-stats div{ padding:9px; }
}

@media (prefers-reduced-motion: reduce){
  .tr *, .tr{ animation:none !important; transition:none !important; }
  .tr-map-kz{ stroke-dashoffset:0; }
  .tr-bub.ai{ opacity:1; transform:none; }
  .tr-bub.ai .tr-ans{ display:inline; } .tr-bub.ai .tr-dots{ display:none; }
  .tr-tgbtns span.on{ background:#B0283F; color:#fff; } .tr-tgbtns span.on svg{ display:inline; }
}
