/* Область help — помощь, подсказки и их подсветка, настройки, доступ и ошибки (help.js, tour.js, settings.js, privacy.js, tariff.js, access.js).
   Ведёт сессия R1-7. Классы — с префиксом области (.help-…); только токены
   tokens.css, без жёстких цветов; компоненты эталона — в components.css.
   Образец вида — prototype/flows/more.css (статьи, тур, тариф) и
   flows/calendar.css (экраны доступа). */

/* ==========================================================================
   Цели касания 48 px (до слияния с R1-0 проверка вёрстки меряет рамку
   элемента и не видит ::after): кнопка 44 px, поле поиска 40 px и
   переключатель 31 px добирают высоту прозрачной границей, видимая подложка
   и место в раскладке — прежние (отрицательные поля), как у ленты
   (area_feed.css). После слияния с R1-0 обход снять.
   ========================================================================== */
.help .btn:not(.btn-s):not(.btn-l) {
  height: 48px; margin: -2px 0; border: 2px solid transparent; background-clip: padding-box;
  border-radius: calc(var(--r-control) + 2px);
}
.help .btn:not(.btn-s):not(.btn-l)::after { content: none; }
.help .empty .btn:not(.btn-s):not(.btn-l) { margin-top: calc(var(--space-5) - 2px); }
.help .help-switch {
  height: 49px; margin: -9px 0; border: solid transparent; border-width: 9px 0; background-clip: padding-box;
  border-radius: 16px / 25px;
}
.help .help-switch::after { content: none; }

/* ==========================================================================
   «Помощь»: поиск, статьи
   ========================================================================== */
.help-srow { padding: var(--space-3) 0 0; }
/* поле — цель касания 48 px в поле поиска 40 px (подложка — у .search) */
.help-search input { height: 48px; margin: -4px 0; }
.help-search input:focus-visible { outline: none; }
.help-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.help-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.help-res .section, .help-res > .list, .help-gap .section { margin-top: var(--space-5); }

