/* ===========================================================================
   Оболочка приложения — то, что делает сайт похожим на приложение.

   Реализация макета Claude Design «Оболочка приложения» (2026-07-31).
   Живёт только на узких экранах: на десктопе остаётся привычная шапка CRM
   с меню, и трогать её незачем — там мышь, а не большой палец.

   Всё, что здесь есть, — шапка раздела, нижняя навигация из пяти пунктов,
   полноэкранные «Ещё» и поиск, полоса «нет сети» и всплывающие
   подтверждения. Разделы страниц не меняются: оболочка их обрамляет.
   =========================================================================== */

@media (max-width: 767px) {

  /* Десктопная шапка на телефоне только отнимает экран у содержимого. */
  .u-topbar { display: none !important; }

  /* Место под шапку и нижнюю панель. Панель перекрывала последние строки
     списков — на длинной ленте это незаметно, а на короткой съедает
     единственное действие.

     Отступы вешаем на класс, а не на body вообще: полноэкранные экраны
     (мастер выдачи, день курьера, диспетчерская) берут из оболочки только
     нижнюю панель, а раскладку строят сами на 100dvh — глобальный padding
     сдвинул бы её за край экрана. */
  body.as-shell {
    padding-top: 60px;
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  /* --- Шапка --------------------------------------------------------- */
  .as-top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    background: var(--u-surface); border-bottom: 1px solid var(--u-border);
    padding: 6px 12px calc(6px);
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
    display: flex; align-items: center; gap: 10px;
  }
  .as-top-t { flex: 1 1 auto; min-width: 0; }
  .as-brand { font-size: 12px; color: var(--u-muted); letter-spacing: .02em; }
  .as-title {
    font-size: 20px; font-weight: 700; letter-spacing: -.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .as-btn {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px;
    border: 1px solid var(--u-border); background: var(--u-border-soft); color: var(--u-text-2);
    font-size: 18px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; text-decoration: none;
  }
  .as-me {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px;
    background: var(--u-blue-bg); border: 1px solid var(--u-blue-bd); color: var(--u-blue-fg);
    font-weight: 700; font-size: 14px; display: flex; align-items: center;
    justify-content: center; text-transform: uppercase; text-decoration: none;
  }

  /* --- Нижняя навигация ---------------------------------------------- */
  .as-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--u-surface); border-top: 1px solid var(--u-border);
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-columns: repeat(5, 1fr);
  }
  .as-nav a, .as-nav button {
    position: relative; height: 58px; border: 0; background: transparent;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; color: var(--u-muted); font-size: 11px;
    font-weight: 500; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .as-nav .is-active { color: var(--u-blue-fg); font-weight: 600; }
  /* Активный пункт помечен и цветом, и полоской: на солнце цвет не виден. */
  .as-nav .is-active::before {
    content: ''; position: absolute; top: 0; width: 26px; height: 3px;
    border-radius: 0 0 3px 3px; background: var(--u-blue);
  }
  .as-nav-ico { position: relative; font-size: 19px; line-height: 1; }
  /* Счётчик серый по умолчанию: это работа на сегодня. Красным становится
     только то, где срок уже нарушен, и не больше одного пункта за раз —
     две тревоги в панели читаются как фон. */
  .as-badge {
    position: absolute; top: -6px; left: 11px; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 999px; background: var(--u-muted); color: var(--u-on-fill);
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
    border: 2px solid var(--u-surface); box-sizing: content-box;
  }
  .as-badge--hot { background: var(--u-red); }

  /* --- Частые действия в «Ещё» --- */
  .as-quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
              margin: 0 0 18px; }
  .as-quick-i {
    min-height: 64px; border-radius: 14px; text-decoration: none;
    background: var(--u-surface); border: 1px solid var(--u-border); color: var(--u-text);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; text-align: center;
    font-size: 12px; font-weight: 600; line-height: 1.2; padding: 8px 6px;
  }
  .as-quick-i--main { background: var(--u-blue-solid); border-color: var(--u-blue-solid); color: var(--u-on-blue); }
  .as-quick-i span:first-child { font-size: 15px; }

  /* --- Четвёртый слой --- */
  .as-more-rare { width: 100%; text-align: left; border: 0; background: transparent;
                  font: inherit; cursor: pointer; }
  .as-rare[hidden] { display: none; }

  .as-whoami .as-item-ico {
    background: var(--u-blue-bg); border: 1px solid var(--u-blue-bd); color: var(--u-blue-fg);
    border-radius: 50%; font-weight: 700;
  }

  /* --- Полноэкранные слои (Ещё, поиск) -------------------------------- */
  .as-sheet {
    position: fixed; inset: 0; z-index: 60; background: var(--u-page);
    display: flex; flex-direction: column;
    animation: as-up .24s cubic-bezier(.2,.7,.2,1);
  }
  .as-sheet[hidden] { display: none; }
  .as-sheet-head {
    flex: 0 0 auto; background: var(--u-surface); border-bottom: 1px solid var(--u-border);
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 12px;
    display: flex; align-items: center; gap: 10px;
  }
  .as-sheet-title {
    flex: 1 1 auto; font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  }
  .as-sheet-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 14px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  @keyframes as-up { from { transform: translateY(14px); opacity: .4; }
                     to   { transform: none; opacity: 1; } }

  .as-group { margin-bottom: 18px; }
  .as-group-t {
    font-size: 12px; font-weight: 600; color: var(--u-muted); letter-spacing: .04em;
    text-transform: uppercase; margin: 0 4px 8px;
  }
  .as-list {
    background: var(--u-surface); border: 1px solid var(--u-border); border-radius: 18px;
    overflow: hidden; box-shadow: var(--u-sh-1);
  }
  .as-item {
    display: flex; align-items: center; gap: 12px; min-height: 56px;
    padding: 8px 14px; border-top: 1px solid var(--u-border-soft); background: var(--u-surface);
    text-decoration: none; color: var(--u-text); width: 100%; text-align: left;
    border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer;
  }
  .as-list > .as-item:first-child { border-top: 0; }
  .as-item-ico {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px;
    background: var(--u-border-soft); display: flex; align-items: center;
    justify-content: center; font-size: 16px;
  }
  .as-item-b { flex: 1 1 auto; min-width: 0; }
  .as-item-t { font-size: 15px; font-weight: 600; }
  .as-item-s {
    font-size: 12px; color: var(--u-muted); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .as-item-n {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    background: var(--u-red-bg); border: 1px solid var(--u-red-bd); color: var(--u-red-fg);
    font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  }
  .as-chev { font-size: 15px; color: var(--u-faint); }

  /* --- Поиск ---------------------------------------------------------- */
  .as-search-field { flex: 1 1 auto; position: relative; }
  .as-search-field input {
    width: 100%; height: 48px; box-sizing: border-box; padding: 0 40px;
    border-radius: 14px; border: 1px solid var(--u-blue-bd); background: var(--u-blue-bg);
    font-size: 16px; color: var(--u-text); outline: 0;
  }
  .as-search-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; pointer-events: none;
  }
  .as-search-cancel {
    height: 48px; padding: 0 6px; border: 0; background: transparent;
    color: var(--u-blue); font-size: 15px; font-weight: 600; cursor: pointer;
  }
  .as-chips { display: flex; gap: 8px; flex-wrap: wrap; }
  .as-chip {
    height: 42px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--u-border); background: var(--u-border-soft); color: var(--u-text-2);
    font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center;
  }
  .as-empty { text-align: center; padding: 44px 20px; }

  /* --- Нет сети ------------------------------------------------------- */
  .as-offline {
    position: fixed; left: 0; right: 0; z-index: 45;
    top: calc(60px + env(safe-area-inset-top, 0px));
    background: var(--u-amber-bg); border-bottom: 1px solid var(--u-amber-bd);
    padding: 10px 14px; display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 600; color: var(--u-amber-fg);
  }
  .as-offline[hidden] { display: none; }

  /* --- Сохранение не прошло -------------------------------------------- */
  /* Полоса ВНУТРИ формы (разметка — templates/_formfail.html, логика —
     static/formfail.js). Цвет отличается от жёлтой «нет сети» намеренно:
     жёлтое означает «уйдёт само, когда появится связь», красное — «сервер
     ответил отказом, без вас не уйдёт». Один цвет на оба случая приучил бы
     не обращать внимания на второй.

     `[hidden]` с !important — та же грабля, что у плашки очереди: авторский
     display:flex перебивает атрибут, и полоса висела бы всегда. */
  .ff[hidden] { display: none !important; }
  .ff {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 12px 14px; margin-bottom: 12px;
    border-radius: 14px; border: 1px solid var(--u-red-bd); background: var(--u-red-bg);
  }
  .ff-i { font-size: 17px; line-height: 1.2; }
  .ff-b { flex: 1 1 auto; min-width: 0; }
  .ff-t { font-size: 14px; font-weight: 650; color: var(--u-red-fg); }
  .ff-s { margin-top: 2px; font-size: 12.5px; line-height: 1.35;
          color: var(--u-red-fg); opacity: .85; }
  .ff-btn {
    flex: 0 0 auto; min-height: 40px; padding: 0 12px;
    border-radius: 10px; border: 1px solid var(--u-red-bd); background: var(--u-surface);
    color: var(--u-red-fg); font-size: 13px; font-weight: 650;
  }
  .ff-btn[hidden] { display: none !important; }

  /* --- Кнопка во время отправки ---------------------------------------- */
  /* Раньше кнопка просто серела: подпись прежняя, движения нет, и это
     читается как «не нажалось» — жмут второй раз. Теперь внутри кнопки
     крутится спиннер, а подпись говорит, что происходит («Проводим
     платёж…», атрибут `data-ff-busy-label` ставит formfail.js).
     Спиннер — тот же, что в шторке расхода (`.em-spin`), но ЗДЕСЬ, а не
     отдельным блоком рядом: ожидание принадлежит кнопке, которую нажали.
     Экран НЕ затемняем: человек должен видеть, что именно отправляется.

     Псевдоэлемент, а не вставленный узел: formfail.js работает и там, где
     `document` недоступен (прогон логики в node), и создавать элементы ему
     нечем. */
  form[aria-busy="true"] button[type="submit"]::before,
  form[aria-busy="true"] input[type="submit"]::before {
    content: ""; display: inline-block; vertical-align: -3px;
    width: 16px; height: 16px; margin-right: 9px; border-radius: 999px;
    border: 2px solid currentColor; border-top-color: transparent;
    opacity: .75; animation: bm-spin .8s linear infinite;
  }
  @keyframes bm-spin { to { transform: rotate(360deg); } }
  /* Двойное нажатие гасится и курсором: кнопка уже disabled, но на
     тачскрине пальцу об этом говорит только вид. */
  form[aria-busy="true"] button[type="submit"] { cursor: progress; }

  /* --- Приглашение установить ----------------------------------------- */
  /* Карточка над панелью, а не модалка: модалка на первом же экране — это
     просьба уйти, и её закрывают не глядя. */
  .as-install {
    position: fixed; left: 12px; right: 12px; z-index: 50;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    background: var(--u-surface); border: 1px solid var(--u-border); border-radius: 20px;
    padding: 14px; box-shadow: var(--u-sh-2);
    display: flex; gap: 12px; align-items: flex-start;
    animation: as-toast .24s cubic-bezier(.2,.7,.2,1);
  }
  .as-install[hidden] { display: none; }
  .as-install-ico {
    width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px;
    background: var(--u-blue-bg); border: 1px solid var(--u-blue-bd); display: flex;
    align-items: center; justify-content: center; overflow: hidden;
  }
  .as-install-ico img { width: 100%; height: 100%; }
}

