/*
  Кабинет Halyk Market. Один файл стилей, никаких внешних зависимостей.

  Почему так:
    - шрифт системный. Сервер общий и слабый, за веб-шрифтом пришлось бы
      ходить наружу, а системный шрифт на телефоне владельца уже знаком;
    - проверочная ширина 390 пикселей: владелец смотрит кабинет
      с телефона, стоя в аптеке;
    - цветом ничего не кодируется в одиночку. У каждого состояния три
      признака сразу: цвет, слово и форма значка. Проверка простая -
      распечатать страницу чёрно-белой, все состояния должны остаться
      различимыми;
    - акцент (бирюзовый) только для навигации, кнопок и ссылок.
      Состояния живут на своих токенах, иначе «всё хорошо» и «кнопка»
      сливаются в один цвет, и состояние перестаёт читаться.
*/

:root {
  --bg: #f4f6f7;
  --card: #ffffff;
  --ink: #17211f;
  --muted: #65736f;
  --line: #dde4e4;
  --line-strong: #c2cccb;

  --accent: #0b6e7a;
  --accent-soft: #e3eff1;

  --ok: #0f6b4f;
  --ok-soft: #e6f2ed;
  --warn: #8a5411;
  --warn-soft: #fbf0e2;
  --err: #a32b21;
  --err-soft: #fbeae8;

  /* Самый светлый оттенок: «прогона не планировалось», «не отправляем».
     Это не состояние, а отсутствие события, и кричать о нём нельзя. */
  --faint: #edf1f1;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

/* Цифры не должны прыгать при обновлении страницы: разная ширина знаков
   сдвигает колонку цен, и таблица выглядит дёргано. */
.num, td.num, th.num, .tile .n, .kv .v, input[type=number], input[type=text],
.money, .explain b, .formula, table { font-variant-numeric: tabular-nums; }

a { color: var(--accent); }

/* Ширина 1140, а не 1080 как у соседнего кабинета: таблица конкурентов
   на семь колонок, и лишние 60 пикселей избавляют от горизонтальной
   прокрутки на ноутбуке. */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 24px; padding-bottom: 40px; }

.ic { width: 17px; height: 17px; flex: none; vertical-align: -3px; }


/* --- Шапка --------------------------------------------------------------- */

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.brand-text { font-weight: 600; font-size: 15px; white-space: nowrap; }

/*
  Лента разделов прокручивается на ЛЮБОЙ ширине, а не только на телефоне.
  Восьми разделов не хватало места уже на 768 пикселях (окно браузера
  в половину ноутбучного экрана, планшет), и вместо прокрутки внутри
  ленты уезжала вся страница: сдвигались заголовки, таблицы и кнопки.
  Там, где разделы помещаются, это правило ничего не меняет.
*/
.nav {
  display: flex; gap: 4px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 8px 12px; border-radius: 6px; text-decoration: none;
  color: var(--muted); font-size: 14.5px; white-space: nowrap;
}
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.exit {
  color: var(--muted); display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 6px; text-decoration: none;
}
.exit:hover { background: var(--bg); color: var(--ink); }


/* --- Заголовки ----------------------------------------------------------- */

h1 { font-size: 24px; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 15px; margin: 18px 0 8px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 14.5px; max-width: 80ch; }
.sub-tight { margin-bottom: 10px; }
.dim { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); line-height: 1.5; }


