/* Приветственная страница (/welcome; гостю — на /). Мир Dealix (DESIGN.md) без изменений: графит, линия 1 px, системный
   шрифт, светофор только у вердикта. 3D-призма вилки — язык схем «Инструкции»: линии 1,5 px, грань Dealix — акцентом.
   Телефоны: сетка складывается в столбец на ≤ 900 px, кнопки — во всю ширину на ≤ 600 px, отступы — с safe-area. */
/* прокручивается сам документ, а не main дашборда (theme.css: main — overflow auto во всю высоту): на телефоне так
   прячется адресная строка и работает «наверх» по касанию строки состояния */
body.pub-page:has(#welcome-root) { display: block; height: auto; min-height: 100%; }
.pub-page:has(#welcome-root) .pub-main { overflow: visible; }
.pub-page:has(#welcome-root) .pub-bar { min-height: 56px; padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right)); }
.wl { max-width: 1180px; margin: 0 auto; font-size: 14px; line-height: 1.55;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.wl a:not(.wl-btn) { color: var(--accent); text-underline-offset: 3px; }

/* ---------- первый экран ---------- */
.wl-hero { text-align: center; padding: 36px 0 0; overflow-x: clip; }   /* бок призмы на самых узких экранах — без прокрутки вбок */
.wl-title { margin: 0 auto; font-size: clamp(32px, 3.9vw, 54px); line-height: 1.08; font-weight: 800;
  letter-spacing: -.02em; text-wrap: balance; }
.wl-title span { display: block; color: var(--accent); }
.wl-sub { margin: 14px 0 0; color: var(--muted); font-size: 17px; }
.wl-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "l scene r" "cta cta cta"; align-items: center; gap: 0 28px; margin: 28px auto 0; max-width: 1120px; }
.wl-side-l { grid-area: l; } .wl-scene { grid-area: scene; } .wl-side-r { grid-area: r; } .wl-stage .wl-cta { grid-area: cta; }
.wl-side { margin: 0; max-width: 270px; color: var(--muted); font-size: 16px; text-align: left; }
.wl-side p { margin: 0; }
.wl-side b { display: block; margin-bottom: 6px; color: var(--text); font-size: 20px; }
.wl-side-l { justify-self: end; text-align: right; }
.wl-life { display: grid; gap: 2px; margin-top: 22px; }
.wl-life-k { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.wl-life-v { color: var(--text); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wl-track { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.wl-track i { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform .9s var(--ease); }

/* сцена и призма: квадратная в плане (глубина = ширине), 4 грани — зелёные вилки, передние — полупрозрачные, задние
   рёбра (задняя грань и крышки) — пунктир --edge, видны сквозь них */
.wl-scene { --w: 400px; --h: 210px; --edge: var(--muted); display: grid; justify-items: center; gap: 12px; }
/* кнопка — только зона касания и фокус; 3D-контекст — у вложенной .wl-prism (кнопка как контейнер 3D уплощает его
   в WebKit: задняя грань просвечивала зеркально). Призма отодвинута на полглубины: передняя грань в покое — в плоскости
   страницы и не наезжает на подписи по сторонам */
/* сверху поля меньше, чем снизу: в покое (−15° по X) призма выступает над кнопкой на ~20 px, а под неё — на ~80 */
.wl-turn { display: block; width: var(--w); height: var(--h); margin: 32px 64px 72px; padding: 0; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wl-turn:focus-visible { outline-offset: 16px; }
.wl-prism { --step: 0; position: relative; display: block; width: 100%; height: 100%;
  -webkit-transform-style: preserve-3d; transform-style: preserve-3d;
  transform: perspective(1000px) translateZ(calc(var(--w) / -2)) rotateX(calc(-15deg + var(--tilt-x, 0deg)))
    rotateY(calc(var(--step) * -90deg - 26deg + var(--tilt-y, 0deg)));
  transition: transform .9s var(--ease); }
.wl-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 18px 24px; text-align: left; border: 1.5px solid var(--accent); border-radius: 10px;
  background: color-mix(in srgb, var(--bg-2) 68%, transparent); -webkit-backface-visibility: hidden; backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * 90deg)) translateZ(calc(var(--w) / 2));
  transition: opacity .5s var(--ease), background-color .5s var(--ease), border-color .5s var(--ease); }
.wl-face > * { transition: opacity .5s var(--ease); }
/* задняя грань смотрит от зрителя: рисуется изнанкой (backface visible) — пунктирная рамка и лёгкая заливка акцентом,
   без текста; видна сквозь передние */
.wl-face.is-back { border-style: dashed; border-color: var(--edge); background: color-mix(in srgb, var(--accent) 7%, transparent);
  -webkit-backface-visibility: visible; backface-visibility: visible; }
.wl-face.is-back > * { opacity: 0; }
.wl-face.is-away { opacity: 0; }
.wl-prism.is-flat .wl-face.is-back { opacity: 0; }
/* движок без общего 3D-контекста (index.js prism → is-flat): карточка с наклоном, шаги сменяются проявлением */
.wl-prism.is-flat { transform: perspective(1000px) rotateX(calc(-6deg + var(--tilt-x, 0deg))) rotateY(calc(-14deg + var(--tilt-y, 0deg))); }
.wl-prism.is-flat .wl-face { transform: none; transform-origin: left top; transition: opacity .5s var(--ease), transform .7s var(--ease); }
.wl-prism.is-flat .wl-face.is-side { opacity: .6; transform: translateX(100%) skewY(-24deg) scaleX(.26); }
.wl-prism.is-flat .wl-cap { display: none; }
.wl-face-k { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.wl-face-v { font-size: 54px; line-height: 1.12; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.wl-face-n { color: var(--muted); font-size: 14px; }
.wl-face-s { color: var(--muted); font-size: 14px; }
.wl-face-s s { text-decoration-thickness: 2px; white-space: nowrap; }
.wl-face-v { color: var(--green); }
.wl-cap { position: absolute; left: 0; top: calc((var(--h) - var(--w)) / 2); width: var(--w); height: var(--w);
  border: 1.5px dashed var(--edge); border-radius: 10px; pointer-events: none; }
.wl-cap-top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }
.wl-cap-bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); }
.wl-badge { display: inline-block; padding: 0 8px; border-radius: 9px; font-size: 12px; font-weight: 600; line-height: 1.6;
  background: var(--green-bg); color: var(--green); white-space: nowrap; }
.wl-badge-red { background: var(--red-bg); color: var(--red); }
.wl-badge-yellow { background: var(--yellow-bg); color: var(--yellow); }

/* шаги расчёта — язык сегментного переключателя «Бюджет» */
.wl-steps { position: relative; display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; --glide-r: 5px; }
.wl-steps button { min-height: 36px; padding: 4px 14px; border: 0; border-radius: 5px; background: none; color: var(--text);
  font-size: 14px; transition: background-color var(--t) var(--ease), color var(--t) var(--ease); }
.wl-steps button:hover:not(.active) { background: var(--bg-3); }
/* заливка выбранного едет к новому шагу (motion.js glide, как «Бюджет»); без скрипта — заливка самой кнопки */
.wl-steps button.active { background: var(--accent); color: var(--on-accent); }
.wl-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wl-ex { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.wl-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.wl-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-3); color: var(--text); font-size: 16px;
  font-weight: 600; text-decoration: none; transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast); }
.wl-btn:hover { border-color: var(--accent); }
.wl-btn:active { transform: translateY(1px); }
.wl-btn-p { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.wl-btn-p:hover { background: color-mix(in srgb, var(--accent) 86%, var(--text)); }
/* кнопка в две строки: действие и куда ведёт («в Telegram, один раз», «от 990 ₽ за неделю») — та же высота 48 px */
.wl-btn-2 { flex-direction: column; gap: 1px; padding: 6px 22px; line-height: 1.2; }
.wl-btn-2 small { color: var(--muted); font-size: 12px; font-weight: 400; }
.wl-btn-p.wl-btn-2 small { color: inherit; }
.wl-cta-hero .wl-btn { min-width: 200px; }
.wl-facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: 8px 48px; margin: 44px 0 0;
  padding: 18px 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.wl-facts b { margin-right: 6px; color: var(--text); font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- разделы ---------- */
.wl-sec { padding-top: 72px; }
.wl-h2 { max-width: 24ch; margin: 0 0 12px; font-size: clamp(24px, 3vw, 34px); line-height: 1.18; font-weight: 800;
  letter-spacing: -.015em; text-wrap: balance; }
.wl-lead { max-width: 66ch; margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.wl-note { max-width: 72ch; margin: 22px 0 0; color: var(--muted); }

.wl-why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 28px 56px; align-items: start; }
/* расчёт вилки: крупно — что останется, полоса спреда (твоя доля зелёным, вычеты — тремя оттенками muted, как их
   квадратики в строках) и строки «уже вычел» — числа muted без минусов */
.wl-ledger { padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.wl-budget { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.wl-budget-k { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.wl-keep { display: grid; gap: 2px; margin-top: 18px; }
.wl-keep-k { color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.wl-keep-v { color: var(--green); font-size: 40px; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.wl-keep-n { color: var(--muted); font-size: 14px; }
.wl-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 12px; margin-top: 18px;
  color: var(--muted); font-size: 14px; }
.wl-split b { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.wl-bar { grid-column: 1 / -1; display: flex; height: 14px; margin-top: 6px; border-radius: 4px; overflow: hidden; background: var(--bg-3); }
.wl-bar i { display: block; flex: none; height: 100%; transition: width .6s var(--ease); }
.wl-bar i + i { box-shadow: inset 2px 0 0 var(--bg-2); }
.wl-sw-net { background: var(--green); }
.wl-sw-1 { background: color-mix(in srgb, var(--muted) 62%, transparent); }
.wl-sw-2 { background: color-mix(in srgb, var(--muted) 40%, transparent); }
.wl-sw-3 { background: color-mix(in srgb, var(--muted) 24%, transparent); }
.wl-paid-h { margin: 22px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.wl-paid { border-top: 1px solid var(--line); margin-top: 6px; }
.wl-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: baseline; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 16px; }
.wl-row small { display: block; color: var(--muted); font-size: 13px; }
.wl-sw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; vertical-align: 1px; }
.wl-num { color: var(--muted); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
/* проход по строкам расчёта (index.js ledger → walk): спред → вычеты → чистая подложкой акцента 12 %, как шаг
   «Инструкции» подсвечивает клетки; поля по бокам — тенью (снаружи рамки), раскладка не сдвигается */
.wl-split, .wl-row, .wl-keep { --lit: transparent; border-radius: 2px; background-color: var(--lit);
  box-shadow: -8px 0 0 var(--lit), 8px 0 0 var(--lit); transition: background-color .28s var(--ease), box-shadow .28s var(--ease); }
.wl-ledger .is-lit { --lit: color-mix(in srgb, var(--accent) 12%, transparent); }

/* виды вилок — по центру, как тарифы над ними (просьба владельца 28.10): заголовок в одну строку, список — колонкой
   «схема + текст» шириной в сами строки */
.wl-kinds-sec > .wl-h2, .wl-kinds-sec > .wl-lead { margin-left: auto; margin-right: auto; text-align: center; text-wrap: balance; }
.wl-kinds-sec > .wl-h2 { max-width: none; }
.wl-kinds { display: grid; max-width: 900px; margin: 0 auto; border-top: 1px solid var(--line); }
.wl-kind { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px 40px; align-items: center; padding: 22px 0;
  border-bottom: 1px solid var(--line); }
.wl-kind .ill { width: 100%; max-width: 260px; height: auto; }
.wl-kind h3 { margin: 0 0 4px; font-size: 18px; }
.wl-kind p { max-width: 70ch; margin: 0; color: var(--muted); font-size: 16px; }

/* ловушки — плотный список: на широком экране в две колонки, бейдж над заголовком, схема справа, текст 14 px */
.wl-traps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--line); }
.wl-trap { display: grid; grid-template-columns: minmax(0, 1fr) 200px; grid-template-areas: "badge ill" "text ill";
  gap: 6px 20px; align-content: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wl-trap .wl-badge { grid-area: badge; justify-self: start; }
.wl-trap > div { grid-area: text; }
.wl-trap .ill { grid-area: ill; align-self: center; width: 200px; height: auto; }
.wl-trap b { font-size: 16px; }
.wl-trap p { max-width: 72ch; margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* «Реальная игра» — полоса во всю ширину окна: фон bg-2 тенью за пределы колонки, линии сверху и снизу — border-image с
   вылетом (тень и вылет только рисуются, прокрутку вбок не дают); роботы — две колонки через линию, итог крупно Pub-figure */
.wl-band { margin-top: 88px; padding: 56px 0 52px; background: var(--bg-2); --ill-bg: var(--bg-2);
  border-block: 1px solid var(--line); border-image: linear-gradient(var(--line) 0 0) 1 / 1px 0 / 0 100vmax;
  box-shadow: 0 0 0 100vmax var(--bg-2); clip-path: inset(0 -100vmax); }
.wl-band .wl-h2 { max-width: 32ch; }
.wl-robots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; margin-top: 28px; }
.wl-robot { padding: 0 48px 0 0; }
.wl-robot + .wl-robot { padding: 0 0 0 48px; border-left: 1px solid var(--line); }
.wl-robot header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.wl-robot header b { font-size: 18px; }
.wl-robot header span { color: var(--muted); }
.wl-robot-ret { margin-top: 8px; font-size: 54px; line-height: 1.12; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.wl-robot-ret.up { color: var(--green); }
.wl-robot-ret small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.wl-curve { width: 100%; height: 96px; margin: 14px 0 6px; }
.wl-curve path { vector-effect: non-scaling-stroke; }
.wl-robot dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; }
.wl-robot dt { color: var(--muted); font-size: 12px; }
.wl-robot dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wl [data-f] { border-radius: 4px; }   /* «тик» живых цифр «Игры» — подложкой по числу */
.wl-exit { display: grid; gap: 2px; margin-top: 22px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wl-exit b { font-size: 16px; }
.wl-exit p { max-width: 72ch; margin: 0; color: var(--muted); font-size: 16px; }

/* тарифы — по центру сразу за полосой «Игры»: тариф — цена, срок, «в день», выгода и оплата в боте под ними */
.wl-price, .wl-end { text-align: center; }
.wl-price .wl-h2, .wl-price .wl-lead, .wl-price .wl-note, .wl-end .wl-h2, .wl-end .wl-note { margin-left: auto; margin-right: auto; }
#wl-price { scroll-margin-top: 24px; }
.wl-plans { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 20px 0 0; }
/* карточки одной высоты (flex-ряд тянет их по самой высокой), оплата прижата к низу — кнопки соседних тарифов на одном уровне */
.wl-plan { display: flex; flex-direction: column; gap: 2px; width: 320px; padding: 18px 22px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg-2); color: var(--muted); text-align: left; }
.wl-plan b { color: var(--text); font-size: 16px; }
.wl-plan-v { color: var(--text); font-size: 40px; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.wl-plan-save { color: var(--green); }
.wl-plan-pay { display: grid; gap: 8px; margin-top: auto; padding-top: 14px; }
.wl-plan-pay .wl-btn { padding: 10px 12px; font-size: 14px; text-align: center; }
.wl-price .wl-lead, .wl-price .wl-note, .wl-end .wl-note { text-wrap: balance; }
.wl-price > .wl-ex { margin-top: 12px; }
.wl-trial { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; max-width: 656px;
  margin: 24px auto 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.wl-trial p { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: 16px; }
.wl-trial p b { display: block; color: var(--text); }
.wl-end { padding-top: 96px; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1100px) {
  .wl-scene { --w: 340px; --h: 190px; }
  .wl-face-v { font-size: 46px; }
}
@media (max-width: 900px) {
  /* телефон и планшет: сразу за призмой — кнопки, пояснения «двух глаз» — под ними */
  .wl-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "scene" "cta" "l" "r"; justify-items: center; gap: 0; }
  .wl-side, .wl-side-l { justify-self: center; max-width: 36ch; margin-top: 28px; text-align: center; }
  .wl-life { max-width: 300px; margin: 18px auto 0; }
  .wl-why { grid-template-columns: minmax(0, 1fr); }
  .wl-facts { grid-template-columns: repeat(2, auto); gap: 10px 32px; }
  .wl-traps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .wl-hero { padding-top: 16px; }
  .wl-title { font-size: clamp(28px, 8vw, 34px); }
  .wl-sub { margin-top: 10px; font-size: 14px; }
  .wl-stage { margin-top: 12px; }
  .wl-scene { --w: min(250px, 66vw); --h: 160px; gap: 8px; }
  .wl-prism.is-flat .wl-face.is-side { transform: translateX(100%) skewY(-24deg) scaleX(.2); }   /* бок уже: карточка — по оси экрана */
  .wl-turn { margin: 20px 0 36px; }
  .wl-scene .wl-ex { margin-top: 4px; }
  /* первый экран телефона: пробный и тарифы — рядом, в одну строку, вход — под ними */
  .wl-stage .wl-cta { justify-self: stretch; margin-top: 14px; }
  .wl-cta.wl-cta-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wl-cta-hero .wl-btn { min-width: 0; padding-left: 10px; padding-right: 10px; }
  .wl-cta-hero > :nth-child(3) { grid-column: 1 / -1; }
  .wl-face { padding: 14px 16px; }
  .wl-face-v { font-size: 38px; }
  .wl-face-n, .wl-face-s { font-size: 13px; }
  .wl-steps button { min-height: 44px; padding: 4px 9px; font-size: 13px; }
  .wl-ledger { padding: 14px; }
  .wl-keep-v { font-size: 34px; }
  .wl-cta { flex-direction: column; align-items: stretch; }
  .wl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; text-align: left; gap: 10px 16px; font-size: 14px; }
  .wl-facts b { display: block; }
  .wl-sec { padding-top: 52px; }
  .wl-kind { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wl-kind .ill { justify-self: center; }   /* схема в одну колонку — по центру (просьба владельца 28.10) */
  .wl-trap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "badge" "text" "ill"; }
  .wl-trap .ill { align-self: start; justify-self: center; width: min(200px, 100%); margin-top: 6px; }   /* по центру, как схемы видов вилок (замечание владельца 30.10) */
  .wl-band { margin-top: 56px; padding: 40px 0 36px; }
  .wl-robots { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wl-robot, .wl-robot + .wl-robot { padding: 0; border-left: 0; }
  .wl-robot + .wl-robot { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
  .wl-robot-ret { font-size: 40px; }
  .wl-plan { width: auto; flex: 1 1 100%; }
  .wl-plan-v { font-size: 34px; }
  .wl-trial .wl-btn { flex: 1 1 100%; }
  .wl-end { padding-top: 64px; }
}
