/* Демо «телефон + CRM»: цвета панели VEXA (тёмно-синий и жёлтый) */
:root {
  --bg: #E9EEF4; --ink: #0E2A47; --muted: #5B6E84; --line: #D3DCE6; --surface: #FFFFFF;
  --nav: #0E2A47; --nav-ink: #FFFFFF; --nav-muted: rgba(255, 255, 255, .66); --nav-line: rgba(255, 255, 255, .16);
  --accent: #F2C400; --accent-ink: #0E2A47; --bezel: #0B0D12;
  --tg-bg: #FFFFFF; --tg-ink: #0B0D12; --tg-line: #E6E8EC; --tg-muted: #8A9099; --tg-link: #2A86E0; --app-bg: #F5F7FA;
  --gutter: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #07111C; --ink: #EAF1F8; --muted: #8FA2B6; --line: #1E3248; --surface: #12233A; --nav: #0B1D31;
  --tg-bg: #17212B; --tg-ink: #F5F5F5; --tg-line: #0E1621; --tg-muted: #708499; --tg-link: #6AB3F3; --app-bg: #0A1522;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; min-height: 100dvh; height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font: 500 14px/1.4 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, select { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Верхняя полоса ---------- */
.top {
  display: flex; align-items: center; gap: 12px 20px; padding: 10px var(--gutter);
  background: var(--nav); color: var(--nav-ink);
}
.top-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.logo { font: 900 20px/1 Unbounded, Manrope, sans-serif; letter-spacing: .02em; }
.pill {
  padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
}
.top-note { color: var(--nav-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.views { display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.views button {
  border: 0; background: transparent; color: var(--nav-muted); padding: 7px 14px; border-radius: 9px;
  font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 36px;
}
.views button:hover { color: var(--nav-ink); }
.views button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.v-short { display: none; }

.reset {
  border: 1px solid var(--nav-line); background: transparent; color: var(--nav-ink);
  padding: 7px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 36px;
}
.reset:hover, .theme:hover { border-color: rgba(255, 255, 255, .5); }
.theme {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--nav-line); background: transparent;
  color: var(--nav-ink); padding: 7px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 36px;
}
.theme .i-moon, .theme[aria-pressed="true"] .i-sun { display: none; }
.theme[aria-pressed="true"] .i-moon { display: block; }
.reset[data-armed] { background: #E8392E; border-color: #E8392E; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Шаги ---------- */
.steps {
  display: flex; gap: 8px; margin: 0; padding: 10px var(--gutter); list-style: none; counter-reset: step;
  overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line);
}
.steps::-webkit-scrollbar { display: none; }
.steps li {
  counter-increment: step; display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--nav); color: var(--accent); font-weight: 700; font-size: 12px;
}
.steps b { color: var(--ink); font-weight: 700; }

/* ---------- Сцена ---------- */
.stage { flex: 1 1 auto; min-height: 0; display: flex; gap: 24px; padding: 18px var(--gutter); }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane-shop { flex: 0 0 auto; align-items: center; }
.pane-crm { flex: 1 1 auto; }
.stage[data-view="shop"] .pane-crm, .stage[data-view="crm"] .pane-shop { display: none; }
.stage[data-view="shop"] .pane-shop { flex: 1 1 auto; }

.disclaimer { flex: none; margin: 0; padding: 0 var(--gutter) 10px; text-align: center; color: var(--muted); opacity: .8;
  font: 700 9px/1.5 Unbounded, Manrope, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.caption { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* Телефон: 390×844, масштабируется по высоте сцены (split.js задаёт --s) */
.phone-fit { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; justify-content: center; }
.phone {
  --s: 1;
  position: relative; flex: none; width: 414px; height: 868px; padding: 12px; border-radius: 56px;
  background: var(--bezel); box-shadow: 0 0 0 2px #2A2F3A inset, 0 24px 60px rgba(14, 42, 71, .28);
  transform: scale(var(--s)); transform-origin: top center;
  margin-bottom: calc((var(--s) - 1) * 868px); /* место под уменьшенный телефон */
  display: flex; flex-direction: column; overflow: hidden;
}
.phone > * { flex: none; }
.phone-status {
  display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 30px 0 34px;
  background: var(--tg-bg); color: var(--tg-ink); border-radius: 44px 44px 0 0; font: 600 15px/1 system-ui, sans-serif;
}
.notch { width: 120px; height: 30px; border-radius: 20px; background: var(--bezel); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 3px; background: currentColor; border-radius: 1px; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 6px; } .bars i:nth-child(3) { height: 9px; } .bars i:nth-child(4) { height: 12px; }
.tg-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 46px; padding: 0 16px;
  background: var(--tg-bg); color: var(--tg-ink); border-bottom: 1px solid var(--tg-line); font-size: 15px;
}
.tg-close { color: var(--tg-link); }
.tg-title { text-align: center; font-weight: 700; line-height: 1.1; }
.tg-title small { display: block; font-weight: 500; font-size: 11px; color: var(--tg-muted); }
.tg-dots { text-align: right; color: var(--tg-link); letter-spacing: 1px; }
.phone iframe {
  flex: 1 1 auto; width: 390px; border: 0; background: var(--app-bg); display: block; border-radius: 0 0 44px 44px;
}

/* CRM: окно браузера; при узкой сцене страница рисуется шире и уменьшается (split.js) */
.crm-card {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(14, 42, 71, .16);
}
.crm-bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.crm-dots { display: flex; gap: 6px; }
.crm-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.crm-title { font-weight: 700; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.role select {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px;
  padding: 5px 8px; font-weight: 600; min-height: 32px; cursor: pointer;
}
.crm-fit { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.crm-fit iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: var(--app-bg);
  transform-origin: top left;
}

/* ---------- Инструкция: три видео на одном экране ---------- */
.guide { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px var(--gutter); }
.guide[hidden], .stage[hidden], .steps[hidden] { display: none; }
.guide-in { height: 100%; display: flex; flex-direction: column; justify-content: center; max-width: 1360px; margin: 0 auto; }
.guide-tabs { display: none; }
.guide-row { display: flex; gap: 20px; align-items: flex-start; justify-content: center; min-height: 0; }
.g-fig { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; --vh: min(calc(100dvh - 215px), 640px); }
.g-fig figcaption { display: grid; gap: 2px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.g-fig figcaption b { color: var(--ink); font-size: 14.5px; }
.g-fig video { display: block; height: var(--vh); width: auto; max-width: 100%; border-radius: 14px; background: #0E2A47; box-shadow: 0 14px 36px rgba(14, 42, 71, .18); }
.g-fig:not(.wide) { flex: 0 1 calc(var(--vh) * .417); }
.g-fig:not(.wide) video { width: calc(var(--vh) * .417); object-fit: contain; }
.g-fig.wide { flex: 1 1 0; }
.g-fig.wide video { width: 100%; height: auto; max-height: var(--vh); }

/* ---------- Телефон и планшет: один экран за раз, без рамки телефона ---------- */
@media (max-width: 899px) {
  :root { --gutter: 16px; }
  .top { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .top-note { display: none; }
  .views { order: 3; width: 100%; }
  .theme span { display: none; }
  .theme { padding: 7px 10px; }
  .views button { flex: 1 1 0; }
  .views button[data-view="both"] { display: none; }
  .steps { display: none; }
  .guide { padding: 12px var(--gutter); }
  .guide-in { justify-content: flex-start; gap: 12px; }
  .guide-tabs { display: flex; gap: 6px; }
  .guide-tabs button { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 6px; font-weight: 600; cursor: pointer; }
  .guide-tabs button[aria-pressed="true"] { background: var(--nav); color: var(--accent); border-color: var(--nav); }
  .guide-row { display: block; }
  .g-fig { --vh: min(calc(100dvh - 300px), 520px); align-items: center; }
  .g-fig, .g-fig.wide { display: none; }
  .guide-row[data-active="ig"] [data-g="ig"], .guide-row[data-active="tg"] [data-g="tg"], .guide-row[data-active="crm"] [data-g="crm"] { display: flex; }
  .g-fig figcaption { text-align: center; }
  .g-fig.wide video { width: 100%; max-height: none; height: auto; }
  .stage { padding: 0; gap: 0; }
  .stage[data-view="both"] .pane-crm { display: none; }
  .stage .pane-shop { flex: 1 1 auto; }
  .phone-fit { display: block; }
  .phone {
    width: 100%; height: 100%; padding: 0; border-radius: 0; background: none; box-shadow: none;
    transform: none; margin: 0;
  }
  .phone-status, .tg-head, .caption { display: none; }
  .phone iframe { width: 100%; height: 100%; border-radius: 0; }
  .crm-card { border-radius: 0; border: 0; box-shadow: none; }
  .crm-dots { display: none; }
}

.bots { flex: none; margin: 0; padding: 4px var(--gutter) 8px; text-align: center; color: var(--muted); font-size: 13px; }
.bots a { color: inherit; font-weight: 600; text-decoration: underline; }