/* --- Карточки и плитки --------------------------------------------------- */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px; margin-bottom: 16px;
}
.card-tight { padding: 16px 18px; }
.card h2 .ic { color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tile .n { font-size: 26px; font-weight: 650; line-height: 1.15; }
.tile .n.warn { color: var(--warn); }
.tile .n.err { color: var(--err); }
.tile .n.ok { color: var(--ok); }
.tile .t { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.tile .t a { color: var(--accent); }
.tiles-inner { margin-top: 14px; }
.tiles-inner .tile { background: var(--bg); border-color: transparent; }


/* --- Фраза-вывод --------------------------------------------------------- */
/* Главное отличие обзора: сначала вывод словами, потом подтверждающие
   числа. Плитки в ряд, из которых вывод надо собирать самому, -
   это работа, которую программа должна делать за владельца. */

.verdict {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 16.5px; line-height: 1.45; font-weight: 550;
}
.verdict .ic { width: 19px; height: 19px; margin-top: 3px; }
.verdict-ok .ic { color: var(--ok); }
.verdict-warn .ic { color: var(--warn); }
.verdict-err .ic { color: var(--err); }
.verdict-dim .ic { color: var(--muted); }
.verdict-dim { color: var(--muted); font-weight: 500; }


/* --- Что сделать -------------------------------------------------------- */

.todo { display: grid; gap: 10px; }
.todo-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border-radius: 8px; font-size: 14.5px; line-height: 1.5;
}
.todo-item .ic { margin-top: 2px; }
.todo-ok { background: var(--ok-soft); } .todo-ok .ic { color: var(--ok); }
.todo-warn { background: var(--warn-soft); } .todo-warn .ic { color: var(--warn); }
.todo-err { background: var(--err-soft); } .todo-err .ic { color: var(--err); }
.todo-item a { font-weight: 550; white-space: nowrap; }
.todo-nothing { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 15px; }
.todo-nothing .ic { color: var(--ok); }


/* --- Полоса суток ------------------------------------------------------- */
/* 24 столбика, по одному на час последних суток. Набор обычных блоков:
   библиотека графиков потянула бы внешний файл и работу для браузера
   на телефоне, а картина за сутки читается и так. */

.day { display: flex; gap: 3px; align-items: flex-end; }
.day b {
  display: block; width: 8px; height: 26px; border-radius: 2px;
  background: var(--faint);
}
.day b.ok { background: var(--ok); }
.day b.fail { background: var(--err); }
/* Перенос из-за занятого сервера - серый, а не красный: это штатное
   поведение по правилу очерёдности, и пугать им владельца нельзя. */
.day b.skipped { background: var(--line-strong); }
.day-ends {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--muted); margin-top: 6px; max-width: 262px;
}
.day-text { font-size: 14px; color: var(--muted); margin-top: 10px; }
.day-wrap { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }


/* --- Воронка витрины ---------------------------------------------------- */

