/* Кедр — оформление. Один файл на всё приложение. */

:root {
  --green:  #2F6B4F;
  --green-d:#245440;
  --ink:    #1A1A1A;
  --muted:  #6E6E6E;
  --faint:  #8A8A85;
  --line:   #E8E6E1;
  --cline:  #EDEBE6;
  --bg:     #F6F5F2;
  --red:    #C0392B;
  --amber:  #B8862B;
  --slate:  #4A6178;

  --r-card: 14px;
  --r-btn:  10px;
  --shadow: 0 2px 10px rgba(26,26,26,.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ══ Ощущение приложения, а не сайта ═════════════════════════════════════
 *
 * Здесь убраны привычки браузера, которые выдают в приложении веб-страницу:
 * синяя рамка вокруг нажатой кнопки, выделение текста пальцем, меню по
 * долгому нажатию, оттягивание страницы вниз и зум по двойному тапу.
 * ═══════════════════════════════════════════════════════════════════════ */

/* Браузер сам обводит нажатую кнопку — на телефоне это читается
   как синее свечение. Убираем, но для тех, кто ходит с клавиатуры,
   рамку оставляем: :focus-visible срабатывает только на Tab, не на палец. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;

  /* Страница не оттягивается за край и не перезагружается рывком вниз */
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  /* Текст не выделяется пальцем и долгое нажатие не зовёт меню браузера */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  /* Нет зума по двойному тапу и нет задержки 300 мс перед нажатием */
  touch-action: manipulation;
}

/* Там, где текст нужно набирать или скопировать — выделение возвращаем */
input, textarea, select, .pickable, .pickable * {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}

/* Картинки нельзя утащить и «сохранить как» долгим нажатием */
img { -webkit-user-drag: none; user-select: none; }

::selection { background: rgba(47,107,79,.18); }

input, button, select, textarea { font-family: inherit; font-size: 16px; }
button { cursor: pointer; }

/* Нажатие должно отзываться сразу — как в приложении, без задержки */
.btn, .tile, button.row, .back, .out, .opt, .av, .thumb { touch-action: manipulation; }
.btn:active, .tile:active, button.row:active, .back:active, .out:active,
.goods-main:active, .cat-main:active {
  transform: scale(.982);
}
.btn, .tile, button.row, .back, .out, .goods-main, .cat-main {
  transition: transform .08s ease, background .12s ease;
}
button.row:active, .tile:active { background: #FAF9F7; }

/* Пока приложение запущено с домашнего экрана, под системными
   панелями оставляем воздух — иначе шапка лезет под часы. */
@media (display-mode: standalone) {
  .hdr { padding-top: calc(12px + env(safe-area-inset-top)); }
  .page { padding-left: calc(16px + env(safe-area-inset-left));
          padding-right: calc(16px + env(safe-area-inset-right)); }
}

/* ── Каркас ────────────────────────────────────────────────────────────── */

.hdr {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: #fff; border-bottom: 1px solid var(--line);
  transition: transform .22s ease;
}
.hdr.hide { transform: translateY(-100%); }
.hdr img { width: 26px; height: 26px; object-fit: contain; }
.hdr .brand { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.hdr .spacer { flex: 1; }
.hdr .who { font-size: 15px; font-weight: 600; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
.hdr .out {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: var(--r-btn); min-height: 38px; padding: 0 13px; font-size: 15px;
}

.page { max-width: 1160px; margin: 0 auto; padding: 16px; }
.page.narrow { max-width: 680px; }

/* ── Заголовок раздела ─────────────────────────────────────────────────── */

.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.back {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: var(--r-btn); min-height: 40px; padding: 0 14px; font-size: 15px;
}
.sec { display: flex; align-items: center; gap: 10px; }
.sec .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 32px; }
.sec .ic svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2;
               stroke-linecap: round; stroke-linejoin: round; }
.sec h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.rule { height: 3px; border-radius: 2px; margin: 8px 0 16px; }

/* ── Карточки и списки ─────────────────────────────────────────────────── */

.card {
  background: #fff; border: 1px solid var(--cline);
  border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow);
}
.list { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--cline); border-radius: var(--r-card);
  padding: 14px 16px; box-shadow: var(--shadow); text-align: left; width: 100%;
  color: inherit; position: relative; overflow: hidden;
}
button.row { border-color: var(--cline); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.row .sub   { font-size: 13px; color: var(--faint); margin-top: 3px;
              display: flex; align-items: center; gap: 5px; }
.row .chev  { color: #C9C6C0; font-size: 20px; flex: 0 0 auto; }
.row .strip { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }

.group { font-size: 13px; color: var(--faint); font-weight: 600;
         letter-spacing: .04em; text-transform: uppercase; margin: 16px 2px 4px; }
.group:first-child { margin-top: 2px; }

.av { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px;
      display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700; }

.thumb { width: 44px; height: 44px; border-radius: 10px; flex: 0 0 44px;
         display: grid; place-items: center; overflow: hidden;
         color: #fff; font-size: 12px; font-weight: 700; text-align: center;
         padding: 3px; line-height: 1.1; }
.thumb.big { width: 56px; height: 56px; flex-basis: 56px; border-radius: 12px; }

/* Крупная картинка — в каталоге и в товарах у владельца.
   Занимает всю высоту карточки, чтобы мешок был виден целиком,
   а не пятном в углу. */
.row.prod, .goods-main.prod { align-items: stretch; }
.row.prod { padding: 12px; gap: 11px; }
.row.prod .grow { display: flex; flex-direction: column; justify-content: center; min-width: 0; }

/* Название — максимум две строки, иначе карточки получаются разной высоты
   и список выглядит рваным. */
.row.prod .title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.25;
}

/* Круглая кнопка «добавить» — по центру высоты карточки, а не вверху */
.row.prod .add {
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border-radius: 50%; font-size: 23px; flex: 0 0 44px; align-self: center;
}

.thumb.lg {
  width: 104px; flex: 0 0 104px;
  height: auto; min-height: 104px; align-self: stretch;
  border-radius: 12px; border: 1px solid var(--cline);
  font-size: 15px; padding: 8px; line-height: 1.15;
}
.thumb.lg img { padding: 5px; }

@media (max-width: 380px) {
  .thumb.lg { width: 96px; flex-basis: 96px; min-height: 96px; }
}
/* Фото товара показываем целиком, а не обрезаем — иначе от мешка виден угол */
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; box-sizing: border-box; }

