/*
 * НеттоПрофит — стили интерфейса. Один файл, без препроцессора и сборщика
 * (ADR-001 §1: свой CSS, самостоятельно размещённые шрифты, без CDN).
 *
 * Внешний вид — перенос дизайна Claude (design-claude/, 27.09): бумага,
 * чернила, жёлтый маркер и красная ручка аудитора вместо старой
 * бело-зелёной темы. Раздел 1 (Фундамент) уже на новых токенах; разделы
 * 2–3 (Главная, Результат) донашивают старую тему через псевдонимы до
 * своих пакетов (WP2/WP3b) — временно и ожидаемо. Правила, которые чинили
 * вёрстку в прошлых проходах (Б3, Б4, Б21, Б25, Б29, Б30, Б32 и прокрутка
 * при пересчёте), сохранены — у каждого свой комментарий ниже.
 *
 * Тёмной темы нет намеренно: сайт светлый (кроме подвала), а две темы —
 * вдвое больше проверок на каждую правку вёрстки. color-scheme: light
 * держит светлыми и системные поля ввода, когда у продавца в системе
 * тёмная тема.
 *
 * ШРИФТЫ: Golos Text (текст, суммы и теперь заголовки — Unbounded убран
 * 27.09), JetBrains Mono (артикулы, чек, пример вставки) и Caveat (пометки
 * от руки — .hand/.note/.receipt__hand) лежат в static/fonts/ — правило
 * проекта против Google Fonts (152-ФЗ и скорость в РФ). Golos Text и
 * JetBrains Mono — вариативные .woff2 из npm-пакетов
 * @fontsource-variable/*@5.3.0 (лицензия OFL-1.1), подмножества cyrillic
 * и latin; диапазоны unicode-range взяты из index.css пакетов. Caveat —
 * статический .woff2 700 из npm-пакета @fontsource/caveat@5 (тот же
 * cdn.jsdelivr.net, та же лицензия), диапазоны unicode-range оттуда же.
 * Знак ₽ (U+20BD) входит в подмножество latin-ext, которого здесь нет,
 * поэтому он рисуется следующим шрифтом из стека. Golos Text — запасной
 * шрифт для пометок (--hand), если Caveat не загрузился.
 *
 * Caveat — © 2014 The Caveat Project Authors, SIL OFL 1.1.
 */

/* ═══ 1. ФУНДАМЕНТ ═══
   Шрифты, токены, база, типографика, маркер/ручка, кнопки, поля,
   индикатор htmx, числа, плашки, бейджи, служебные, шапка и подвал,
   секции, чек, линейка/шкала, раскрывашка, панели, экраны-сообщения,
   юридические страницы, cookie-баннер + свои @media. */

@font-face {
  font-family: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat";
  font-weight: 700;
  font-style: normal;
  /* optional, не swap: пометки от руки не должны сменить шрифт после
     первого кадра (рывок позиции у плавающих .note, заметная подмена у
     .receipt__hand) — либо Caveat готов к показу (preload в base.html
     почти всегда успевает), либо страница на этот показ держит запасной
     Golos Text (--hand, раздел 1) и не переключается позже. */
  font-display: optional;
  src: url("/static/fonts/caveat-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Caveat";
  font-weight: 700;
  font-style: normal;
  font-display: optional;
  src: url("/static/fonts/caveat-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Канонические токены переноса дизайна (design-claude/assets/styles.css,
     SPEC §3). Бумага, чернила, жёлтый маркер, красная ручка аудитора. */
  --paper: #fbfaf6;
  --paper-2: #f3efe5;
  --paper-3: #e9e3d4;
  --card: #ffffff;
  --receipt: #fffdf6;
  --ink: #131a33;
  --ink-2: #3b4260;
  --ink-3: #6c7189;
  --ink-4: #9a9eb0; /* только декор и рамки — на тексте контраст всего 2,5:1 */
  --line: #e5dfd1;
  --line-strong: #cec6b3;
  --marker: #ffe04a;
  --marker-soft: #fff4b8;
  --red: #d6392b; /* заливки, штрихи ручки */
  --red-ink: #c22e21; /* текст убытков */
  --red-soft: #fcebe8;
  --green: #0b8a5a; /* заливки, крупные числа от 24px */
  --green-ink: #07704a; /* текст ≤ 18px, бейджи */
  --green-soft: #e2f3ea;

  --r-lg: 22px;
  --r: 16px;
  --r-sm: 11px;
  --shadow-1: 0 1px 0 rgba(19, 26, 51, 0.03), 0 1px 3px rgba(19, 26, 51, 0.07);
  --shadow-2:
    0 1px 2px rgba(19, 26, 51, 0.05), 0 14px 34px -12px rgba(19, 26, 51, 0.18);
  --shadow-3:
    0 2px 4px rgba(19, 26, 51, 0.05), 0 30px 60px -24px rgba(19, 26, 51, 0.32);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-print: cubic-bezier(0.22, 0.9, 0.3, 1);

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Caveat 700 — пометки от руки (.hand/.note/.receipt__hand); Golos
     Text — запасной шрифт, если Caveat не загрузился. */
  --hand: "Caveat", "Golos Text", system-ui, sans-serif;

  /* Своё, без аналога в прототипе — держат правила разделов 2–3. */
  --gap: 16px;
  --read-width: 760px;
  --shadow: 0 18px 54px rgba(19, 26, 51, 0.1), 0 2px 8px rgba(19, 26, 51, 0.05);
  --shadow-small: 0 5px 18px rgba(19, 26, 51, 0.08);

  /* Псевдонимы прода: старые имена остаются — держат правила разделов 2–3
     (ещё не переехавших на канонические имена выше) и тест --color-accent,
     но указывают на новую палитру. --color-paper → --card: во всех местах
     раздела 2–3 это фон карточки, а не самой бумаги чека. */
  --color-bg: var(--paper);
  --color-surface: var(--card);
  --color-paper: var(--card);
  --color-text: var(--ink);
  --color-text-2: var(--ink-2);
  --color-text-secondary: var(--ink-3);
  --color-line: var(--line);
  --color-line-soft: #eee9dd;
  --color-line-strong: var(--line-strong);
  --color-accent: var(--ink); /* «нетто», прибыль, основная кнопка */
  --color-accent-strong: #1e2748;
  --color-accent-contrast: #fff;
  --color-lime: var(--marker);
  --color-lime-soft: var(--marker-soft);
  --color-loss: var(--red-ink); /* только отрицательные суммы и тревоги */
  --color-loss-soft: var(--red-soft);
  --color-loss-line: #f1c6bf;
  --color-loss-text: #8f2219;
  --color-warning: #7a5b00;
  --color-warning-soft: var(--marker-soft);
  --color-warning-line: #eed98a;
  --color-warning-text: #5f4600;
  --color-info: var(--ink-2);
  --color-info-soft: var(--paper-2);
  --color-focus: var(--ink);
  --font-display: var(--font);
  --font-body: var(--font);
  --font-mono: var(--mono);
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --page-width: var(--wrap);
}

/* ── Сброс и база ── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  /* Липкая шапка (.site-header, --header-h) закрывала верх всего, к чему
     страница прокручивается: якоря («Заполнить сейчас», «Получить отчёт»),
     ошибки форм (#report-error, #waitlist-error, поля с aria-invalid) и любой
     элемент, получивший фокус. Общий отступ прокрутки — высота шапки плюс
     зазор (проход 28.09, Б2/М4); scroll-margin-top у отдельных якорей к нему
     не добавляем, они складываются. */
  scroll-padding-top: calc(var(--header-h) + 24px);
}

:root {
  --header-h: 72px;
}

@media (max-width: 719px) {
  :root {
    --header-h: 64px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  font-feature-settings: "tnum" 0;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--ink);
  text-underline-offset: 0.18em;
}

/* Фокус — сплошная рамка чернильного цвета, 3px, с отступом: держит 3:1 к
   фону на бумаге и на карточках. На тёмном подвале — своё правило ниже
   (кольцо тем же цветом, что и фон, было бы не видно вовсе). */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--marker);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  left: 8px;
}

/* ---------- Типографика ---------- */

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--ink);
  font-weight: 800;
  text-wrap: balance;
}

/* Шкала заголовков — как в прототипе (styles.css) и SPEC §3. Частные
   кегли (hero, результат, карточки) задают свои правила ниже. */
h1 {
  font-size: clamp(38px, 4.5vw, 64px);
  line-height: 1;
  letter-spacing: -0.036em;
}

.h1-muted {
  color: var(--ink-3);
}

h2 {
  font-size: clamp(32px, 3.7vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.034em;
}

h3 {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.lead {
  margin: 0 0 1em;
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 34em;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 1.25em;
}

/* На главной сейчас работает СВОЙ, добуквенно старый .eyebrow (раздел
   «Главная», ещё не в этом коммите) — та же специфичность и более позднее
   место в каскаде отдают приоритет ему, так что здесь эта пара правил до
   поры не видна нигде. Канонический вариант — этот: WP2/WP3b подключают
   его на лендинге и на результате («Детализация начислений», SPEC §5),
   убирая свой локальный дубль. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font: 600 13px/1 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  flex: none;
}

/* Маркер: жёлтая полоса под словом, будто проведена от руки. Без .js —
   сразу целиком видна; .mark--sweep со скриптом «проводит» её слева
   направо один раз (см. .js ниже) — без .js анимация не начнётся никогда,
   и прятать полосу clip-path'ом навсегда нельзя. */
.mark {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.08em;
  right: -0.1em;
  bottom: 0.02em;
  height: 0.44em;
  background: var(--marker);
  border-radius: 0.12em 0.28em 0.16em 0.3em;
  transform: rotate(-1.2deg) skewX(-8deg);
  transform-origin: left center;
}

.js .mark--sweep::before {
  clip-path: inset(0 100% 0 0);
  animation: mark-sweep 620ms var(--ease-out) forwards;
  animation-delay: var(--mark-delay, 450ms);
}

@keyframes mark-sweep {
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Ручка аудитора: красной линией обводит слово, которому нельзя верить
   (цифра кабинета Ozon вместо настоящей прибыли). SVG рисует вызывающий
   компонент — pathLength="100" на нём, чтобы dasharray/dashoffset ниже не
   зависели от формы контура. Без .js обводка сразу целиком нарисована. */
.pen {
  position: relative;
  white-space: nowrap;
}

.pen svg {
  position: absolute;
  left: -0.2em;
  top: -0.14em;
  width: calc(100% + 0.4em);
  height: calc(100% + 0.3em);
  overflow: visible;
  pointer-events: none;
}

.pen path {
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
  stroke-linecap: round;
}

.js .reveal .pen path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 700ms var(--ease-out) 450ms;
}

.js .reveal.is-in .pen path {
  stroke-dashoffset: 0;
}

.hand {
  font-family: var(--hand);
  font-weight: 700;
  color: var(--red-ink);
  line-height: 1;
}

/* Появление секций при прокрутке — только под .js: без скрипта, который
   добавит .is-in, содержимое обязано быть видно сразу (SPEC §2, п. 3). */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms var(--ease-out),
    transform 700ms var(--ease-out);
  transition-delay: var(--rd, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Кнопки ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 1rem/1 var(--font);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 20px -10px rgba(19, 26, 51, 0.55);
  transition:
    transform 160ms var(--ease-out),
    box-shadow 200ms var(--ease-out),
    background-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
}

/* Прод-акцент (лаймовая кнопка старой темы) = маркер новой: --color-lime
   теперь и есть --marker (псевдоним выше), поэтому перекрашивать нечего —
   только добавляем ту же обводку-кольцо, что у нового .btn--marker. */
.btn--accent,
.btn--marker {
  --btn-bg: var(--marker);
  --btn-fg: var(--ink);
  box-shadow:
    0 0 0 1px rgba(19, 26, 51, 0.1) inset,
    0 8px 20px -12px rgba(160, 120, 0, 0.6);
}

.btn--secondary,
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  box-shadow: 0 0 0 1.5px var(--line-strong) inset;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 0.9375rem;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: #1e2748;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.12) inset,
      0 12px 26px -10px rgba(19, 26, 51, 0.6);
  }

  .btn--accent:hover,
  .btn--marker:hover {
    background: #ffd91a;
    box-shadow:
      0 0 0 1px rgba(19, 26, 51, 0.12) inset,
      0 12px 24px -12px rgba(160, 120, 0, 0.7);
  }

  .btn--secondary:hover,
  .btn--ghost:hover {
    background: var(--paper-2);
    box-shadow: 0 0 0 1.5px var(--ink) inset;
  }
}

.btn-hint {
  color: var(--ink-3);
  font-size: 0.8125rem;
  margin: 0;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid var(--marker);
  padding-bottom: 2px;
  transition: border-color 200ms ease;
}

.link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover {
    border-color: var(--ink);
  }

  .link-arrow:hover svg {
    transform: translateX(3px);
  }
}

/* ── Поля форм ── */

.field {
  margin: 0;
}

.field label,
.field legend {
  display: block;
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 650;
}

.field__hint {
  color: var(--ink-3);
  font-size: 0.8125rem;
  margin: 6px 0 0;
}

.field__error {
  color: var(--red-ink);
  font-size: 0.8125rem;
  font-weight: 650;
  margin: 6px 0 0;
}

/* Поле ввода — прод почти всегда обращается к нему через атрибут
   (input[type=email] и т. п.), а не через класс .input: держим оба, чтобы
   существующая разметка разделов 2–3 перекрасилась сама, без правки
   шаблонов. Фокус — рамка цвета чернил и жёлтое кольцо маркера. */
.input,
input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  font-size: 1rem;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .input:hover,
  input[type="text"]:hover,
  input[type="email"]:hover,
  input[type="search"]:hover,
  select:hover,
  textarea:hover {
    border-color: var(--ink-3);
  }
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 224, 74, 0.55);
}

select {
  appearance: none;
  padding-right: 36px;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236c7189' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}

textarea {
  min-height: 6em;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  letter-spacing: -0.012em;
  resize: vertical;
}

input[type="file"] {
  width: 100%;
  max-width: 100%;
  font-size: 0.875rem;
  color: var(--ink-2);
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

/* Выбор периода — над цифрами, в одном ряду с кнопками: подпись мелко над
   полем, ширина по содержимому. Варианты подписаны датами, и растянутый
   на всю строку select оставлял бы полстроки пустоты. */
.field--period label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.field--period select {
  width: auto;
  max-width: 100%;
}

/* min-width: 0 у поля и у списка — иначе список держит ширину самого
   длинного варианта («УСН «доходы» 6 % с НДС …») и на телефоне вылезал за
   край карточки таблицы на 34 px (проверка 24.09 на 375 px). */
.field--inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.field--inline label {
  margin: 0;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
}

.field--inline select {
  width: auto;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}

/* Флажок согласия — .check новый (WP2/WP3b), .checkbox-field прод: тот же
   вид, чтобы существующие формы (лист ожидания, согласие на отчёт на
   почту) перекрасились без правки шаблонов. */
.check,
.checkbox-field {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-2);
  cursor: pointer;
}

.check input,
.checkbox-field input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  flex: none;
  border-radius: 7px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.check input:checked,
.checkbox-field input[type="checkbox"]:checked {
  border-color: var(--ink);
  background:
    var(--ink)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16.2 7.7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/100% no-repeat;
}

.check a,
.checkbox-field a {
  color: var(--ink);
  text-decoration: underline;
}

/* Поле-ловушка для ботов (B6): не display:none — часть ботов такие поля
   игнорирует; прячем визуально, оставляя доступным для форм-заполнителей. */
.field--trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Индикатор загрузки/расчёта (HTMX) ──
   Стандартное правило htmx: элемент с классом htmx-indicator скрыт, пока
   не идёт запрос — .htmx-request добавляется htmx на время запроса. */
.htmx-indicator {
  opacity: 0;
  transition: opacity 150ms ease;
}

.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator {
  opacity: 1;
}

/* Б46: opacity прячет индикатор, но место оставляет — под кнопкой загрузки
   оставалась пустая строка. Здесь он выпадает из потока, пока нет запроса.
   У «Пересчитать» индикатор стоит в строке рядом с кнопкой и место держит
   нарочно: иначе кнопка прыгала бы, когда он появляется. */
.spinner-text--collapsed:not(.htmx-request) {
  display: none;
}

.spinner-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Подсказки, которые правдивы только со скриптом (выбор файла сразу
   запускает расчёт, файл можно бросить на страницу): класс js ставит
   base.html первой строкой. Без скрипта их просто нет. */
.js-only {
  display: none;
}

.js .js-only {
  display: block;
}

/* Б57: перетаскивание — жест мыши. Там, где её нет (телефон, планшет без
   мыши), «Перетащите файл сюда» и «файл можно и перетащить» — неправда,
   а на телефоне ещё и лишние строки над полем выбора файла. Правило стоит
   после .js .js-only: вес у них равный, побеждает последнее. */
@media (hover: none) and (pointer: coarse) {
  .js .drag-only {
    display: none;
  }
}

/* ── Числа ── */

.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: nowrap;
}

