/* Демо кабинета: обёртка «телефон в рамке» для широких экранов,
   чип «Тур» в заголовке раздела и сам тур. Стили кабинета — panel.css,
   он скопирован из агента как есть; здесь только надстройка. */

/* ── Обёртка: телефон в рамке ─────────────────────────────── */
html.framed body { background: #070B14; color: #F2F5FB; padding: 0 !important; margin: 0; min-height: 100vh; }
html.framed .app, html.framed .tabbar, html.framed #tour, html.framed #progress, html.framed .demo-toast { display: none !important; }
/* Обёртка видна только на широком экране верхнего окна: внутри iframe
   у этого же документа класса framed нет, и блок остаётся скрытым. */
#frame { display: none; }
html.framed #frame {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: clamp(32px, 6vw, 96px); padding: 32px clamp(20px, 4vw, 48px);
}
.frame-copy { max-width: 400px; }
.frame-eyebrow { margin: 0 0 14px; color: #7392FF; font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.frame-copy h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 16px; }
.frame-copy p { color: #AAB6CC; font-size: 17px; line-height: 1.55; margin: 0 0 24px; }
.frame-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.frame-btn {
  padding: 14px 22px; border: 0; border-radius: 14px; cursor: pointer;
  background: #3D5CFF; color: #fff; font: inherit; font-size: 16px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(61,92,255,.28);
}
.frame-btn:hover { background: #5471FF; }
.frame-link { color: #AAB6CC; text-decoration: none; font-size: 15px; }
.frame-link:hover { color: #fff; }
/* ── Внутри нарисованного телефона ─────────────────────────── */
/* Место под островок сверху и полоску home снизу — то, что на
   настоящем айфоне даёт env(safe-area-inset-*), а в iframe равно нулю. */
html.in-phone { overscroll-behavior: contain; }
html.in-phone .app { padding-top: calc(22px + 54px); }
html.in-phone .page-title { margin-top: calc(-22px - 54px); padding-top: calc(16px + 54px); }
html.in-phone body { padding-bottom: 108px; }
html.in-phone body.tour-on { padding-bottom: 340px; }
html.in-phone .tabbar { padding-bottom: 26px; }
html.in-phone .tour-card { bottom: 96px; }
html.in-phone .demo-toast { top: 64px; }

/* ── «Закрыть» — когда кабинет открыт с лендинга на весь экран ── */
.demo-close {
  position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); right: 12px; z-index: 80;
  padding: 10px 16px; border-radius: 999px; text-decoration: none;
  background: #3D5CFF; color: #fff; font-weight: 600; font-size: 14px; line-height: 1;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.demo-close:active { filter: brightness(.92); }

/* ── Чип «Тур» в заголовке раздела ─────────────────────────── */
.demo-chip {
  flex: none; margin: -4px 0; padding: 7px 12px; border: 0; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.demo-chip:active { filter: brightness(.95); }

/* ── Тур ───────────────────────────────────────────────────── */
#tour { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.tour-hole {
  position: fixed; border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(6, 10, 18, .58);
  outline: 2px solid var(--accent);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
.tour-hole[hidden] { display: none; }
.tour-card {
  position: fixed; left: 10px; right: 10px; z-index: 60;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  max-width: 440px; margin: 0 auto; pointer-events: auto;
  background: var(--surface); color: var(--ink);
  border-radius: 18px; padding: 16px 18px 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.tour-card.center { top: 50%; bottom: auto; transform: translateY(-50%); }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tour-step { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.tour-close {
  width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--surface-sunk); color: var(--ink-2); font-size: 18px; line-height: 1;
  margin: -4px -6px -4px 0;
}
.tour-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.tour-card p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.tour-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.tour-next {
  display: inline-block; padding: 11px 18px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font: inherit; font-size: 15px; font-weight: 600;
}
.tour-next.secondary { background: var(--surface-sunk); color: var(--ink); }
.tour-back { padding: 8px 4px; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 14px; cursor: pointer; }
.tour-back:hover { color: var(--ink); }
.tour-hint { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; font-weight: 600; }
.tour-hint::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: tour-pulse 1.4s ease-out infinite;
}
@keyframes tour-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}
/* Пока тур идёт, внизу нужен запас: иначе цель у подвала страницы
   не выезжает из-под карточки. */
body.tour-on { padding-bottom: 320px; }

/* ── Тост ──────────────────────────────────────────────────── */
.demo-toast {
  position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); left: 12px; right: 12px; z-index: 70;
  max-width: 420px; margin: 0 auto; padding: 12px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); font-size: 14px;
}