/* ── Плитки главного экрана ────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.tile {
  background: #fff; border: 1px solid var(--cline); border-radius: 16px;
  min-height: 112px; padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  box-shadow: var(--shadow); position: relative;
}
.tile .circ { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.tile .circ svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2;
                  stroke-linecap: round; stroke-linejoin: round; }
.tile .cap { font-size: 17px; font-weight: 600; text-align: center; line-height: 1.2; }
.tile .badge {
  position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 12px; background: var(--red); color: #fff;
  font-size: 13px; font-weight: 700; display: grid; place-items: center;
}

.hello { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 2px; }
.date  { color: var(--muted); font-size: 15px; margin-bottom: 18px; }

/* ── Сводка ────────────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--cline); border-radius: 12px;
  padding: 12px 14px; min-height: 72px; text-align: left;
  display: flex; flex-direction: column; justify-content: center;
}
.stat.on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.stat .n { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.stat .l { font-size: 12px; color: var(--faint); margin-top: 2px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-btn);
  border: 1px solid transparent; background: var(--green); color: #fff;
  font-size: 16px; font-weight: 600;
}
.btn:active { background: var(--green-d); }
.btn.wide { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.slate { background: var(--slate); }
.btn.danger { background: #fff; color: var(--red); border-color: #E9C3BD; }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.fab {
  position: fixed; right: 18px; bottom: 90px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--green); color: #fff; border: 0; font-size: 28px; line-height: 1;
  box-shadow: 0 6px 18px rgba(47,107,79,.32); z-index: 30;
}

/* ── Поля ──────────────────────────────────────────────────────────────── */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .req { color: var(--red); }
.inp {
  width: 100%; min-height: 52px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-btn);
  background: #fff; color: var(--ink); outline: none;
}
.inp:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,107,79,.12); }
textarea.inp { padding: 13px 14px; min-height: 84px; resize: vertical; line-height: 1.45; }

