/* Общие компоненты РОБОРАБ поверх roborab-ui.css: вход и PIN, инструкция, пустые экраны,
   плашка стенда, сообщение о связи. Цвета и стекло только из переменных --rr-*.
   Движение по стандарту: кривая cubic-bezier(.45,.05,.25,1), при уменьшенном движении без анимации. */

:root {
  --rr-motion: cubic-bezier(.45, .05, .25, 1);
  --rr-blue: #0a84ff;
  --rr-dim: rgb(10 14 22 / .58);
}

/* ---------- Пустой экран: инструкция вместо пустоты ---------- */
.rr-empty {
  display: grid;
  gap: 16px;
  max-width: 560px;
  margin: 8px auto;
  padding: 24px;
  border: 1px solid var(--rr-glass-edge);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--rr-glass-shadow);
  color: var(--rr-ink);
  font: 500 15px/1.5 var(--rr-font);
}
.rr-empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgb(10 132 255 / .1);
  color: var(--rr-blue);
}
.rr-empty__icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rr-empty__title { margin: 0; font: italic 900 22px/1.15 var(--rr-display); letter-spacing: -.01em; }
.rr-empty__lead { margin: 0; color: rgb(20 20 20 / .7); }
.rr-empty__steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: rr-step; }
.rr-empty__steps li { position: relative; padding-left: 40px; counter-increment: rr-step; min-height: 28px; }
.rr-empty__steps li::before {
  content: counter(rr-step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--rr-violet);
  color: #fff;
  font: 800 13px/1 var(--rr-display);
}
.rr-empty__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rr-empty__more {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rr-blue);
  font: 700 14px/1.4 var(--rr-font);
  cursor: pointer;
}

/* ---------- Инструкция по экрану (тур) ----------
   Одна рамка живёт весь тур и перелетает от блока к блоку. Затемнение не мигает. */
.rr-tour-blocker { position: fixed; inset: 0; z-index: 2147482000; }
.rr-tour-hole {
  position: fixed;
  z-index: 2147482001;
  top: 0;
  left: 0;
  border-radius: 18px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 9999px var(--rr-dim);
  pointer-events: none;
  will-change: transform, width, height;
  opacity: 0;
  transition: opacity .6s var(--rr-motion);
}
.rr-tour-hole.is-on { opacity: 1; }
.rr-tour-pop {
  position: fixed;
  z-index: 2147482002;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid var(--rr-glass-edge);
  border-radius: 24px;
  background: #fff;
  color: var(--rr-ink);
  box-shadow: 0 18px 50px -18px rgb(10 30 70 / .45);
  font: 500 15px/1.5 var(--rr-font);
  will-change: transform;
  opacity: 0;
  transition: opacity .6s var(--rr-motion);
}
.rr-tour-pop.is-on { opacity: 1; }
.rr-tour-pop__body { transition: opacity .24s var(--rr-motion); }
.rr-tour-pop__body.is-swapping { opacity: 0; }
.rr-tour-pop__count { margin: 0 0 4px; color: rgb(20 20 20 / .55); font: 700 12px/1 var(--rr-font); letter-spacing: .02em; }
.rr-tour-pop__title { margin: 0 0 6px; font: italic 900 19px/1.2 var(--rr-display); }
.rr-tour-pop__text { margin: 0; color: rgb(20 20 20 / .82); }
.rr-tour-pop__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.rr-tour-pop__nav { display: flex; gap: 8px; }
.rr-tour-pop__arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 3px;
  transform: rotate(45deg);
  transition: left .5s var(--rr-motion), top .5s var(--rr-motion);
}
.rr-tour-pop[data-side="bottom"] .rr-tour-pop__arrow { top: -6px; }
.rr-tour-pop[data-side="top"] .rr-tour-pop__arrow { bottom: -6px; }
.rr-tour-pop[data-side="sheet"] .rr-tour-pop__arrow { display: none; }
.rr-tour-pop[data-side="sheet"] { width: auto; }

.rr-btn-quiet, .rr-btn-sec {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: 800 14px/1 var(--rr-display);
  cursor: pointer;
}
.rr-btn-quiet { border: 0; background: none; color: rgb(20 20 20 / .6); padding-inline: 4px; }
.rr-btn-sec { border: 1px solid var(--rr-line); background: #fff; color: var(--rr-ink); }
.rr-btn-main {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--rr-violet);
  color: #fff;
  font: 800 14px/1 var(--rr-display);
  cursor: pointer;
  transition: background .4s var(--rr-ease);
}
@media (hover: hover) { .rr-btn-main:hover { background: var(--rr-blue); } }
.rr-btn-main:focus-visible, .rr-btn-sec:focus-visible, .rr-btn-quiet:focus-visible { outline: 2px solid var(--rr-blue); outline-offset: 2px; }

