/* Статья «Контроль остатков конкурентов». Каркас — `.story__*` в v2.css,
   здесь только её собственные блоки. */

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

/* ── Шапка: дата и кнопка ──────────────────────────────────────────────── */

.article-head__meta { margin-top: 18px; color: #FFFFFF73; font-size: 13px; letter-spacing: 0.2px; }

.head-cta { display: flex; align-items: center; gap: 16px; margin-top: 28px; }

.head-cta .btn { padding: 12px 20px; font-size: 14.5px; }

.head-cta__note { color: #FFFFFF73; font-size: 12.5px; }

/* ── Кнопки внутри текста ──────────────────────────────────────────────── */

.invite { margin-top: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 24px 26px; }

.article__text .invite__title { margin: 0; color: var(--ink); font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -0.3px; }

.article__text .invite__text { margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }

.invite .try { margin-top: 18px; }

.try { display: flex; align-items: center; gap: 16px; margin-top: 28px; }

.try .btn { padding: 12px 20px; font-size: 14.5px; }

.try__note { color: var(--ink-2); font-size: 13px; }

.article__text .try .btn,
.article__text .switch .btn { text-decoration: none; }

.article__text .try .btn--dark { color: #FFFFFF; }

.article__text .switch .btn--white { color: var(--ink); }

.article__text .switch .btn--outline { color: #FFFFFF; }

/* ── Метки событий ─────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.badge svg { flex: none; width: 14px; height: 14px; }

.badge--in { background: var(--ok-bg); color: var(--ok-fg); }

.badge--out { background: var(--down-bg); color: var(--down-fg); }

.badge--price { background: #FDF3E3; color: #B36B00; }

/* ── Тёмные врезки: общая шапка ────────────────────────────────────────── */

.signals,
.deficit,
.diff {
    display: flex;
    flex-direction: column;
    gap: 32px;
    border-radius: 16px;
    background: var(--dark);
    padding: 44px 48px;
    color: #FFFFFF;
}

.signals__kicker,
.deficit__kicker,
.diff__kicker { color: #FFFFFF73; font-size: 12px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; }

.signals__title,
.deficit__title,
.diff__title { margin-top: 10px; font-size: 30px; letter-spacing: -0.8px; }

.deficit__title,
.diff__title { margin-top: -22px; }

/* ── Три истории одного статуса ────────────────────────────────────────── */

.signals__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

.signals__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; color: #FFFFFF99; font-size: 13px; list-style: none; }

.signals__legend li { display: flex; align-items: center; gap: 8px; }

.signals__legend .signals__cell { width: 14px; height: 14px; border-radius: 3px; }

.signals__grid { width: 100%; border-collapse: separate; border-spacing: 6px 10px; margin: -10px -6px; table-layout: fixed; }

.signals__grid th { font-weight: 400; text-align: left; }

.signals__grid thead th { vertical-align: bottom; color: #FFFFFF59; font-size: 12px; text-align: center; }

.signals__grid thead th:first-child { width: 300px; }

.signals__grid thead .signals__today { color: #FFFFFF; font-weight: 500; }

.signals__grid tbody th b { display: block; font-size: 15px; font-weight: 500; }

.signals__grid tbody th span { display: block; margin-top: 3px; color: #FFFFFF73; font-size: 13px; }

.signals__grid td { padding: 0; }

.signals__cell { display: block; height: 36px; border-radius: 5px; }

.signals__cell--in { background: #FFFFFFD9; }

.signals__cell--out { box-shadow: inset 0 0 0 1px #FFFFFF4D; }

.signals__cell--today.signals__cell--out { box-shadow: inset 0 0 0 2px #FFFFFF; }

.signals__outcome { display: flex; gap: 40px; border-top: 1px solid #FFFFFF26; padding-top: 20px; }

.signals__outcome p { flex: 1; font-size: 16px; line-height: 1.5; }

.signals__outcome span {
    display: block;
    margin-bottom: 6px;
    color: #FFFFFF73;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Цена без наличия ──────────────────────────────────────────────────── */

.offers {
    flex: none;
    width: 520px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    padding: 24px 28px 12px;
    box-shadow: 0 20px 50px #1717171A;
}

.offers__name { font-size: 17px; font-weight: 500; }

.offers__sub { margin-top: 4px; color: var(--ink-2); font-size: 13px; }

.offers__table { width: 100%; margin-top: 16px; border-collapse: collapse; }

.offers__table th,
.offers__table td { border-top: 1px solid var(--line); padding: 16px 0; font-size: 15px; text-align: left; vertical-align: middle; }

.offers__table th { font-weight: 400; }

.offers__table th span { display: block; margin-top: 3px; color: var(--ink-2); font-size: 12.5px; }

.offers__mine th { font-weight: 600; }

.offers__table .offers__price { padding: 16px; font-size: 16px; font-weight: 500; white-space: nowrap; }

.offers__price--gone { color: var(--ink-3); text-decoration: line-through; }

.offers__table .offers__state { text-align: right; }

.offers__kicker { color: var(--ink-2); font-size: 12px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; }

.offers__title { margin-top: 10px; font-size: 28px; line-height: 1.2; letter-spacing: -0.7px; }

/* ── Дефицит: столбцы по дням ──────────────────────────────────────────── */

/* Высота столбца — число конкурентов из разметки, умноженное на шаг. Не
   проценты: от высоты ряда их отъели бы подписи над и под столбцом. */
.deficit__chart {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.deficit__chart li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }

.deficit__value { color: #FFFFFF99; font-size: 14px; font-weight: 500; }

.deficit__bar { width: 100%; height: calc(var(--shops) * 36px); border-radius: 6px; background: #FFFFFF40; }

.deficit__day { color: #FFFFFF73; font-size: 12.5px; }

.deficit__last .deficit__value { color: #FFFFFF; }

.deficit__last .deficit__bar { background: #FFFFFF; }

/* ── Наличие и цена: три сочетания ─────────────────────────────────────── */

.combos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }

.combos section { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 18px; }

.article__text .combos p { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.45; }

.combos svg { flex: none; width: 16px; height: 16px; }

.article__text .combos .combos__note { display: block; margin: 10px 0 0; color: var(--ink-2); font-size: 14.5px; font-weight: 400; line-height: 1.5; }

/* ── Таблица показателей ───────────────────────────────────────────────── */

.fields { margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

.fields table { width: 100%; border-collapse: collapse; }

.fields thead th {
    background: #FAFAF8;
    padding: 12px 20px;
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: left;
    text-transform: uppercase;
}

.fields tbody th,
.fields td { border-top: 1px solid var(--line); padding: 13px 20px; font-size: 15.5px; text-align: left; vertical-align: top; }

.fields tbody th { width: 40%; font-weight: 500; }

.fields td { color: #171717B3; }

/* ── Четыре сценария ───────────────────────────────────────────────────── */

.scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }

.scenarios section { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 22px; }

.article__text .scenarios .scenarios__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.scenarios__top svg { width: 18px; height: 18px; color: var(--ink); }

.article__text .scenarios h3 { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -0.2px; }

.article__text .scenarios p { margin: 0; color: var(--ink); font-size: 14.5px; line-height: 1.5; }

.scenarios p span { display: block; margin-bottom: 2px; color: var(--ink-2); font-size: 13px; }

/* ── Счёт ручной проверки ──────────────────────────────────────────────── */

.tally { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 48px 64px; }

.tally__kicker { color: var(--ink-2); font-size: 12px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; }

.tally__title { margin-top: 10px; font-size: 30px; letter-spacing: -0.8px; }

.tally__row { display: flex; align-items: center; gap: 20px; margin: 36px 0 0; }

.tally__row div { flex: 1; padding: 22px 0; }

.tally__row dt { font-size: 44px; line-height: 1.1; letter-spacing: -1.4px; white-space: nowrap; }

.tally__row dd { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }

.tally__op { color: var(--ink-3); font-size: 34px; }

.tally__row .tally__total { flex: 1.4; border-radius: 12px; background: var(--ink); padding: 22px 24px; color: #FFFFFF; }

.tally__total dt { font-size: 48px; }

.tally__total dd { color: #FFFFFF99; }

/* ── Вчера, сегодня и разница ──────────────────────────────────────────── */

.diff__row { display: flex; align-items: center; gap: 20px; }

/* Подпись таблицы стоит вне её рамки, а заголовок должен быть внутри
   карточки: подпись выносится наверх абсолютом, место под неё — отступом. */
.diff__check {
    position: relative;
    flex: 1;
    min-width: 0;
    border: 1px solid #FFFFFF26;
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    padding: 44px 18px 6px;
}

.diff__check caption {
    position: absolute;
    top: 0;
    left: 0;
    padding: 16px 18px 12px;
    color: #FFFFFF73;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: left;
    text-transform: uppercase;
}

.diff__check th,
.diff__check td { border-top: 1px solid #FFFFFF1A; padding: 10px 0; font-size: 13.5px; text-align: left; white-space: nowrap; }

.diff__check th { color: #FFFFFF; font-size: 14px; font-weight: 400; }

.diff__check td { padding-left: 10px; color: #FFFFFFB3; }

.diff__check .diff__state { color: #FFFFFFD9; font-size: 12.5px; text-align: right; }

.diff__check .diff__state--out { color: #FF8A80; }

.diff__check .diff__state--none { color: #FFFFFF59; }

.diff__arrow { flex: none; width: 20px; height: 20px; color: #FFFFFF73; }

.diff__result { flex: none; width: 300px; border-radius: 12px; background: var(--surface); padding: 16px 18px 18px; color: var(--ink); }

.diff__label { color: var(--ink-2); font-size: 11.5px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }

.diff__result ul { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }

.diff__result li { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 14px; }

.diff__result .badge { padding: 4px 10px; font-size: 12.5px; }

.diff__result .badge svg { width: 13px; height: 13px; }

/* ── Пять шагов ────────────────────────────────────────────────────────── */

.article__text .flow { gap: 0; margin-top: 12px; }

.article__text .flow > li { gap: 20px; border-top: 1px solid var(--line); padding: 14px 0; }

.article__text .flow > li:first-child { border-top: 0; }

.article__text .flow > li::before { width: 28px; color: var(--ink-3); font-size: 15px; content: "0" counter(article-item); }

.article__text .flow > li > div { gap: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }

.flow b { color: var(--ink); font-size: 17px; font-weight: 500; }

/* ── Группы товаров ────────────────────────────────────────────────────── */

.article__text .groups { flex-direction: row; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.article__text .groups li { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 7px 16px; color: var(--ink); font-size: 15px; line-height: 1.4; }

.article__text .groups li::before { content: none; }

/* ── Заголовки с иконкой ───────────────────────────────────────────────── */

.article__text .icon-h { display: flex; align-items: center; gap: 10px; }

.icon-h svg { flex: none; width: 20px; height: 20px; }

/* ── Одна цена — четыре смысла ─────────────────────────────────────────── */

.article__text .one-price { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }

.article__text .one-price li {
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 16px;
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.45;
}

.article__text .one-price li::before { content: none; }

.one-price b { color: var(--ink); font-size: 22px; font-weight: 500; letter-spacing: -0.5px; line-height: 1.2; }

.one-price span { margin: 8px 0 2px; color: var(--ink); font-size: 14px; font-weight: 500; }

/* ── Видно и не видно ──────────────────────────────────────────────────── */

.seen { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }

.seen section { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 22px; }

.article__text .seen h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; letter-spacing: -0.2px; }

.seen h3 svg { flex: none; width: 17px; height: 17px; }

.seen__yes { color: var(--ok-fg); }

.seen__no { color: var(--down-fg); }

.article__text .seen ul { gap: 8px; margin-top: 14px; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }

/* ── Два ответа на один вопрос ─────────────────────────────────────────── */

.answers { display: flex; flex-direction: column; gap: 28px; padding: 16px 72px; }

.answers__row { display: flex; align-items: flex-start; gap: 32px; }

.answers__label {
    flex: none;
    width: 180px;
    padding-top: 18px;
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.answers__label span { display: block; margin-top: 4px; color: var(--ink-3); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }

.answers__label--on { color: var(--ink); }

.answers__card {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 18px 22px;
    color: var(--ink-2);
    font-size: 20px;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.answers__card--on { border: 1.5px solid var(--ink); padding-bottom: 22px; color: var(--ink); box-shadow: 0 16px 40px #1717171A; }

.answers__scale { display: flex; gap: 4px; margin: 18px 0 0; padding: 0; list-style: none; }

.answers__scale li {
    flex-basis: 0;
    min-width: 0;
    color: var(--ink-2);
    font-size: 12.5px;
    letter-spacing: 0;
    line-height: 1.4;
}

.answers__scale li::before { content: ""; display: block; height: 14px; margin-bottom: 8px; border-radius: 4px; background: var(--ink); }

.answers__scale b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 500; }

.answers__scale .answers__out::before { box-shadow: inset 0 0 0 1px var(--ink-3); background: var(--surface); }

.answers__scale .answers__back { color: #B36B00; }

.answers__scale .answers__back::before { background: #C77700; }

/* ── Призыв в конце текста ─────────────────────────────────────────────── */

.switch {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
    border-radius: 14px;
    background: var(--dark);
    padding: 28px;
    color: #FFFFFF;
}

.article__text .switch__title { margin: 0; color: #FFFFFF; font-size: 22px; font-weight: 400; line-height: 1.3; letter-spacing: -0.5px; }

.article__text .switch__text { max-width: 560px; margin: 0; color: #FFFFFF99; font-size: 14.5px; line-height: 1.6; }

.switch__buttons { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

.article__text .switch__note { margin: 0; color: #FFFFFF73; font-size: 12.5px; }

.article__text .switch__request {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    border-top: 1px solid #FFFFFF26;
    padding-top: 16px;
    color: #FFFFFF99;
    font-size: 13.5px;
    line-height: 1.5;
}

.switch__request svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }

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

.qa { margin-top: 18px; border-bottom: 1px solid var(--line); }

.qa__item { border-top: 1px solid var(--line); }

.qa__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
    list-style: none;
    cursor: pointer;
}

.qa__q::-webkit-details-marker { display: none; }

.qa__i { flex: none; width: 18px; height: 18px; color: var(--ink-2); transition: transform 0.2s var(--ease); }

.qa__item[open] .qa__i { transform: rotate(45deg); }

.qa__a { margin-top: -8px; padding-bottom: 20px; color: #171717B3; font-size: 15.5px; line-height: 1.65; }

/* ── Планшет ───────────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
    .signals,
    .deficit,
    .diff { padding: 36px 32px; }

    .tally { padding: 36px 32px; }

    .signals__head { flex-direction: column; align-items: flex-start; }

    .signals__grid thead th:first-child { width: 160px; }

    .offers { align-self: center; max-width: 100%; }

    .diff__row { flex-direction: column; align-items: stretch; }

    .diff__check { width: 100%; }

    .diff__arrow { align-self: center; transform: rotate(90deg); }

    .diff__result { width: auto; }

    .answers { padding: 16px 0; }

    .answers__row { flex-direction: column; gap: 10px; }

    .answers__label { width: auto; padding-top: 0; }

    .answers__card { width: 100%; }

    .article__text .one-price { grid-template-columns: 1fr 1fr; }
}

/* ── Телефон ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .invite { padding: 20px 18px; }

    .article__text .invite__title { font-size: 17px; }

    .head-cta,
    .try { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }

    .head-cta .btn,
    .try .btn { justify-content: center; padding: 13px 18px; font-size: 15px; }

    .signals,
    .deficit,
    .diff { gap: 20px; border-radius: 14px; padding: 28px 20px 24px; }

    .deficit__title,
    .diff__title { margin-top: -10px; }

    .signals__title,
    .deficit__title,
    .diff__title,
    .tally__title,
    .offers__title { font-size: 22px; line-height: 1.25; letter-spacing: -0.5px; }

    .signals__legend { font-size: 12px; }

    /* Две недели в строку не помещаются: имя товара уходит над его днями,
       номера дней остаются одной строкой сверху. */
    .signals__grid,
    .signals__grid thead,
    .signals__grid tbody { display: block; }

    .signals__grid { margin: 0; }

    .signals__grid thead tr,
    .signals__grid tbody tr { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }

    .signals__grid tbody tr { margin-top: 14px; row-gap: 6px; }

    .signals__grid thead th:first-child { display: none; }

    .signals__grid thead th { font-size: 10px; }

    .signals__grid thead .signals__today { font-size: 0; }

    .signals__grid thead .signals__today::after { content: "↓"; font-size: 12px; }

    .signals__grid tbody th { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }

    .signals__grid tbody th b { font-size: 14px; }

    .signals__grid tbody th span { margin: 0; font-size: 12px; }

    .signals__cell { height: 26px; border-radius: 3px; }

    .signals__outcome { flex-direction: column; gap: 14px; padding-top: 16px; }

    .signals__outcome p { font-size: 15px; }

    .offers { width: 100%; padding: 18px 18px 6px; }

    .offers__table th,
    .offers__table td { font-size: 14px; }

    .offers__table .offers__price { padding: 14px 8px; font-size: 14.5px; }

    .offers .badge { padding: 5px 9px; font-size: 12px; }

    .deficit__chart { gap: 6px; }

    .deficit__bar { height: calc(var(--shops) * 26px); border-radius: 4px; }

    .deficit__value { font-size: 11px; white-space: nowrap; }

    .deficit__day { font-size: 11.5px; }

    .combos,
    .scenarios,
    .seen { grid-template-columns: 1fr; }

    .scenarios section,
    .seen section { padding: 18px; }

    .fields thead { display: none; }

    .fields tr { display: block; border-top: 1px solid var(--line); padding: 12px 16px; }

    .fields tbody tr:first-child { border-top: 0; }

    .fields tbody th,
    .fields td { display: block; width: auto; border: 0; padding: 0; font-size: 15px; }

    .fields td { margin-top: 2px; font-size: 14px; }

    .tally { border-radius: 14px; padding: 28px 20px 24px; }

    .tally__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-top: 20px; }

    .tally__op { display: none; }

    .tally__row div { padding: 0; }

    .tally__row dt { font-size: 32px; }

    .tally__row dd { font-size: 12.5px; }

    .tally__row .tally__total { grid-column: 1 / -1; padding: 18px 20px; }

    .tally__total dt { font-size: 38px; }

    .diff__check { padding: 40px 14px 4px; }

    .diff__check caption { padding: 14px 14px 10px; }

    .diff__check th { font-size: 13px; white-space: normal; }

    .diff__check td { font-size: 12.5px; }

    .diff__check .diff__state { font-size: 11.5px; }

    .article__text .one-price { gap: 8px; }

    .article__text .one-price li { padding: 14px; }

    .one-price b { font-size: 19px; }

    .answers__card { padding: 16px 18px; font-size: 17px; }

    .answers__scale li { font-size: 11.5px; }

    .answers__scale b { font-size: 12.5px; }

    .switch { border-radius: 16px; padding: 28px 22px 24px; }

    .switch__buttons { flex-direction: column; }

    .switch__buttons .btn { justify-content: center; padding: 13px 18px; }

    .qa__q { align-items: flex-start; padding: 16px 0; font-size: 15.5px; }

    .qa__a { font-size: 14.5px; }
}