.funnel { display: flex; height: 34px; border-radius: 6px; overflow: hidden; background: var(--faint); }
.funnel a {
  display: block; height: 100%; text-decoration: none;
  /* Ширина доли задаётся в разметке процентом, но сжиматься доля может:
     иначе при шести долях минимальные ширины вылезут за край полосы
     и последняя доля окажется обрезанной. */
  flex: 0 1 auto;
  /* Доли меньше двух процентов не должны исчезать: иначе владелец
     никогда не увидит те самые 28 ненайденных товаров. */
  min-width: 7px;
}
.funnel a:hover { filter: brightness(1.08); }
.seg-on { background: var(--ok); }
.seg-out { background: var(--line-strong); }
.seg-not_mapped { background: #d9a24a; }
.seg-expired { background: var(--err); }
.seg-blocked { background: var(--faint); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg-new { background: var(--accent-soft); }

.funnel-legend {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 20px; margin-top: 14px; font-size: 14px;
}
.funnel-legend a { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.funnel-legend a:hover { color: var(--accent); }
.funnel-legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.funnel-legend span { color: var(--muted); }
.funnel-legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }


/* --- Ценовая линейка ---------------------------------------------------- */
/* Главный элемент кабинета. Весь вывод виден картинкой: если самое
   дешёвое предложение - серая точка за пределами затенённой области,
   значит общий минимум держит тот, кто нашему покупателю не конкурент. */

.ruler { position: relative; height: 118px; margin: 26px 0 6px; }
.ruler-axis {
  position: absolute; left: 0; right: 0; top: 46px; height: 2px;
  background: var(--line-strong); border-radius: 2px;
}
.ruler-band {
  position: absolute; top: 30px; height: 34px;
  left: var(--l); width: var(--w);
  background: var(--accent-soft); border-radius: 5px;
}
.ruler-band-label {
  position: absolute; top: 6px; left: var(--l);
  font-size: 12.5px; color: var(--accent); white-space: nowrap;
}
.ruler-pt {
  position: absolute; top: 46px; left: var(--p);
  transform: translate(-50%, calc(-50% - var(--row, 0) * 11px));
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-strong);
}
.ruler-pt.fast { width: 9px; height: 9px; background: var(--ink); }
.ruler-pt.ours {
  width: 13px; height: 13px; background: transparent;
  border: 2.5px solid var(--ink); box-shadow: 0 0 0 3px var(--card);
}
.ruler-you {
  position: absolute; top: 24px; left: var(--p);
  transform: translateX(-50%);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.ruler-anchor {
  position: absolute; left: var(--p); top: calc(62px + var(--row, 0) * 20px);
  font-size: 12.5px; line-height: 1.3; white-space: nowrap;
  color: var(--muted); max-width: 50%;
}
.ruler-anchor.fast { color: var(--ink); }
.ruler-anchor b { font-weight: 600; }
/* Подпись начинается от своей точки и уходит вправо, а не центрируется:
   якорные подписи - это две самые дешёвые цены, то есть всегда левая
   часть оси, и так они не уезжают за край карточки. */
.ruler-ends { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.ruler-text { font-size: 14.5px; line-height: 1.55; margin: 12px 0 0; }


/* --- Коридор цены ------------------------------------------------------- */

.corridor { position: relative; height: 54px; margin: 18px 0 4px; }
.corridor-bar {
  position: absolute; left: 0; right: 0; top: 20px; height: 8px;
  background: var(--accent-soft); border-radius: 4px;
}
.corridor-edge {
  position: absolute; top: 12px; width: 3px; height: 24px;
  background: var(--line-strong); border-radius: 2px;
}
.corridor-edge.lo { left: 0; } .corridor-edge.hi { right: 0; }
.corridor-edge.hit { background: var(--warn); }
.corridor-pt {
  position: absolute; top: 24px; left: var(--p);
  transform: translate(-50%, -50%);
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--card); border: 2.5px solid var(--ink);
}
.corridor-labels { position: absolute; left: 0; right: 0; top: 40px; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.corridor-note { font-size: 14px; line-height: 1.5; }


/* --- Метки состояний ---------------------------------------------------- */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 5px; font-size: 12.5px; white-space: nowrap;
}
.tag .ic { width: 13px; height: 13px; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-err { background: var(--err-soft); color: var(--err); }
.tag-dim { background: var(--bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.tag-own { background: var(--accent-soft); color: var(--accent); }
.tag-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }


/* --- Плашки и сообщения ------------------------------------------------- */

.note {
  display: flex; gap: 11px; padding: 14px 16px; border-radius: 8px;
  background: var(--warn-soft); font-size: 14px; line-height: 1.55;
  margin-bottom: 14px;
}
.note .ic { color: var(--warn); margin-top: 2px; }
.note-accent { background: var(--accent-soft); }
.note-accent .ic { color: var(--accent); }
.note-err { background: var(--err-soft); }
.note-err .ic { color: var(--err); }
.note-dim { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.note-dim .ic { color: var(--muted); }
.note b { font-weight: 600; }
.note-wide { border-radius: 0; margin-bottom: 0; }
/* Плашка последней в карточке не должна оставлять пустую полосу снизу. */
.card > .note:last-child { margin-bottom: 0; }
/* Перечень внутри плашки: пункты, а не строка через запятую. */
.plain-list { margin: 6px 0 0; padding-left: 20px; }
.plain-list li { margin-bottom: 3px; }

.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14.5px;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--err-soft); color: var(--err); }
.flash .ic { margin-top: 2px; }


/* --- Формы -------------------------------------------------------------- */

.field { padding: 15px 0; border-top: 1px solid var(--line); }
.field:first-child { border-top: none; padding-top: 0; }
.field-row { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.field-label { flex: 1; min-width: 240px; }
.field-label b { font-weight: 600; display: block; font-size: 14.5px; }
.field-label small { color: var(--muted); display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; }
.field-input { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.field-heading {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 22px 0 6px; border-top: 1px solid var(--line-strong);
}
.card > form > .field-heading:first-child,
.card > .field-heading:first-child { padding-top: 0; border-top: none; }
.field-heading + .field { border-top: none; padding-top: 8px; }

/* Выключатель «Остановить отправку» - единственная настройка, которая
   останавливает работу целиком. Он отделён рамкой и подложкой, чтобы
   не выглядеть как ещё одно поле в ряду безобидных чисел. */
.field-stop {
  background: var(--warn-soft); border-radius: 8px;
  padding: 14px 16px; margin: 4px 0;
  border-top: none; box-shadow: inset 0 0 0 1px rgba(138, 84, 17, .2);
}
.field-stop + .field { border-top: none; }

input[type=text], input[type=number], input[type=password] {
  width: 130px; padding: 9px 11px; font: inherit;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: var(--ink);
}
input.wide { width: 100%; }
/* Текстовое поле (название аптеки, код продавца) шире числового, но
   не фиксированной ширины: на 390 пикселях фиксированные 260 уже упираются
   в край карточки. */
input.wide-text { width: 260px; max-width: 100%; }
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
select {
  padding: 9px 11px; font: inherit; border: 1px solid var(--line-strong);
  border-radius: 7px; background: #fff; color: var(--ink); max-width: 100%;
}
.unit { color: var(--muted); font-size: 14px; }

.toggle { position: relative; display: inline-block; width: 44px; height: 26px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; cursor: pointer; background: var(--line-strong); border-radius: 999px; transition: .15s; }
.toggle span:before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .15s;
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span:before { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }


/* --- Кнопки ------------------------------------------------------------- */
/* Разрушительных действий в кабинете нет вовсе, поэтому красных кнопок
   тоже нет. «Отправить всё сейчас» - обычная основная кнопка. */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border: none; border-radius: 7px; min-height: 40px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 550;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); filter: none; }
.btn-sm { padding: 6px 11px; font-size: 13px; min-height: 34px; }
.actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
.actions-plain { border-top: none; padding-top: 0; margin-top: 14px; }
.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--accent); text-decoration: underline;
}
.linkbtn:hover { color: var(--ink); }


/* --- Пояснение расчёта -------------------------------------------------- */

.explain { background: var(--accent-soft); border-radius: 8px; padding: 14px 16px; font-size: 14px; line-height: 1.6; }
.explain b { font-weight: 600; }
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; margin: 10px 0 0;
  overflow-x: auto; white-space: pre; line-height: 1.7;
}