.num--loss {
  color: var(--color-loss);
}

.num--lg {
  /* Раньше clamp считался от ширины ЭКРАНА (vw): в сетке карточек на 800 px
     шрифт не мельчал вместе с ними — сумма вроде «116 450 ₽» обрезалась
     молча за край карточки (координатор, ревью на файле MarketWay, 20.09).
     cqi — доля ширины САМОЙ карточки (.summary-card: container-type:
     inline-size), поэтому шрифт мельчает именно там, где карточки узкие. */
  /* Б32: было 15cqi, и «1 081 295 ₽» рвалось на две строки — знак рубля
     уезжал под число. Множитель тут — единственное, что решает: cqi и
     ширина карточки сокращаются, остаётся «влезет ли строка такой длины»,
     и ответ от ширины карточки не зависит вовсе. Замер 21.09 на Unbounded
     (docs/reviews/2026-09-21-walkthrough.md): «123 456 789 ₽» — 8,32 em,
     влезает при множителе не больше 12,0. С переносом дизайна суммы
     набраны Golos Text — он уже Unbounded, так что запас только вырос. */
  font-size: clamp(1.25rem, 12cqi, 2.4rem);
  font-weight: 770;
  line-height: 1.05;
  letter-spacing: -0.045em;
  /* Страховка на суммы в 10 знаков и больше, которым клампа всё же не
     хватит: перенос в две строки вместо обрезки за край карточки. .num
     задаёт nowrap — тут его нужно снять, иначе overflow-wrap не сработает.
     overflow-wrap: anywhere рвёт строку по любому месту, включая
     неразрывный пробел перед знаком рубля, — от переноса защищает только
     кламп. Это и был Б32. */
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ── Плашки (предупреждения, «н/д», ошибки форм) ── */

.notice {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.9rem;
}

.notice--warning {
  background: var(--color-warning-soft);
  border-color: var(--color-warning-line);
  color: var(--color-warning-text);
}

.notice--danger {
  background: var(--color-loss-soft);
  border-color: var(--color-loss-line);
  color: var(--color-loss-text);
}

.notice--info {
  background: var(--color-info-soft);
  border-color: var(--line);
  color: var(--ink);
}

.notice > :last-child {
  margin-bottom: 0;
}

.notice ul,
.notice ol {
  margin: 8px 0 12px;
  padding-left: 1.2em;
}

.notice li + li {
  margin-top: 6px;
}

.notice a {
  color: inherit;
  font-weight: 700;
}

/* ── Ошибка формы (.form-error и .input.is-invalid прототипа) ──
   Красный текст без плашки; поле получает красную рамку через
   aria-invalid (его читают и скринридеры) либо класс is-invalid. Вместо
   нативных пузырей браузера — форма с novalidate и серверные тексты. */
.form-error {
  margin: 0;
  color: var(--red-ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.input.is-invalid,
input[aria-invalid="true"],
.input.is-invalid:focus,
input[aria-invalid="true"]:focus {
  border-color: var(--red);
}

.checkbox-field input[type="checkbox"][aria-invalid="true"],
.check input[aria-invalid="true"] {
  border-color: var(--red);
}

/* На тёмной карточке «Скоро» --red-ink не читается (около 2,6:1): текст
   ошибки кладём на светлую подложку --red-soft (контраст около 4,9:1). */
.upsell .form-error {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--red-soft);
}

/* ── Успех формы (.form-done прототипа) ──
   Своя зелёная подложка и свои цвета текста: одинаково читается на светлой
   карточке главной и на тёмной карточке «Скоро» результата (S-01) — там
   заголовки и абзацы иначе наследуют цвета чернильного фона. */
.form-done {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-weight: 600;
}

.form-done svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.form-done__title,
.form-done__text {
  margin: 0;
  color: var(--green-ink);
}

.form-done__title {
  font-size: 1.0625rem;
  font-weight: 700;
}

.form-done__text {
  margin-top: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ── Бейджи статуса товара ── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 4px 2px 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  /* Не nowrap: подпись флага может быть целым предложением и должна
     переноситься, а не вылезать за карточку на 375 px. Б4, docs/reviews/
     2026-09-20-walkthrough.md: без предела ширины бейдж иногда считал себя
     от текста, а не от колонки, и вылезал за неё. max-width привязывает
     бейдж к ширине ячейки, overflow-wrap — страховка на одно длинное слово. */
  max-width: 100%;
  overflow-wrap: anywhere;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.badge--loss {
  color: var(--red-ink);
  background: var(--red-soft);
}

.badge--warning {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.badge--info {
  color: var(--ink-2);
  background: var(--color-info-soft);
}

.badge--good {
  color: var(--green-ink);
  background: var(--green-soft);
}

/* ── Утилиты ── */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.text-secondary {
  color: var(--ink-3);
}

.mt-0 {
  margin-top: 0;
}

.stack {
  display: grid;
  /* minmax(0, 1fr), а не 1fr: 1fr — это minmax(АUTO, 1fr), и минимум auto
     не даёт колонке стать уже, чем самое «неподатливое» содержимое внутри.
     На 375 px одна таблица растягивала колонку до 431 px и тянула за собой
     ВСЕХ соседей — заголовок, карточки, переключатель периода, — и страницу
     можно было таскать вбок. Карточная вёрстка таблицы при этом работала
     исправно: виновата была не она, а трек сетки вокруг (Б25,
     docs/reviews/2026-09-20-walkthrough.md). */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
}

/* Раскрывающиеся блоки с «+» и «−» вместо треугольника: «Где скачать
   отчёт», расходы вне товаров, вставка себестоимости (index.html,
   partials/result.html). У вопросов лендинга то же поведение —
   .faq details > summary в разделе «Главная», свои отступы. */
.disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.disclosure > summary::-webkit-details-marker {
  display: none;
}

.disclosure > summary::after {
  content: "+";
  flex: none;
  color: var(--color-accent);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
}

.disclosure[open] > summary::after {
  content: "−";
}

/* ---------- Секции (WP2/WP3b) ---------- */

.section {
  padding: clamp(72px, 9vw, 128px) 0;
}

.section--tint {
  background: var(--paper-2);
}

.section__head {
  display: grid;
  gap: 18px;
  max-width: 760px;
  margin-bottom: clamp(36px, 5vw, 60px);
}

.section__head .eyebrow {
  margin: 0;
}

.section__head p:not(.eyebrow) {
  margin: 0;
  font-size: 1.1875rem;
  color: var(--ink-2);
}

/* Тёмная секция («Файл не остаётся у нас»): фон --ink, светлый текст.
   Цвета заголовков и подписей — на фоне --ink контраст не ниже 4,5:1
   (белый и rgba(255,255,255,.7+) на #131a33). Фокус — кольцо маркера:
   чернильное на чернильном не видно. */
.section--ink {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
}

.section--ink h2,
.section--ink h3 {
  color: #fff;
}

.section--ink .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.section--ink .eyebrow::before {
  background: var(--marker);
}

.section--ink .section__head p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.78);
}

.section--ink :focus-visible {
  outline-color: var(--marker);
}

/* ---------- Чек (WP2/WP3b) ----------
   Общий компонент: держит только напечатанный вид. Принтер, щель над
   чеком и анимация печати (.receipt-stage/.printer/.receipt-slot/
   .is-printing) — только на главной (WP2, index.html прототипа) и сюда не
   перенесены (SPEC §3). Без них .receipt просто всегда показан целиком —
   работает и без JS, и при reduced motion без единой лишней строчки. */

.receipt {
  position: relative;
  padding: 28px 24px 40px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.4  0 0 0 0 0.3  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #f6f1e3 0, var(--receipt) 34px);
  font: 400 13px/1.62 var(--mono);
  color: #222842;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-2);
  --zig: 14px;
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg)
    50% / var(--zig) 100%;
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg)
    50% / var(--zig) 100%;
}

.receipt--flat {
  box-shadow: none;
}

.receipt--mini {
  padding: 18px 16px 26px;
  font-size: 12px;
}

.receipt__title {
  margin: 0 0 4px;
  text-align: center;
  font: 600 14px/1.3 var(--mono);
  letter-spacing: 0.08em;
}

.receipt__sub {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #6a6f86;
}

.receipt__rule {
  height: 0;
  margin: 12px 0;
  border: 0;
  border-top: 1.5px dashed #b9b3a2;
}

.receipt__rule--double {
  border-top: 3px double #3a4060;
}

.receipt__line {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.receipt__line > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt__line .amt,
.receipt__line .pct {
  white-space: nowrap;
}

.receipt__line::after {
  content: "";
  order: 1;
  flex: 1;
  min-width: 12px;
  border-bottom: 1.5px dotted #c8c1ae;
  transform: translateY(-4px);
}

.receipt__line .amt {
  order: 2;
  flex: none;
  text-align: right;
}

.receipt__line .pct {
  order: 3;
  flex: none;
  width: 4.2em;
  text-align: right;
  color: #6a6f86;
}

.receipt__line--muted {
  color: #6a6f86;
}

.receipt__line--total {
  font-weight: 600;
}

.receipt__line--net {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.receipt__line--net::after {
  border-bottom-color: #9d977f;
}

.receipt__line--net .amt,
.receipt__line--net .pct {
  color: var(--ink);
}

.receipt__net-mark {
  position: absolute;
  z-index: -1;
  inset: -3px -9px -2px -9px;
  background: var(--marker);
  border-radius: 3px 8px 4px 9px;
  transform: rotate(-0.8deg) skewX(-6deg);
  mix-blend-mode: multiply;
}

.receipt__foot {
  margin: 0;
  display: grid;
  gap: 2px;
  font-size: 12.5px;
  color: #585d76;
}

.receipt__foot .receipt__line::after {
  border-bottom-color: #d9d3c2;
}

.receipt__stamp {
  margin: 16px auto 0;
  width: fit-content;
  padding: 6px 10px;
  border: 1.5px solid rgba(7, 112, 74, 0.75);
  border-radius: 6px;
  color: var(--green-ink); /* текст 11px: --green на бумаге чека даёт 4,2:1, нужно 4,5 */
  font: 600 11px/1.25 var(--mono);
  letter-spacing: 0.08em;
  text-align: center;
  transform: rotate(-2.5deg);
}

.receipt__barcode {
  height: 34px;
  margin: 16px 12px 0;
  background: repeating-linear-gradient(
    90deg,
    #222842 0 2px,
    transparent 2px 4px,
    #222842 4px 5px,
    transparent 5px 8px,
    #222842 8px 11px,
    transparent 11px 12px,
    #222842 12px 13px,
    transparent 13px 16px
  );
  opacity: 0.85;
}

/* Красная ручка по строке «до налога»: аудитор зачёркивает то, чему не
   верит. SVG рисует вызывающий компонент (--len/--d в style — свои числа
   на главной; на результате продавца эти строки в ym-hide-content). */
.strike {
  position: relative;
  display: inline-block;
}

.strike svg {
  position: absolute;
  left: -6px;
  right: -6px;
  top: 50%;
  width: calc(100% + 12px);
  height: 16px;
  transform: translateY(-58%);
  overflow: visible;
  pointer-events: none;
}

.strike path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* ---------- Линейка цены и шкала ДРР (WP3b, на главной и в результате) ----------
   Геометрия — БЕЗРАЗМЕРНЫЕ custom properties (--x/--p0/--w/--c, 0–100,
   calc(var(--x, 0) * 1%), дефолт 0 через var()-фолбэк): числа продавца
   нельзя класть в атрибут даже без единиц — Вебвизор пишет атрибуты
   всегда, даже под ym-hide-content (SPEC §2). На главной это НАШИ цифры —
   их можно ставить в style напрямую. На странице результата WP3b задаёт
   геометрию через JS (element.animate(..., {fill:"forwards"}) — WAAPI не
   трогает атрибуты), а саму обёртку держит класс "js-only" (см. раздел
   «Индикатор htmx» выше): без JS полосы там не показываются вовсе, только
   текстовые значения рядом с ними. */

/* Без @property браузер не знает, что --x/--p0/--w/--c — числа, и WAAPI
   не интерполирует их между кадрами: держится только верный конечный
   кадр (fill: "forwards"). Гап фундамента из отчёта WP3b — закрывается
   здесь. inherits: true обязательно: на главной --w/--c стоят в style у
   .gauge__track, а читают их дочерние <i>/<em>; с false они видят 0 и
   шкала ДРР рисуется пустой. */
@property --x {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --p0 {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --w {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --c {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.ruler {
  display: grid;
  gap: 14px;
  font-size: 13.5px;
}

.ruler__track {
  position: relative;
  height: 10px;
  margin: 26px 4px 20px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    var(--red-soft) 0 calc(var(--p0, 0) * 1%),
    var(--green-soft) calc(var(--p0, 0) * 1%) 100%
  );
}

.ruler__pin {
  position: absolute;
  top: 50%;
  left: calc(var(--x, 0) * 1%);
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(19, 26, 51, 0.3);
}

.ruler__pin span {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ruler__pin--now {
  background: var(--red);
}

.ruler__pin--p0 {
  background: var(--ink);
}

.ruler__pin--p0 span {
  top: 18px;
  bottom: auto;
}

.ruler__cta {
  justify-self: start;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--marker);
  font-weight: 700;
  font-size: 13.5px;
}

.gauge {
  display: grid;
  gap: 12px;
  font-size: 13.5px;
}

.gauge__row {
  display: grid;
  gap: 6px;
}

.gauge__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-2);
}

.gauge__row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.gauge__track {
  position: relative;
  height: 10px;
  border-radius: 10px;
  background: var(--paper-3);
}

.gauge__track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--w, 0) * 1%);
  border-radius: inherit;
  background: var(--ink);
}

.gauge__track em {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: calc(var(--c, 0) * 1%);
  width: 3px;
  border-radius: 3px;
  background: var(--red);
}

.gauge__note {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-weight: 600;
}

/* ---------- Раскрывашка «Как посчитано» / FAQ (WP2/WP3b) ---------- */

.qa {
  border-bottom: 1px solid var(--line-strong);
  interpolate-size: allow-keywords;
}

.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary i {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper-2);
  font-style: normal;
  transition: background-color 200ms ease;
}

