/* ==========================================================================
   app.css — экраны сотрудника. Телефон в руке, солнце в глаза, палец в перчатке.

   Правила, из которых выведено всё остальное:
   · тёмный текст на светлом фоне — экран смотрят на улице;
   · нет ни одной цели нажатия мельче 44×44;
   · нет ни одного состояния, которое показывается ТОЛЬКО по наведению мыши;
   · горизонтального скролла у страницы нет вообще, ширина от 320 px;
   · нижняя полоса живёт выше системной черты iPhone (safe-area-inset-bottom).
   ========================================================================== */

:root {
  --bg:        #f4f2ee;
  --surface:   #ffffff;
  --ink:       #1b1a17;
  --ink-soft:  #56534c;
  --muted:     #807c74;
  --line:      #e2ded6;
  --line-hard: #cfc9be;

  --accent:      #2f6f4f;   /* основное действие */
  --accent-dark: #24583e;

  --ok:    #2e8b57;
  --low:   #d98324;
  --none:  #c0392b;

  --self:      #2f5d8a;     /* режим «Съели сами» */
  --self-bg:   #e8f0f8;
  --defect:    #a8501f;     /* режим «Испортилось» */
  --defect-bg: #fbeee2;

  --r:  14px;
  --r-s: 10px;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --dock-h: 84px;           /* высота нижней полосы без чека */
}

* { box-sizing: border-box; }

/* Атрибут hidden обязан побеждать любой display ниже по файлу.
   Без этого спрятанные экраны (боковая шторка, чек, вкладки) остаются на виду:
   у браузера [hidden] слабее, чем .btn{display:flex}. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;          /* горизонтального скролла у страницы нет */
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;              /* убирает задержку 300 мс */
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

h1, h2, h3, p, ul, li { margin: 0; padding: 0; }
ul { list-style: none; }

/* Тексты интерфейса не выделяются пальцем — случайное «копировать» только мешает.
   Поля ввода — исключение. */
.app { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }

/* --------------------------------------------------------------------------
   Загрузка и фатальная ошибка
   -------------------------------------------------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 100;
  padding: 24px;
}
.boot-box { max-width: 340px; text-align: center; }
.boot-spin {
  width: 34px; height: 34px;
  margin: 0 auto 18px;
  border: 3px solid var(--line-hard);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot-msg  { font-size: 19px; font-weight: 600; }
.boot-hint { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }
.boot #bootRetry { margin-top: 22px; }
.boot.error .boot-spin { display: none; }

/* --------------------------------------------------------------------------
   Верхняя панель
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding-top: var(--safe-t);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 4px 10px;
}

.title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px 0 4px;
  font-size: 17px;
  color: var(--accent);
  font-weight: 600;
  border-radius: var(--r-s);
}
.icon-btn:active { background: rgba(0,0,0,.07); }
.chev {
  width: 11px; height: 11px;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
}

.more-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.more-btn:active { background: #3a3733; }

/* Точка синхронизации: маленькая, в углу, ничего не перекрывает */
.syncdot {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.syncdot::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.syncdot.ok::after      { background: var(--ok); }
.syncdot.wait::after    { background: var(--low); }
.syncdot.offline::after { background: var(--line-hard); border: 2px solid var(--muted); width: 12px; height: 12px; }

/* --------------------------------------------------------------------------
   Чипы разделов
   -------------------------------------------------------------------------- */

.chips {
  display: flex;
  gap: 8px;
  padding: 6px 10px 9px;
  overflow-x: auto;                 /* скроллится ЛЕНТА, не страница */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 22px;
  background: var(--surface);
  border: 1.5px solid var(--line-hard);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-soft);
}
.chip:active { background: #ebe7df; }
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Основная область
   -------------------------------------------------------------------------- */

.main {
  padding: 12px 10px calc(var(--dock-h) + var(--safe-b) + 24px);
  max-width: 100%;
}
body.no-tabs { --dock-h: 16px; }
/* Чек-полоса добавляет высоты нижней полосе — иначе последняя строка списка
   прячется под ней и выглядит как обрезанная. */
body.has-check { --dock-h: 160px; }
body.no-tabs.has-check { --dock-h: 92px; }

.sect { margin-bottom: 18px; }
.sect-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 4px 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Плитка товара — вся целиком цель нажатия
   -------------------------------------------------------------------------- */

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 104px;
  padding: 10px 10px 8px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform .06s ease;
}
.tile:active {
  transform: scale(.97);
  background: #f0ece4;
}

/* Цветная полоса статуса — слева во всю высоту */
.tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 9px;
  background: var(--ok);
}
.tile.s-low::before  { background: var(--low); }
.tile.s-none::before { background: var(--none); }

.tile-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: pre-line;          /* short в каталоге приходит с переносом */
  color: var(--ink);
  word-break: break-word;
  max-height: 3.6em;
  overflow: hidden;
}

.tile-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