/* --- Таблицы ------------------------------------------------------------ */

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--line-strong); white-space: nowrap;
  background: var(--card);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.name { min-width: 230px; }
td.name b { font-weight: 600; }
.row-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
/*
  Пояснение внутри числовой колонки обязано переноситься.
  td.num запрещает перенос ради того, чтобы не разрывались цифры, но
  в колонке «Цена на Halyk» под ценой стоит целое предложение («встали
  на 10 тенге ниже самой низкой цены среди быстрых»). Без переноса оно
  растягивало таблицу на полтора экрана, а на телефоне, где таблица
  становится карточками и больше не прокручивается, уводило страницу
  за правый край. Текст прижат к правому краю блоком, но внутри
  выровнен влево: предложение с рваным левым краем не читается.
*/
td.num .row-note, td.num .rule-edit {
  white-space: normal; text-align: left; max-width: 30ch; margin-left: auto;
}

/* Название товара остаётся на месте при горизонтальной прокрутке:
   иначе на ноутбуке непонятно, к какому товару относится колонка. */
@media (min-width: 761px) {
  .tbl-sticky th:first-child, .tbl-sticky td:first-child {
    position: sticky; left: 0; background: var(--card);
    box-shadow: 1px 0 0 var(--line);
  }
}


/* --- Фильтры и поиск ---------------------------------------------------- */

.searchbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.searchbar input { flex: 1; min-width: 180px; width: auto; }

.filters { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.filters a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--muted); text-decoration: none; font-size: 13.5px; white-space: nowrap;
}
.filters a span { font-variant-numeric: tabular-nums; opacity: .75; }
.filters a:hover { color: var(--ink); background: var(--bg); }
.filters a.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }


/* --- Раскрывашки -------------------------------------------------------- */

.more { margin-top: 12px; }
.more > summary {
  cursor: pointer; color: var(--accent); font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; list-style: none;
  padding: 4px 0; min-height: 28px;
}
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary .ic { transform: rotate(180deg); }
.legend { display: grid; grid-template-columns: max-content 1fr; gap: 9px 12px; align-items: start; margin-top: 12px; font-size: 13.5px; }
.legend > span:nth-child(even) { color: var(--muted); }


/* --- Список ключ-значение ----------------------------------------------- */

.kv { display: grid; grid-template-columns: 230px 1fr; }
.kv > div { padding: 11px 0; border-top: 1px solid var(--line); }
.kv > div:nth-child(-n+2) { border-top: none; }
.kv .k { color: var(--muted); font-size: 14px; }
.kv .v { font-size: 14px; overflow-wrap: anywhere; }
.kv .v small { color: var(--muted); display: block; font-size: 13px; }


/* --- Правило цены у товара ---------------------------------------------- */

.rule-edit { margin-top: 6px; }
.rule-edit summary { cursor: pointer; list-style: none; font-size: 13px; color: var(--accent); text-decoration: underline; }
.rule-edit summary::-webkit-details-marker { display: none; }
.rule-edit form {
  display: flex; flex-direction: column; gap: 9px; margin-top: 9px; padding: 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  width: 230px; text-align: left; white-space: normal;
}
.rule-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.rule-edit select, .rule-edit input { width: 100%; font-size: 13.5px; }


/* --- Вход --------------------------------------------------------------- */

.login-page { display: grid; place-items: center; min-height: 86vh; padding: 20px; }
.login-box { width: 100%; max-width: 350px; }
.login-box .card { padding: 24px; }
.login-box h1 { font-size: 19px; margin-bottom: 4px; }
.login-box input { width: 100%; margin-bottom: 10px; }
.login-box .btn { width: 100%; }
.login-mark { width: 34px; height: 34px; border-radius: 8px; font-size: 17px; margin-bottom: 14px; }


