/* Телефон: «Соинвест», «Позиции», карточка позиции, новый товар.
   Только правила внутри @media (max-width: 640px): компьютерный вид не меняется. */
@media (max-width: 640px) {

  /* ---------- Обёртка раздела ---------- */
  section[data-pane="own"] .ownpanel { padding-top: 16px; }

  /* ---------- Соинвест: заголовок и сводки ---------- */
  section[data-pane="own"] .pagehead { flex-direction: column; align-items: stretch; gap: 14px;
                                        margin: 6px 4px 16px; }
  section[data-pane="own"] .pagetitle { font-size: 36px; }
  section[data-pane="own"] .stats { flex-direction: column; gap: 10px; }
  section[data-pane="own"] .stat { width: auto; flex: none; padding: 14px 16px; gap: 6px; }
  section[data-pane="own"] .stat-value { font-size: 36px; }
  section[data-pane="own"] .stat:not(.soinv-card) { flex-direction: row; align-items: center; }
  section[data-pane="own"] .stat:not(.soinv-card) .stat-value { margin-top: 0; }

  /* Добавление товара: поле во всю ширину, кнопки режимов — ровным рядом под ним. */
  section[data-pane="own"] .panelbar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  section[data-pane="own"] .panelbar h2 { flex: 1 1 100%; margin: 0 0 2px; }
  section[data-pane="own"] .panelbar .addform { flex: 1 1 100%; gap: 8px; flex-wrap: nowrap; }
  section[data-pane="own"] .panelbar .addform input { font-size: 16px; min-height: 44px; min-width: 0; }
  section[data-pane="own"] .panelbar .addform button { min-height: 44px; padding: 0 16px; }
  section[data-pane="own"] .panelbar .pickmode { flex: 1 1 auto; min-height: 40px; padding: 8px 12px;
                                                 font-size: 13px; }
  /* Подсказки каталога — во всю ширину формы, а не только поля. */
  section[data-pane="own"] .panelbar .addform { position: relative; }
  section[data-pane="own"] .panelbar .addform .ac { position: static; }
  section[data-pane="own"] .ac-list { max-height: 50vh; }
  section[data-pane="own"] .ac-text .sku { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  section[data-pane="own"] .ac-item { min-height: 48px; }

  section[data-pane="own"] .bulkbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  section[data-pane="own"] .bulkbar .count { flex: 1 1 100%; }
  section[data-pane="own"] .bulkbar .spacer { display: none; }
  section[data-pane="own"] .bulkbar button { flex: 1 1 0; min-height: 40px; padding: 8px 10px; }

  /* ---------- Соинвест: таблица → карточка на товар ---------- */
  #own, #own > tbody { display: block; width: 100%; }
  /* Шапка остаётся рядом пилюль сортировки: без неё порядок не поменять. */
  #own > thead { display: block; }
  #own > thead tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
                  margin-bottom: 10px; }
  #own > thead th { display: none; }
  #own > thead th.sortable { display: inline-flex; align-items: center; gap: 2px; width: auto;
                           justify-content: center; min-height: 38px; padding: 6px 4px;
                           border-radius: var(--r-pill); background: var(--card); font-size: 12px; color: var(--text-2);
                           white-space: nowrap; }
  #own > thead th.sortable .sar { display: none; }
  #own > thead th.sortable.asc .sar, #own > thead th.sortable.desc .sar { display: inline-block; }
  #own > thead th.sortable.asc, #own > thead th.sortable.desc {
    background: var(--accent-soft); color: var(--accent); }

  /* Карточка: товар слева, справа крестик и график суток; ниже три числа,
     соинвест — самым широким и крупным. */
  #own tr.product { display: grid; margin-bottom: 8px;
                    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(80px, auto);
                    grid-template-areas: "prod prod del" "prod prod spark" "seller green diff";
                    column-gap: 8px; row-gap: 4px; padding: 12px 10px;
                    background: var(--card); border-radius: var(--r-row); }
  #own tr.product:hover { background: var(--card-hover); }
  #own tr.product td, #own tr.product:hover td, #own tr.product.picked td {
    display: block; width: auto; padding: 0; background: none; border-radius: 0; box-shadow: none;
    font-size: 15px; min-width: 0; }
  #own tr.product td:nth-child(2) { grid-area: prod; align-self: center; }
  #own tr.product td:nth-child(3) { grid-area: seller; }
  #own tr.product td:nth-child(4) { grid-area: green; }
  #own tr.product td:nth-child(5) { grid-area: spark; align-self: end; }
  #own tr.product td:nth-child(6) { grid-area: diff; }
  #own tr.product td.actions { grid-area: del; justify-self: end; margin: -6px -6px 0 0; }
  #own tr.product td:nth-child(3), #own tr.product td:nth-child(4),
  #own tr.product td:nth-child(6) { margin-top: 8px; padding-top: 10px;
                                     border-top: 1px solid var(--line); }
  #own tr.product td.num { text-align: left; font-size: clamp(12px, 3.5vw, 14px); white-space: nowrap;
                           overflow: hidden; text-overflow: ellipsis; }
  #own tr.product td.num::before { display: block; margin-bottom: 2px; font-size: 11px;
                                   font-weight: 500; color: var(--muted-2); }
  #own tr.product td:nth-child(3)::before { content: "Моя цена"; }
  #own tr.product td:nth-child(4)::before { content: "Зелёная"; }
  #own tr.product td:nth-child(6)::before { content: "Соинвест"; text-align: right; }
  /* Главное число строки — соинвест: крупнее остальных. */
  #own tr.product td:nth-child(6) { font-size: 17px; font-weight: 600; text-align: right; }
  #own tr.product td.c .spark24-box { align-items: flex-end; }
  #own tr.product td.c .spark24 { margin: 0; }
  #own tr.product td.c .spark-axis.mini { margin: 1px 0 0; }
  #own tr.product .del { width: 40px; height: 40px; padding: 0; }
  /* Заглушка фото внутри ссылки — строчный span, без блока он схлопывался в черту. */
  section[data-pane="own"] .thumb-link > span.thumb,
  section[data-pane="pos"] .thumb-link > span.thumb { display: block; }
  #own tr.product .thumb.sm { width: 39px; height: 52px; border-radius: 9px; }
  #own tr.product .pcell-row { gap: 10px; }
  #own tr.product .pname { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
                           -webkit-box-orient: vertical; line-height: 1.3; }
  #own tr.product .pcell .sku { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #own tr.product .own-out { margin: 8px 0 0; display: inline-block; }
  #own tr.product.paused td { opacity: 1; }
  #own tr.product.paused { opacity: .6; }

  /* Режим выбора: кружок слева от карточки, отметка — полоской акцента. */
  #own td.pick { display: none; }
  #own.picking tr.product { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) minmax(80px, auto);
                            grid-template-areas: "pick prod prod del" "pick prod prod spark"
                                                 "pick seller green diff"; }
  #own.picking tr.product td.pick { display: flex; grid-area: pick; align-items: center;
                                    width: auto; padding: 0; }
  #own tr.product.picked { background: rgba(52,211,153,.12); box-shadow: inset 3px 0 0 var(--accent-2); }

  /* Каркас загрузки и пустое состояние */
  #own tr.skeleton-tr { display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
                        padding: 12px; background: var(--card); border-radius: var(--r-row); }
  #own tr.skeleton-tr td { display: block; padding: 0; background: none; }
  #own tr.skeleton-tr td:first-child { flex: 1; min-width: 0; }
  #own tr.skeleton-tr td.num ~ td.num, #own tr.skeleton-tr td.actions { display: none; }
  #own > tbody > tr:not(.product):not(.detail):not(.skeleton-tr) { display: block; }
  #own > tbody > tr:not(.product):not(.detail):not(.skeleton-tr) > td { display: block; padding: 0; }
  section[data-pane="own"] .emptystate { padding: 28px 18px; gap: 12px; }
  section[data-pane="own"] .emptystate-title { font-size: 20px; }
  section[data-pane="own"] .emptystate .primary { min-height: 44px; }

  /* ---------- История замеров под карточкой ---------- */
  #own tr.detail { display: block; margin: -2px 0 10px; }
  #own tr.detail > td { display: block; padding: 0; }
  #own .detail-inner { padding: 4px 0; }
  #own details.day { margin-bottom: 6px; }
  #own details.day > summary { flex-wrap: wrap; gap: 4px 10px; min-height: 44px; padding: 8px 4px; }
  #own .dcell.date { flex: 1 1 calc(100% - 24px); }
  #own .dcell.avg { width: auto; text-align: left; font-size: 13px; }
  #own .dcell.count { width: auto; margin-left: auto; }
  :is(#own, #own-day-modal) .hist, :is(#own, #own-day-modal) .hist thead, :is(#own, #own-day-modal) .hist tbody { display: block; width: 100%; }
  :is(#own, #own-day-modal) .hist colgroup { display: none; }
  /* Замер: время и три числа в ряд; статус — строкой ниже и только когда он
     не «собрано», затем комментарий во всю ширину. */
  :is(#own, #own-day-modal) .hist tr { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) minmax(56px, auto);
                  column-gap: 6px; align-items: center; }
  :is(#own, #own-day-modal) .hist th:nth-child(5) { display: none; }
  :is(#own, #own-day-modal) .hist td:nth-child(5) { grid-column: 1 / -1; }
  :is(#own, #own-day-modal) .hist td:nth-child(5):has(.badge.ok) { display: none; }
  :is(#own, #own-day-modal) .hist td:nth-child(4), :is(#own, #own-day-modal) .hist th:nth-child(4) { text-align: right; }
  :is(#own, #own-day-modal) .hist thead tr { padding: 0 8px 6px; }
  :is(#own, #own-day-modal) .hist thead th { padding: 0; font-size: 11px; }
  :is(#own, #own-day-modal) .hist thead th:last-child { display: none; }
  :is(#own, #own-day-modal) .hist tbody tr { margin-bottom: 6px; padding: 10px 8px; row-gap: 8px;
                        background: var(--card); border-radius: var(--r-row); }
  :is(#own, #own-day-modal) .hist td.hcell, :is(#own, #own-day-modal) .hist th.hcell { text-align: left; }
  :is(#own, #own-day-modal) .hist td { display: block; padding: 0; background: none; border-radius: 0;
                  font-size: clamp(12px, 3.4vw, 13px); min-width: 0; white-space: nowrap; overflow: hidden;
                  text-overflow: ellipsis; }
  :is(#own, #own-day-modal) .hist td.hcomment { grid-column: 1 / -1; white-space: normal; overflow: visible; }
  :is(#own, #own-day-modal) .hist td.hcomment .comments { gap: 6px; }
  :is(#own, #own-day-modal) .hist .comment { display: flex; width: 100%; align-items: flex-start; }
  :is(#own, #own-day-modal) .hist .comment-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  :is(#own, #own-day-modal) .hist .comment-del { width: 40px; height: 40px; flex: none; }
  :is(#own, #own-day-modal) .hist td.hcomment .cform { display: flex; gap: 6px; }
  :is(#own, #own-day-modal) .hist td.hcomment .cform input { font-size: 16px; min-height: 40px; }
  :is(#own, #own-day-modal) .hist td.hcomment .cform button { width: 44px; height: 40px; }

  /* Подсказка графиков: на касание — полосой сверху, а не у пальца, где её
     закрывает палец и где длинный текст уходил за край экрана. */
  .spark-tip { left: 12px !important; right: 12px; top: calc(env(safe-area-inset-top) + 12px) !important;
               white-space: normal; text-align: center; line-height: 1.4; }

  /* ---------- Позиции: шапка списка ---------- */
  #pos-list .panelhead { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  #pos-list .panelhead h2 { flex: 1 1 100%; margin: 0 0 2px; }
  #pos-list .panelhead .spacer { display: none; }
  #pos-list .panelhead .budget { min-height: 40px; display: inline-flex; align-items: center; }
  #pos-list #kw-add-toggle { flex: 1 1 auto; min-height: 40px; }
  #pos-list .rulesbtn { width: 40px; height: 40px; }
  #pos-list .notice, #pos-list .poscapacity { padding: 12px 14px; }
  #add-kw { gap: 8px; }
  #add-kw > * { flex: 1 1 100% !important; }
  #add-kw input, #add-kw select { font-size: 16px; min-height: 44px; }

  /* Сортировка списка — пилюлями вместо заголовков колонок. */
  #pos-list .poshead { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; }
  #pos-list .poshead > div { display: none; }
  #pos-list .poshead > .sortable { display: inline-flex; align-items: center; gap: 2px;
                                   min-height: 36px; padding: 6px 12px; border-radius: var(--r-pill);
                                   background: var(--card); font-size: 12.5px; color: var(--text-2); }
  #pos-list .poshead > .sortable.asc, #pos-list .poshead > .sortable.desc {
    background: var(--accent-soft); color: var(--accent); }

  /* Строка товара → карточка: товар, график недели во всю ширину, сводка снизу. */
  #pos-rows .posrow { position: relative; gap: 4px 10px; padding: 12px; margin-bottom: 8px;
                      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
                      grid-template-areas: "prod prod prod prod" "spark spark spark spark"
                                           "start region count go"; }
  #pos-rows .posrow .posprod { grid-area: prod; padding-right: 36px; }
  #pos-rows .posrow .spark-slot { grid-area: spark; margin-top: 6px; min-width: 0; }
  #pos-rows .posrow > :nth-child(3) { grid-area: start; }
  #pos-rows .posrow > :nth-child(4) { grid-area: region; }
  #pos-rows .posrow > .count { grid-area: count; }
  #pos-rows .posrow > .go { grid-area: go; align-self: end; padding-bottom: 2px; }
  #pos-rows .posrow > .c { text-align: left; min-width: 0; overflow: hidden;
                           text-overflow: ellipsis; white-space: nowrap; }
  #pos-rows .posrow > .count { font-size: 14px; }
  #pos-rows .posrow > :nth-child(3)::before, #pos-rows .posrow > :nth-child(4)::before,
  #pos-rows .posrow > .count::before { display: block; font-size: 11px; font-weight: 500;
                                       color: var(--muted-2); }
  #pos-rows .posrow > :nth-child(3)::before { content: "Начало сбора"; }
  #pos-rows .posrow > :nth-child(4)::before { content: "Локация"; }
  #pos-rows .posrow > .count::before { content: "Запросов"; }
  #pos-rows .posrow .drop { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px;
                            opacity: 1; }
  #pos-rows .posrow .pname { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
                             -webkit-box-orient: vertical; line-height: 1.3; }
  #pos-rows .posrow .pcell .sku { white-space: normal; overflow-wrap: anywhere; }
  section[data-pane="pos"] .copyable-icon { opacity: .5; }
  #pos-rows .spark svg { width: 100%; height: auto; }
  #pos-rows .spark-slot > .small { display: block; padding: 4px 0; }
  #pos-rows .skeleton-row { margin-bottom: 8px; }

  /* ---------- Карточка позиции ---------- */
  #pos-card .cardbar { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  #pos-card .cardbar .back { min-height: 40px; padding: 8px 14px; }
  #pos-card .cardbar > .small.muted { flex: 1 1 100%; margin-top: 4px; }
  /* «Дата» не подписываем: кнопка с календарём говорит сама, а подпись
     на узком экране отрывала кнопку на отдельную строку. */
  #pos-card .cardbar > .small.muted:first-of-type { display: none; }
  #pos-card .cardbar > .datepick { margin-left: auto; }
  #pos-card .cardbar > .spacer { display: none; }
  #pos-card .datebtn { min-height: 40px; }
  #pos-card .cardbar .seg { flex: 1 1 100%; }
  #pos-card .cardbar .seg button { flex: 1 1 0; min-width: 0; min-height: 36px; padding: 6px 4px;
                                   white-space: nowrap; }
  /* Календарь — от левого края полосы: кнопка даты переносится то вправо, то
     на новую строку, и от неё меню уходило за край экрана. */
  #pos-card .cardbar { position: relative; }
  #pos-card .datepick { position: static; }
  #pos-card .datemenu { top: auto; left: 0; right: auto; margin-top: 6px; width: min(308px, 100%); }
  #pos-card .calday { height: 40px; font-size: 14px; }
  #pos-card .calstep { width: 40px; height: 40px; }
  #pos-card .callink { min-height: 40px; padding: 4px 12px; }

  #pos-card .chipsbar { flex-wrap: wrap; gap: 8px; }
  #pos-card .chipsbar .chips { flex: 1 1 100%; }
  #pos-card .chipsbar > button { flex: 1 1 auto; height: auto; min-height: 44px; padding: 10px 14px;
                                 border-radius: 14px; }
  #pos-card .chipinput { font-size: 16px; min-height: 36px; }
  #pos-card .chip { max-width: 100%; }
  #pos-card .chip i { padding: 6px; margin: -6px 0; }

  #pos-card .cardhead { flex-wrap: wrap; gap: 12px; padding: 12px; }
  #pos-card .cardhead .pcell { flex: 1 1 0; min-width: 0; }
  #pos-card .cardtitle { font-size: 15px; line-height: 1.3; }
  #pos-card .cardhead .sku { overflow-wrap: anywhere; }
  #pos-card .cardhead .cityseg { max-width: 100%; overflow-x: auto; }
  #pos-card .cardhead .cityseg button { flex: none; min-height: 34px; }
  #pos-card .cardhead > .spacer { display: none; }
  #pos-card .cardstats { flex: 1 1 100%; justify-content: space-between; gap: 12px; }
  #pos-card .cstat { align-items: flex-start; }

  /* Ряд метрик: меню добавления открывается от края ряда, чтобы не уйти за экран. */
  #pos-card .mtabs { position: relative; gap: 6px; }
  #pos-card .mtab, #pos-card .metricbtn.addtab { height: 40px; padding: 0 14px; }
  #pos-card .mtab .tabdel { opacity: .6; padding: 8px 4px; margin-right: -6px; font-size: 12px; }
  #pos-card .metricpicker { position: static; }
  #pos-card .metricmenu { left: 0; right: 0; top: calc(100% - 8px); min-width: 0; }
  #pos-card .metricitem { min-height: 42px; white-space: normal; }
  #pos-card .navbtn { width: 40px; height: 40px; }
  /* Стрелки соседних плашек — своей строкой справа, парой: при переносе
     ряда метрик они разъезжались по разным строкам. */
  #pos-card .mtabs > .spacer { flex: 1 1 100%; height: 0; }
  #pos-card #prod-prev { margin-left: auto; }

  /* Матрица: слева только запрос, популярность и глубина — второй строкой под ним. */
  #pos-card .matrix { padding: 14px 0; }
  #pos-card .mcaption { padding: 0 12px 10px; }
  #pos-card .matrixbody { padding: 0 0 6px 10px; }
  #pos-card .mhead, #pos-card .mrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px;
                                      width: 150px; }
  #pos-card .mhead { grid-template-areas: "q q del" "pop dep del"; align-content: center; }
  #pos-card .mrow { grid-template-areas: "q q del" "pop dep del"; align-content: center;
                    grid-template-rows: auto 14px; row-gap: 1px; }
  #pos-card .mhead > :nth-child(1), #pos-card .mrow > :nth-child(1) { grid-area: q; }
  #pos-card .mhead > :nth-child(2), #pos-card .mrow > :nth-child(2) { grid-area: pop; }
  #pos-card .mhead > :nth-child(3), #pos-card .mrow > :nth-child(3) { grid-area: dep; }
  #pos-card .mhead > :nth-child(4), #pos-card .mrow > :nth-child(4) { grid-area: del; }
  #pos-card .mhead { font-size: 10px; line-height: 1.2; }
  #pos-card .mhead .q { padding-left: 10px; }
  #pos-card .mhead .c, #pos-card .mrow .c { text-align: left; padding-left: 10px; overflow: hidden;
                                            text-overflow: ellipsis; white-space: nowrap; }
  #pos-card .mhead > :nth-child(3), #pos-card .mrow > :nth-child(3) { padding-left: 4px; }
  #pos-card .mrow .q { padding: 0 2px 0 10px; font-size: 12px; line-height: 1.2; }
  /* Запрос — до двух строк: в узкой колонке одна строка обрезала его до слова. */
  #pos-card .mrow .q .copyable { margin: 0 0 0 -6px; text-align: left; }
  #pos-card .mrow .q .copyable-text { white-space: normal; display: -webkit-box;
                                      -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  #pos-card .mrow .q .copyable-icon { display: none; }
  #pos-card .mrow .c { font-size: 11px; color: var(--muted-2); }
  #pos-card .mrow .c:nth-child(4) { text-align: center; padding: 0; }
  #pos-card .mrow .kw-del { width: 30px; height: 44px; }

  /* Инструменты ячейки — по касанию (класс ставит 06-position-card.js):
     ячейка целиком делится на две кнопки, наведения на телефоне нет. */
  #pos-card .mcell:hover .mtools { display: none; }
  #pos-card .mcell.tools-open .mtools { display: flex; inset: 0; gap: 2px; z-index: 1; }
  #pos-card .mcell.tools-open .mtool { flex: 1; font-size: 16px; border-radius: 10px;
                                       background: var(--surface); color: var(--text); }

  /* ---------- Окно «Новый товар» ---------- */
  #new-product { padding: 10px; align-items: flex-start; }
  #new-product .modal-card { display: flex; flex-direction: column;
                             max-height: calc(100dvh - 20px); overflow-y: auto;
                             overscroll-behavior: contain; padding: 20px 16px 0; border-radius: 18px; }
  #new-product .modal-title { margin-bottom: 14px; }
  #new-product .fcontrol { font-size: 16px; min-height: 48px; }
  #new-product .chipsfield .ac input { font-size: 16px; }
  #new-product .chipinput { font-size: 16px; }
  #new-product .chip { max-width: 100%; overflow-wrap: anywhere; }
  #new-product .chip i { padding: 6px; margin: -6px 0; }
  #new-product .ac-list { max-height: 40vh; }
  #np-interval { width: 100%; margin-bottom: 16px; }
  #np-interval button { flex: 1 1 0; min-height: 38px; padding: 6px 4px; }
  /* Кнопки окна прилипают к низу: «Отменить» видна при любой прокрутке. */
  #new-product .modal-actions { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px;
                                padding-bottom: calc(12px + env(safe-area-inset-bottom));
                                background: var(--surface); border-top: 1px solid var(--line); }
  #new-product .modal-actions button { flex: 1 1 0; min-height: 46px; }
  #new-product #np-error:empty { display: none; }
  #new-product #np-error { order: 1; margin: 0 0 12px; }
  #new-product .modal-actions { order: 2; }

  /* ---------- Окна карточки позиции: отчёт, копирование, заметка, срез ---------- */
  #report, #copy-kw { padding: 10px; }
  #report .confirmbox, #copy-kw .confirmbox { max-height: calc(100dvh - 20px); padding: 20px 16px 16px;
                                              border-radius: 20px; gap: 10px; }
  #report .confirmbox { overflow: hidden; }
  #report .ctitle, #copy-kw .ctitle { font-size: 18px; }
  #report .ctext { font-size: 13px; }
  #report .reportbody { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto;
                        overscroll-behavior: contain; }
  #report .rephead { display: none; }
  #report .reprow { grid-template-columns: 26px repeat(4, minmax(0, 1fr)); gap: 8px 6px;
                    padding: 10px; align-items: start; }
  #report .reprow input { width: 22px; height: 22px; margin: 0; grid-row: span 3; align-self: center; }
  #report .reprow .q { grid-column: 2 / -1; white-space: normal; font-weight: 600; }
  #report .reprow .c { text-align: left; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
  #report .reprow .c::before { display: block; font-size: 10.5px; color: var(--muted-2); }
  #report .reprow .c:nth-of-type(2)::before { content: "Искали"; }
  #report .reprow .c:nth-of-type(3)::before { content: "Увидели"; }
  #report .reprow .c:nth-of-type(4)::before { content: "Позиция"; }
  #report .reprow .c:nth-of-type(5)::before { content: "В карточку"; }
  #report .reprow .c:nth-of-type(6)::before { content: "В заказ"; }
  #report .reprow .c:nth-of-type(7)::before { content: "Заказов"; }
  #report .reprow .c:nth-of-type(8)::before { content: "Сумма"; }
  #report .reprow .c:nth-of-type(8) { grid-column: span 2; white-space: nowrap; }
  #report .confirmacts, #copy-kw .confirmacts { margin-top: 4px; }
  #report .confirmacts button, #copy-kw .confirmacts button { flex: 1 1 auto; height: auto;
                                                              min-height: 44px; padding: 8px 14px; }

  #copy-kw .confirmbox { overflow-y: auto; overscroll-behavior: contain; }
  #copy-kw input { font-size: 16px; min-height: 44px; }
  /* Поле товара без своего оформления выходило белым системным — как у поиска города. */
  #copy-kw-product { width: 100%; border-radius: 12px; border: 0; padding: 0 12px;
                     background: var(--card); color: var(--text); font: inherit; font-size: 16px;
                     box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
  #copy-kw-product:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
  #copy-kw .copyregions { max-height: 34vh; }
  #copy-kw .copycity { min-height: 44px; }
  #copy-kw .copycity input { width: 20px; height: 20px; min-height: 0; }

  #note-box { padding: 10px; align-items: flex-start; }
  #note-box .sheet-inner { width: 100%; max-height: calc(100dvh - 20px); border-radius: 18px; padding: 18px 16px; }
  #note-box textarea { font-size: 16px; }
  #note-box .sheet-actions button { flex: 1 1 0; min-height: 44px; }
  #note-box .noteitem { flex-wrap: wrap; gap: 2px 10px; padding: 8px 4px 8px 10px; }
  #note-box .noteitem .when { flex: 1 1 auto; font-size: 12px; }
  #note-box .noteitem .what { flex: 1 1 100%; order: 3; overflow-wrap: anywhere; }
  #note-box .noteitem .drop { order: 2; width: 40px; height: 36px; }

  /* Срез выдачи: окно на весь экран, крестик прилип к верху, таблица крутится
     внутри себя с закреплёнными местом и названием товара. */
  #serp-box { padding: 8px; }
  #serp-box .sheet-inner { width: 100%; height: calc(100dvh - 16px); max-height: none; padding: 0 0 8px;
                           border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
  /* У окна нет внутренних полей: общий сдвиг шапки на −16px (16-mobile-shell)
     уводил крестик за край. */
  #serp-box .sheet-head { top: 0; margin: 0; padding: 6px 6px 0 16px; }
  #serp-box .sheet-head h3 { margin: 0; font-size: 16px; }
  #serp-box #serp-close { width: 44px; height: 44px; }
  #serp-box .sheet-sub { padding: 0 16px; margin: 2px 0 10px; }
  #serp-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #serp-body > .empty { padding: 16px; }
  #serp-box .serp-scroll { flex: 1 1 auto; max-height: none; overscroll-behavior: contain; }
  #serp-box table.serp { min-width: 1400px; }
  #serp-box table.serp td.pos, #serp-box table.serp th.pos { position: sticky; left: 0; z-index: 2;
                                                             background: var(--surface); }
  #serp-box table.serp td.name, #serp-box table.serp th.name { position: sticky; left: 52px; z-index: 2;
                                                               background: var(--surface); }
  #serp-box table.serp thead th.pos, #serp-box table.serp thead th.name { z-index: 3; }
  #serp-box table.serp tr.ours td.pos, #serp-box table.serp tr.ours td.name {
    background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); }
}