.tile-stock {
  font-size: clamp(34px, 10.5vw, 44px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.tile.s-none .tile-stock { color: var(--none); }
.tile.s-low  .tile-stock { color: #b06a15; }

.tile-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* короткая вспышка после записи — видно, что касание засчитано */
.tile.hit { animation: hit .32s ease; }
@keyframes hit {
  0%   { background: #dff0e4; }
  100% { background: var(--surface); }
}

/* --------------------------------------------------------------------------
   Режимы списания: перекрашено целиком, цен нет
   -------------------------------------------------------------------------- */

body.mode-self   { --bg: var(--self-bg); --surface: #f7fafd; --line: #c9d9e8; }
body.mode-defect { --bg: var(--defect-bg); --surface: #fdf7f1; --line: #ebd4bd; }
body.mode-self   .tile-price,
body.mode-defect .tile-price { color: var(--ink); font-weight: 700; }
body.mode-self   .tile:active { background: #dae7f3; }
body.mode-defect .tile:active { background: #f4e2d0; }

/* В режиме списания шапка режима И ЕСТЬ шапка: обычная строка с заголовком
   осталась бы пустой полосой на 52 px (всё в ней прячется). */
body.mode-self   .topbar-row,
body.mode-defect .topbar-row { display: none; }

.modebar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 6px 10px 6px 16px;
  color: #fff;
  background: var(--self);
}
body.mode-defect .modebar { background: var(--defect); }
.modebar-text {
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.15;
}
.modebar-exit {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.modebar-exit:active { background: rgba(255,255,255,.38); }

/* --------------------------------------------------------------------------
   Нижняя полоса: чек + вкладки
   -------------------------------------------------------------------------- */

.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--bg);
  padding-bottom: var(--safe-b);        /* iPhone: выше системной черты */
  border-top: 1px solid var(--line);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px 8px 8px;
}
.tab {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  background: transparent;
  border: 1.5px solid transparent;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--muted);
  text-align: center;
}
.tab:active { background: rgba(0,0,0,.06); }
.tab.on {
  background: var(--surface);
  border-color: var(--line-hard);
  color: var(--ink);
}

/* Чек-полоса */
.check {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.check-info {
  flex: 1 1 auto;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 12px;
  border-radius: var(--r);
  background: #f0ece4;
  font-size: 18px;
  font-weight: 700;
}
.check-info small {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.check-info:active { background: #e5e0d6; }

.check-done, .check-undo {
  flex: 0 0 auto;
  min-height: 56px;
  min-width: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  font-weight: 800;
  font-size: 17px;
}
.check-done { background: var(--accent); color: #fff; }
.check-done:active { background: var(--accent-dark); }
.check-undo { background: var(--none); color: #fff; letter-spacing: .02em; }
.check-undo:active { background: #97281c; }

.check.done .check-info { background: #e8f2e9; }

.checklist {
  max-height: 46vh;
  overflow-y: auto;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.cl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.cl-name { flex: 1 1 auto; font-size: 16px; font-weight: 600; min-width: 0; }
.cl-qty  { flex: 0 0 auto; font-size: 17px; font-weight: 800; min-width: 34px; text-align: right; }
.cl-minus {
  flex: 0 0 auto;
  min-width: 56px; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-s);
  background: #f0ece4;
  font-size: 20px;
  font-weight: 800;
}
.cl-minus:active { background: #e0dad0; }

/* --------------------------------------------------------------------------
   Кнопки, списки, карточки
   -------------------------------------------------------------------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 12px 18px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1.5px solid var(--line-hard);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.btn:active { background: #ebe7df; }
.btn[disabled] { opacity: .45; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dark); }
.btn-danger  { background: var(--none); border-color: var(--none); color: #fff; }
.btn-danger:active { background: #97281c; }
.btn-ghost   { background: transparent; border-color: transparent; color: var(--accent); font-weight: 600; }
.btn-ghost:active { background: rgba(0,0,0,.06); }
.btn-big { min-height: 72px; font-size: 19px; }

.menu { display: flex; flex-direction: column; gap: 10px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 19px;
  font-weight: 700;
}
.menu-item:active { background: #ebe7df; }
.menu-item .mi-sub {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}
.mi-mark {
  flex: 0 0 auto;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.mi-mark.self   { background: var(--self); }
.mi-mark.defect { background: var(--defect); }
.mi-mark.count  { background: #7a5ea8; }
.mi-mark.recv   { background: var(--ok); }
.mi-mark.log    { background: var(--muted); }
.mi-mark.new    { background: var(--ink); }
.mi-body { flex: 1 1 auto; min-width: 0; }

.lead {
  font-size: 16px;
  color: var(--ink-soft);
  padding: 0 4px 14px;
  line-height: 1.4;
}
.big-sum {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.big-sum b { font-size: 30px; font-weight: 800; display: block; line-height: 1.1; }
.big-sum span { font-size: 15px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  padding: 40px 20px;
  line-height: 1.5;
}

.owner-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 18px 10px 4px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   «Привезли» — строки со степперами
   -------------------------------------------------------------------------- */

.search {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  margin-bottom: 12px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-hard);
  background: var(--surface);
  font-size: 17px;               /* 17px, иначе iOS зумит страницу на фокусе */
  -webkit-appearance: none;
  appearance: none;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

.rrow {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.rrow-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.rrow-name { font-size: 17px; font-weight: 700; min-width: 0; }
.rrow-have { font-size: 14px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.rrow-have b { color: var(--ink); font-size: 17px; }
.rrow-added { color: var(--ok); font-weight: 700; }
.steppers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.step {
  min-height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-s);
  background: #eef4ef;
  border: 1.5px solid #cfe0d5;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 800;
}
.step:active { background: #dcebe1; }

/* --------------------------------------------------------------------------
   «Пересчёт»
   -------------------------------------------------------------------------- */

.zone {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 10px;
}
.zone:active { background: #ebe7df; }
.zone.done { background: #eef6f0; border-color: #cfe4d6; }
.zone-body { flex: 1 1 auto; min-width: 0; }
.zone-name { font-size: 18px; font-weight: 700; }
.zone-sub  { font-size: 14px; color: var(--muted); margin-top: 2px; }
.zone-badge {
  flex: 0 0 auto;
  min-width: 62px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
}
.zone.done .zone-badge { color: var(--ok); }

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 14px;
}
.progress-text { font-size: 15px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-hard); }
.dot.on { background: var(--accent); }
.dot.now { background: var(--ink); transform: scale(1.25); }

.count-name {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  padding: 6px 4px 4px;
}
.count-ask { font-size: 17px; color: var(--ink-soft); padding: 0 4px 12px; }

/* Клавиатура цифр — своя, крупная, без прыжков системной */
.pad-val {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--line-hard);
  border-radius: var(--r);
  font-size: 44px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.pad-val.empty { color: var(--line-hard); }
.pad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.key {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  background: var(--surface);
  border: 1.5px solid var(--line-hard);
  font-size: 26px;
  font-weight: 700;
}
.key:active { background: #e2ded6; }
.key.soft { font-size: 19px; font-weight: 700; color: var(--ink-soft); }

.diff-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 14px;
}
.diff-box.ok { background: #eef6f0; border-color: #cfe4d6; }
.diff-head { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.diff-text { font-size: 17px; color: var(--ink-soft); line-height: 1.4; }
.cause-title { font-size: 16px; font-weight: 700; padding: 4px 4px 10px; }
.cause-hint  { font-size: 14px; color: var(--muted); padding: 0 4px 12px; }
.cause-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

/* --------------------------------------------------------------------------
   «Что я записала сегодня»
   -------------------------------------------------------------------------- */

.log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.log-time { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--muted); width: 44px; }
.log-body { flex: 1 1 auto; min-width: 0; }
.log-title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.log-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.log-row.voided { opacity: .55; }
.log-row.voided .log-title { text-decoration: line-through; }
.log-undo {
  flex: 0 0 auto;
  min-width: 100px; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-s);
  background: #f0ece4;
  font-size: 15px;
  font-weight: 700;
}
.log-undo:active { background: #e0dad0; }
.log-gone { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--muted); }
.log-confirm { display: flex; gap: 8px; flex: 0 0 auto; }
.log-confirm .btn { min-height: 48px; width: auto; padding: 0 14px; font-size: 15px; }

.log-kind-sale   .log-title::before { content: "▲ "; color: var(--ok); }
.log-kind-self   .log-title::before { content: "● "; color: var(--self); }
.log-kind-defect .log-title::before { content: "● "; color: var(--defect); }
.log-kind-receipt .log-title::before { content: "▼ "; color: var(--muted); }
.log-kind-count  .log-title::before { content: "◆ "; color: #7a5ea8; }
.log-kind-new    .log-title::before { content: "＋ "; color: var(--ink); }

/* --------------------------------------------------------------------------
   «Новая позиция» — форма
   -------------------------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field-label { font-size: 15px; font-weight: 700; color: var(--ink-soft); padding: 0 4px 6px; display: block; }
.field-input {
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-hard);
  background: var(--surface);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}
.field-input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-btn {
  min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  background: var(--surface);
  border: 1.5px solid var(--line-hard);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .03em;
  text-align: center;
}
.seg-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg-btn:active { background: #e2ded6; }
.seg-btn.on:active { background: #3a3733; }

/* --------------------------------------------------------------------------
   Шторка (мягкие вопросы) и подсказка
   -------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20,18,15,.45);
  z-index: 50;
}

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 18px 14px calc(18px + var(--safe-b));
  max-height: 88vh;
  overflow-y: auto;
  animation: rise .16s ease-out;
  box-shadow: 0 -6px 24px rgba(0,0,0,.14);
}
@keyframes rise { from { transform: translateY(22px); } to { transform: none; } }

.sheet-title { font-size: 22px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.sheet-sub { font-size: 16px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.35; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }

.toast {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--dock-h) + var(--safe-b) + 14px);
  z-index: 70;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  animation: rise .14s ease-out;
}
.toast.bad { background: var(--none); }

/* Узкие телефоны (от 320 px) — ничего не должно вылезать по горизонтали */
@media (max-width: 340px) {
  .tile { padding-left: 16px; }
  .tile-name { font-size: 14px; }
  .check-done, .check-undo { min-width: 96px; font-size: 16px; }
  .more-btn { padding: 0 14px; }
  .tab { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