/* --- Подвал ------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line); margin-top: 10px;
  padding: 18px 0 30px; color: var(--muted); font-size: 13.5px;
}
.foot-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }


/* --- Телефон ------------------------------------------------------------ */

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .main { padding-top: 18px; }

  /* Знак и выход остаются в строке, навигация уходит во вторую строку
     одной прокручиваемой лентой. Перенос в три строки, как в кабинете
     Wolt, съедает пол-экрана телефона. */
  .topbar { height: auto; padding: 10px 0 0; flex-wrap: wrap; gap: 10px; }
  .nav {
    order: 3; width: 100%; flex: none; padding: 0 0 8px;
    /* Затухание справа подсказывает, что ленту можно двигать. На телефоне
       она не помещается никогда, поэтому подсказка уместна всегда. */
    mask-image: linear-gradient(to right, #000 92%, transparent);
  }
  .brand { flex: 1; }

  h1 { font-size: 21px; }
  .card { padding: 16px; }
  .verdict { font-size: 15.5px; }

  /*
    Список выбора на телефоне занимает всю ширину. Подписи у способов
    расчёта длинные («по цене тех, кто возит быстро (так и нужно)»),
    и select сам по себе растягивается по самой длинной из них:
    max-width в 100% его не держит, потому что считается от колонки,
    которая тоже растянулась. Поэтому ширину задаём явно.
  */
  .field-input { width: 100%; min-width: 0; }
  .field-input select { width: 100%; }
  .field-input input[type=number] { width: 130px; }

  .kv { grid-template-columns: 1fr; }
  .kv .k { padding-bottom: 0; border-top: 1px solid var(--line); }
  .kv .v { padding-top: 2px; border-top: none; }
  .kv > div:nth-child(2) { border-top: none; }

  .legend { grid-template-columns: 1fr; gap: 4px 0; }
  .legend > span:nth-child(even) { margin-bottom: 8px; }

  /* Фильтры - одна прокручиваемая лента, а не четыре строки таблеток. */
  .filters {
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }

  /* Суточная картина важнее деталей: столбиков остаётся 24, они просто
     становятся уже. */
  .day b { width: 5px; }
  .day-ends { max-width: 189px; }

  /* Таблицы перестают быть таблицами и становятся карточками строк.
     Подписи берутся из data-label в ячейке: вторая разметка и
     JavaScript для этого не нужны, и ни одно значение не исчезает,
     как было бы при простом скрытии колонок. */
  .tbl-wrap { border: none; background: transparent; overflow: visible; }
  .tbl-wrap table, .tbl-wrap tbody, .tbl-wrap tr, .tbl-wrap td { display: block; width: auto; }
  .tbl-wrap thead { display: none; }
  .tbl-wrap tr {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 14px; margin-bottom: 10px;
  }
  .tbl-wrap td { border: none; padding: 4px 0; text-align: left !important; }
  .tbl-wrap td[data-label]::before {
    content: attr(data-label) " ";
    display: block; font-size: 11.5px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); margin-bottom: 1px;
  }
  .tbl-wrap td.name {
    min-width: 0; font-size: 15px; padding-bottom: 8px; margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }
  .tbl-wrap td.name::before { content: none; }
  .rule-edit form { width: 100%; }

  /* Ценовая линейка разворачивается вертикально: ось сверху вниз,
     подписи справа. На 390 пикселях по горизонтали точки слиплись бы. */
  .ruler { height: 300px; margin-left: 4px; }
  .ruler-axis { left: 30px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .ruler-band { left: 16px; width: 30px; top: var(--l); height: var(--w); }
  .ruler-band-label { top: calc(var(--l) - 18px); left: 54px; }
  .ruler-pt { left: 30px; top: var(--p); transform: translate(-50%, -50%); }
  .ruler-you { left: 48px; top: var(--p); transform: translateY(-50%); }
  .ruler-anchor {
    left: 48px; top: var(--p); transform: translateY(-50%);
    max-width: calc(100% - 56px); white-space: normal;
  }
  .ruler-ends { display: none; }

  .corridor-labels { font-size: 12px; }
  .actions .btn { flex: 1; }
}

/* Печать: страница должна оставаться понятной в чёрно-белом виде. */
@media print {
  .top, .foot, .actions, .filters, .searchbar { display: none; }
  .card { break-inside: avoid; border-color: #999; }
  body { background: #fff; }
}