.qa summary i::before,
.qa summary i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.qa summary i::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 260ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .qa summary:hover i {
    background: var(--marker);
  }
}

.qa[open] summary i::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Раскрытие ответа: где браузер умеет ::details-content — плавно, где нет
   — сразу (progressive enhancement, без разницы в конечном состоянии).
   Только у .qa: блок «Расходы кабинета» и шеврон строки таблицы раскрываются
   мгновенно (владелец 03.10: анимация — у FAQ). */
.qa::details-content {
  block-size: 0;
  overflow-y: clip;
  opacity: 0;
  transition:
    block-size 280ms var(--ease-out),
    opacity 220ms ease,
    content-visibility 280ms allow-discrete;
}

.qa[open]::details-content {
  block-size: auto;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  /* ::details-content — не ::before/::after, общее правило раздела
     «Движение» его не ловит (SPEC §2, п. 3: без анимаций совсем). */
  .qa::details-content {
    transition-duration: 1ms;
  }
}

.qa__body p {
  margin: 0 0 24px;
  max-width: 40em;
  color: var(--ink-2);
}

/* ── Панели под таблицей и в экранах-сообщениях ── */

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-paper);
  box-shadow: var(--shadow-1);
}

.panel__title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.25;
  letter-spacing: -0.024em;
}

.panel p {
  margin: 0;
}

.panel__text {
  color: var(--color-text-2);
  font-size: 0.875rem;
}

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.panel form .btn {
  justify-self: start;
}

/* ── Экраны-сообщения: ошибка загрузки, «отчёт в пути» ── */

.error-screen,
.message-card {
  width: 100%;
  max-width: var(--read-width);
  /* Слева — по сетке шапки и подвала (не по центру): край колонки
     совпадает с логотипом. */
  margin: 0;
}

/* Служебные экраны — заголовок скромнее hero-шкалы (64 px на 1440 съедал
   первый экран страницы с одной формой). */
.message-card h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
}

.error-card h1 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--color-text);
}

.error-card {
  padding: 20px 22px;
  border-left-width: 5px;
}

.error-card p {
  margin: 8px 0 0;
}

.error-card.notice--danger {
  border-left-color: var(--red);
}

.error-card.notice--warning {
  border-left-color: var(--color-warning);
}

.error-card.notice--info {
  border-left-color: var(--ink-3);
}

/* Разбор «проверьте по порядку» — обычный текст, не красная стена (S-09). */
.error-help {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.error-help > :first-child {
  margin-top: 0;
}

.error-help ol {
  margin: 8px 0 12px;
  padding-left: 1.3em;
}

.error-help li + li {
  margin-top: 8px;
}

/* ── Юридические страницы ── */

.legal {
  max-width: var(--read-width);
  margin: 0;
  font-size: 0.95rem;
}

.legal > .notice {
  margin-bottom: 24px;
}

.legal h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.legal h2 {
  margin-top: 1.6em;
  font-size: 1.2rem;
}

/* Версия текста согласия. Её же пишет журнал заявок рядом с email, поэтому
   она должна быть видна, но не спорить с заголовком за внимание. */
.legal-version {
  margin-top: -0.5em;
  color: var(--color-text-secondary);
  font-size: 0.9em;
}

.legal blockquote {
  margin: 0;
  padding: 0.5em 0 0.5em 1em;
  border-left: 3px solid var(--color-line);
  color: var(--color-text-secondary);
}

/* ── Шапка и подвал ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  /* Линия снизу всегда видна (SPEC: «без JS — всегда видна ИЛИ
     scroll-driven-анимация под @supports»; здесь — первый, самый простой и
     надёжный вариант, без зависимости от поддержки браузером). */
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms ease;
}

/* Главная: линия под шапкой появляется, когда страница уехала (landing.js
   ставит .is-scrolled), как в прототипе. Только со скриптом (.js) и только
   пока на экране лендинг (.page-stack): на остальных страницах и без
   скрипта линия видна всегда. */
.js .site-header:not(.is-scrolled):has(~ #main .page-stack) {
  border-bottom-color: transparent;
}

.site-header .btn {
  white-space: nowrap;
}

.site-header__inner {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.logo__mark {
  width: 28px;
  height: 32px;
  flex: none;
}

.logo__word {
  font: 800 1.25rem/1 var(--font);
  letter-spacing: -0.03em;
}

.logo__word span {
  color: var(--ink-3);
}

/* Сетка страницы — как .wrap прототипа: контент шапки, main и подвала на
   1440 лежит по краям 120–1320 (max-width = --wrap + 2 × --gutter,
   боковое поле = --gutter, на телефоне 16px). */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 40px var(--gutter) 72px;
  /* Продавец вписывает себестоимость в середине таблицы — и страницу
     прокручивает вниз, к самому подвалу (находка основателя 20.09). Это
     «scroll anchoring» браузера: он запоминает видимый элемент и подгоняет
     прокрутку, когда содержимое над ним меняет высоту. Здесь htmx заменяет
     весь #main разом, якорь исчезает вместе со старой разметкой, и поправка
     получается бессмысленной. Внутри #main меняется только то, что мы
     заменили целиком, — терять тут нечего, а прокрутку это возвращает
     на место. */
  overflow-anchor: none;
}

/* Весь отступ — на .site-footer__inner (родное прода, ниже без изменений):
   здесь только новый тёмный фон и то, что от него зависит — цвет текста
   по умолчанию и размер шрифта. Padding на обоих сразу задвоил бы отступ
   сверху и снизу. */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.90625rem;
}

/* Фокус на тёмном подвале: чернильное кольцо (правило выше) на чернильном
   фоне не видно вовсе — здесь кольцо цвета маркера. */
.site-footer :focus-visible {
  outline-color: var(--marker);
}

.site-footer__inner {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px var(--gutter) 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 40px;
}

.site-footer__inner p {
  margin: 0 0 4px;
}

/* Реквизиты слева, юридические ссылки справа; на узком экране — друг
   под другом. Без flex-basis строка реквизитов занимала всю ширину, и
   ссылки уезжали вниз даже на широком экране. */
.site-footer__inner > div {
  flex: 1 1 340px;
  min-width: 0;
}

.site-footer__inner p.site-footer__brand {
  margin-bottom: 12px;
  color: #fff;
  font-weight: 700;
}

/* Логотип в подвале — слово белое, «Профит» приглушённее (контраст выше
   4,5:1 на --ink), кегль слова как в шапке. */
.site-footer .logo {
  color: #fff;
}

.site-footer .logo__word span {
  color: rgba(255, 255, 255, 0.72);
}

/* Сеткой два на два (полировка десктопа, 26.09): переносом по словам
   ссылки вставали лесенкой — одна, две, одна. На телефоне — столбиком. */