.help-article-t { text-wrap: balance; }
.help-article { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.help-article-p { margin: 0 var(--space-1); font-size: var(--fs-body); line-height: 1.55; text-wrap: pretty; }
.help-article-go { margin-top: var(--space-5); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.help-note { margin: var(--space-2) var(--space-1) 0; font-size: var(--fs-caption); line-height: 1.4; color: var(--text-2); text-wrap: pretty; }
.help-marks .why { margin: 0; padding: var(--space-3) var(--space-4); }
.help-level { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: var(--space-2) var(--space-4); }
.help-level .match.is-compact { flex: none; width: 112px; }
.help-level-d { font-size: var(--fs-sub); color: var(--text-2); line-height: 1.35; }
/* путь отклика «чей ход»: названия шагов полным цветом, метка исполнителя
   шага — отдельной строкой; шаг «ваш ход» — точка цвета действия (это образец
   пути, а не текущий отклик: кольца «сейчас» нет) */
.help-who-tl .tl.is-next .tl-t { color: var(--text); font-weight: 600; }
.help-who-tl .tl { padding-bottom: var(--space-3); }
.help-who { display: block; margin: 2px 0 var(--space-1); }
.help-who-tl .tl.help-who-you .tl-dot i { background: var(--accent); box-shadow: none; }
.help-go { font-size: var(--fs-sub); font-weight: 600; color: var(--link); white-space: nowrap; }

/* ==========================================================================
   Подсказки: слой поверх живого экрана — затемнение с окошком над якорем
   и подсказка рядом. Слой — в body, от низа окна на стабильную высоту окна
   Telegram (в стенде окно ниже окна браузера на полосу шапки).
   ========================================================================== */
.help-tour {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; overflow: hidden;
  height: var(--tg-viewport-stable-height, 100vh);
  /* жест по затемнению не прокручивает экран под окошком */
  touch-action: none; overscroll-behavior: contain;
}
.help-tour-hole {
  position: absolute; left: var(--x, 0px); top: var(--y, 0px); width: var(--w, 0px); height: var(--h, 0px);
  border-radius: var(--r-control); pointer-events: none;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 4000px var(--scrim);
  transition: left var(--dur-sheet) var(--ease-out), top var(--dur-sheet) var(--ease-out),
    width var(--dur-sheet) var(--ease-out), height var(--dur-sheet) var(--ease-out);
}
.help-tour-pop {
  position: absolute; left: var(--space-3); right: var(--space-3); top: var(--pop-top, 120px);
  max-width: 480px; margin: 0 auto;
  padding: var(--space-4); border-radius: var(--r-container); background: var(--surface-raised); box-shadow: var(--elev-float);
  transition: top var(--dur-sheet) var(--ease-out);
}
.help-tour-pop:focus, .help-tour-pop:focus-visible { outline: none; }
.help-tour-pop::before {
  content: ""; position: absolute; left: var(--arrow-x, 50%); width: 14px; height: 14px; margin-left: -7px;
  background: var(--surface-raised); transform: rotate(45deg); border-radius: 2px; display: none;
}
.help-tour-pop.is-below::before { display: block; top: -6px; }
.help-tour-pop.is-above::before { display: block; bottom: -6px; }
.help-tour-n { position: relative; font-size: var(--fs-caption); color: var(--text-2); }
.help-tour-t { position: relative; margin-top: var(--space-1); font: 600 var(--fs-section)/1.25 var(--font-face); letter-spacing: -.012em; }
.help-tour-x {
  position: relative; margin-top: var(--space-2); max-height: 40vh; overflow-y: auto; touch-action: pan-y;
  font-size: var(--fs-callout); line-height: 1.45; color: var(--text-2); text-wrap: pretty;
}
.help-tour-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
/* первый шаг — сразу на месте, переезд — только между шагами */
.help-tour:not(.is-ready) .help-tour-hole, .help-tour:not(.is-ready) .help-tour-pop { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .help-tour-hole, .help-tour-pop { transition: none; }
}

/* ==========================================================================
   «Настройки», «Конфиденциальность», «Тариф»
   ========================================================================== */
.help-val { font-size: var(--fs-sub); color: var(--text-2); white-space: nowrap; }
.help-cell-m { display: block; margin-top: 2px; font-size: var(--fs-caption); color: var(--hint); line-height: 1.3; text-wrap: pretty; }

.help-soon { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--fs-callout); line-height: 1.4; color: var(--text-2); }
.help-soon .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.help-hero { margin-top: var(--space-4); padding: var(--space-6) var(--space-5); border-radius: var(--r-container); background: var(--match-bg); }
.help-hero-over { font-size: var(--fs-sub); font-weight: 600; color: var(--match); }
.help-hero-t { margin-top: var(--space-2); font: 700 var(--fs-display)/1.1 var(--font-face); letter-spacing: -.025em; color: var(--text); text-wrap: balance; }
.help-hero-s { margin-top: var(--space-3); font-size: var(--fs-callout); line-height: 1.45; color: var(--text); text-wrap: pretty; }
.help-incl { display: grid; place-items: center; color: var(--match); }
.help-incl .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.help-foot { margin-top: var(--space-4); }

/* ==========================================================================
   Доступ и ошибки: по центру окна, знак «Оффер» над экраном постороннего
   ========================================================================== */
.help-access {
  min-height: calc(var(--tg-viewport-stable-height, 100vh) - var(--space-8));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-4) var(--space-4) var(--space-7);
}
.help-mark { font: 700 var(--fs-title)/1 var(--font-face); letter-spacing: -.03em; color: var(--text); margin-bottom: calc(-1 * var(--space-4)); }
.help-access-note { max-width: 300px; margin-top: calc(-1 * var(--space-2)); text-align: center; font-size: var(--fs-caption); line-height: 1.4; color: var(--text-2); text-wrap: pretty; }
