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

@media (max-width: 640px) {

  /* ---------- Общее для трёх разделов ---------- */

  /* Две вложенные плашки с отступами по 22–24 px съедали треть ширины экрана. */
  :is(section[data-pane="ab"], section[data-pane="sq"], section[data-pane="act"]) .panel {
    padding: 8px; border-radius: var(--r-block);
  }
  :is(section[data-pane="ab"], section[data-pane="sq"], section[data-pane="act"]) .panelblock {
    padding: 16px 12px 18px; border-radius: 14px;
  }

  /* Шапка раздела: заголовок отдельной строкой, кнопки под ним во всю ширину. */
  :is(section[data-pane="ab"], section[data-pane="sq"], section[data-pane="act"]) .panelhead {
    flex-wrap: wrap; gap: 8px;
  }
  #ab-list > .panelhead { margin-bottom: 12px; }
  :is(section[data-pane="ab"], section[data-pane="sq"], section[data-pane="act"]) .panelhead h2 {
    flex: 1 1 100%; margin: 0 0 4px; font-size: 13px;
  }
  :is(section[data-pane="ab"], section[data-pane="sq"], section[data-pane="act"]) .panelhead .spacer {
    display: none;
  }
  :is(section[data-pane="ab"], section[data-pane="act"]) .panelhead > button {
    flex: 1 1 calc(50% - 4px); min-height: 44px; padding: 10px 12px;
  }

  /* Формы добавления: поле на строку. Ширины у полей заданы в разметке
     атрибутом style, поэтому без !important их не перебить. */
  #add-ab, #add-act { flex-direction: column; align-items: stretch; gap: 8px; }
  #add-ab > *, #add-act > * { flex: 0 0 auto !important; width: 100%; min-width: 0; }
  #add-ab input, #add-ab select, #add-act input {
    width: 100%; min-height: 44px; font-size: 16px;
  }
  #add-ab button, #add-act button { min-height: 44px; }

  /* Панель выбора висит у нижнего края: выбирают, листая плитки вниз, и
     «Удалить выбранные» должна быть под пальцем, а не уехавшей наверх. */
  #ab-bulk:not([hidden]), #act-bulk:not([hidden]) {
    position: fixed; z-index: 50; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    flex-wrap: wrap; gap: 8px; padding: 12px;
    background: var(--surface); border: 1px solid var(--line-strong);
    box-shadow: var(--sh-modal);
  }
  #ab-bulk .count, #act-bulk .count { flex: 1 1 100%; }
  #ab-bulk .spacer, #act-bulk .spacer { display: none; }
  #ab-bulk button, #act-bulk button { flex: 1 1 calc(50% - 4px); min-height: 44px; }
  /* Последние строки не прячутся под панелью выбора. */
  /* Тост встаёт над панелью выбора, а не на её кнопки. */
  body:has(.tabpane:not([hidden]) :is(#ab-bulk, #act-bulk):not([hidden])) #toasts {
    bottom: calc(140px + env(safe-area-inset-bottom));
  }
  #ab-rows.picking { padding-bottom: 150px; }
  #act.picking { margin-bottom: 150px; }

  /* ---------- АБ-тесты: список ---------- */

  /* Плитка — строкой: фото слева, текст справа. Вертикальная плитка на
     узком экране давала фото во весь экран и один тест на прокрутку. */
  #ab-rows.abgrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #ab-rows .abtile {
    position: relative; display: grid; gap: 4px 12px; padding: 12px;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: 28px auto auto 1fr auto;
    grid-template-areas: "photo ." "photo title" "photo sku" "photo strip" "photo lead";
    border-radius: var(--r-block);
  }
  #ab-rows .abtile-photo {
    grid-area: photo; position: static; align-self: start; border-radius: 12px;
  }
  #ab-rows .abtile-title {
    grid-area: title; font-size: 14px; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  }
  #ab-rows .abtile-sku { grid-area: sku; margin-top: 0; overflow-wrap: anywhere; }
  #ab-rows .abtile-strip { grid-area: strip; justify-content: flex-start; gap: 4px; margin-top: 4px; }
  #ab-rows .abtile-strip img { flex: 0 1 28px; width: 28px; border-radius: 6px; }
  #ab-rows .abtile-lead { grid-area: lead; font-size: 12.5px; padding-top: 8px; }
  /* Статус — над текстом, а не поверх маленького фото: «остановлен ошибкой»
     на нём не помещался. Позиционируется от плитки (у фото position: static). */
  #ab-rows .abtile-photo .abrow-status {
    position: absolute; top: 12px; left: 120px; right: auto;
    font-size: 12px; padding: 3px 10px;
    background: var(--st-na-bg); color: var(--st-na-fg);
  }
  #ab-rows .abtile-photo .abrow-status.ab-paused,
  #ab-rows .abtile-photo .abrow-status.ab-calibrating {
    background: var(--st-warn-bg); color: var(--st-warn-fg);
  }
  #ab-rows .abtile-photo .abrow-status.ab-running {
    background: var(--accent); color: var(--accent-ink); box-shadow: none;
  }
  #ab-rows .abtile-photo .abrow-status.ab-stopped,
  #ab-rows .abtile-photo .abrow-status.ab-paused_error {
    background: var(--up); color: #2a0f0b; box-shadow: none;
  }
  /* После касания плитка остаётся «под курсором», и затемнение наведения
     перекрывало зелёный кружок выбранной. */
  #ab-rows.picking .abtile.picked .abpick { background: var(--accent-2); }
  #ab-rows .abpick { left: 18px; top: 18px; width: 26px; height: 26px; }
  #ab-rows .abtile.picked .abpick::after { left: 9px; top: 5px; }

  #ab-rows .emptystate, section[data-pane="ab"] .emptystate { padding: 28px 18px; }
  section[data-pane="ab"] .emptystate-title { font-size: 20px; }

  /* ---------- АБ-тесты: карточка теста ---------- */

  #ab-card .abhead { flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }
  #ab-card .abhead > .spacer { display: none; }
  #ab-card #ab-back { flex: none; width: 44px; height: 44px; padding: 0; }
  #ab-card .abhead-text { flex: 1 1 calc(100% - 56px); min-width: 0; }
  #ab-card .abhead-title { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
  #ab-card .abhead-sub { font-size: 12.5px; line-height: 1.55; margin-top: 4px; overflow-wrap: anywhere; }
  #ab-card .abfield { padding: 6px 2px; }
  #ab-card .abfield-input { width: 140px; font-size: 16px; padding: 6px 10px; }
  #ab-card .abhead > .abrow-status { align-self: center; font-size: 12.5px; padding: 4px 10px; }
  #ab-card .abmenu { margin-left: auto; }
  #ab-card #ab-actions { min-height: 44px; }
  #ab-card .abmenu-list { width: min(280px, calc(100vw - 48px)); top: 50px; }
  #ab-card .abmenu-list button { min-height: 44px; font-size: 15px; }

  /* Варианты — по два в ряд: одна колонка давала фото во весь экран. */
  #ab-card .abvariants { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #ab-card .abvariant { padding: 8px 8px 12px; gap: 10px; border-radius: var(--r-block); }
  #ab-card .abvariant-photo { border-radius: 10px; }
  #ab-card .abvariant-tags { left: 6px; top: 6px; right: 44px; }
  #ab-card .abvariant-photo .tag {
    height: auto; min-height: 22px; padding: 3px 8px; line-height: 1.2; white-space: normal;
    font-size: 10.5px;
  }
  #ab-card .ab-del-variant { right: 4px; top: 4px; width: 36px; height: 36px; font-size: 14px; }
  #ab-card .abvariant-head { flex-wrap: wrap; gap: 0 6px; padding: 0 2px; }
  #ab-card .abvariant-label, #ab-card .abvariant-ctr { font-size: 16px; }
  #ab-card .abvariant-stats { padding: 0 2px; }
  #ab-card .abvariant-stats div { gap: 4px; font-size: 11.5px; }
  #ab-card .abvariant-stats dd { text-align: right; white-space: nowrap; }
  #ab-card .abvariant-note { margin: 2px 2px 0; }
  #ab-card .abvariant.add { aspect-ratio: auto; min-height: 180px; padding: 16px 10px; }

  /* Вывод и кнопки под ним: кнопки во всю ширину, под палец. */
  #ab-card .abresult { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; }
  #ab-card .abresult .spacer { display: none; }
  #ab-card .abresult .v { font-size: 16px; overflow-wrap: anywhere; }
  #ab-card .abresult button { height: auto; min-height: 44px; }
  #ab-card .abwins > summary { min-height: 44px; }
  #ab-card .abwindow { padding: 8px 10px; }

  /* ---------- Запросы ---------- */

  /* Переключатель вида: две длинные кнопки на всю ширину, текст переносится. */
  #sq-kind { flex: 1 1 100%; }
  #sq-kind button { flex: 1 1 0; min-height: 44px; padding: 8px 10px; white-space: normal;
                    line-height: 1.25; }
  #sq-hint { font-size: 13px; }

  /* Сбор по API: поля столбиком, даты парой, кнопки во всю ширину. */
  #sq-api { padding: 14px 12px; }
  #sq-api .sqapi-form { gap: 10px; }
  #sq-api .sqapi-form label { flex: 1 1 100%; min-width: 0; }
  #sq-api .sqapi-form label:has(input[type="date"]) { flex: 1 1 calc(50% - 5px); }
  #sq-api .sqapi-form input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px;
                              color-scheme: dark; }
  #sq-api .sqapi-form input[type="date"] { padding: 9px 8px; }
  #sq-api .sqapi-form button { flex: 1 1 100%; min-height: 44px; }
  #sq-api .qiprod { min-width: 0; flex: 1 1 100%; align-items: flex-start; }
  #sq-api .qiprod .t { min-width: 0; }
  #sq-api .qiprod .n { overflow-wrap: anywhere; }

  /* Свёрнутые блоки: номер и стрелка остаются, описание и тело — без отступа
     под номер, на телефоне это 38 px из трёхсот. */
  section[data-pane="sq"] .qsec { padding: 12px; }
  section[data-pane="sq"] .qsec-head { min-height: 44px; gap: 10px; }
  /* После касания «наведение» залипает и оставляло серую плашку на заголовке. */
  section[data-pane="sq"] .qsec-head:hover { background: none; }
  section[data-pane="sq"] .qsec-head .ttl { font-size: 14.5px; line-height: 1.3; }
  section[data-pane="sq"] .qsec-head .chev { margin-right: 2px; }
  section[data-pane="sq"] .qsec .note { margin-left: 0; font-size: 12.5px; }
  section[data-pane="sq"] .qsec-body { margin-left: 0; }
  #sq-drop { padding: 18px 12px; }

  /* Загруженные отчёты: строка-сводка и кнопка «Сформировать» друг под другом. */
  #sq-files-block .sqfiles-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  #sq-files-block .qsec-head { flex-wrap: wrap; }
  #sq-files-block .qsec-head .sub { flex: 1 1 100%; order: 3; margin: 0; }
  #sq-build { min-height: 44px; }
  #sq-files-block .qsec-body { max-height: none; overflow: visible; }

  /* Файлы — карточкой на строку: таблица в восемь колонок с полями ввода
     на телефоне не читалась. Подписи полей ставятся сами по data-rate. */
  #sq-files, #sq-files tbody { display: block; margin: 0; }
  #sq-files tr:has(th) { display: none; }
  #sq-files tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
    padding: 10px 0; border-bottom: 1px solid var(--line);
  }
  #sq-files td { display: block; padding: 0; border: 0; }
  #sq-files td:first-child { flex: 1 1 calc(100% - 56px); min-width: 0; font-weight: 600;
                             overflow-wrap: anywhere; }
  #sq-files td.del { order: 1; flex: none; width: 44px; }
  #sq-files td.del button { width: 44px; height: 44px; padding: 0; font-size: 15px; }
  #sq-files td:nth-child(2) { order: 2; color: var(--text-2); }
  #sq-files td:nth-child(3), #sq-files td:nth-child(4) { order: 3; color: var(--muted-2);
                                                         text-align: left; }
  #sq-files td:nth-child(3)::after { content: " дн."; }
  #sq-files td:nth-child(4)::after { content: " строк"; }
  /* Перенос строки перед полями ставок: иначе они цеплялись к «строк». */
  #sq-files tr::after { content: ""; order: 4; flex: 1 1 100%; height: 0; }
  #sq-files td:has(input[data-rate]) { order: 5; flex: 1 1 calc(50% - 6px); text-align: left; }
  #sq-files td:has(input[data-rate])::before { display: block; margin: 6px 0 4px;
                                                font-size: 11px; color: var(--muted-2); }
  #sq-files td:has(input[data-rate="cpc"])::before { content: "Ставка, ₽"; }
  #sq-files td:has(input[data-rate="soinvest_percent"])::before { content: "Соинвест, %"; }
  #sq-files input { width: 100%; min-height: 40px; font-size: 16px; }
  #sq-files td.muted { order: 6; flex: 1 1 100%; font-size: 12px; }
  #sq-files-block .sqfiles-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  #sq-files-block .sqfiles-foot .ghost { min-height: 44px; }

  /* Ключевые показатели — по две плашки в ряд, цифра помельче. */
  #sq-report .kpigrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #sq-report .kpi { padding: 12px; min-height: 0; }
  #sq-report .kpi .k { font-size: 10.5px; letter-spacing: .04em; }
  #sq-report .kpi .v { font-size: 19px; overflow-wrap: anywhere; }
  #sq-report .kpi .v.text { font-size: 13px; }
  #sq-report .kpisub { font-size: 12.5px; overflow-wrap: anywhere; }

  /* Широкие таблицы крутятся внутри себя, запрос (первая колонка) стоит на
     месте. Подложка ячейки непрозрачная — собрана из тех же слоёв, что под
     ней: панель, плашка раздела и плашка блока. */
  #sq-report .sqtable { font-size: 13px; }
  #sq-report .qstable td { padding: 8px; }
  #sq-report .qstable td .v { font-size: 14px; }
  #sq-report .sqtable tr > :first-child {
    position: sticky; left: 0; z-index: 1; min-width: 132px; max-width: 160px;
    white-space: normal; overflow-wrap: anywhere;
    background: linear-gradient(var(--card), var(--card)), linear-gradient(var(--card), var(--card)),
                var(--surface);
    box-shadow: 1px 0 0 var(--line);
  }
  #sq-report .sqtable tr.totalrow > :first-child {
    background: linear-gradient(var(--st-ok-bg), var(--st-ok-bg)),
                linear-gradient(var(--card), var(--card)), linear-gradient(var(--card), var(--card)),
                var(--surface);
  }
  #sq-report .sqtable tr.marked.mark-warn > :first-child {
    background: linear-gradient(rgba(232,195,74,.12), rgba(232,195,74,.12)),
                linear-gradient(var(--card), var(--card)), linear-gradient(var(--card), var(--card)),
                var(--surface);
  }
  #sq-report .sqtable tr.marked.mark-ok > :first-child {
    background: linear-gradient(rgba(52,211,153,.12), rgba(52,211,153,.12)),
                linear-gradient(var(--card), var(--card)), linear-gradient(var(--card), var(--card)),
                var(--surface);
  }
  #sq-report .sqtable tr.marked.mark-bad > :first-child {
    background: linear-gradient(rgba(255,122,107,.12), rgba(255,122,107,.12)),
                linear-gradient(var(--card), var(--card)), linear-gradient(var(--card), var(--card)),
                var(--surface);
  }
  #sq-report .qstable td.l { white-space: normal; }
  #sq-report .qsmetric td.q { max-width: 160px; }
  /* Кружок пометки — под палец: 12 px не попасть. */
  #sq-report .sqtable td.qcell { gap: 6px; }
  #sq-report .qmark { width: 22px; height: 22px; }

  /* Фильтр, страницы, полосы каталога. */
  #sq-report .qsfilter { padding: 10px; gap: 10px; }
  #sq-report .qsfilter .qssearch { flex: 1 1 100%; min-width: 0; min-height: 44px; font-size: 16px; }
  #sq-report .qsfilter label { flex: 1 1 100%; justify-content: space-between; white-space: normal; }
  #sq-report .qsfilter .qsmin { min-height: 44px; font-size: 16px; }
  #sq-report .qspager { gap: 10px; }
  #sq-report .qspager .pages { flex: 1 1 100%; margin-right: 0; }
  #sq-report .qspage { min-width: 40px; height: 40px; }
  #sq-report .qspager .qssize { min-height: 40px; font-size: 16px; }
  #sq-report .qsbar { grid-template-columns: 96px minmax(0, 1fr); gap: 4px 10px; }
  #sq-report .qsbar .l { white-space: normal; }
  #sq-report .qsday-top { padding: 10px 12px; }
  #sq-report .qsday-head { min-height: 44px; padding: 10px 12px; flex-wrap: wrap; }
  #sq-report .qsday-head .more { display: none; }
  #sq-report .qsday-head .chev { margin-left: auto; }
  #sq-report .qsqs { padding: 4px 12px 12px; }
  #sq-report .qsq { flex-wrap: wrap; max-width: 100%; overflow-wrap: anywhere; }
  #sq-report .qsquiet { margin: 0 12px 12px; min-height: 40px; }
  #sq-report .qsmethod { font-size: 13.5px; }
  #sq-report .qenote { overflow-wrap: anywhere; }

  /* График: поле шире экрана и крутится вбок внутри своей колонки — сжатое
     до трёхсот пикселей, оно давало подписи осей в три пикселя. Подсказка
     к точке открывается касанием: тап по точке шлёт тот же mousemove. */
  #sq-report .qchartbody { gap: 12px; }
  #sq-report .qchartbody > div:last-child { min-width: 0; overflow-x: auto; }
  #sq-report .qplot { width: 600px; }
  /* Легенда и пометки не уезжают вместе с полем графика. */
  #sq-report .qchartbody > div:last-child > :not(.qplot) { position: sticky; left: 0; }
  #sq-report .qplot .axis { font-size: 18px; }
  #sq-report .qmetrics { gap: 6px; }
  #sq-report .qmetrics .t { flex: 1 1 100%; margin-bottom: 0; }
  #sq-report .qmetric { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line);
                        border-radius: var(--r-pill); font-size: 13.5px; }
  #sq-report .qmetric.on { border-color: transparent; }
  #sq-report .qpick input { min-height: 44px; font-size: 16px; }
  #sq-report .qopt { min-height: 44px; flex-wrap: wrap; gap: 2px 10px; }
  #sq-report .qopt > span:first-child { overflow-wrap: anywhere; min-width: 0; }
  #sq-report .qchip { max-width: 100%; }
  #sq-report .qchip button { width: 32px; height: 32px; margin: -6px -6px -6px 0; }
  #sq-report .qlegend { gap: 6px 14px; }
  #sq-report .qlegend .item { overflow-wrap: anywhere; }

  /* ---------- Акции ---------- */

  #act-run, #act-summary { flex: 1 1 100%; }

  /* Таблица — карточкой на артикул: товар и цена сверху, плашки под ними. */
  #act, #act tbody { display: block; }
  #act thead { display: none; }
  #act tbody tr.watch {
    display: grid; align-items: start; gap: 8px 10px; padding: 12px 0;
    grid-template-columns: minmax(0, 1fr) auto 40px;
    grid-template-areas: "prod price del" "badges badges badges";
    border-top: 1px solid var(--line);
  }
  #act tbody tr.watch > td { display: block; padding: 0; border: 0; background: none; }
  #act tbody tr.watch > td.pick { display: none; }
  #act.picking tbody tr.watch > td.pick { display: block; grid-area: pick; width: auto; }
  #act tbody tr.watch > td:nth-child(2) { grid-area: prod; min-width: 0; }
  #act tbody tr.watch > td.num { grid-area: price; font-size: 15px; font-weight: 600; }
  #act tbody tr.watch > td.badges { grid-area: badges; }
  #act tbody tr.watch > td.actions { grid-area: del; }
  #act tbody tr.watch .del { width: 40px; height: 40px; padding: 0; margin-top: -10px; }
  #act tbody tr.watch.open { background: var(--card-hover); border-radius: var(--r-row) var(--r-row) 0 0;
                             box-shadow: inset 3px 0 0 var(--accent-2); padding-left: 10px;
                             padding-right: 4px; }
  #act tbody tr.watch.open > td:first-child { box-shadow: none; }
  #act tbody tr.watch:hover > td, #act tbody tr.watch.open > td { background: none; }
  section[data-pane="act"] .panelhead { margin-bottom: 12px; }
  #act .pcell-row { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
  #act .pcell .pname { white-space: normal; overflow-wrap: break-word; }
  #act .pcell .sku { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
                     overflow: hidden; }
  #act td.badges .badge { margin: 0 4px 4px 0; }
  /* Режим выбора: кружок слева, как в «Соинвесте». */
  #act.picking tbody tr.watch {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas: "pick prod price" "pick badges badges";
  }
  /* В режиме выбора убирают панелью снизу — крестик строки только теснит название. */
  #act.picking tbody tr.watch > td.actions { display: none; }
  #act.picking td.pick input {
    appearance: none; -webkit-appearance: none; display: block; position: relative;
    margin: 14px 0 0; width: 24px; height: 24px; border-radius: 50%;
    border: 1.5px solid var(--line-strong); background: var(--card-hover);
  }
  #act.picking td.pick input:checked { background: var(--accent-2); border-color: var(--accent-2); }
  #act.picking td.pick input:checked::after {
    content: ""; position: absolute; left: 7.5px; top: 3.5px; width: 5px; height: 10px;
    border: solid #12201a; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  #act tbody tr.watch.picked { background: rgba(52,211,153,.12); border-radius: var(--r-row); }
  #act tbody tr.watch.picked > td { background: none; }
  #act tbody tr:not(.watch):not(.detail) td.empty { display: block; }

  /* Раскрытый артикул: группы акций столбиком, строка акции переносится —
     название сверху, цена и кнопка под ним. */
  #act tr.detail, #act tr.detail > td { display: block; padding: 0; }
  #act .actdetail { padding: 10px 8px 14px; gap: 10px; }
  #act .actcols { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #act .actgroup { padding: 10px 12px; }
  #act .actline { flex-wrap: wrap; gap: 4px 8px; padding: 8px 0; font-size: 13px; }
  #act .actline .t { flex: 1 1 100%; white-space: normal; overflow-wrap: anywhere; }
  #act .actline .go { margin-left: auto; min-height: 36px; padding: 6px 16px; font-size: 13px; }
  #act .actline .edit { margin-left: auto; min-width: 40px; min-height: 36px; font-size: 13px; }
  #act .actline .x { min-width: 40px; min-height: 36px; font-size: 15px; }
  #act .actline .priceedit { flex: 1 1 100%; flex-wrap: wrap; order: 1; }
  #act .actline:has(.priceedit) :is(.edit, .x) { order: 2; }
  #act .priceedit input { width: 110px; min-height: 40px; font-size: 16px; }
  #act .priceedit .go { margin-left: auto; }
  #act .actwarn { margin: -2px 0 8px; font-size: 12px; }
  #act .evday > summary { min-height: 40px; display: flex; align-items: center; }
  #act .evrow { flex-wrap: wrap; gap: 4px 10px; padding: 8px 0 8px 14px;
                border-bottom: 1px solid var(--line); }
  #act .evrow > span:nth-child(3) { flex: 1 1 100%; overflow-wrap: anywhere; }
  #act .evrow > span:empty { display: none; }

  /* Окно настроек раздела — почти на весь экран, крестик всегда виден. */
  #act-settings { padding: 8px; align-items: stretch; }
  #act-settings .sheet-inner {
    width: 100%; max-height: none; padding: 0 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: var(--r-block);
  }
  #act-settings .sheet-head {
    position: sticky; top: 0; z-index: 2; gap: 12px; margin: 0; padding: 12px 0 8px;
    background: var(--surface);
  }
  #act-settings .sheet-head h3 { margin: 0; font-size: 17px; line-height: 1.3; }
  #act-settings #act-settings-close { flex: none; width: 44px; height: 44px; margin-right: -10px; }
  #act-settings .setrow { gap: 12px; }
  #act-settings .setrow > .spacer { display: none; }
  #act-settings .setrow-label { flex: 1 1 0; width: auto; min-width: 0; max-width: none; }
  #act-settings .actthr { padding: 6px 12px; }
  #act-settings .actthr input { width: 64px; font-size: 16px; min-height: 30px; }
  #act-settings #act-cleanup-now { min-height: 44px; }
}