.site-footer__links {
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer__links a {
  display: inline-block;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  transition: color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__links a:hover {
    color: var(--marker);
  }
}

/* ── Баннер cookie ── */

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

/* S-13: на компьютере баннер (около 72 px + 16 отступ) закрывал низ подвала. */
body:has(.cookie-banner:not([hidden])) .site-footer__inner {
  padding-bottom: 108px;
}

.cookie-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cookie-banner p {
  flex: 1 1 320px;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.8125rem;
}

/* 360–390: логотип и кнопка «Загрузить отчёт» — в одну строку. */
@media (max-width: 400px) {
  .site-header__inner {
    gap: 12px;
  }

  .logo {
    gap: 8px;
  }

  .logo__word {
    font-size: 1.125rem;
  }

  .site-header .btn--sm {
    padding: 0 14px;
    font-size: 0.875rem;
  }
}

@media (max-width: 719px) {
  main {
    padding-block: 24px 48px;
  }

  .site-footer__inner {
    padding-block: 22px 28px;
  }

  /* Ревью 1, п. 5: логотипы (шапка, подвал) и малая кнопка шапки — цель касания
     не меньше 44 px. Шапка 64 px, поэтому 44 в неё помещается без сдвига. */
  .logo,
  .btn--sm {
    min-height: 44px;
  }

  /* L-11: цель касания ссылок подвала не меньше 44 px (SPEC §2.7). */
  .site-footer__links {
    gap: 0;
  }

  .site-footer__links a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .panel {
    padding: 18px;
  }

  /* Б60: на телефоне баннер куки был 144 px и закрывал поле выбора файла
     на первом экране (прод, 360×740: баннер 580–724, поле под ним, скрыто
     целиком). Текст менять нельзя (юридический) — сокращаем сам баннер:
     кнопка встаёт в одну строку с текстом вместо переноса под него, отступы
     и кегль меньше. min-height у кнопки держит 44 px (попадание пальцем),
     цвета не трогаем — контраст текста и кнопки те же, что и на компьютере.

     360×740 — самый тесный из проверенных размеров: под полем выбора файла
     остаётся всего ~56 px до низа экрана. Кнопка с полом в 44 px в отступах
     оставляет впритык, поэтому нижний отступ баннера здесь уже, чем на
     компьютере (2 px вместо 16) — иначе поле остаётся под баннером даже
     после всех сокращений. */
  .cookie-banner {
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 8px 10px;
  }

  .cookie-banner__inner {
    flex-wrap: nowrap;
    gap: 8px;
  }

  /* S-12: кегль как у .form-note прототипа (13,5 px) вместо 11 px. */
  .cookie-banner p {
    flex: 1 1 auto;
    font-size: 0.84375rem;
    line-height: 1.35;
  }

  .cookie-banner .btn {
    flex: 0 0 auto;
    min-height: 44px;
    min-width: 44px;
    padding: 6px 12px;
    font-size: 0.8125rem;
  }

  /* S-13: пока баннер показан, подвалу отдаём место под ним, чтобы реквизиты
     и ссылки можно было прочитать и нажать. Баннер на телефоне выше. */
  body:has(.cookie-banner:not([hidden])) .site-footer__inner {
    padding-bottom: 150px;
  }
}

/* ═══ 2. ГЛАВНАЯ ═══
   Лендинг, форма загрузки (оба варианта), платный тариф и лист
   ожидания, частые вопросы + свои @media.

   Компоненты из фундамента (раздел 1), которые эта секция ТОЛЬКО
   использует и не переопределяет: .eyebrow, .lead, .mark/.mark--sweep,
   .pen, .btn*, .badge*, .input/.check, .qa, .receipt и .receipt__*,
   .strike, .note/.hand, .ruler, .gauge, .section/.section__head/
   .section--tint/.section--ink. Пока фундамент их не завёл — секция
   ниже выглядит без части оформления, это ожидаемо (WP2.md, п. 3). */

/* ── Разметка страницы ── */

.page-stack {
  /* <main> (раздел 1) центрирует контент и держит своё поле (--gutter) — секциям
     с сплошной подложкой (.facts, .section--tint, .section--ink) нужно
     тянуться на всю ширину экрана. Здесь это поле отменяется (--gutter —
     ровно как у main, на любой ширине), а .wrap ниже возвращает отступ уже внутри каждой секции.
     overflow-x сюда нарочно не ставится: он обрезал бы собственную
     подложку секций ниже, которая на 100vw выходит ЗА пределы этого
     блока — обрезать пришлось бы на <body>, а его правит фундамент. */
  margin-inline: calc(-1 * var(--gutter));
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Секции со сплошной подложкой (лента фактов, «+100 ₽», «Где взять
   отчёт», FAQ, тёмная «Файл не остаётся у нас») — на всю ширину экрана,
   а не только .page-stack. Внутри у каждой всё равно есть .wrap.
   Не 100vw: при видимой полосе прокрутки (десктоп) 100vw шире окна и
   даёт горизонтальный сдвиг. Подложку тянет тень со спредом (она не
   входит в scrollable overflow), clip-path срезает её сверху и снизу. */
.facts,
.section--tint,
.section--ink {
  clip-path: inset(0 -100vmax);
}

.facts {
  box-shadow: 0 0 0 100vmax var(--card);
}

.section--tint {
  box-shadow: 0 0 0 100vmax var(--paper-2);
}

.section--ink {
  box-shadow: 0 0 0 100vmax var(--ink);
}

/* ── Первый экран ── */

/* Без своего max-width/центрирования по горизонтали: <main> (раздел 1)
   уже задаёт и то, и другое — свои же значения здесь рассинхронировали бы
   левый край первого экрана с обычными .section ниже. Только свой
   вертикальный ритм и сетка. */
.hero {
  position: relative;
  padding-block: clamp(28px, 5vw, 64px) clamp(56px, 8vw, 112px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "copy art" "form art" "proof art";
  grid-template-rows: auto auto 1fr;
  align-items: start;
  column-gap: clamp(32px, 4.5vw, 64px);
  row-gap: 0;
}

.hero__copy {
  grid-area: copy;
  display: grid;
  gap: 28px;
  padding-bottom: 32px;
}

/* Широкий экран: <main> уже даёт 40 px сверху — чек встаёт на уровень
   шапки первого экрана (как в прототипе, y≈137), а текст опускается на
   свой отступ и остаётся на месте. */
@media (min-width: 1050px) {
  .hero {
    margin-top: -40px;
  }

  /* Ритм колонки как в прототипе: eyebrow → заголовок → лид через один
     gap (28 px) — собственные отступы h1/eyebrow/лида его не удваивают.
     Форма загрузки — главное действие страницы, первому экрану 900 px она
     нужна целиком (D1). */
  .hero__copy {
    gap: 28px;
    padding-top: clamp(4px, 2vw, 24px);
    padding-bottom: 18px;
  }

  .hero__copy > .eyebrow,
  .hero__copy > h1,
  .hero__copy > .hero__subtitle {
    margin-bottom: 0;
  }
}

/* Лид у нас в семь строк против четырёх у прототипа (тексты прода длиннее),
   поэтому левая колонка чуть шире правой: пять-шесть строк вместо семи.
   Чек и его пометки остаются в колонке не уже 460 px + запас под пометки. */
@media (min-width: 1280px) {
  .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}

/* Первая строка h1 — приглушённая, вторая («Мы показываем прибыль») —
   обычным цветом текста, «прибыль» — под маркером (.mark--sweep). */
.hero__line {
  display: block;
}

.hero__line:first-child {
  color: var(--ink-3);
}

/* Маркер под «прибыль» проводится через 600 мс, как в прототипе (сам
   маркер — со свесом слева и скосом — общий .mark, раздел 1). */
.hero .mark--sweep {
  --mark-delay: 600ms;
}

.hero > .upload-card {
  grid-area: form;
}

.hero__art {
  grid-area: art;
  /* Чек начинается на уровне заголовка колонки и целиком виден в первом
     экране: левая колонка (текст, форма, галочки) выше, центрировать
     чек по ней нельзя. */
  align-self: start;
  justify-self: center;
  width: 100%;
  max-width: 460px;
}

.hero__caption {
  margin: 40px 0 0;
  max-width: 440px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-3);
  text-align: center;
}

/* Галочки под формой (как .drop__meta прототипа): не чипы, а строка. */
.hero .proof-list {
  grid-area: proof;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 0 4px;
  list-style: none;
}

.proof-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.3;
}

.proof-list svg {
  width: 16px;
  height: 16px;
  color: var(--green);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Чек печатается из принтера — оформление щели и тени, которых у общего
   .receipt (раздел 1) нет: они нужны только на первом экране. */
.receipt-stage {
  position: relative;
  display: grid;
  justify-items: center;
}

.printer {
  position: relative;
  z-index: 3;
  width: min(100%, 420px);
  height: 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a3358 0%, #121831 70%);
  box-shadow:
    0 10px 18px -10px rgba(19, 26, 51, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.printer::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 5px;
  height: 3px;
  border-radius: 3px;
  background: #05070f;
}

.receipt-slot {
  position: relative;
  z-index: 2;
  width: min(100% + 28px, 476px);
  margin: -9px -14px -48px;
  overflow: hidden;
  padding: 0 28px 48px;
}

.receipt-shadow {
  filter:
    drop-shadow(0 16px 16px rgba(19, 26, 51, 0.14))
    drop-shadow(0 2px 2px rgba(19, 26, 51, 0.08));
}

/* Пометки от руки — плавающие рядом с чеком (десктоп, только со
   скриптом: их позицию считает landing.js по факту разметки чека). На
   телефоне и без скрипта марки идут прямо в чеке — .receipt__hand,
   стили в разделе 1, показ ниже и в @media (max-width: 719px). */
.note {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  display: none;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

.js .note {
  display: flex;
}

.note svg {
  flex: none;
  overflow: visible;
}

.note path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note .hand {
  font-size: 28px;
  line-height: 0.9;
  white-space: nowrap;
  transform: rotate(var(--rot, -5deg));
}

.note--tax {
  --rot: -6deg;
}

.note--net {
  --rot: -4deg;
}

/* Плавающие .note взяли на себя обе пометки — та же пара внутри чека
   (.receipt__hand) здесь лишняя, иначе на широком экране получится
   два одинаковых «а налог?» сразу. На телефоне .note снова display: none
   (@media max-width: 719px ниже) — там .receipt__hand возвращается. */
.js .hero__art .receipt__hand {
  display: none;
}

/* Та же пометка от руки, но напечатанная прямо в чеке (телефон и версия
   без скрипта — там плавающих .note нет вовсе, см. .js .note выше и
   @media (max-width: 719px) ниже). .hand (раздел 1) даёт шрифт и цвет,
   здесь — только раскладка строки со стрелкой и наклон. */
.receipt__hand {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 4px;
  margin: 1px 0 3px;
  font-family: var(--hand);
  font-weight: 700;
  color: var(--red-ink);
  font-size: 21px;
  line-height: 1;
  transform: rotate(var(--rot, -3deg));
  transform-origin: right center;
}

.receipt__hand svg {
  flex: none;
  width: 20px;
  height: 20px;
  overflow: visible;
}

.receipt__hand path {
  fill: none;
  stroke: var(--red-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Без скрипта или с рабочим он, но пометки уже нарисованы (по умолчанию
   .receipt__hand в разделе 1 виден) — печать не анимируем вовсе, чтобы
   ничего не «уезжало» после отрисовки (класс js ставится в <head> синхронно,
   поэтому этот селектор либо действует с самого начала, либо не действует
   совсем — вспышки нет). */
.js .hero__art .receipt-shadow {
  transform: translateY(-100%);
  animation: np-print-out 1500ms var(--ease-print) 250ms forwards;
}

@keyframes np-print-out {
  to {
    transform: translateY(0);
  }
}

.js .hero__art .receipt [data-line] {
  opacity: 0;
  animation: np-line-in 260ms ease-out forwards;
  animation-delay: calc(420ms + var(--i, 0) * 62ms);
}

@keyframes np-line-in {
  to {
    opacity: 1;
  }
}

/* Плавающие .note проявляются на своих 2000ms — после печати чека
   (np-print-out кончается на 1750ms), как и задумано. Позицию landing.js
   к этому моменту уже посчитал по раскладке (offsetTop/offsetLeft —
   transform печати на неё не влияет), а Caveat с font-display: optional
   после первого кадра не подменяется: пометка появляется сразу на месте
   и своим шрифтом, без рывка. */
.js .hero__art .strike path,
.js .hero__art .note path {
  stroke-dasharray: var(--len, 200);
  stroke-dashoffset: var(--len, 200);
  animation: np-draw 420ms var(--ease-out) forwards;
  animation-delay: var(--d, 2000ms);
}

@keyframes np-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.js .hero__art .note .hand,
.js .hero__art .receipt__hand {
  opacity: 0;
  transform: translateY(4px) rotate(var(--rot, -5deg)) scale(0.96);
  animation: np-hand-in 360ms var(--ease-out) forwards;
  animation-delay: var(--d, 2000ms);
}

@keyframes np-hand-in {
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--rot, -5deg)) scale(1);
  }
}

.js .hero__art .receipt__net-mark {
  clip-path: inset(0 100% 0 0);
  animation: np-marker-sweep 560ms var(--ease-out) forwards;
  animation-delay: 2750ms;
}

@keyframes np-marker-sweep {
  to {
    clip-path: inset(0 0 0 0);
  }
}

.js .hero__art .receipt__stamp {
  opacity: 0;
  transform: rotate(-2.5deg) scale(1.25);
  animation: np-stamp 300ms var(--ease-out) forwards;
  animation-delay: 3150ms;
}

@keyframes np-stamp {
  to {
    opacity: 1;
    transform: rotate(-2.5deg) scale(1);
  }
}

/* ── Карточка загрузки на лендинге ──
   Как .drop прототипа: белая карточка с тенью, внутри пунктирная зона
   (сама форма — на ней и подсветка при перетаскивании). */

/* Якорь «Загрузить отчёт»: h2 скрыт и лежит у верхнего края карточки; отступ
   под липкую шапку задаёт scroll-padding-top у html (раздел 1). */

.upload-card {
  position: relative;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-2);
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.upload-card:has(.upload-drop--active) {
  transform: scale(1.012);
  box-shadow: var(--shadow-3);
}

/* ── Форма загрузки (лендинг, результат, экран ошибки) ── */

.upload-drop {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 20px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r);
  background: var(--card);
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.upload-drop .btn {
  justify-self: start;
}

/* Пунктирная зона лендинга: значок · «Перетащите файл сюда» · кнопка
   выбора. Без скрипта значка, заголовка зоны и кнопки-<label> нет — там
   поле выбора файла и кнопка отправки; пустые строки сетки высоты не
   держат (row-gap 0, отступы у самих блоков). */
.upload-drop--card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "icon body pick"
    "format format format"
    "field field field"
    "submit submit submit"
    "hint hint hint"
    "spinner spinner spinner";
  column-gap: 16px;
  row-gap: 0;
  align-items: center;
  padding: 18px 18px 18px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

.upload-drop--card.upload-drop--active {
  box-shadow: none;
}

.upload-drop--card .file-icon {
  display: none;
  grid-area: icon;
}

.upload-drop__body {
  grid-area: body;
  min-width: 0;
}

.upload-drop--card .upload-drop__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.upload-drop--card .upload-drop__text {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.upload-drop__format {
  grid-area: format;
  margin: 0;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.js .upload-drop__format {
  margin-top: 12px;
}

.upload-drop--card .file-pick {
  grid-area: pick;
  justify-self: end;
  padding: 0 20px;
}

.upload-drop--card .field {
  grid-area: field;
  width: 100%;
  margin-top: 14px;
}

.js .upload-drop--card .field {
  margin-top: 8px;
}

.upload-drop--card .field label {
  color: var(--ink-3);
  font-weight: 600;
}

.upload-drop--card .field__hint {
  margin: 0;
}

.upload-drop--card .upload-submit {
  grid-area: submit;
  justify-self: stretch;
  margin-top: 14px;
}

.upload-drop--card .btn-hint {
  grid-area: hint;
  margin-top: 12px;
}

.upload-drop--card .spinner-text {
  grid-area: spinner;
  margin-top: 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

/* Идёт расчёт (htmx ставит .htmx-request на индикатор): зона — как
   .drop.is-busy прототипа, рамка чернилами; повторный выбор файла на это
   время закрыт. Процентов и шагов, как у прототипа, нет: настоящий
   прогресс сервер не отдаёт, рисовать выдуманный не будем. */
.upload-drop--card:has(.spinner-text.htmx-request) {
  border-style: solid;
  border-color: var(--ink);
}

.upload-drop--card:has(.spinner-text.htmx-request) .file-pick {
  opacity: 0.5;
  pointer-events: none;
}

@media (min-width: 720px) {
  .js .upload-drop--card .file-icon {
    display: grid;
    width: 46px;
    height: 53px;
  }
}

/* Hover — как .drop__zone:hover прототипа (только с мышью). */
@media (hover: hover) and (pointer: fine) {
  .upload-drop--card:not(.upload-drop--active):hover {
    border-color: var(--ink-3);
  }

  .plans > .upsell > summary:hover .upsell__cta {
    background: #1e2748;
  }
}

/* Выбор файла — одна кнопка (upload_form.html, полировка десктопа 26.09).
   Без скрипта — системное поле с подписью и кнопка отправки, как было. Со
   скриптом файл уходит сам сразу после выбора, поэтому поле, его подпись и
   кнопка отправки спрятаны, а выбор открывает кнопка-<label>. Поле прячем
   визуально, не display: none: оно остаётся в порядке Tab, и его фокус
   с клавиатуры показывает кольцо на кнопке. */
.file-pick {
  display: none;
}

.js .file-pick {
  display: inline-flex;
}

.js .upload-drop .file-input,
.js .upload-drop .file-field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.js .upload-submit {
  display: none;
}

.upload-drop:has(.file-input:focus-visible) .file-pick {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* На карточке лендинга про перетаскивание уже сказал заголовок зоны
   («Перетащите файл сюда») — вторая такая строка под кнопкой там лишняя.
   На результате и экране ошибки зона внизу страницы, там она нужна. */
.upload-drop--card .field__hint .drag-only {
  display: none;
}

/* Подсветка при перетаскивании файла над окном (W2, drag-and-drop) —
   слушатели висят на window (бросить можно в любое место страницы), но
   подсвечиваем именно эту зону, чтобы было видно, куда попадёт файл.
   Жёлтая заливка — как .drop.is-over в прототипе. */
.upload-drop--active {
  border-color: var(--ink);
  background: var(--marker-soft);
  box-shadow: var(--shadow-3);
}

.upload-drop__caption {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: inherit;
  background: var(--marker-soft);
  color: var(--ink);
  font-weight: 700;
}

.upload-drop--active .upload-drop__caption {
  display: flex;
}

/* Ошибка выбора или перетаскивания — как .form-error прототипа. */
.upload-drop .field__error {
  font-size: 0.875rem;
  font-weight: 500;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 62px;
}

.file-icon svg {
  width: 100%;
  height: 100%;
}

/* ── Лента фактов ── */

.facts {
  border-block: 1px solid var(--line);
  /* линии выходят за края блока на весь экран (outset не даёт прокрутки) */
  border-image: linear-gradient(var(--line), var(--line)) 1 / 1px 0 / 0 100vmax;
  background: var(--card);
}

.facts__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fact {
  display: grid;
  gap: 4px;
  padding: 26px 24px;
  border-left: 1px solid var(--line);
}

.fact:first-child {
  border-left: 0;
  padding-left: 0;
}

.fact b {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.fact span {
  font-size: 14.5px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* ── «Маржа» в кабинете красивее, чем деньги на счёте ── */

.gap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gap-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 28px 26px 30px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.gap-card__tag {
  justify-self: start;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.gap-card__num {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--red-ink);
  font-variant-numeric: tabular-nums;
}

.gap-card p {
  margin: 0;
  color: var(--ink-2);
}

.gap-total {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  padding: 30px 32px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
}

.gap-total b {
  font-size: clamp(54px, 7vw, 88px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--marker);
}

.gap-total p {
  margin: 0;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.9);
}

.gap-total small {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  letter-spacing: 0;
}

/* ── «+100 ₽» ── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.split__text p:not(.eyebrow) {
  margin: 18px 0 0;
  font-size: 19px;
  color: var(--ink-2);
}

.hundred {
  padding: 30px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.hundred__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
  font-weight: 600;
}

.hundred__top b {
  font-size: 34px;
  letter-spacing: -0.03em;
}

.hundred__bar {
  display: flex;
  height: 64px;
  gap: 3px;
}

.hundred__seg {
  position: relative;
  flex: 0 0 auto;
  width: calc(var(--w) * 1%);
  border-radius: 8px;
  transform-origin: left center;
}

.hundred__seg--fee {
  background: var(--ink);
}

.hundred__seg--tax {
  background: var(--red);
}

.hundred__seg--acq {
  background: var(--ink-4);
}

.hundred__seg--you {
  background: var(--marker);
  box-shadow: 0 0 0 1.5px rgba(19, 26, 51, 0.12) inset;
}

.hundred__legend {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  color: var(--ink-2);
}

.hundred__legend li {
  display: grid;
  gap: 2px;
}

.hundred__legend b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hundred__legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex: none;
}

.hundred__legend li:last-child b {
  font-size: 26px;
}

.hundred__foot {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
  font-size: 14.5px;
  color: var(--ink-3);
}

.js .hundred:not(.is-in) .hundred__seg {
  transform: scaleX(0);
}

.hundred .hundred__seg {
  transition: transform 700ms var(--ease-out);
  transition-delay: calc(var(--i) * 140ms);
}

/* ── Что вы увидите ── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  gap: 22px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.feature__visual {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 188px;
  /* снизу место под подпись «пример» — она в углу и макет не перекрывает */
  padding: 18px 18px 30px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}

/* Подпись «пример» (решение §11): мелкая, в правом нижнем углу. Селектор
   с .feature__visual — иначе его перебивает .feature > div > p ниже
   (тот же p лежит в div). Цвет --ink-3: --ink-4 для текста бледен. */
.feature__visual > .feature__example {
  position: absolute;
  right: 12px;
  bottom: 8px;
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.feature h3 {
  margin: 0 0 8px;
}

.feature > div:not(.feature__visual) > p:not(.benefit__note),
.feature .benefit__text {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
}

.feature .benefit__note {
  margin: 10px 0 0;
  color: var(--ink-3);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.mini-rows {
  display: grid;
  gap: 10px;
  font-size: 13.5px;
}

.mini-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
}

/* Общая нулевая ось: убытки влево, прибыль вправо, масштаб один. */
.mini-row__bar {
  --zero: calc(var(--min) / (var(--max) + var(--min)) * 100%);
  position: relative;
  height: 8px;
  background: linear-gradient(
    90deg,
    transparent calc(var(--zero) - 1px),
    var(--line-strong) calc(var(--zero) - 1px) calc(var(--zero) + 1px),
    transparent calc(var(--zero) + 1px)
  );
}

.mini-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

.mini-row i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--zero);
  width: calc(var(--v) / (var(--max) + var(--min)) * 100%);
  border-radius: 0 8px 8px 0;
  background: var(--green);
}

.mini-row i.neg {
  left: auto;
  right: calc(100% - var(--zero));
  border-radius: 8px 0 0 8px;
  background: var(--red);
}

.mini-row b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

.mini-row b.neg {
  color: var(--red-ink);
}

/* .ruler/.gauge — целиком раздел 1 (уже безразмерные custom properties,
   calc(var(--p0, 0) * 1%) и т. п.): здесь только используются классы,
   свою геометрию секция 2 не переопределяет. */

/* ── Где взять отчёт ── */

.howto-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.howto-step {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.howto-step__n {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.howto-step h3 {
  margin: 0;
}

.howto-step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
}

.howto-step__ui {
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13.5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 600;
  white-space: nowrap;
}

.chip--on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip--file {
  gap: 10px;
  padding: 8px 12px;
}

.chev {
  color: var(--ink-4);
}

/* ── Файл не остаётся у нас ── */

.trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.trust__item {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.trust__item svg {
  width: 30px;
  height: 30px;
  color: var(--marker);
}

.trust__item h3 {
  margin: 0;
  color: #fff;
}

.trust__item p {
  margin: 0;
  font-size: 16px;
}

/* ── Сколько стоит ── */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.plan__price b {
  font-size: 54px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.plan__price span {
  color: var(--ink-3);
  font-size: 17px;
}

.plan ul {
  display: grid;
  gap: 10px;
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
}

.plan li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
}

.plan li svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--green);
}

.plan > .btn {
  margin-top: auto;
}

/* Бейдж тарифа — компактный, а не на всю ширину карточки. */
.plan > .badge {
  align-self: flex-start;
  margin: 0;
  padding: 6px 11px;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.plan > .badge::before {
  display: none;
}

/* Тариф «Скоро» — тот же <details class="upsell">, что и раньше (класс не
   трогаем, тест ищет его дословно); вид карточки прайс-плана — только
   через .plans > .upsell, без добавления класса самому <details>.
   Как .plan--soon прототипа: светлая карточка с рамкой. Общие .upsell__*
   ниже (вне .plans их правит другой пакет) не меняются — здесь только
   перекрытия с .plans > .upsell в селекторе. */
.plans > .upsell {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.plans > .upsell > summary {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 32px;
  cursor: pointer;
  list-style: none;
}

.plans > .upsell > summary::-webkit-details-marker {
  display: none;
}

.plans > .upsell .upsell__copy {
  display: grid;
  gap: 12px;
  justify-items: start;
}

/* Бейдж «Скоро» — маркером, как .plan__badge--soon прототипа. */
.plans > .upsell .upsell__eyebrow {
  margin: 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--marker-soft);
  color: var(--color-warning);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.plans > .upsell .upsell__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.upsell__price {
  white-space: nowrap;
}

.plans > .upsell .upsell__text {
  max-width: none;
  color: var(--ink-2);
  font-size: 1rem;
}

/* Кнопка-приглашение внизу карточки — на одной линии с кнопкой соседнего
   тарифа (карточки одной высоты, у обеих margin-top: auto). */
.plans > .upsell .upsell__cta {
  margin-top: auto;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.plans > .upsell[open] .upsell__cta {
  background: transparent;
  box-shadow: 0 0 0 1.5px var(--ink) inset;
  color: var(--ink);
}

.plans > .upsell .upsell__body {
  display: grid;
  gap: 24px;
  padding: 22px 32px 32px;
  border-top: 1px solid var(--line-strong);
  background: transparent;
}

.plans > .upsell .upsell__body > p {
  margin: 0;
  color: var(--ink-2);
}

.plans > .upsell .btn {
  justify-self: start;
}

/* Форма листа ожидания на светлой карточке — как .wait-form прототипа:
   ошибка красным текстом без плашки (розовая подложка нужна только тёмному
   фону вне .plans), кнопка отправки чернильная, как .btn прототипа. */
.plans > .upsell .form-error {
  padding: 0;
  background: none;
}

/* Подсказка под кнопкой на светлой карточке: --ink-3 на --paper-2 даёт 4,19:1,
   --ink-2 — выше 4,5:1 (ревью 1, п. 1). */
.plans > .upsell .btn-hint {
  color: var(--ink-2);
}

.plans > .upsell .btn--accent {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .plans > .upsell .btn--accent:hover {
    background: #1e2748;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.12) inset,
      0 12px 26px -10px rgba(19, 26, 51, 0.6);
  }
}

/* Общие правила .upsell__* (вне .plans используются другим блоком). */
.upsell__eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--marker);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.upsell__title {
  display: block;
  margin-bottom: 7px;
  font-size: 1.3rem;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.028em;
}

.upsell__text {
  display: block;
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.875rem;
}

.upsell__cta {
  flex: none;
  padding: 11px 15px;
  border-radius: 11px;
  background: var(--marker);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

/* ── Частые вопросы ── */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.faq__head {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 18px;
}

.faq__head p:not(.eyebrow) {
  margin: 0;
  color: var(--ink-2);
}

.faq__contact {
  font-size: 1.0625rem;
}

.faq__head a {
  font-weight: 600;
}

/* Ответ не заходит под плюс: справа тот же отступ, что у кнопки в строке
   вопроса (30 px + зазор). */
.faq__list .qa__body p {
  padding-right: 48px;
}

.faq__list {
  display: grid;
  border-top: 1.5px solid var(--ink);
}

/* ── Финальный призыв ── */

.final {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 6vw, 80px);
  border-radius: 28px;
  background: var(--marker);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
}

.final::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 2px dashed rgba(19, 26, 51, 0.18);
}

.final h2 {
  margin: 0;
  max-width: 13em;
  color: var(--ink);
}

.final p {
  margin: 14px 0 0;
  font-size: 19px;
  color: rgba(19, 26, 51, 0.75);
}

.final .btn {
  position: relative;
  z-index: 1;
  min-height: 60px;
  padding: 0 30px;
  font-size: 17px;
}

/* .reveal/.is-in — целиком раздел 1 (появление секций при прокрутке,
   плюс увязка с обводкой .pen); секция 2 только отмечает классом. */

@media (max-width: 1049px) {
  .upload-card {
    max-width: 760px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "form" "proof" "art";
    grid-template-rows: none;
  }

  .hero__art {
    max-width: 460px;
    margin-top: 48px;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .gap-grid,
  .feature-grid,
  .howto-list,
  .trust,
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .gap-total {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 26px 22px;
  }

  .facts__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact b {
    font-size: 24px;
    white-space: nowrap;
  }

  .fact:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }

  .fact:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .faq {
    grid-template-columns: 1fr;
  }

  .faq__head {
    position: static;
  }

  .plans > .upsell .upsell__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .final {
    grid-template-columns: 1fr;
    padding: 36px 24px;
  }
}

/* Между 1050 и 1419px .hero снова двухколоночный (grid-template-columns
   выше), и колонка .hero__art теснее приёма плавающих .note: их left
   считает landing.js пикселями от правого края 460px-чека, и на таких
   промежуточных ширинах пометке за пределами колонки уже некуда деться —
   горизонтальная прокрутка (RC-report, найдено на 1280). Тот же приём,
   что на телефоне (см. @media 719px ниже): пометки печатаются прямо в
   чеке (.receipt__hand), плавающие .note спрятаны — дубля не будет.
   На 1420+ (в т.ч. 1440) колонка снова достаточно широкая — вид как в
   прототипе, это правило их не трогает. */
@media (min-width: 1050px) and (max-width: 1419px) {
  .hero__art .note {
    display: none;
  }

  .js .hero__art .receipt__hand {
    display: flex;
  }
}

@media (max-width: 719px) {
  /* Б57: на телефоне форма загрузки — сразу под заголовком (сохранено
     из прежней вёрстки). Порядок задаёт только показ: единственное на
     весь файл превращение колонки-обёртки в display: contents — ниже
     (test_phone_first_screen). */
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
    gap: 0;
    padding-top: 8px;
  }

  .hero__copy {
    display: contents;
  }

  .hero .eyebrow {
    order: 1;
  }

  .hero h1 {
    order: 2;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.038em;
  }

  .hero > .upload-card {
    order: 3;
    grid-area: unset;
    margin-bottom: 28px;
  }

  .hero__subtitle {
    order: 4;
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero .proof-list {
    order: 5;
    grid-area: unset;
  }

  .hero__art {
    order: 6;
    grid-area: unset;
    max-width: none;
    margin-top: 40px;
  }

  /* Значок файла — украшение: на телефоне его место нужнее полю выбора. */
  .upload-card .file-icon {
    display: none;
  }

  /* Зона на телефоне: тащить нечем, значка и заголовка зоны нет — кнопка
     на всю ширину (как в прототипе на 560 и уже). */
  .upload-drop--card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "body"
      "format"
      "pick"
      "field"
      "submit"
      "hint"
      "spinner";
    padding: 18px;
  }

  .js .upload-drop__format {
    margin-top: 0;
  }

  .upload-drop--card .file-pick {
    justify-self: stretch;
    margin-top: 14px;
  }

  .upload-card {
    padding: 16px;
  }

  /* Чек как в прототипе (≤560): бумага почти во всю ширину, подписи
     целиком. Щель шире колонки на 14 px с каждой стороны (тень чека),
     поле --gutter вокруг .hero это позволяет. */
  .hero__art .receipt {
    padding: 24px 16px 34px;
    font-size: 11.4px;
  }

  .hero__art .receipt__line {
    gap: 6px;
  }

  .hero__art .receipt__line--net {
    font-size: 12.4px;
  }

  .hero__art .receipt__line .pct {
    width: 3.9em;
  }

  .hero__art .receipt__foot {
    font-size: 11px;
  }

  .plan,
  .plans > .upsell > summary {
    padding: 24px 20px;
  }

  .plans > .upsell .upsell__body {
    padding: 20px;
  }

  /* «Каждые +100 ₽»: легенда 2×2, как в прототипе (≤560). minmax(0, 1fr):
     четыре колонки по содержимому на 360 вылезали за край. */
  .hundred {
    padding: 22px 18px;
  }

  .hundred__bar {
    height: 48px;
  }

  .hundred__legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: start;
    gap: 14px 20px;
  }

  .hero__art .note {
    display: none;
  }

  /* .note выше спрятан — без плавающих пометок обе реплики возвращаются
     в чек (там же, где и без скрипта, и без анимации печати: правило
     выше в этом разделе). */
  .js .hero__art .receipt__hand {
    display: flex;
  }

  .hero__caption {
    margin-top: 32px;
  }
}

/* На 360 и уже чек ужимается ещё на шаг, чтобы «Прибыль до налога» и
   цены безубыточности не резались многоточием и правым краем. */
@media (max-width: 380px) {
  .hero__art .receipt {
    padding: 22px 12px 32px;
    font-size: 10.4px;
  }

  .hero__art .receipt__line {
    gap: 4px;
  }

  .hero__art .receipt__line--net {
    font-size: 11.6px;
  }

  .hero__art .receipt__line .pct {
    width: 3.7em;
  }

  .hero__art .receipt__foot {
    font-size: 10.4px;
  }
}

/* ═══ 3. РЕЗУЛЬТАТ ═══
   Страница результата, таблица товаров, себестоимость и вставка
   из Excel, панели после таблицы + свои @media. */

/* ── Страница результата ── */

.result {
  gap: 18px;
}

/* Шапка результата (R-07): eyebrow с периодом, h1 56/36 px, строка
   «товары · строки · чип сверки»; справа налог, ниже — кнопки и период. */
.result-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title title"
    "actions tax";
  align-items: end;
  gap: 24px 40px;
  margin: 28px 0 8px;
}

.result-head__title {
  grid-area: title;
  min-width: 0;
}

.result-head .eyebrow {
  margin-bottom: 16px;
}

.result-head h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.038em;
}

.r-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: 16px 0 0;
  color: var(--ink-3);
  font-size: 0.90625rem;
}

/* Чекмарк сверки — раньше отдельным блочным <p> под карточками итогов,
   теперь рядом со счётчиком товаров в шапке (WP3b.md, п.1: период, число
   товаров и результат сверки — одной строкой). */
.reconcile {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 320px;
  max-width: 44em;
  color: var(--green-ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

.reconcile::before {
  content: "✓";
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--green-soft);
  font-size: 11px;
}

.result-head__note {
  margin: 10px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

/* ── Переключатель налога (WP3b.md, п.1) ──
   Настоящие радиокнопки (form="recalc-form", вне <form> в DOM — тот же
   приём, что у переключателя периода): вид сегмента даёт только
   :checked + label, без JS и без анимированного бегунка прототипа. */
.tax {
  grid-area: tax;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.tax__label {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.015em;
}

/* Сегмент как в прототипе: скруглённая плитка с внутренней рамкой; на
   телефоне — сетка 3 + 2, без «пузыря» из переносов (R-04). Радиокнопки
   visually-hidden вне потока, сеткой раскладываются только подписи. */
.seg {
  display: inline-flex;
  max-width: 100%;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.seg__label {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 0.90625rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .seg__label:hover {
    color: var(--ink);
  }
}

.seg__input:checked + .seg__label {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(19, 26, 51, 0.08), 0 0 0 1px rgba(19, 26, 51, 0.06);
}

.seg__input:focus-visible + .seg__label {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.result-head__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

/* ── Итог: карточка прибыли + раскладка «из каждых 100 ₽», чек магазина,
   три карточки прода (Выручка нетто/Рентабельность/ДРР) строкой ниже ──
   Б5, docs/reviews/2026-09-20-walkthrough.md: карточек прода — ровно три
   плюс главная, раскладка на каждой ширине задана явно, не «как получится».
   Наверху — области primary/receipt рядом, под ними — stats на всю ширину;
   .summary-stats — свой внутренний грид ровно с этими тремя карточками. */
.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-areas: "primary receipt";
  align-items: start;
  gap: 18px;
}

.summary-grid > .summary-card--primary {
  grid-area: primary;
}

.summary-grid > .store-receipt {
  grid-area: receipt;
}

/* Выручка нетто / Рентабельность / ДРР — строкой внутри главной карточки. */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 24px;
  margin-top: 22px;
}

.summary-stats .summary-card {
  padding: 0;
  border: 0;
  background: none;
  container-type: normal;
}

.summary-card--primary .summary-stats .summary-card__label {
  margin: 0 0 4px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 600;
}

.summary-card--primary .summary-stats .summary-card__value {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.summary-card--primary .summary-stats .summary-card__foot {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.summary-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--color-paper);
  /* container-type — чтобы .num--lg считал cqi от ширины именно этой
     карточки (Б32 выше); min-width: 0 — иначе число с nowrap распирает
     карточку шире её доли в сетке. */
  container-type: inline-size;
}

/* Главная карточка итога — белая, как .net-card прототипа (R-01). Класс
   summary-card--primary остаётся (на него опираются тесты и шаблон). */
.summary-card--primary {
  display: grid;
  align-content: start;
  padding: clamp(24px, 3vw, 36px);
  border: 0;
  border-radius: var(--r-lg);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-2);
}

.summary-card__label {
  margin: 0 0 14px;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.012em;
}

.summary-card__foot {
  margin: 12px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  line-height: 1.35;
}

.summary-card--primary .summary-card__label {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
}

.summary-card--primary .summary-card__foot {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.summary-card__value {
  margin: 0;
}

/* Сумма: 88 px на десктопе, ≈40–49 px на телефоне (cqi от ширины карточки:
   «123 456 789,00 ₽» должно влезть на 360 px, см. замер в отчёте R1).
   Не .num--lg — у него свой потолок cqi, который держит тест. */
.summary-card--primary .summary-card__value {
  margin: 14px 0 0;
  font-size: clamp(2.25rem, 14cqi, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
}

.net-card__num .kop {
  font-size: 0.48em;
  letter-spacing: -0.01em;
  color: var(--ink-3);
}

/* Минус — красным, маркер под ним бледно-красный (как .is-neg прототипа). */
.summary-card--primary .num--loss {
  color: var(--red-ink);
}

.summary-card--primary .num--loss .mark::before {
  background: var(--red-soft);
}

/* Себестоимость есть не у всех товаров: итог и производные — серым
   (--ink-3 на белом ≈ 4,9:1), без маркера. */
.num--pending,
.summary-card .num--pending,
.summary-card--primary .num--pending {
  color: var(--ink-3);
}

.net-card__pre {
  display: block;
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}

.ruble__you.is-pending b {
  color: var(--ink-3);
}

/* Раскладка «из каждых 100 ₽» — внутри главной карточки. Полоса рендерится
   с hidden (см. партиал): без JS видны только подписи и цифры легенды,
   геометрию сегментов (flex-grow) на них накладывает static/result.js
   через WAAPI, ничего не пишет в атрибуты. */
.ruble {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--line-strong);
}

.ruble__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 12px;
  margin: 0 0 14px;
}

.ruble__head p {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.ruble__you b {
  margin-left: 4px;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ruble__you.is-neg b {
  color: var(--red-ink);
}

.ruble__bar {
  display: flex;
  gap: 3px;
  height: 46px;
}

/* flex-basis: 0 — ширина каждого сегмента идёт только из flex-grow
   (result.js ставит его равным per_100, сумма всех per_100 — ровно 100
   по построению _per_100 в receipts.py); отрицательная прибыль при общем
   убытке магазина не может «сжать» полосу — известное упрощение, полоса
   в этом редком случае просто перераспределяет её между расходами. */
.ruble__seg {
  flex: 0 0 0;
  min-width: 3px;
  height: 100%;
  border-radius: 7px;
}

.ruble__seg[data-seg="ozon_fee"] {
  background: var(--ink);
}

.ruble__seg[data-seg="logistics"] {
  background: #3b4470;
}

.ruble__seg[data-seg="ads"] {
  background: #737a99;
}

.ruble__seg[data-seg="other"] {
  background: #b3b6c4;
}

.ruble__seg[data-seg="cogs"] {
  background: #d6c49c;
}

.ruble__seg[data-seg="tax"] {
  background: var(--red);
}

.ruble__seg[data-seg="profit"] {
  background: var(--marker);
}

.ruble__legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.84375rem;
  line-height: 1.3;
  color: var(--ink-3);
}

.ruble__legend li {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.ruble__legend b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 700;
  white-space: nowrap;
}

.ruble__swatch {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: currentColor;
}

.ruble__swatch[data-swatch="ozon_fee"] {
  color: var(--ink);
}

.ruble__swatch[data-swatch="logistics"] {
  color: #3b4470;
}

.ruble__swatch[data-swatch="ads"] {
  color: #737a99;
}

.ruble__swatch[data-swatch="other"] {
  color: #b3b6c4;
}

.ruble__swatch[data-swatch="cogs"] {
  color: #d6c49c;
}

.ruble__swatch[data-swatch="tax"] {
  color: var(--red);
}

.ruble__swatch[data-swatch="profit"] {
  color: var(--marker);
}

/* Чек магазина (R-10) — рядом с итоговой карточкой. Тень — drop-shadow на
   обёртке: у самого чека маска зубцов срезала бы box-shadow. */
.store-receipt {
  min-width: 0;
  filter: drop-shadow(0 16px 18px rgba(19, 26, 51, 0.13)) drop-shadow(0 2px 2px rgba(19, 26, 51, 0.07));
}

.store-receipt .receipt {
  padding-inline: 20px;
  border-radius: 4px 4px 0 0;
}

.store-receipt .receipt__line .pct {
  width: 3.7em;
}

.store-receipt .receipt__line::after {
  min-width: 6px;
}

.store-receipt .receipt__line--net {
  font-size: 13.5px;
}

.receipt__calc {
  margin: 0 0 2px 1.2em;
  font-size: 0.9em;
  color: #6a6f86;
}

.receipt__note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #6a6f86;
}

/* Пометка от руки — справа над «Себестоимостью», со стрелкой. */
.store-receipt .receipt__hand {
  justify-content: flex-end;
  gap: 4px;
  margin: 1px 0 3px;
  font-size: 21px;
  line-height: 1;
  transform-origin: right center;
}

.store-receipt .receipt__hand svg {
  width: 20px;
  height: 20px;
}

.store-receipt .receipt__stamp {
  margin-bottom: 4px;
}

/* «Шлёпок» печати (R-26): на первом показе после загрузки печать сверки
   ставится с поворотом и лёгким «ударом» после подсчёта суммы. Скрытое
   до анимации состояние — только под .js; при reduced motion раздел 4
   сводит длительность к нулю, и печать сразу в конечном виде. */
@keyframes stamp-hit {
  from {
    opacity: 0;
    transform: rotate(-9deg) scale(1.55);
  }

  60% {
    opacity: 1;
    transform: rotate(-2deg) scale(0.96);
  }

  to {
    opacity: 1;
    transform: rotate(-2.5deg) scale(1);
  }
}

.js .result--fresh .store-receipt .receipt__stamp {
  animation: stamp-hit 380ms var(--ease-print) 1100ms both;
}

/* Плашка про себестоимость (R-24): то же предложение, что уходит в
   предупреждения расчёта, — одной компактной строкой над карточкой итога
   (в разметке она обязана стоять раньше summary-grid, держит тест), справа
   счётчик «14 из 16» с полоской и ссылка на первое пустое поле. */
.cost-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--marker-soft);
  color: var(--color-warning-text);
}

.cost-banner__text {
  flex: 1 1 380px;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.cost-banner__text a {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.coverage {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 650;
}

.coverage__track {
  flex: none;
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(122, 91, 0, 0.16);
  overflow: hidden;
}

.coverage__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-warning);
}

/* ── «Главное» — три карточки (убыток / себестоимость / лидер) ── */

.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.insight__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-weight: 800;
}

.insight--loss .insight__icon {
  background: var(--color-loss-soft);
  color: var(--color-loss);
}

.insight--cost .insight__icon {
  background: var(--marker-soft);
  color: #7a5b00;
}

.insight--good .insight__icon {
  background: var(--green-soft);
  color: var(--green-ink);
}

.insight--unknown .insight__icon {
  background: var(--paper-2);
  color: var(--ink-2);
}

.insight--unknown .insight__title {
  margin: 0;
}

.insight--pending .insight__icon {
  background: var(--paper-2);
  color: var(--ink-2);
}

.insight--pending .insight__text,
.insight--pending .insight__text a {
  color: var(--ink-3);
}

.insight__title {
  display: block;
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.insight__text {
  display: block;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.insight__text a {
  font-weight: 700;
}

/* ── Обёртка секции с заголовком (убыточные / как посчитано) ── */

.r-block {
  display: grid;
  gap: 14px;
  margin-top: clamp(40px, 6vw, 72px);
}

.r-block__head {
  display: grid;
  gap: 10px;
  max-width: 740px;
  margin-bottom: 12px;
}

.r-block__head h2 {
  margin: 0;
}

.r-block__head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1.0625rem;
}

/* ── Что делать с убыточными: линейка цены или шкала ДРР ── */

.loss-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Карточка убытка (R-11): шапка «вид убытка / название / мета» слева, сумма
   минуса справа; внутри — линейка или шкала в рамке. */
.loss {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding: 24px 26px 26px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.loss__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.loss__top > div {
  min-width: 0;
}

.loss__why {
  margin: 0 0 8px;
  color: var(--red-ink);
  font-size: 0.78125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.loss h3 {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
}

.loss h3 a {
  color: inherit;
  text-decoration: none;
}

.loss,
.insight {
  transition: box-shadow 200ms ease;
}

/* R-22: отклик на наведение — только там, где есть мышь; на телефоне
   «залипшего» hover после касания не бывает. */
@media (hover: hover) and (pointer: fine) {
  .loss h3 a:hover,
  .loss a.pill:hover {
    text-decoration: underline;
  }

  .loss:hover,
  .insight:hover {
    box-shadow: var(--shadow-2);
  }

  .th-sort:hover {
    color: var(--ink);
  }
}

.loss__meta {
  margin: 4px 0 0;
  color: var(--ink-3);
  font: 500 0.78125rem/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.loss__sum {
  flex: none;
  color: var(--red-ink);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.loss .ruler,
.loss .gauge {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.loss .ruler__track {
  margin: 30px 6px 26px;
}

.loss__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.loss__also {
  margin: -6px 0 0;
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* Строки «сейчас / безубыточно» (R-05): подпись слева, сумма справа. Без JS
   это единственный способ показать числа; с JS (.is-live) их место занимают
   подписи на самой линейке, а строки остаются только для чтения с экрана. */
.ruler__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line-strong);
  color: var(--ink-2);
}

.ruler:not(.is-live) {
  gap: 0;
}

.ruler__row:last-of-type {
  border-bottom: 0;
}

.ruler__row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ruler.is-live .ruler__row {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.loss__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 14px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--marker);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Плашка-ссылка («Впишите себестоимость» в карточке убытка без с/с): подчёркивание
   у ссылки есть по умолчанию, у плашки его быть не должно. */
a.pill {
  text-decoration: none;
}

/* Шкала ДРР (R-12): в рамке, красная заливка до текущего ДРР, засечка
   потолка. Геометрию (--w/--c) ставит result.js через WAAPI. Заливка красная
   всегда: карточка «реклама выше потолка» существует, только когда ДРР
   выше потолка, поэтому цвет не зависит от чисел продавца. */
.loss .gauge {
  gap: 10px;
}

.loss .gauge__track {
  margin: 10px 0 8px;
}

.loss .gauge__track .gauge__fill {
  background: var(--red);
}

@media (max-width: 899px) {
  .loss-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 559px) {
  .loss {
    padding: 20px 18px 22px;
  }

  .loss__top {
    flex-direction: column;
    gap: 8px;
  }
}

/* ── Таблица товаров ──
   Как в прототипе: заголовок блока и подсказка без рамки, таблица — белая
   карточка с тенью, под ней подвал с «Пересчитать». */

.workspace {
  display: grid;
  gap: 16px;
  margin-top: clamp(40px, 6vw, 72px);
}

.workspace__bar {
  display: grid;
  gap: 10px;
  max-width: 740px;
}

.workspace__bar h2 {
  margin: 0;
}

.workspace__count {
  margin-left: 4px;
  color: var(--ink-3);
  font-size: 0.5em;
  font-weight: 650;
  letter-spacing: 0;
  vertical-align: 0.35em;
}

.workspace__hint {
  margin: 0;
  max-width: 740px;
  color: var(--ink-2);
  font-size: 1.0625rem;
}

/* ── Панель поиска/фильтров (WP3b.md, п.6) ──
   Вне #recalc-form: ничего не отправляет на сервер, только прячет строки
   таблицы JS-ом. hidden по умолчанию в разметке — result.js снимает его
   при загрузке; без JS панели на экране нет вовсе. */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
  min-width: 0;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.search input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 42px;
  border-radius: 12px;
  font-size: 0.9375rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--ink-2);
  font: 600 0.90625rem/1 var(--font);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.fchip b {
  color: var(--ink-3);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fchip:active {
  transform: scale(0.97);
}

.fchip.is-on {
  background: var(--ink);
  box-shadow: none;
  color: #fff;
}

.fchip.is-on b {
  color: var(--marker);
}

@media (hover: hover) and (pointer: fine) {
  .fchip:not(.is-on):hover {
    box-shadow: inset 0 0 0 1.5px var(--ink-3);
  }
}

.toolbar__paste {
  gap: 8px;
  margin-left: auto;
  white-space: nowrap;
}

.toolbar__paste svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.toolbar__paste[aria-expanded="true"] {
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Панель вставки под тулбаром: result.js переносит сюда section#paste-panel
   из блока ниже. Слева — пояснение и пример, справа — поле и итог. */
.paste-slot > .panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  grid-auto-flow: row;
  align-items: start;
  gap: 8px 24px;
  margin: 0;
  padding: 24px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.paste-slot > .panel > .field {
  display: contents;
}

.paste-slot .panel__title {
  grid-column: 1;
  margin: 0;
  font-size: 1.125rem;
}

.paste-slot .field > label,
.paste-slot .paste-example {
  grid-column: 1;
}

.paste-slot .field > label {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 400;
}

.paste-slot textarea {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-height: 132px;
  border-radius: 12px;
}

.paste-slot .field > .ym-hide-content,
.paste-slot .panel__actions {
  grid-column: 2;
}

.paste-slot .btn-hint {
  grid-column: 1;
  grid-row: 4 / span 2;
  margin: 8px 0 0;
}

/* Ревью 2, п. 3: панель в слоте на --paper-2, --ink-3 давал 4,19:1. */
.paste-slot .field__hint,
.paste-slot .btn-hint,
.paste-slot .paste-example {
  color: var(--ink-2);
}

.paste-slot[hidden] {
  display: none;
}

.empty {
  margin: 0;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--paper-2);
  color: var(--ink-2);
  text-align: center;
}

.workspace__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

#recalc-form {
  display: grid;
  gap: 16px;
}

.workspace__footer p {
  margin: 0;
}

.workspace__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.table-wrap {
  /* Страховка: если колонки всё же не сойдутся тютелька-в-тютельку (длинный
     артикул без пробелов и т.п.), едет сама таблица, а не вся страница. */
  overflow-x: auto;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  /* auto считал ширину колонки от её контента: «Товару» доставался минимум,
     а «Цена безубыточности» и статусы росли вплоть до переполнения таблицы
     за правый край (координатор, ревью на MarketWay, 20.09). fixed —
     ширины строго из <colgroup> ниже, не зависят от содержимого строк. */
  table-layout: fixed;
}

/* Одиннадцать колонок (R-14 + «Маржа»): товар, продано, выручка, к выплате,
   себестоимость, налог, прибыль, маржа, цена безубыточности, ДРР / потолок,
   статус. Ниже 1280 px «К выплате» и «Налог» уходят — их числа остаются
   в чеке товара, — а ниже 1100 px и «Маржа» (она и в чеке). Колонки, что
   остались, делят всю ширину: проценты каждого размера в сумме дают сто. */
table.data col:nth-child(1) {
  width: 14%;
}

table.data col:nth-child(2) {
  width: 5.5%;
}

table.data col:nth-child(3),
table.data col:nth-child(4),
table.data col:nth-child(9) {
  width: 8.5%;
}

table.data col:nth-child(5) {
  width: 9.5%;
}

table.data col:nth-child(6),
table.data col:nth-child(8) {
  width: 7%;
}

table.data col:nth-child(7) {
  width: 11%;
}

table.data col:nth-child(10) {
  width: 10%;
}

table.data col:nth-child(11) {
  width: 10.5%;
}

@media (min-width: 900px) and (max-width: 1279px) {
  table.data .col-payout,
  table.data .col-tax {
    display: none;
  }

  table.data col:nth-child(1) {
    width: 18.1%;
  }

  table.data col:nth-child(2) {
    width: 6.2%;
  }

  table.data col:nth-child(3) {
    width: 10.3%;
  }

  table.data col:nth-child(5) {
    width: 11%;
  }

  table.data col:nth-child(9) {
    width: 10.6%;
  }

  table.data col:nth-child(7) {
    width: 12.6%;
  }

  table.data col:nth-child(8) {
    width: 7.4%;
  }

  table.data col:nth-child(10) {
    width: 11.5%;
  }

  table.data col:nth-child(11) {
    width: 12.3%;
  }
}

/* 900–1099 px: как до «Маржи» — восемь колонок. Тут теснее всего (окно
   в пол-экрана монитора 1920 — 960 px): доли пересчитаны под самое узкое
   окно, 900 px, чтобы пилюля «нет себестоимости», «ДРР / потолок» и подпись
   «до себестоимости» не вылезали за свою колонку; боковые поля ячеек и
   пилюли для этого уже — ниже, рядом с их правилами. Сумма долей — сто. */
@media (min-width: 900px) and (max-width: 1099px) {
  table.data .col-margin {
    display: none;
  }

  table.data col:nth-child(1) {
    width: 19.9%;
  }

  table.data col:nth-child(2) {
    width: 6%;
  }

  table.data col:nth-child(3) {
    width: 9.2%;
  }

  table.data col:nth-child(5) {
    width: 11.1%;
  }

  table.data col:nth-child(9) {
    width: 10.6%;
  }

  table.data col:nth-child(7) {
    width: 13.3%;
  }

  table.data col:nth-child(10) {
    width: 14.4%;
  }

  table.data col:nth-child(11) {
    width: 15.5%;
  }
}

table.data caption {
  text-align: left;
}

table.data th {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-3);
  font-size: 0.78125rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  vertical-align: bottom;
}

table.data th.num {
  text-align: right;
}

/* Кнопка сортировки — вставляет result.js вокруг уже напечатанного текста
   заголовка (WP3b.md, п.7: «кнопки в th добавляет JS»); без JS шапка —
   обычный текст. Сброс до вида обычного th, стрелка — по aria-sort самого
   th, не хранит номер колонки нигде, кроме замыкания в JS. */
.th-sort {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  cursor: pointer;
}

table.data th.num .th-sort {
  justify-content: flex-end;
}

.th-sort::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 0 4px 2px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  opacity: 0.35;
  transform: translateY(-2px) rotate(45deg);
}

th[aria-sort="ascending"] .th-sort::after {
  opacity: 0.9;
  transform: translateY(2px) rotate(-135deg);
}

th[aria-sort="descending"] .th-sort::after {
  opacity: 0.9;
}

th[aria-sort="ascending"],
th[aria-sort="descending"] {
  color: var(--ink);
}

table.data td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

table.data td.num,
table.data th.num {
  text-align: right;
}

/* .num даёт числам nowrap — заголовку он мешает: «Цена безубыточности»
   (два слова) в колонке фиксированной ширины вылезала на соседнюю. */
table.data th.num {
  white-space: normal;
}

table.data th:first-child,
table.data td:first-child {
  padding-left: 14px;
}

/* Прибыль — главное число строки: жирным, минус красным (без цветной полосы
   и фона у строки — как в прототипе). */
table.data td[data-label="Прибыль"] {
  font-weight: 700;
}

table.data td.num--loss {
  color: var(--red-ink);
}

/* Переход по ссылке из «Что требует внимания» — строка подсвечена. */
table.data tr:target td {
  background: var(--marker-soft);
}

table.data tbody tr:not(.row-detail) {
  transition: background-color 120ms ease;
}

table.data tbody tr.is-open:not(.row-detail) {
  background: var(--paper);
}

/* Строку целиком можно кликнуть только с JS (он раскрывает чек). */
.js table.data tbody tr:not(.row-detail):has([data-row-toggle]:not([hidden])) {
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  table.data tbody tr:not(.row-detail):hover {
    background: #fdfcf7;
  }
}

/* Итого по магазину: итоги отчёта, а не сумма строк. */
table.data tfoot th,
table.data tfoot td {
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  vertical-align: top;
}

table.data tfoot th {
  font-size: inherit;
}

table.data tfoot .cell-sub {
  font-weight: 400;
}

/* «Товар» — самое длинное поле в таблице: без ограничения браузер при
   table-layout: fixed переносит по слову на строку и растягивает строку
   на пол-экрана. Клампим на 2 строки; полное название — в самой ячейке. */
.cell-name {
  position: relative;
}

table.data tbody td.cell-name {
  padding-left: 42px;
}

.cell-name .name-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-weight: 600;
}

/* Б3, docs/reviews/2026-09-20-walkthrough.md: длинный артикул Ozon (11+ цифр
   подряд, без единого пробела) не мог перенестись и вылезал за свою
   колонку. Правило нарочно висит только на артикуле: на всех ячейках оно
   рвало посреди слога обычные слова («Себестоим|ость»). */
.cell-offer {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* Шеврон раскрытия чека: кнопка в ячейке названия. Появляется с JS (hidden). */
.row-chev {
  position: absolute;
  left: 12px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: background-color 160ms ease;
}

.row-chev svg {
  width: 18px;
  height: 18px;
}

.row-chev[aria-expanded="true"] {
  color: var(--ink);
  transform: rotate(90deg);
}

@media (hover: hover) and (pointer: fine) {
  .row-chev:hover {
    background: var(--paper-2);
  }
}

/* Число и подпись под ним — один элемент. В карточке (узкий экран) ячейка —
   flex со space-between: без обёртки число и подпись разъезжались к разным
   краям, и подпись оказывалась там, где ждёшь число. */
.cell-value {
  display: inline-block;
}

.cell-sub {
  display: block;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
}

/* Без себестоимости прибыль показываем, но с пометкой: закупка не вычтена. */
table.data td .cell-value .cell-sub {
  color: #7a5b00;
  font-size: 0.71875rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Статус (с JS): одна красная пилюля-тревога на строку, повтор красного
   сворачивается (.badge--fold) и виден в раскрытии. Жёлтые и серые пометки —
   «ставка Ozon — оценка», «логистика до 28.08» и т. п. — объясняют, что число
   в строке оценка или неполное, поэтому остаются в строке на любой ширине.
   Без JS раскрывать нечем, поэтому там видны все. */
table.data td.cell-flags .badge {
  margin: 0;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.71875rem;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.js table.data tbody td.cell-flags .badge--fold {
  display: none;
}

/* 900–1099 px — самые узкие колонки (доли — выше, у <colgroup>). Поля
   ячеек 6 px вместо 10, а пилюля статуса компактнее (11 px, поля 6, зазор
   до точки 4): иначе слово «себестоимости» (88 px) вылезало за жёлтую
   пилюлю, а «ДРР / потолок» заходило на соседнюю колонку. */
@media (min-width: 900px) and (max-width: 1099px) {
  table.data th,
  table.data td {
    padding-right: 6px;
  }

  table.data th:not(:first-child),
  table.data td:not(:first-child) {
    padding-left: 6px;
  }

  table.data td.cell-flags .badge {
    gap: 4px;
    padding: 3px 6px;
    font-size: 0.6875rem;
  }
}

/* ДРР / потолок + мини-шкала (размер даёт result.js через WAAPI). */
.drr-cell {
  font-variant-numeric: tabular-nums;
}

.drr-cell--over {
  color: var(--red-ink);
  font-weight: 700;
}

.drr-mini {
  position: relative;
  display: block;
  width: 86px;
  height: 6px;
  margin: 6px 0 0 auto;
  border-radius: 6px;
  background: var(--paper-3);
}

.drr-mini i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--w) * 1%);
  border-radius: 6px;
  background: var(--ink-2);
}

.drr-mini em {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: calc(var(--c) * 1%);
  width: 2px;
  border-radius: 2px;
  background: var(--red);
}

.drr-cell--over + .drr-mini i {
  background: var(--red);
}

/* Ссылка «Чек товара» — видна только на телефоне (см. @media 899px). */
.row-detail__toggle {
  display: none;
}

/* ── Раскрытая строка — чек товара + линейка/шкала (R-15) ──
   Рендерится сервером внутри hidden <tr>; result.js снимает hidden и
   плавно раскрывает .row-detail__wrap (WAAPI, при reduced motion — сразу). */
tr.row-detail td {
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.row-detail__wrap {
  overflow: hidden;
}

/* Значения, не влезающие в телефонную карточку, — только на телефоне с JS
   (см. @media 899px); на широком экране те же числа уже в колонках. */
.row-detail__facts {
  display: none;
}

/* На широком экране числа уже в колонках, а полный список пометок товара —
   только здесь: показываем один «Статус». */
@media (min-width: 900px) {
  .js .row-detail__facts {
    display: block;
    margin: 0;
    padding: 12px 24px 0 42px;
  }

  .js .row-detail__facts > div:not(.row-detail__flags) {
    display: none;
  }

  .js .row-detail__facts .row-detail__flags {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
  }

  .js .row-detail__facts .row-detail__flags dt {
    color: var(--ink-2);
    font-size: 0.8125rem;
  }

  .js .row-detail__facts .row-detail__flags dd {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
  }
}

.row-detail__in {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 28px;
  padding: 10px 24px 28px 42px;
}

.row-detail__in .receipt {
  margin: 0;
  font-size: 12.5px;
}

.row-detail__side {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-top: 6px;
}

.row-detail__side h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

/* Линейка и шкала — в рамке, как в прототипе. */
.row-detail__side .ruler,
.row-detail__side .gauge {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.row-detail__side .ruler__track {
  margin: 30px 6px 26px;
}

.row-detail__muted {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.90625rem;
}

/* Совет — белая карточка с цветной полосой слева (красная — убыток,
   зелёная — в плюсе). Цвет не единственный носитель смысла: текст совета
   говорит то же самое словами. */
.row-detail__advice {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.45;
}

.row-detail__advice.is-bad {
  border-left-color: var(--red);
  background: var(--card);
  color: var(--ink-2);
}

.row-detail__advice.is-good {
  border-left-color: var(--green);
  background: var(--card);
  color: var(--ink-2);
}

@media (min-width: 900px) and (max-width: 1180px) {
  .row-detail__in {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    padding-left: 24px;
  }
}

/* ── Себестоимость в строке и вставка из Excel (W2) ── */

.cost-cell {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  width: 7.5em;
  max-width: 100%;
}

/* Знак ₽ внутри поля, как в прототипе; сам знак не часть значения. */
.cost-cell::after {
  content: "₽";
  position: absolute;
  top: 0;
  right: 11px;
  height: 38px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  line-height: 38px;
  pointer-events: none;
}

input.cost-input {
  width: 100%;
  max-width: 7.5em;
  min-height: 38px;
  height: 38px;
  padding: 0 26px 0 9px;
  border-radius: 10px;
  text-align: right;
  font-weight: 620;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Пустое поле — янтарная рамка: с ним прибыль строки ещё не итоговая. */
input.cost-input--empty {
  border-color: var(--color-warning);
  border-style: dashed;
  background: var(--marker-soft);
}

/* Б21: вписанное, но не принятое значение остаётся в поле — рамкой и
   подписью под ним видно, что оно не в расчёте. Одного цвета мало: рядом
   стоят обычные числа, и дальтоник отличит поле только по толщине рамки,
   а читающий с экрана — по aria-invalid и подписи. */
input.cost-input--bad {
  border-color: var(--color-loss);
  border-width: 2px;
  background: var(--color-loss-soft);
}

.cost-input__error {
  display: block;
  margin-top: 4px;
  color: var(--color-loss);
  font-size: 0.75rem;
  font-weight: 650;
  text-align: right;
  white-space: normal;
}

/* Пример вставки — две ячейки в ряд, как столбцы в Excel, а не рамка
   поля: иначе он читался вторым полем над настоящим. */
.paste-example {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 12px;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.paste-example table {
  border-collapse: collapse;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.paste-example td {
  padding: 3px 12px;
  border: 1px solid var(--color-line);
}

.paste-example td + td {
  text-align: right;
}

.field__error-list {
  margin: 6px 0 0;
  padding-left: 1.1em;
  color: var(--color-loss);
  font-size: 0.8125rem;
}

/* Б49: артикулы вставки, которых нет в отчёте. Обычно это не ошибка, а товары
   без начислений в файле, — поэтому свёрнуто и спокойным цветом. */
.paste-absent {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.paste-absent > summary {
  font-weight: 650;
}

.paste-absent__list {
  margin: 6px 0 0;
  padding-left: 1.1em;
}

/* Б29: «Расходы магазина вне товаров» — начисления без товара и без
   отправления. Без них итог в шапке не сходился с таблицей, и найти разницу
   было негде. Сумма видна сразу в строке-заголовке, разбивка — по клику.
   Двухколоночный список, а не table.data: тот ниже 900px раскладывается
   в карточки по data-label, которых здесь нет и быть не должно. */
.cabinet-costs {
  padding: 0 24px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.cabinet-costs > summary {
  min-height: 56px;
  padding: 14px 0;
  font-size: 0.9375rem;
}

.cabinet-costs__total {
  margin-left: auto;
}

/* Нативное мгновенное раскрытие: без анимации и зависимости от JS. */

/* Тело: пояснение слева, чек справа (как карточка и чек магазина выше);
   на узком экране друг под другом. */
.cabinet-costs__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 2px 0 24px;
}

.cabinet-costs__body .field__hint {
  margin: 0;
  max-width: 40em;
}

/* Чек расходов вне товаров: тот же .receipt, что чек магазина, только
   строки — dt/dd (список подпись-сумма), а не span. Подписи не режем:
   переносятся по словам. */
.cabinet-receipt {
  width: 100%;
  max-width: 440px;
  padding-top: 18px;
  background-color: var(--receipt);
}

.cabinet-receipt__list {
  display: grid;
  gap: 6px;
  margin: 0;
}

.cabinet-receipt .receipt__line > dt {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.cabinet-receipt .receipt__line > dd {
  margin: 0;
}

.cabinet-receipt .receipt__line--total {
  font-size: 14px;
}

.cabinet-receipt .receipt__rule:first-child {
  margin-top: 0;
}

@media (min-width: 900px) {
  .cabinet-costs__body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    align-items: start;
    column-gap: 40px;
  }
}

/* Нижний блок (R-17): вставка без JS, письмо и «Считать автоматически» —
   одна сетка, как .r-bottom прототипа. Письмо слева шире, карточка тарифа
   справа. Ни письма, ни вставки (JS перенёс её наверх) — карточка тарифа
   одна, на всю строку. Вставка без письма (как на проде) занимает
   левую колонку и не растягивается на всю ширину. */
.r-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
  column-gap: 18px;
  row-gap: 0;
  margin-top: clamp(40px, 6vw, 72px);
}

.r-bottom > .after-table {
  display: contents;
}

.r-bottom > .after-table:not(:has(*)) + .upsell {
  grid-column: 1 / -1;
}

.r-bottom:not(:has(.after-table > *)) > .upsell {
  grid-column: 1 / -1;
}

.r-bottom > details.upsell,
.r-bottom > :not(.plans) > .upsell {
  margin-top: 0;
}

/* Без JS вставка и письмо в левой колонке друг под другом. */
.after-table > .panel {
  grid-column: 1;
  margin: 0;
}

.after-table > .panel--wide {
  max-width: none;
}

/* Ряд под письмом пуст, когда вставку унёс JS: зазор между рядами не нужен,
   иначе карточка тарифа (два ряда) выше письма на 18 px. */
.r-bottom > .after-table > .panel + .panel {
  margin-top: 18px;
}

.r-bottom > .upsell {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: stretch;
}

.r-bottom:not(:has(.mail-card)):not(:has(.panel--wide)) > .upsell {
  grid-column: 1 / -1;
  grid-row: auto;
}

/* ── Получить полный отчёт: плашка-вложение и строка «email + кнопка» ── */

.mail-card {
  gap: 14px;
  padding: clamp(24px, 3vw, 34px);
  border: 0;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.mail-card .panel__title {
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  line-height: 1.1;
}

.mail-card .panel__text {
  margin: 0;
  color: var(--ink-2);
}

.attach {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  font-size: 0.9375rem;
}

.attach__badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 40px;
  border-radius: 6px;
  background: var(--green-ink);
  color: #fff;
  font: 700 0.625rem/1 var(--mono);
  letter-spacing: 0;
}

.attach b {
  display: block;
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.attach small {
  display: block;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 400;
}

.mail-form {
  gap: 12px;
  margin-top: 6px;
}

.mail-form__row {
  display: flex;
  gap: 10px;
}

.mail-form__row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.mail-form__row .btn {
  flex: none;
  white-space: nowrap;
}

/* Ревью 3, п. 5: пока письмо уходит (SMTP ждёт до 40 с), кнопка недоступна
   (hx-disabled-elt, стиль .btn[disabled]) и в ней крутится кружок — слов нет,
   только тот же .spinner-приём, что у «Считаем…». */
.btn__spinner {
  display: none;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 800ms linear infinite;
}

.mail-form.htmx-request .btn__spinner {
  display: inline-block;
}

/* После отправки письма (М2): адрес под сообщением и «Исправить адрес и
   отправить снова» раскрывашкой — с JS и без него одинаково. */
.mail-done {
  display: grid;
  gap: 14px;
}

.mail-done__addr {
  margin: 8px 0 0;
  color: var(--green-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mail-again > summary {
  text-align: center;
  width: fit-content;
  max-width: 100%;
  list-style: none;
  cursor: pointer;
}

.mail-again > summary::-webkit-details-marker {
  display: none;
}

.mail-again .mail-form {
  margin-top: 14px;
}

@media (max-width: 559px) {
  .mail-form__row {
    flex-direction: column;
  }

  .mail-form__row .btn {
    width: 100%;
  }
}

@media (max-width: 899px) {
  .r-bottom {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 18px;
  }

  .r-bottom > .after-table > .panel + .panel {
    margin-top: 0;
  }

  .r-bottom > .upsell,
  .r-bottom:not(:has(.mail-card)):not(:has(.panel--wide)) > .upsell {
    grid-column: 1;
    grid-row: auto;
  }
}

/* ── «Как посчитано» — переиспользует .qa/.r-block фундамента ── */

.how__list {
  display: grid;
  max-width: 860px;
  border-top: 1.5px solid var(--ink);
}

/* Отступ перед блоком «Посчитать другой отчёт» под «Как посчитано» (R-18). */
.r-block.how {
  margin-bottom: clamp(40px, 6vw, 72px);
}

@media (max-width: 1049px) {
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "primary"
      "receipt";
  }

  .store-receipt {
    width: min(100%, 440px);
    justify-self: center;
  }

  /* Шапка расчёта в одну колонку: заголовок, налог, кнопки и период — каждый
     в своей строке, налог по левому краю. */
  .result-head {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "tax"
      "actions";
    align-items: start;
  }

  .tax {
    align-items: flex-start;
  }

  .result-head__actions .field--period {
    flex: 1 1 260px;
    min-width: 0;
  }

  .result-head__actions .field--period select {
    width: 100%;
  }
}

/* Карточками — всё, что уже не тянет таблицу: до 900px восемь колонок не
   помещаются, и строка превращается в кашу из переносов. Раньше порог был
   640px — между 640 и 900 (планшет, окно в половину экрана) как раз и жило
   то нечитаемое состояние. */
@media (max-width: 899px) {
  .ruble__legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paste-slot > .panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px;
  }

  .paste-slot .panel__title,
  .paste-slot .field > label,
  .paste-slot .paste-example,
  .paste-slot textarea,
  .paste-slot .field > .ym-hide-content,
  .paste-slot .panel__actions,
  .paste-slot .btn-hint {
    grid-column: 1;
    grid-row: auto;
  }

  .table-wrap {
    overflow: visible;
    background: none;
    box-shadow: none;
  }

  table.data thead {
    display: none;
  }

  table.data,
  table.data tbody,
  table.data tr,
  table.data td {
    display: block;
    width: 100%;
  }

  table.data tr {
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: var(--color-surface);
  }

  table.data tbody tr:last-child {
    margin-bottom: 0;
  }

  table.data td,
  table.data tbody tr:last-child td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 14px;
    border-bottom: 0;
    text-align: right;
  }

  table.data td::before {
    content: attr(data-label);
    flex: none;
    max-width: 55%;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
  }

  table.data td.cell-name,
  table.data tbody tr:last-child td.cell-name {
    display: block;
    padding: 13px 14px;
    border-bottom: 1px solid var(--color-line);
    text-align: left;
  }

  table.data td.cell-name::before {
    content: none;
    display: none;
  }

  /* Б30: в карточке ячейка — flex-строка «подпись слева, значение справа»,
     и трём бейджам доставалась половина из 375 px. Они сжимались до ширины
     слога, и «убыток» разрывался на «убы|ток». Флагам ширина нужна вся:
     подпись уходит на свою строку, бейджи переносятся под ней. Кнопка
     «Чек товара» — тот же случай, что и бейдж: колонка не должна прятать
     ячейку, пока в ней есть на что нажать (WP3b.md, п.7). */
  table.data td.cell-flags {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  table.data td.cell-flags::before {
    max-width: none;
  }

  table.data td.cell-flags:not(:has(.badge)):not(:has(.row-detail__toggle)) {
    display: none;
  }

  /* Раскрытая строка чека — той же карточкой, вплотную под товаром: без
     своей рамки и с одной колонкой вместо чека и советов рядом. */
  table.data tr.row-detail {
    margin: -12px 0 12px;
    border-top: 0;
    border-radius: 0 0 14px 14px;
  }

  table.data tr.row-detail td {
    display: block;
    padding: 0;
    text-align: left;
  }

  table.data tr.row-detail td::before {
    content: none;
  }

  .row-detail__in {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px 16px;
  }

  table.data tbody td.cell-name {
    padding-left: 14px;
  }

  .row-chev {
    display: none;
  }

  table.data tfoot,
  table.data tfoot th {
    display: block;
    width: 100%;
  }

  table.data tfoot tr {
    margin: 12px 0 0;
  }

  table.data tfoot th {
    padding: 13px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  table.data tfoot td[aria-hidden="true"] {
    display: none;
  }

  /* R-16: компактная карточка товара (≈170 px) — название, шт. и выручка
     мелко, прибыль справа, себестоимость с полем и «Чек товара» ссылкой.
     Только с JS и только у строк, где есть что раскрыть: остальные числа
     (к выплате, налог, цена безубыточности, ДРР, статус) лежат в раскрытии
     (.row-detail__facts). Без JS остаётся полная карточка выше. */
  .js table.data tbody tr:not(.row-detail):has(.row-detail__toggle:not([hidden])) {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "name name name profit"
      "units rev . margin"
      "cost cost cost cost"
      "more more more more";
    align-items: center;
    column-gap: 0;
    padding: 14px 14px 4px;
  }

  .js table.data tbody tr:not(.row-detail):has(.row-detail__toggle:not([hidden])) td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .js tr:not(.row-detail):has(.row-detail__toggle:not([hidden])) td::before {
    content: none;
    display: none;
  }

  .js table.data tbody tr:not(.row-detail):has(.row-detail__toggle:not([hidden])) td[data-label="К выплате"],
  .js table.data tbody tr:not(.row-detail):has(.row-detail__toggle:not([hidden])) td[data-label="Налог"],
  .js table.data tbody tr:not(.row-detail):has(.row-detail__toggle:not([hidden])) td[data-label="Цена безубыточности"],
  .js table.data tbody tr:not(.row-detail):has(.row-detail__toggle:not([hidden])) td[data-label="ДРР / потолок"] {
    display: none;
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td.cell-name {
    grid-area: name;
    padding-bottom: 4px;
    border: 0;
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td[data-label="Продано, шт"] {
    grid-area: units;
    color: var(--ink-3);
    font-size: 0.8125rem;
    text-align: left;
  }

  .js tr:has(.row-detail__toggle:not([hidden])) td[data-label="Продано, шт"]::after {
    content: "\00a0шт.";
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td[data-label="Выручка нетто"] {
    grid-area: rev;
    margin-left: 6px;
    color: var(--ink-3);
    font-size: 0.8125rem;
    text-align: left;
  }

  .js tr:has(.row-detail__toggle:not([hidden])) td[data-label="Выручка нетто"]::before {
    content: "·\00a0";
    display: inline;
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td[data-label="Прибыль"] {
    grid-area: profit;
    align-self: start;
    font-size: 1.1875rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: right;
  }

  /* «Маржа» — мелкой строкой в ряду «шт. · выручка», справа; у товара без
     себестоимости маржи нет, и строка не показывается вовсе. */
  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td[data-label="Маржа"] {
    grid-area: margin;
    align-self: center;
    margin-left: 12px;
    color: var(--ink-3);
    font-size: 0.8125rem;
    text-align: right;
  }

  .js tr:has(.row-detail__toggle:not([hidden])) td[data-label="Маржа"]::before {
    content: "маржа\00a0";
    display: inline;
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td[data-label="Маржа"].num--loss {
    color: var(--red-ink);
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td[data-label="Маржа"].is-empty {
    display: none;
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td[data-label="Себестоимость, ₽/шт"] {
    grid-area: cost;
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    text-align: left;
  }

  .js tr:has(.row-detail__toggle:not([hidden])) td[data-label="Себестоимость, ₽/шт"]::before {
    content: "Себестоимость";
    display: block;
    max-width: none;
    color: var(--ink-2);
    font-size: 0.875rem;
    font-weight: 400;
  }

  .js table.data tbody tr:has(.row-detail__toggle:not([hidden])) td.cell-flags {
    grid-area: more;
    align-self: stretch;
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding-left: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
  }

  /* Пометки-оценки остаются в карточке, «Чек товара» уходит вправо. */
  .js tr:has(.row-detail__toggle:not([hidden])) td.cell-flags .row-detail__toggle {
    margin-left: auto;
  }

  .js .row-detail__toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: -8px 0 -8px;
    padding: 0 0 2px;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
  }

  .js .row-detail__toggle .row-detail__label {
    border-bottom: 2px solid var(--marker);
  }

  .js table.data tr:has(.row-detail__toggle:not([hidden])).is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .js .row-detail__facts {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 16px 16px 0;
  }

  .js .row-detail__facts > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }

  .js .row-detail__facts dt {
    color: var(--ink-3);
    font-size: 0.8125rem;
  }

  .js .row-detail__facts dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: right;
  }

  .js .row-detail__facts .row-detail__flags dd {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
  }
}

/* Флаги товара в раскрытии (текстом, без класса .badge: тесты считают
   пилюли «в прибыли» в самой строке). */
.row-detail__flag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.row-detail__flag.is-loss {
  background: var(--red-soft);
  color: var(--red-ink);
}

.row-detail__flag.is-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.row-detail__flag.is-good {
  background: var(--green-soft);
  color: var(--green-ink);
}

@media (max-width: 719px) {
  .result-head__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-head__actions .field--period {
    grid-column: 1 / -1;
  }

  /* Пункты периода длиннее строки телефона («Новый тариф, с 28.08.2026:
     28.08.2026–20.09.2026» ≈ 415 px при 274–304 px под текст) и обрезались
     многоточием (проход 28.09, Б5). Текст пунктов не трогаем: закрытому
     списку разрешён перенос на вторую строку, высота растёт по тексту. */
  .result-head__actions .field--period select {
    width: 100%;
    height: auto;
    padding-block: 9px;
    line-height: 1.3;
    white-space: normal;
  }

  .result-head__actions .btn:only-of-type {
    grid-column: 1 / -1;
  }

  .summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-stats .summary-card--wide-on-phone {
    grid-column: 1 / -1;
  }

  .summary-card {
    padding: 16px;
  }

  .summary-card--primary {
    padding: 24px;
  }

  .tax {
    align-items: stretch;
  }

  .seg {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .seg__label {
    grid-column: span 2;
    min-height: 44px;
    padding: 0 6px;
    font-size: 0.875rem;
  }

  .seg__label:nth-of-type(n + 4) {
    grid-column: span 3;
  }

  .store-receipt .receipt {
    padding: 24px 16px 34px;
    font-size: 11.4px;
  }

  .store-receipt .receipt__line {
    gap: 6px;
  }

  .store-receipt .receipt__line--net {
    font-size: 12.4px;
  }

  .store-receipt .receipt__line .pct {
    width: 3.9em;
  }

  .ruble__bar {
    height: 38px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  /* В колонке flex-basis 240 стал бы высотой поля — под ним была дыра ≈200 px. */
  .search {
    flex: none;
    max-width: none;
  }

  .fchip {
    min-height: 44px;
  }

  .toolbar__paste {
    justify-content: center;
    margin-left: 0;
    min-height: 44px;
  }

  .cabinet-costs {
    padding: 0 16px;
  }
}

/* фундамент: подписи строк чека не режем многоточием (R-10). Тексты подписей
   — прода дословно («Вознаграждение Ozon», «Предварительная прибыль»), поэтому
   на узком чеке они переносятся по словам, а не обрезаются. */
.receipt__line > span:first-child {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* фундамент: карточка «Считать автоматически» (partials/upsell.html) вне
   .plans — на результате и на «Отчёт в пути» (R-03, S-07). В разделе 2 её
   вид задан только через `.plans > .upsell`; здесь тот же вид для всех
   остальных мест. `:not(.plans) > .upsell` не пересекается с правилами
   главной и не ломается, если их переделают. Тёмная карточка, как
   .upsell-card прототипа: бейдж «Скоро», цена жёлтым, кнопка-маркер. */
:not(.plans) > .upsell {
  display: flex;
  flex-direction: column;
  margin-top: clamp(24px, 4vw, 48px);
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-2);
}

:not(.plans) > .upsell :focus-visible {
  outline-color: var(--marker);
}

:not(.plans) > .upsell > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding: clamp(22px, 3vw, 34px);
  cursor: pointer;
  list-style: none;
}

:not(.plans) > .upsell > summary::-webkit-details-marker {
  display: none;
}

:not(.plans) > .upsell .upsell__copy {
  flex: 1 1 320px;
  min-width: 0;
}

:not(.plans) > .upsell .upsell__eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--marker);
  color: var(--ink);
  letter-spacing: 0.06em;
}

:not(.plans) > .upsell .upsell__title {
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
}

:not(.plans) > .upsell .upsell__text {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
}

:not(.plans) > .upsell .upsell__cta {
  padding: 13px 20px;
  border-radius: var(--r);
}

:not(.plans) > .upsell[open] .upsell__cta {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

:not(.plans) > .upsell .upsell__body {
  display: grid;
  gap: 24px;
  padding: 22px clamp(22px, 3vw, 34px) 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(0, 0, 0, 0.08);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

:not(.plans) > .upsell .upsell__body > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

:not(.plans) > .upsell .field label {
  color: #fff;
}

:not(.plans) > .upsell input[type="email"] {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

:not(.plans) > .upsell .checkbox-field label,
:not(.plans) > .upsell .btn-hint {
  color: rgba(255, 255, 255, 0.72);
}

:not(.plans) > .upsell .checkbox-field a {
  color: #fff;
}

:not(.plans) > .upsell .btn {
  justify-self: start;
}

@media (max-width: 719px) {
  :not(.plans) > .upsell > summary {
    padding: 22px 18px;
  }

  :not(.plans) > .upsell .upsell__cta {
    flex: 1 1 100%;
    text-align: center;
  }
}
/* фундамент: :focus-visible (раздел 1) ставит всем border-radius: 6px, и
   на фокусе чип, кнопка или шеврон меняли форму, а обводка шла по чужому
   радиусу (R-25). Возвращаем каждому его собственный радиус. */
.fchip:focus-visible {
  border-radius: 999px;
}

.btn:focus-visible {
  border-radius: 14px;
}

.row-chev:focus-visible {
  border-radius: 8px;
}

.attach:focus-visible,
.qa summary:focus-visible {
  border-radius: 14px;
}

/* R-23: цели касания на телефоне ≥ 44 px — поле себестоимости в строке. */
@media (max-width: 899px) {
  input.cost-input {
    min-height: 44px;
    height: 44px;
  }

  .cost-cell::after {
    line-height: 44px;
  }
}

/* ═══ 4. ДВИЖЕНИЕ ═══ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    /* Без сброса delay каскад секций (--rd, раздел 1, до 450ms) всё ещё
       появлялся бы по одной — «мгновенно, но по очереди», а не разом. */
    animation-delay: 0ms !important;
    transition-delay: 0ms !important;
  }

  .spinner {
    animation: none;
  }
}