/* ---------- Вход и PIN ---------- */
html.rr-auth-open,
html.rr-auth-open body {
  background: var(--rr-violet);
}
.rr-auth {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 2147483100;
  display: grid;
  place-items: center;
  place-items: safe center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: radial-gradient(120% 80% at 50% 0%, #1f2a3d 0%, #141414 60%);
  color: #fff;
  font: 500 16px/1.4 var(--rr-font);
}
.rr-auth__box { display: grid; gap: 18px; justify-items: center; width: min(360px, 100%); }
.rr-auth__mark { font: italic 900 28px/1 var(--rr-display); letter-spacing: -.02em; text-transform: uppercase; }
.rr-auth__title { margin: 0; font: 700 18px/1.3 var(--rr-font); text-align: center; }
.rr-auth__note { margin: -8px 0 0; color: rgb(255 255 255 / .62); font-size: 14px; text-align: center; }
.rr-auth form { display: grid; gap: 12px; width: 100%; }
.rr-auth input {
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 16px;
  background: rgb(255 255 255 / .08);
  color: #fff;
  font: 500 16px/1 var(--rr-font);
  outline: 0;
  transition: border-color .3s var(--rr-ease), background .3s var(--rr-ease);
}
.rr-auth input:focus { border-color: var(--rr-blue); background: rgb(255 255 255 / .12); }
.rr-auth input::placeholder { color: rgb(255 255 255 / .5); }
.rr-auth__submit {
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--rr-blue);
  color: #fff;
  font: 800 15px/1 var(--rr-display);
  cursor: pointer;
}
.rr-auth__submit:disabled { opacity: .5; cursor: default; }
.rr-auth__error { min-height: 20px; margin: 0; color: #ffb4a8; font-size: 14px; text-align: center; }
.rr-auth__dots { display: flex; gap: 16px; height: 16px; }
.rr-auth__dots i { width: 14px; height: 14px; border: 1.5px solid #fff; border-radius: 50%; transition: background .2s var(--rr-ease), transform .2s var(--rr-ease); }
.rr-auth__dots i.on { background: #fff; transform: scale(1.06); }
.rr-auth__dots.shake { animation: rr-shake .42s var(--rr-motion); }
@keyframes rr-shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.rr-auth__pad { display: grid; grid-template-columns: repeat(3, clamp(64px, 20vw, 78px)); gap: 16px 22px; }
.rr-auth__key {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .14);
  color: #fff;
  font: 500 32px/1 var(--rr-font);
  cursor: pointer;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition: background .15s;
  touch-action: manipulation;
}
.rr-auth__key:active { background: rgb(255 255 255 / .32); }
.rr-auth__key:disabled { opacity: .35; }
.rr-auth__key--text { background: none; font: 600 15px/1 var(--rr-font); }
.rr-auth__key--empty { visibility: hidden; }
.rr-auth__link { border: 0; background: none; color: rgb(255 255 255 / .75); font: 600 14px/1.4 var(--rr-font); cursor: pointer; }

/* ---------- Плашка стенда и связь ---------- */
.rr-stage-badge {
  position: fixed;
  z-index: 2147483200;
  /* Под шапкой справа: не закрывает ни кнопки шапки, ни заголовок страницы */
  top: calc(var(--rr-header-height, 56px) + 8px);
  right: calc(16px + env(safe-area-inset-right, 0px));
  padding: 5px 10px;
  border-radius: 999px;
  background: #ffcc00;
  color: #141414;
  font: 800 11px/1 var(--rr-display);
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px -8px rgb(0 0 0 / .4);
}
/* В чате сверху переключатель «Чат / Профиль»: плашка встаёт справа под ним */
[data-rr-badge="below"] .rr-stage-badge { top: calc(env(safe-area-inset-top, 0px) + 66px); }
.rr-net {
  position: fixed;
  z-index: 2147483300;
  left: 50%;
  top: calc(var(--rr-header-height, 56px) + 12px);
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 18px;
  background: #141414;
  color: #fff;
  font: 600 14px/1.4 var(--rr-font);
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / .5);
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--rr-motion), transform .5s var(--rr-motion);
}
.rr-net.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .rr-tour-hole, .rr-tour-pop, .rr-tour-pop__body, .rr-tour-pop__arrow, .rr-net, .rr-auth__dots i { transition: none; }
  .rr-auth__dots.shake { animation: none; }
}