/* Выпадающий список выглядит так же, как обычное поле, со своей стрелкой */
select.inp {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236E665C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* Шапка над списком товаров: подписи к колонкам «Цена» и «Остаток» */
.goods-head { display: flex; align-items: flex-end; justify-content: space-between;
              gap: 10px; margin-bottom: 8px; }
.goods-cols { display: flex; gap: 8px; flex: none; }
/* Строка каталога у владельца: слева товар, справа цена и остаток */
.goods-row { flex-wrap: wrap; align-items: flex-start; row-gap: 10px; }
.goods-main { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 200px;
              min-width: 0; cursor: pointer; }
.goods-main .grow { min-width: 0; }
.goods-edit { display: flex; gap: 8px; flex: none; margin-left: auto; }
.goods-edit .inp { min-height: 40px; text-align: right; }
.goods-edit .inp:first-child { width: 104px; }
.goods-edit .inp:last-child  { width: 84px; }

/* ── Фотография товара ─────────────────────────────────────────────────── */

.ph-box { border: 2px dashed var(--line); border-radius: 14px; padding: 14px;
          background: #FBFAF8; transition: border-color .15s, background .15s; }
.ph-box.over { border-color: var(--green); background: #EFF5F1; }

.ph-empty { text-align: center; padding: 10px 6px; }
.ph-ic { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--faint); }
.ph-ic svg { width: 100%; height: 100%; }
.ph-t { font-weight: 700; font-size: 16px; margin-bottom: 6px; }

.ph-has { display: flex; gap: 14px; align-items: flex-start; }
.ph-has img { width: 110px; height: 110px; object-fit: contain; flex: none;
              background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ph-side { flex: 1; min-width: 0; }

.ph-box.big .ph-has img { width: 160px; height: 160px; }
.ph-box.big .ph-empty { padding: 22px 6px; }

@media (max-width: 420px) {
  .ph-has { flex-direction: column; align-items: stretch; }
  .ph-has img { width: 100%; height: 190px; }
}

/* Большое фото в карточке товара — его агент показывает клиенту.
   Высота под портретный снимок: мешок стоит вертикально, и в низкой
   полоске от него видно только середину. */
.pic-lg { height: 320px; margin-bottom: 14px; border-radius: 12px; background: #fff;
          border: 1px solid var(--line); display: grid; place-items: center;
          overflow: hidden; cursor: pointer; position: relative; }
/* Картинку прибиваем к рамке всеми четырьмя сторонами.
   Иначе внутри сетки «высота 100%» считать не от чего: браузер
   брал высоту самого снимка, тот вылезал за рамку и обрезался —
   от вертикального мешка было видно только середину. */
.pic-lg img {
  position: absolute; inset: 10px;
  width: calc(100% - 20px); height: calc(100% - 20px);
  object-fit: contain; display: block;
}

/* Подсказка, что по фото можно нажать и рассмотреть */
.pic-lg .zoom {
  position: absolute; right: 10px; bottom: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted);
  box-shadow: 0 2px 6px rgba(26,26,26,.1); pointer-events: none;
}
.pic-lg .zoom svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2;
                    stroke-linecap: round; stroke-linejoin: round; }

@media (max-height: 700px) { .pic-lg { height: 260px; } }

/* Полоса «сколько товаров уже с фото» */
.ph-bar { height: 8px; border-radius: 4px; background: #E8E6E1; overflow: hidden; }
.ph-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width .25s; }

/* Строка категории: слева название, справа стрелки и «Править» */
.cat-row { flex-wrap: wrap; row-gap: 10px; }
.cat-main { display: flex; gap: 12px; align-items: center; flex: 1 1 180px;
            min-width: 0; cursor: pointer; }
.cat-main .grow { min-width: 0; }
.cat-acts { display: flex; gap: 6px; align-items: center; flex: none; margin-left: auto; }
.cat-acts .btn:not(:last-child) { width: 40px; padding: 0; }
@media (max-width: 480px) { .cat-main { flex: 1 1 100%; } }

/* На телефоне цена и остаток уезжают на свою строку — название не сжимается */
@media (max-width: 520px) {
  .goods-main { flex: 1 1 100%; }
  .goods-edit { margin-left: auto; }
  .goods-head { font-size: 12px; }
}
.inp-ic { position: relative; }
.inp-ic .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
              width: 18px; height: 18px; stroke: var(--faint); fill: none; stroke-width: 2; }