/* Тосты нужны и на десктопе: подтверждение действия — не мобильная тема. */
.as-toasts {
  position: fixed; left: 12px; right: 12px; z-index: 70;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
@media (min-width: 768px) {
  .as-toasts { left: auto; right: 20px; bottom: 20px; width: 380px; }
  /* На десктопе оболочки нет — там привычная шапка CRM и мышь. Раньше это
     держалось на классе md:hidden, то есть на Tailwind; полноэкранные
     экраны его не подключают, и панель протекала бы на широкий экран.
     Прячем своим правилом, чтобы не зависеть от чужой сборки. */
  .as-top, .as-nav, .as-offline, .as-sheet, .as-install { display: none !important; }
}
.as-toast {
  pointer-events: auto; background: var(--u-invert); color: var(--u-on-invert); border-radius: 16px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(16,24,40,.28); font-size: 14px; font-weight: 600;
  animation: as-toast .22s cubic-bezier(.2,.7,.2,1);
}
.as-toast-x {
  border: 0; background: transparent; color: #93c5fd; font-size: 14px;
  font-weight: 700; cursor: pointer; padding: 6px;
}
@keyframes as-toast { from { opacity: 0; transform: translateY(14px); }
                      to   { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   Переход между страницами.

   Кросс-документный View Transition: браузер сам сшивает старую страницу с
   новой, никакого SPA и перехвата ссылок. Кто не умеет — просто
   игнорирует правило и получает прежнюю навигацию, поэтому риск нулевой.

   Осознанно НЕ включаем hx-boost на всю CRM: он перехватывает и формы, а на
   них висит офлайн-очередь платежей — сломать её дороже, чем выиграть на
   плавности. Вернуться к этому, когда будет кому проверить на живом
   телефоне.
   --------------------------------------------------------------------------- */
@view-transition { navigation: auto; }

@media (max-width: 767px) {
  ::view-transition-old(root) {
    animation: bm-page-out .16s cubic-bezier(.4, 0, 1, 1) both;
  }
  ::view-transition-new(root) {
    animation: bm-page-in .22s cubic-bezier(0, 0, .2, 1) both;
  }
}
@keyframes bm-page-out { to { opacity: 0; transform: translateX(-8px); } }
@keyframes bm-page-in { from { opacity: 0; transform: translateX(10px); } }

/* Жест «назад» от левого края: страница едет за пальцем. Возврат домой —
   с доводкой, уход — резче, чтобы не ждать окончания уже принятого
   решения. */
body.bm-back-drag { transition: none; }
body.bm-back-snap { transition: transform .2s cubic-bezier(.32, .72, 0, 1); }

/* ---------------------------------------------------------------------------
   Полоса перехода и скелетоны — «экран всегда имеет форму».

   Полоса ползёт к 90 % и там ждёт: честно показать долю загрузки страницы
   браузер не даёт, а дорисовка до конца при живом запросе — враньё, после
   которого ждут ещё дольше. Уходит вместе со старой страницей.
   --------------------------------------------------------------------------- */
.as-prog {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 210;
  background: transparent; pointer-events: none;
}
.as-prog > i {
  display: block; height: 100%; width: 0; background: var(--u-blue);
  border-radius: 0 2px 2px 0; transition: width .35s ease-out;
}
.as-prog.is-go > i { width: 90%; transition: width 2.4s cubic-bezier(.1,.7,.1,1); }

/* Скелетон: форма будущего содержимого, а не кружок. Кружок не сообщает ни
   формы, ни прогресса, и на его месте потом всё прыгает. */
.bm-skel {
  background: var(--u-border-soft); border-radius: 12px;
  background-image: linear-gradient(90deg, var(--u-border-soft) 0%, var(--u-page) 50%, var(--u-border-soft) 100%);
  background-size: 240px 100%;
  /* 1.6 с, а не 1.1: быстрая переливка сама выглядит суетой и торопит там,
     где ускорить нельзя. Совпадает с длительностью из макета. */
  animation: bm-shimmer 1.6s linear infinite;
}
@keyframes bm-shimmer { from { background-position: -240px 0; }
                        to   { background-position: 240px 0; } }
.bm-skel-row { height: 56px; margin-bottom: 10px; }
.bm-skel-line { height: 14px; margin-bottom: 8px; }

/* htmx своих стилей не приносит: индикатор видно только пока запрос в
   пути. Держим место схлопнутым, иначе шторка поиска дёргается. */
.as-search-skel { display: none; padding: 12px 16px 0; }
.htmx-request .as-search-skel,
.as-search-skel.htmx-request { display: block; }

/* ---------------------------------------------------------------------------
   Быстрые действия по долгому нажатию.

   Не дубль карточки: только то, ради чего в неё и заходили. Строки
   крупные — по ним попадают, не глядя, сразу после того, как убрали палец.
   --------------------------------------------------------------------------- */
.bm-menu-scrim {
  position: fixed; inset: 0; z-index: 120; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(16, 24, 40, .28);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.bm-menu {
  width: 100%; max-width: 300px; background: var(--u-surface); border: 1px solid var(--u-border);
  border-radius: 20px; overflow: hidden; box-shadow: var(--u-sh-3);
  animation: bm-menu-in .18s cubic-bezier(.32, .72, 0, 1);
}
@keyframes bm-menu-in { from { opacity: 0; transform: scale(.92); }
                        to   { opacity: 1; transform: none; } }
.bm-menu-h { padding: 12px 16px; background: var(--u-page); border-bottom: 1px solid var(--u-border); }
.bm-menu-t { font-size: 15px; font-weight: 700; color: var(--u-text); }
.bm-menu-s { font-size: 13px; color: var(--u-muted); margin-top: 2px; }
.bm-menu-i {
  min-height: 56px; padding: 0 16px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 600;
  color: var(--u-text); text-decoration: none; border-bottom: 1px solid var(--u-border-soft);
}
.bm-menu-i em { font-style: normal; font-size: 13px; font-weight: 500; color: var(--u-muted); }
.bm-menu-x {
  width: 100%; min-height: 56px; border: 0; background: var(--u-surface);
  font-size: 15px; font-weight: 600; color: var(--u-muted);
}

/* ---------------------------------------------------------------------------
   Экран запуска.

   Показывается только в приложении с домашнего экрана (display-mode:
   standalone) и только при холодном старте: класс bm-ready ставит скрипт в
   <head>, если в этой сессии приложение уже открывали. Внутри сессии каждая
   навигация — перезагрузка страницы, и заставка мигала бы на каждом шаге.
   --------------------------------------------------------------------------- */
.as-splash { display: none; }

@media (display-mode: standalone), (display-mode: fullscreen) {
  html:not(.bm-ready) .as-splash {
    position: fixed; inset: 0; z-index: 200;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; background: var(--u-surface);
    transition: opacity .18s linear;
  }
  html:not(.bm-ready) .as-splash img { border-radius: 24px; }
  html:not(.bm-ready) .as-splash.is-gone { opacity: 0; pointer-events: none; }
}
.as-splash-t { font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--u-text); }
.as-splash-s { position: absolute; bottom: calc(44px + env(safe-area-inset-bottom, 0px));
               font-size: 12px; color: var(--u-muted); }

/* Человек попросил систему меньше двигаться — значит меньше двигается всё,
   а не три класса оболочки, как было раньше. Жесты продолжают работать:
   палец по-прежнему тянет экран, просто без доводочной анимации. Не ноль,
   а 1 мкс: нулевая длительность в части браузеров не даёт событию
   transitionend сработать, и код, который его ждёт, зависает. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------
   Ощущение приложения на iPhone (2026-08-01).

   Это не косметика: каждое правило убирает конкретное поведение Safari,
   по которому человек понимает, что перед ним сайт, а не приложение.
   --------------------------------------------------------------------------- */
@media (max-width: 767px) {

  /* Зум при фокусе в поле. iOS увеличивает страницу, если у поля шрифт
     меньше 16 px, и обратно уже не возвращает — экран остаётся «уехавшим».
     Наши поля были 13 px, то есть зумило всегда. */
  input, select, textarea, .u-input, .u-select, .u-textarea {
    font-size: 16px !important;
  }

  /* Серая вспышка по тапу — самый заметный признак браузера. */
  a, button, summary, label, .as-item, [role="button"] {
    -webkit-tap-highlight-color: transparent;
  }

  /* ...но взамен обязан появиться свой отклик, иначе палец не получает
     ответа вообще: вспышку мы убрали 2026-08-01, а замену не поставили, и
     до результата (перезагрузка страницы) экран полсекунды выглядел
     мёртвым. Отклик мгновенный и держится, пока палец на экране: результат
     может прийти позже, реакция — не может.

     Переход только на возврате: подсветка обязана появляться в тот же
     кадр, а гаснуть плавно. */
  a, button, summary, label, .as-item, [role="button"], .u-btn,
  [data-tap], .q-card, .dlm-card {
    transition: filter .12s ease-out, transform .12s ease-out;
  }
  a:active, button:active:not(:disabled), summary:active, label:active,
  .as-item:active, [role="button"]:active, .u-btn:active:not(:disabled),
  [data-tap]:active, .q-card:active, .dlm-card:active {
    filter: brightness(.94);
    transform: scale(.988);
    transition: none;
  }
  /* Отключённой кнопке отвечать нечем — ей нажатие ничего не меняет. */
  button:disabled:active, .u-btn:disabled:active { filter: none; transform: none; }

  /* Долгое нажатие на карточку не должно выделять текст и звать меню
     «Скопировать / Найти». В приложении так не бывает. */
  .as-nav, .as-head, .as-item, .pt-btn, .d-btn, button, summary {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  /* Но текст, который читают и копируют (суммы, номера, адреса), выделять
     можно — иначе клиент не скопирует реквизиты. */
  input, textarea, .u-num, .pt-v, .pt-due, .ct-sec-body, .as-search-field {
    -webkit-user-select: text;
    user-select: text;
  }

  /* Резиновая прокрутка всей страницы: в приложении «оттягивается» список,
     а не весь экран вместе с шапкой. */
  html, body { overscroll-behavior-y: none; }

  /* Нижняя панель и плавающие кнопки — над домашней полосой iPhone. */
  .as-nav { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Второй вход к полю съёмки: приложить готовый снимок из архива телефона.
   Одинаков на всех экранах — человек узнаёт кнопку, а не разгадывает её. */
.bm-fromarch { display: block; width: 100%; margin-top: 8px;
  font: 500 13px/1 var(--u-font, inherit); color: #475569;
  background: var(--u-surface); border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 11px 12px; cursor: pointer; text-align: center; }
.bm-fromarch:active { filter: brightness(.94); }