.inp-ic .inp { padding-left: 42px; }

.search { display: flex; gap: 10px; margin-bottom: 12px; }
.search .inp { min-height: 48px; }

.seg { display: flex; gap: 6px; background: #EFEEEA; border-radius: 12px; padding: 4px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 9px;
              background: transparent; color: var(--muted); font-size: 16px; font-weight: 600; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ── Плашки статусов ───────────────────────────────────────────────────── */

.pill { display: inline-flex; align-items: center; gap: 4px;
        font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 9px; white-space: nowrap; }

/* ── Нижняя закреплённая панель ────────────────────────────────────────── */

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(26,26,26,.06);
}
.dock .inner { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.dock .sums { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dock .sums .l { font-size: 14px; color: var(--muted); }
.dock .sums .r { font-size: 20px; font-weight: 700; color: var(--green); }
/* Запас под нижнюю панель с суммой: на телефоне у неё ещё и отступ
   под системные кнопки, поэтому считаем с ним. */
.has-dock { padding-bottom: calc(168px + env(safe-area-inset-bottom)); }

/* ── Полоска «вышло обновление» ────────────────────────────────────────── */

.upd {
  position: fixed; left: 12px; right: 12px; z-index: 55;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  background: #221E1A; color: #fff;
  border-radius: 14px; padding: 12px 12px 12px 16px;
  font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.28);
  animation: updup .25s ease;
}
.upd span { flex: 1; }
.upd .btn { min-height: 40px; padding: 0 16px; flex: none; }
@keyframes updup { from { transform: translateY(14px); opacity: 0; } }

/* Если внизу уже стоит панель с суммой заказа — полоску поднимаем,
   чтобы она не перекрыла кнопку «Отправить заказ». */
#app:has(.dock) .upd { bottom: calc(104px + env(safe-area-inset-bottom)); }

/* Имя в шапке — кнопка, ведёт в профиль */
.hdr .who { border: 0; background: none; color: inherit; padding: 6px 4px;
            font-size: 15px; font-weight: 600; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
.hdr .who:active { opacity: .6; }

/* Табличка «что накопилось» в очистке */
.cnt { width: 100%; border-collapse: collapse; font-size: 15px; }
.cnt td { padding: 8px 0; border-bottom: 1px solid #F3F1EC; }
.cnt td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cnt tr:last-child td { border-bottom: 0; }
.cnt tr.keep td { color: var(--faint); font-weight: 400; }
.cnt tr.keep td:last-child { font-weight: 600; color: var(--faint); }

/* Журнал сбоев в профиле */
.log { background: #221E1A; color: #E6E0D8; padding: 12px; border-radius: 10px;
       overflow-x: auto; font-size: 12px; line-height: 1.55; margin: 0;
       max-height: 320px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }

/* Строка «Установить Кедр на телефон» на главной */
.row.install { border-color: #CFE0D6; background: #F3F8F5; }
.row.install .av svg { width: 20px; height: 20px; stroke: #fff; fill: none;
                       stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Выезжающая панель (фильтры и прочее) ──────────────────────────────── */

.sheet-bg { position: fixed; inset: 0; background: rgba(26,26,26,.42); z-index: 50;
            opacity: 0; transition: opacity .2s; }
.sheet-bg.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  background: #fff; border-radius: 18px 18px 0 0; max-height: 86vh;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .24s ease;
}
.sheet.on { transform: none; }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: #DDDBD5; margin: 10px auto 2px; }
.sheet .sh-top { display: flex; align-items: center; gap: 12px; padding: 8px 18px 12px; }
.sheet .sh-top h2 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; }
.sheet .sh-body { overflow-y: auto; padding: 0 8px 12px; flex: 1; }
.sheet .sh-foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
                  border-top: 1px solid var(--line); }
.sheet .sh-foot .btn.ghost { flex: 0 0 110px; }
.sheet .sh-foot .btn:not(.ghost) { flex: 1; min-width: 0; }
.sheet .sh-foot .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 760px) {
  .sheet { left: auto; top: 0; width: 380px; max-height: none; border-radius: 0;
           transform: translateX(100%); }
  .sheet.on { transform: none; }
}

.opt { display: flex; align-items: center; gap: 12px; width: 100%;
       min-height: 48px; padding: 0 14px; border: 0; background: none;
       color: var(--ink); font-size: 16px; text-align: left; border-radius: 10px; }
.opt:active { background: #F6F5F2; }
.opt .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #CFCCC6;
            flex: 0 0 22px; display: grid; place-items: center; }
.opt.on .box { background: var(--green); border-color: var(--green); }
.opt.on .box::after { content: '✓'; color: #fff; font-size: 14px; line-height: 1; }
.opt .n { margin-left: auto; color: var(--faint); font-size: 14px; }
.opt-h { font-size: 13px; color: var(--faint); font-weight: 600;
         letter-spacing: .04em; text-transform: uppercase; padding: 14px 14px 5px; }

/* ── Количество ────────────────────────────────────────────────────────── */

.qty { display: flex; align-items: center; gap: 12px; }
.qty button { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line);
              background: #fff; font-size: 26px; line-height: 1; color: var(--ink); }
.qty .v { flex: 1; text-align: center; font-size: 26px; font-weight: 700; }
.qty.mini button { width: 36px; height: 36px; font-size: 20px; border-radius: 9px; }
.qty.mini .v { font-size: 16px; font-weight: 600; }

/* ── Разное ────────────────────────────────────────────────────────────── */

.note { background: #FDF3DF; border: 1px solid #E7D5A8; color: #7A5A12;
        border-radius: 12px; padding: 13px 15px; font-size: 15px; }
.note.bad { background: #FAECEA; border-color: #E9C3BD; color: #8A2D22; }
.note.good { background: #E6F0EA; border-color: #BFD9CC; color: var(--green); }

/* Короткая строчка-предупреждение внутри строки заказа */
.warn-line { font-size: 13px; color: #8A6A12; background: #FDF3DF;
             border-radius: 9px; padding: 7px 11px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  background: #1A1A1A; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 15px; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25);
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translate(-50%, 8px); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }

.money { font-variant-numeric: tabular-nums; }
.gr { color: var(--green); }
.mut { color: var(--muted); }
.sm { font-size: 13px; }
.center { text-align: center; }
.mb0 { margin-bottom: 0; }

.spin { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--green);
        border-radius: 50%; animation: sp .7s linear infinite; margin: 40px auto; }
@keyframes sp { to { transform: rotate(360deg) } }

.drop {
  border: 2px dashed #CFCCC6; border-radius: var(--r-card); background: #fff;
  padding: 28px 20px; text-align: center; color: var(--muted);
}
.drop.over { border-color: var(--green); background: #F0F6F2; }
.drop .t { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }

/* Экран «Показать клиенту» */
.show {
  position: fixed; inset: 0; z-index: 70; background: #fff;
  display: flex; flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}

/* Фото забирает всё свободное место и сжимается первым.
   Текст под ним — flex: none, иначе при нехватке высоты строки
   съёживались и у букв срезало верхушки. */
.show .pic { flex: 1 1 auto; min-height: 90px; border-radius: 16px;
             display: grid; place-items: center;
             color: #fff; font-size: 34px; font-weight: 700; text-align: center;
             padding: 20px; position: relative; }
.show .pic img {
  position: absolute; inset: 16px;
  width: calc(100% - 32px); height: calc(100% - 32px);
  object-fit: contain; display: block;
  transform-origin: center; will-change: transform;
}

/* Пока картинку увеличивают, браузер не должен уводить страницу
   своей прокруткой — все касания забирает себе сама картинка. */
.show .pic.zoomable { touch-action: none; overflow: hidden; cursor: zoom-in; }
.show .pic.zoomed { cursor: grab; }
.show .pic.zoomed img { transition: none; }
.show .pic img { transition: transform .18s ease; }

/* Подсказка показывается один раз и гаснет, как только тронули фото */
.show .pic .hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  background: rgba(26,26,26,.72); color: #fff; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 20px; white-space: nowrap;
  pointer-events: none; transition: opacity .3s; max-width: calc(100% - 24px);
  overflow: hidden; text-overflow: ellipsis;
}
.show .pic .hint.gone { opacity: 0; }
.show .pic { position: relative; }

.show h2, .show .d, .show .p, .show .nav { flex: none; }
.show h2 { font-size: 24px; margin: 18px 0 8px; line-height: 1.3; padding-top: 2px; }
.show .d { font-size: 17px; color: var(--muted); line-height: 1.45;
           display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
           overflow: hidden; }
.show .p { font-size: 34px; font-weight: 700; color: var(--green); margin-top: 14px;
           line-height: 1.25; padding-bottom: 2px; }
.show .nav { display: flex; align-items: center; gap: 12px; margin-top: 18px; }

/* Крестик поверх фото — как в просмотрщике картинок.
   Раньше «Закрыть» стояло в одном ряду со стрелками и на узком
   экране не помещалось. */
.show-x {
  position: absolute; z-index: 2;
  top: calc(14px + env(safe-area-inset-top)); right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.92);
  color: var(--ink); font-size: 18px; line-height: 1;
  box-shadow: 0 2px 8px rgba(26,26,26,.12);
}
.show-x:active { background: #F2F1ED; }

/* Низкий экран — ужимаем текст, но ничего не режем */
@media (max-height: 700px) {
  .show h2 { font-size: 21px; margin: 12px 0 6px; }
  .show .d { font-size: 15px; -webkit-line-clamp: 2; }
  .show .p { font-size: 28px; margin-top: 10px; }
  .show .nav { margin-top: 12px; }
  .show .nav button { width: 46px; height: 46px; }
}
.show .nav button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line);
                    background: #fff; font-size: 20px; }
.show .nav .pos { flex: 1; text-align: center; color: var(--muted); font-size: 15px; }

/* Вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .box { width: 100%; max-width: 400px; }
.login .logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.login .logo img { width: 88px; height: 88px; object-fit: contain; }
.login .logo .n { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.login .logo .s { color: var(--muted); font-size: 15px; text-align: center; }

/* Таблица для компьютера */
.tbl { width: 100%; border-collapse: collapse; background: #fff;
       border: 1px solid var(--cline); border-radius: var(--r-card); overflow: hidden; }
.tbl th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 600;
          letter-spacing: .04em; text-transform: uppercase; padding: 12px 14px;
          background: #FAF9F7; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #F3F1EC; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.only-wide { display: none; }
@media (min-width: 860px) { .only-wide { display: block; } .only-narrow { display: none; } }
