@charset "utf-8";
/* Стили приложения представителя (и страницы входа). Отдельным файлом: браузер кэширует его, а не скачивает с каждой страницей. */
/* Экран представителя в стиле iOS: системные цвета и шрифт, сгруппированные списки, панели с размытием. */
:root {
  color-scheme: light;
  --bg: #F2F2F7; --surface: #FFFFFF; --text: #000000; --muted: #6C6C70; --line: #D1D1D6; --fill: #E5E5EA;
  --tint: #1F7F80; --tint-bg: #E3F4F4; --accent: #3DB5B6; --accent-strong: #237A7B;
  --green: #248A3D; --orange: #B25000; --red: #D70015; --chevron: #C4C4C7; --tab-off: #8A8A8E;
  --bar-bg: rgba(249, 249, 249, .86); --bar-line: #C6C6C8; --input-bg: #FFFFFF;
  --warn-bg: #FFF4E5; --warn-fg: #A04100; --ok-bg: #E8F5EC; --ok-fg: #1E7A35;
  /* старые имена — для страниц входа и ошибки */
  --link: var(--tint); --error: var(--red); --line-soft: var(--line); --seg-on: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #1C1C1E; --text: #FFFFFF; --muted: #8E8E93; --line: #38383A; --fill: #2C2C2E;
    --tint: #5DD3D4; --tint-bg: #12393A; --green: #2E8B45; --orange: #B25000; --red: #FF453A; --chevron: #5A5A5E;
    --tab-off: #98989D; --bar-bg: rgba(22, 22, 24, .86); --bar-line: #38383A; --input-bg: #1C1C1E;
    --warn-bg: #3D2713; --warn-fg: #FFB870; --ok-bg: #173A1F; --ok-fg: #8FD694; --seg-on: #636366;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #1C1C1E; --text: #FFFFFF; --muted: #8E8E93; --line: #38383A; --fill: #2C2C2E;
  --tint: #5DD3D4; --tint-bg: #12393A; --green: #2E8B45; --orange: #B25000; --red: #FF453A; --chevron: #5A5A5E;
  --tab-off: #98989D; --bar-bg: rgba(22, 22, 24, .86); --bar-line: #38383A; --input-bg: #1C1C1E;
  --warn-bg: #3D2713; --warn-fg: #FFB870; --ok-bg: #173A1F; --ok-fg: #8FD694; --seg-on: #636366;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
       background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--tint); }
button, .btn, summary, .cell-link, .tab { -webkit-user-select: none; user-select: none; }
button { font-family: inherit; }
/* iPhone сам увеличивает текст в блоках, но не в кнопках — «Выйти» выглядел мельче строк над ним */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Как в приложении: страница не масштабируется — двойное касание не приближает (щипок — в _loading.html) */
html { touch-action: manipulation; }

/* Верхняя панель: пустая над большим заголовком, при прокрутке — с размытием и маленьким заголовком */
/* Запас сверху под строку состояния. В раскрытом складном телефоне (экран шире, чем выше) строка состояния сбоку,
   но Safari всё равно отдаёт отступ сверху — получалась пустая полоса над шапкой. */
:root { --top-inset: env(safe-area-inset-top); }
@media (orientation: landscape) { :root { --top-inset: 0px; } }
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding-top: var(--top-inset);
          transition: background-color .2s, border-color .2s; border-bottom: .5px solid transparent; }
.topbar-in { height: 56px; max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: center;
             padding: 0 20px; position: relative; }
.topbar-title { font-size: 17px; font-weight: 600; opacity: 0; transition: opacity .2s; text-align: center;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.topbar-title small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
body.scrolled .topbar { background: var(--bar-bg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
                        border-bottom-color: var(--bar-line); }
body.scrolled .topbar-title { opacity: 1; }
.avatar { position: absolute; right: 20px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.avatar img { width: 100%; height: 100%; }
body.scrolled .avatar { opacity: 0; }

main { max-width: 640px; margin: 0 auto; padding: calc(56px + var(--top-inset)) 0 32px; }
body.has-tabbar main { padding-bottom: calc(49px + env(safe-area-inset-bottom) + 28px); }
.large-title { padding: 0 16px; }
.large-title h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; }
.large-title p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }

/* Сгруппированные списки iOS */
.section-head { margin: 22px 16px 7px; padding: 0 16px; font-size: 13px; font-weight: 400; color: var(--muted);
                text-transform: uppercase; letter-spacing: -.08px; }
.section-foot { margin: 7px 16px 0; padding: 0 16px; font-size: 13px; color: var(--muted); }
.group { margin: 0 16px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.cell { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 11px 16px;
        color: var(--text); text-decoration: none; background: none; border: 0; width: 100%; text-align: left; font-size: 17px; }
.cell + .cell::before, .group > details + details::before, .group > * + .cell-sep::before {
  content: ""; position: absolute; top: 0; left: 56px; right: 0; height: .5px; background: var(--line); }
.cell .grow { flex: 1; min-width: 0; }
.rows > * { position: relative; }
.rows > * + *::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: .5px; background: var(--line); }
.rows .cell + .cell::before { left: 56px; }
.segmented { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.segmented button { flex: 1; min-height: 32px; border: 0; border-radius: 7px; background: none; color: var(--text); font-size: 13px; cursor: pointer; }
.segmented button[aria-checked="true"] { background: var(--seg-on); box-shadow: 0 3px 8px rgba(0, 0, 0, .12); font-weight: 600; }
.cell.danger { color: var(--red); justify-content: center; }
.cell .sub { display: block; font-size: 15px; color: var(--muted); margin-top: 2px; }
.cell .sub-sm { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.cell .value { color: var(--muted); white-space: nowrap; }
.cell:active, summary.cell:active { background: var(--fill); }
.chev { width: 8px; height: 13px; flex: none; color: var(--chevron); }
.tile { width: 28px; height: 28px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; }
.tile svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile.blue { background: #007AFF; } .tile.green { background: #34C759; } .tile.orange { background: #FF9500; }
.tile.purple { background: #AF52DE; } .tile.red { background: #FF3B30; } .tile.gray { background: #8E8E93; } .tile.teal { background: var(--accent); } .tile.teal svg { stroke: #000; }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); flex: none; display: flex; align-items: center;
       justify-content: center; font-size: 15px; font-weight: 600; }
.num.next { background: var(--accent); color: #000; }
.num.done { background: #34C759; color: #000; }
.abc { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 5px;
       border-radius: 5px; font-size: 12px; font-weight: 700; color: #fff; vertical-align: 2px; flex: none; }
.abc.A { background: var(--green); } .abc.B { background: var(--orange); } .abc.C { background: #6C6C70; }
.card-head { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; }
.card-head .name { font-size: 17px; font-weight: 600; }
.trend { font-weight: 600; white-space: nowrap; font-size: 15px; }
.trend.up { color: var(--ok-fg); } .trend.down { color: var(--red); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; }
.badge { display: inline-block; font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-fg); }
.badge.gray { background: rgba(120, 120, 128, .16); color: var(--muted); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }

/* Раскрывающиеся строки: точки маршрута, отгрузки */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { transition: transform .2s; }
details[open] > summary .chev { transform: rotate(90deg); }
.group > details { position: relative; }
.stop-body { border-top: .5px solid var(--line); background: var(--surface); }

/* Кнопки */
.actions { display: flex; gap: 10px; padding: 6px 16px 16px; }
.actions form { display: contents; }
.btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 12px;
       border: 0; border-radius: 12px; font-size: 17px; font-weight: 600; text-decoration: none; text-align: center;
       background: var(--tint-bg); color: var(--tint); cursor: pointer; }
.btn.primary { background: var(--accent-strong); color: #fff; }
.btn.ok { background: var(--green); color: #fff; }
.btn:active { opacity: .6; }
.btn:disabled { background: var(--fill); color: var(--muted); opacity: 1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.row .btn { flex: 1 1 140px; }

/* Фото входа и обязательный снимок */
.place-required { margin: 0 16px 12px; padding: 12px; border-radius: 12px; background: var(--warn-bg); font-size: 15px;
                  display: flex; flex-direction: column; gap: 8px; }
.place-required-title { font-weight: 600; color: var(--warn-fg); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Неделя */
.week { display: flex; align-items: stretch; gap: 6px; padding: 14px 16px 0; }
.week-arrow { flex: none; width: 30px; display: flex; align-items: center; justify-content: center; color: var(--muted);
              text-decoration: none; font-size: 22px; }
.week-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0;
            border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.week-day span, .week-day small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.week-day small { font-size: 10px; }
.week-day b { font-size: 17px; font-weight: 600; }
.week-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.week-day.selected { background: var(--accent-strong); color: #fff; box-shadow: none; }
.week-day.selected span, .week-day.selected small { color: rgba(255, 255, 255, .85); }
.notice { margin: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 15px; }

/* Отгрузки внутри точки */
details.order > summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 10px 16px;
                          font-size: 15px; }
details.order { position: relative; }
details.order::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--line); }
.orders > .line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 16px 6px 60px; font-size: 14px; }
.orders > .line:last-child { padding-bottom: 12px; }
.orders > .line .sub-sm { display: block; font-size: 13px; color: var(--muted); }
.orders > .line > span:last-child { white-space: nowrap; font-weight: 600; }
.order .line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 16px 4px 28px; font-size: 14px; color: var(--muted); }
.order .line:last-child { padding-bottom: 10px; }
.order .line span:last-child { white-space: nowrap; color: var(--text); font-weight: 600; }

/* Шторка снизу (iOS sheet) */
dialog.sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 640px; max-height: 92vh; margin: 0 auto; padding: 0;
               border: 0; border-radius: 14px 14px 0 0; background: var(--bg); color: var(--text); overflow-y: auto;
               box-shadow: 0 -2px 20px rgba(0, 0, 0, .2); padding-bottom: env(safe-area-inset-bottom); }
dialog.sheet[open] { animation: sheet-up .32s cubic-bezier(.2, .9, .3, 1); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .35); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.grabber { display: flex; justify-content: center; padding: 6px 0 2px; touch-action: none; }
.grabber i { width: 36px; height: 5px; border-radius: 3px; background: #C7C7CC; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 6px; }
.sheet-bar b { font-size: 17px; font-weight: 600; }
.link-btn { border: 0; background: none; color: var(--tint); font-size: 17px; min-height: 44px; padding: 0; cursor: pointer; }
.sheet textarea { width: 100%; border: 0; resize: none; font: inherit; font-size: 17px; color: var(--text); background: none;
                  outline: none; padding: 12px 16px; min-height: 92px; display: block; }
.sheet select, .sheet input:not([type=file]) { width: 100%; box-sizing: border-box; border: 0; font: inherit; font-size: 17px;
  color: var(--text); background: none; outline: none; padding: 12px 16px; min-height: 44px; display: block; }
.sheet select { width: calc(100% - 12px); }  /* стрелка списка — не впритык к краю */
.sheet-field { display: flex; align-items: center; padding-left: 16px; }
.sheet-field span { flex: none; width: 112px; }
.sheet-field input { padding: 0; min-height: 0; }
.sheet-submit { padding: 16px 16px 18px; }
.sheet-submit .btn { width: 100%; min-height: 52px; border-radius: 14px; }
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px; }
.thumb { position: relative; width: 76px; height: 76px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.thumb button { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface);
                background: #3A3A3C; color: #fff; font-size: 13px; line-height: 1; padding: 0; }
.photo-pick { position: relative; width: 76px; height: 76px; border-radius: 10px; border: 1.5px dashed var(--accent);
              background: var(--tint-bg); color: var(--tint); display: flex; flex-direction: column; align-items: center;
              justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; text-align: center; cursor: pointer; }
.photo-pick svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick:has(input:disabled) { opacity: .5; }

/* Просмотр фото входа во весь экран */
.photo-view { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
.photo-view::backdrop { background: rgba(0, 0, 0, .92); }
.photo-view[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.photo-view img { max-width: 100%; max-height: calc(100% - 90px); border-radius: 12px; object-fit: contain; }
.photo-view .btn { flex: none; width: 200px; background: rgba(255, 255, 255, .16); color: #fff; }

/* Страницы с нижними вкладками: окно — во всю высоту экрана, лента листается внутри него, а панель стоит
   у низа окна (absolute), а не экрана (fixed). Safari на складном телефоне после раскрытия держит у fixed
   старую высоту — панель ездила и застревала посередине; высоту окна браузер пересчитывает сам. */
html:has(body.has-tabbar) { height: 100%; overflow: hidden; }
/* min(): Chrome на Android в приложении «с экрана Домой» иногда даёт 100dvh больше окна (823 при окне 767) —
   панель уезжала под край в «Рейсах». Высота окна (100%) при этом верная. */
body.has-tabbar { height: 100%; height: min(100%, 100dvh); overflow: hidden; position: relative; }
body.has-tabbar .scroller { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;  /* пружинит только содержимое; меню вне прокрутки — стоит */ }
body.has-tabbar .tabbar { position: absolute; }

/* Нижние вкладки */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bar-bg); border-top: .5px solid var(--bar-line);
          -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding-bottom: max(env(safe-area-inset-bottom), 6px); }
.tabbar-in { max-width: 640px; margin: 0 auto; height: 49px; display: flex; justify-content: space-around; align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; max-width: 90px; min-width: 0; padding-top: 4px;
       color: var(--tab-off); text-decoration: none; font-size: 10px; font-weight: 500; }
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--tint); font-weight: 600; }
/* Нажатие как в iOS: значок тускнеет и чуть сжимается, выбранная вкладка подсвечивается сразу */
.tab svg, .tab span { transition: opacity .15s, transform .15s; }
.tab:active svg, .tab:active span { opacity: .45; transform: scale(.9); }
/* Как в офисе: под пальцем (и под мышкой) вкладка светлеет — iPhone при касании включает :hover */
@media (hover: hover) { .tab:hover:not(.active) { color: var(--text); } }  /* на телефоне касание не оставляет «наведение» */

/* Широкий экран (раскрытый телефон, iPad): маршрут на два столбца — слева точки, справа выбранная */
.route-index { display: none; }
@media (min-width: 768px) {
  main.route { max-width: none; padding-left: 8px; padding-right: 8px; }  /* маршрут — во всю ширину экрана */
  body:has(main.route) .topbar-in { max-width: none; }  /* логотип — у края страницы, а не узкой колонки */
  .route-wide { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 0 4px; align-items: start; }
  .route-index { display: block; position: sticky; top: calc(64px + var(--top-inset)); }
  .route-index .cell.active { background: var(--tint-bg); }
  .route-detail { padding-top: 37px; }
  .route-detail .section-head, .route-detail > .section-foot { display: none; }
  .route-detail [id^="stop-"]:not(.picked) { display: none; }
  .route-detail details.picked > summary { pointer-events: none; }
  .route-detail details.picked > summary .chev { display: none; }
  .route-detail .stop-body { border-top: .5px solid var(--line); }
}

/* Подсказка «установите приложение» */
.install { margin: 12px 16px 0; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--surface);
           display: flex; align-items: center; gap: 10px; font-size: 14px; }
.install[hidden] { display: none; }
.queue-note { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-fg); font-size: 15px; }
.queue-note[hidden] { display: none; }
.install span { flex: 1; }
.install button { border: 0; border-radius: 8px; font-size: 14px; min-height: 36px; cursor: pointer; }
.install .install-btn { background: var(--accent-strong); color: #fff; padding: 0 14px; }
.install .install-close { background: none; color: var(--muted); font-size: 18px; width: 36px; }

/* Страницы без вкладок: вход, «страница устарела» */
.card { background: var(--surface); border-radius: 12px; padding: 16px; margin: 0 16px 10px; }
.name { font-weight: 600; font-size: 17px; }
.muted { color: var(--muted); font-size: 15px; }
.errors { color: var(--red); }
input[type=text], input[type=password] { width: 100%; padding: 12px; font-size: 17px; border: 1px solid var(--line);
                                         border-radius: 10px; background: var(--input-bg); color: var(--text); }
label { display: block; margin: 12px 0 6px; }
.theme-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
             display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.theme-btn svg { width: 20px; height: 20px; }
.version { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px max(20px, env(safe-area-inset-bottom)); }

/* Плавное появление содержимого экрана (шапка и вкладки стоят на месте). Только прозрачность: сдвиг через transform
   поменял бы привязку шторок и закреплённых элементов внутри. */
main { animation: tpa-in .18s ease-out both; }
@keyframes tpa-in { from { opacity: .3; } }  /* не с нуля: если кадры не рисуются, страница всё равно видна */
@media (prefers-reduced-motion: reduce) { main { animation: none; } }
.plan-card { display: grid; gap: 8px; }
.plan-top { display: flex; align-items: baseline; gap: 10px; }
.plan-top b { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-bar { display: block; height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.plan-bar i { display: block; height: 100%; max-width: 100%; border-radius: 999px; background: var(--green); }
.plan-bar.behind i { background: var(--orange); }

.plan-card .sub-sm { font-size: 13px; color: var(--muted); }

/* Заказы на склад: строка и кнопки в ряд, состав — в шторке */
.order-wh + .order-wh { border-top: .5px solid var(--line); }
.wh-open { width: 100%; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.wh-open .chev { width: 8px; height: 13px; flex: none; color: #C4C4C7; }
.wh-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.wh-actions form { display: contents; }
.wh-actions .btn { flex: 1 1 0; min-width: 96px; min-height: 40px; font-size: 15px; border-radius: 10px; }
.wh-sheet .wh-actions { padding: 12px 16px 18px; }
.wh-sheet .wh-actions .btn { flex-basis: 40%; min-height: 48px; font-size: 17px; }
.wh-head { padding: 4px 16px 10px; font-size: 17px; font-weight: 600; }
.wh-head .sub-sm { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.wh-box { margin: 0 16px 10px; padding: 6px 0; background: var(--surface); border-radius: 12px; }
.wh-box .line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 16px; font-size: 15px; }
.wh-box .line span:last-child { white-space: nowrap; font-weight: 600; }
.wh-box .line span.muted, .wh-box .line.report span { white-space: normal; font-weight: 400; font-size: 14px; color: var(--muted); }
.wh-box .line.report span { color: var(--warn-fg); }
.bad-notice { color: var(--warn-fg); background: var(--warn-bg); }

/* Экран склада: плитки сводки, просрочка, фото отгрузки */
.wh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 8px 16px 0; }
.wh-tile { background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.wh-tile b { display: block; font-size: 22px; font-weight: 600; }
.wh-tile span { font-size: 13px; color: var(--muted); }
.wh-order.late-yellow { box-shadow: inset 4px 0 0 var(--orange); }
.wh-order.late-red { box-shadow: inset 4px 0 0 var(--red); }
.cell .wh-actions { padding: 0; margin-top: 8px; }
.cell .wh-actions .btn { white-space: nowrap; min-width: 0; align-self: stretch; }
.wh-actions select { flex: 1 1 140px; min-height: 40px; border-radius: 10px; font-size: 15px; }
.wh-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.wh-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.warn-text { color: var(--warn-fg); }
.wh-map { height: 260px; margin: 8px 16px 0; border-radius: 12px; overflow: hidden; }
/* Тёмная карта Яндекса — как в office.css: перекрашиваем только подложку, метки и маршрут в своих цветах.
   shortcut: фильтр поверх светлой карты; родная тёмная схема есть только в API 3.0. */
:root[data-theme="dark"] .wh-map [class*="ground-pane"] { filter: invert(.92) hue-rotate(180deg) saturate(.6) brightness(.95); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .wh-map [class*="ground-pane"] { filter: invert(.92) hue-rotate(180deg) saturate(.6) brightness(.95); }
}
.wh-staff { flex-direction: column; align-items: stretch; gap: 8px; }
.wh-select { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 12px; font-size: 17px;
             background: var(--input-bg); color: var(--text); border: 1px solid var(--line); }
/* Рейсы: главные кнопки — каждая на всю ширину, текст в одну строку; строка точки — стрелки, выбор рейса, «Перенести» */
.wh-actions .wh-main, .wh-actions form:has(> .wh-main) { flex: 1 1 100%; }
.wh-move .btn { flex: none; min-width: 44px; padding: 0 14px; }
.wh-move select { flex: 1 1 0; min-width: 0; }
/* Доступ к геопозиции: без него экран склада закрыт */
.geo-gate { position: fixed; inset: 0; z-index: 10000; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.geo-gate[hidden] { display: none; }
.geo-gate-in { max-width: 420px; }
.geo-gate-in h2 { margin: 0 0 10px; font-size: 22px; }
.geo-gate-in p, .geo-gate-in li { color: var(--muted); font-size: 15px; line-height: 1.4; }
.geo-gate-in ol { padding-left: 20px; margin: 12px 0 20px; }
.geo-gate-in .btn { width: 100%; min-height: 48px; }
.geo-busy { opacity: .5; pointer-events: none; }
.wh-big { min-height: 56px !important; font-size: 18px !important; }
/* Личное фото в «Ещё»: нажать — выбрать новое */
.me-photo label { position: relative; display: block; width: 56px; height: 56px; cursor: pointer; flex: none; }
.me-photo img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; }
.me-photo-edit { position: absolute; left: 0; right: 0; bottom: -2px; text-align: center; font-size: 11px; color: #fff;
                 background: rgba(0, 0, 0, .55); border-radius: 0 0 28px 28px; line-height: 16px; }
.shift-face { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
/* Отмена рейса: причина обязательна */
.wh-cancel { margin: 8px 16px 0; }
.wh-cancel summary { list-style: none; display: flex; justify-content: center; align-items: center; min-height: 40px;
                     border-radius: 10px; color: var(--red); cursor: pointer; }
.wh-cancel summary::-webkit-details-marker { display: none; }
.wh-cancel form { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 0; }
.wh-cancel label { font-size: 13px; color: var(--muted); }
.wh-cancel textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; font: inherit; font-size: 16px;
                      background: var(--input-bg); color: var(--text); border: 1px solid var(--line); }
.wh-cancel .danger-btn { min-height: 44px; border-radius: 10px; background: var(--red); color: #fff; border: 0; font-weight: 600; }
.btn[disabled] { opacity: .45; pointer-events: none; }
/* Кнопки заказа на экране склада: основное действие во всю ширину, «Заказ клиента» и «Стикер» — две равные */
.wh-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
.wh-grid > .btn, .wh-grid form > .btn, .wh-grid form > label.btn { width: 100%; min-height: 44px; margin: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; padding: 0 10px; font-size: 15px; white-space: nowrap; }
.wh-grid .wh-main { grid-column: 1 / -1; }
.btn.bad { background: var(--red); color: #fff; }  /* «Коды заново»: прошлые коды не подошли */
.wh-fixed { display: flex; flex-direction: column; justify-content: center; padding: 8px 12px; }
/* Рейсы: все кнопки рейса одной ширины и высоты; «Отменить рейс» — красная, в самом низу */
.wh-actions .wh-main { min-height: 44px; }
/* «Отменить рейс» — скромная красная ссылка справа, под всеми кнопками: не рядом с «Построить маршрут» */
.wh-cancel { margin: 16px 16px 0; }
.wh-cancel summary { justify-content: flex-end; background: none; color: var(--red); font-size: 15px; font-weight: 500; min-height: 44px; }
.wh-cancel[open] summary { justify-content: center; color: var(--muted); }

/* Рейсы завсклада: точка — номер, текст, ≡ справа; под текстом «куда перенести» и кнопка — сеткой, одной высоты */
.wh-move { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.wh-move select, .wh-move .btn { min-height: 40px; margin: 0; border-radius: 10px; font-size: 15px; box-sizing: border-box; }
.wh-move select { width: 100%; min-width: 0; padding: 0 10px; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); }
.wh-move .btn { flex: none; min-width: 0; padding: 0 16px; white-space: nowrap; }
.wh-stop { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wh-stop.dragging { position: relative; z-index: 5; background: var(--surface, #fff); box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
                    border-radius: 12px; transition: none; }
.wh-grip { align-self: center; padding: 8px 2px 8px 8px; font-size: 22px; line-height: 1; color: var(--muted); cursor: grab; touch-action: none; }

.wh-staff .wh-select { min-height: 52px; font-size: 17px; font-weight: 600; padding: 0 14px; }

/* Коды на экране склада: сканер — в раскрывающемся поле под кнопкой файла */
.wh-scan summary { list-style: none; display: flex; align-items: center; justify-content: center; min-height: 44px; }
.wh-scan summary::-webkit-details-marker { display: none; }
.wh-scan form { display: flex !important; flex-direction: column; gap: 8px; padding-top: 8px; }
.wh-scan textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
                    background: var(--input-bg); color: var(--text); font: 15px ui-monospace, Menlo, monospace; }
.wh-scan .scan-count { font-size: 13px; color: var(--muted); }
.wh-scan .btn { min-height: 44px; }

.wh-order:target { box-shadow: inset 0 0 0 2px var(--accent); }  /* пришли по ссылке из бота — заказ подсвечен */

/* Состав заказа на экране склада: строка — галочка, товар, количество и блоки; отмеченная — зачёркнута */
.wh-check { margin-top: 8px; border-radius: 12px; background: var(--fill); overflow: hidden; }
.wh-check summary { list-style: none; padding: 10px 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.wh-check summary::-webkit-details-marker { display: none; }
.wh-check.all summary { color: var(--green); }
.wh-check.all summary::after { content: " ✓"; }
.wh-check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-top: .5px solid var(--line);
                font-size: 16px; color: var(--text); cursor: pointer; }
.wh-check-row input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--green); }
.wh-check-row .wh-qty { flex: none; text-align: right; font-weight: 600; }
.wh-check-row .wh-qty small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.wh-check-row:has(input:checked) .grow, .wh-check-row:has(input:checked) .wh-qty { text-decoration: line-through; color: var(--muted); }

/* «Смены»: переключатель дня — карточка ‹ день › с отступами от текста сверху и списка снизу */
.day-step { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; margin: 16px 16px 8px; min-height: 56px;
            background: var(--surface); border-radius: 12px; }
.day-step a { display: flex; align-items: center; justify-content: center; height: 56px; font-size: 28px; color: var(--accent-strong);
              text-decoration: none; }
.day-step b { text-align: center; font-size: 17px; font-weight: 600; }
.day-step small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }


.wh-staff .wh-me { min-height: 44px; border-radius: 12px; font-weight: 600; }

.wh-map-frame { display: block; width: calc(100% - 32px); height: 300px; margin: 8px 16px 0; border: 0; border-radius: 12px; }


/* Дата отгрузки у заказа: позже сегодня — выделена; правка — свернута */
.ship-later { color: var(--warn-fg); }
.ship-edit summary { display: block; padding: 9px 0; font-size: 14px; color: var(--accent-strong); cursor: pointer; }  /* не меньше 36px под палец */
.ship-edit form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ship-edit input, .ship-edit select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--input-bg);
                                      color: var(--text); padding: 0 10px; font-size: 15px; }
.ship-edit .btn { flex: none; min-height: 40px; padding: 0 16px; }
.ship-hold { color: var(--red); font-weight: 600; }
.ship-edit-inline select { width: 100%; min-height: 40px; margin-top: 6px; border-radius: 10px; border: 1px solid var(--line);
                           background: var(--input-bg); color: var(--text); padding: 0 10px; font-size: 15px; }

/* Мерчендайзинг на визите: фото полки «до» */
.merch { margin: 8px 16px; display: flex; flex-direction: column; gap: 8px; }
.merch-title { font-weight: 600; font-size: 15px; }
.merch .thumbs { padding: 0; }
.merch .btn { min-height: 44px; }
.need-photo { display: block; text-align: center; margin-top: 6px; color: var(--muted); }

/* Новая точка: режим работы — дни кнопками, время «с — до» в строку */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }  /* семь дней — в один ряд */
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0;
            border-radius: 10px; background: var(--fill); font-size: 15px; cursor: pointer; }
.day input:checked + span { background: var(--accent-strong); color: #fff; font-weight: 600; }
.day input:focus-visible + span { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.field-time { gap: 8px; }
.field-time span { flex: 0 0 72px; }
.field-time input { flex: 1; min-width: 0; min-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg);
                    color: var(--text); padding: 0 8px; font-size: 16px; }
.field-time i { color: var(--muted); font-style: normal; }

/* «Рейсы в работе»: точки рейса по порядку — время доставки (фото у клиента), где машина сейчас */
.trip { flex-direction: column; align-items: stretch; gap: 0; }
.trip-head { display: flex; gap: 8px; align-items: flex-start; }
.trip-stops { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.trip-stops li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 14px; }
.trip-stops .trip-n { text-align: center; color: var(--muted); font-weight: 600; }
.trip-stops .trip-what small, .trip-stops .trip-when small { display: block; font-size: 12px; color: var(--muted); }
.trip-stops .trip-when { text-align: right; white-space: nowrap; }
.trip-stops li.done .trip-n { color: var(--green); }
.trip-stops li.next { font-weight: 600; }
.trip-stops li.next .trip-when { color: var(--accent-strong); }
.trip-stops li.fail .trip-when { color: var(--red); }
.trip-stops a.far { color: var(--red); font-weight: 600; }
.wh-link { flex-direction: column; align-items: stretch; gap: 8px; }
.wh-link input { display: block; width: 100%; margin-top: 8px; min-height: 44px; padding: 0 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--input-bg); color: var(--text); box-sizing: border-box; }
.wh-link .btn { min-height: 44px; border-radius: 12px; font-weight: 600; }
.order-choice .cell { min-height: 52px; font-size: 17px; cursor: pointer; }
.sheet .order-choice input[type=radio] { flex: none; width: 24px; height: 24px; min-height: 0; margin: 0; padding: 0; accent-color: var(--tint); }
.order-choice .cell:has(input:checked) { background: color-mix(in srgb, var(--tint) 10%, transparent); }
/* Чек-лист визита: шаги по порядку, сделанный — с галочкой */
.checklist { list-style: none; margin: 0; padding: 0 16px 4px; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--fill); }
.step.need { background: var(--warn-bg); }
.step.done { background: var(--ok-bg); }
.step-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
             font-size: 15px; font-weight: 700; background: var(--surface); color: var(--muted); }
.step.done .step-mark { background: var(--green); color: #fff; }
.step.need .step-mark { background: var(--warn-fg); color: #fff; }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.step-body b { font-size: 17px; font-weight: 600; }
.step-body .thumbs { padding: 4px 0; }
.step-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.step-actions .btn { flex: 1 1 140px; min-height: 44px; font-size: 16px; }
.step-hints { margin: 10px 16px 4px; border-radius: 12px; background: var(--fill); overflow: hidden; }
.card-sub { margin: 14px 16px 4px; font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.step-body .streak { color: var(--warn-fg); font-weight: 600; }
/* Мелкие ссылки под палец: область нажатия больше текста, раскладка не меняется */
.trip-stops .trip-when a { display: inline-block; padding: 8px 0 8px 10px; margin: -8px 0; }
.wh-link .sub-sm a { display: inline-block; padding: 10px 0; margin: -8px 0; }
.cell .value.action { color: var(--accent-strong); font-weight: 600; }
.wh-link-fold > summary { list-style: none; cursor: pointer; }
.wh-link-fold > summary::-webkit-details-marker { display: none; }
.wh-link-fold[open] > summary { display: none; }  /* раскрыли — дальше сама форма со своим заголовком */
/* Пояснение под заголовком — свёрнуто: «Как это работает ›», чтобы работа была сразу под рукой */
.intro > summary { list-style: none; display: inline-flex; align-items: center; min-height: 36px; color: var(--accent-strong); font-size: 15px; cursor: pointer; }
.intro > summary::-webkit-details-marker { display: none; }
.intro > summary::after { content: " ›"; white-space: pre; }
.intro[open] > summary::after { content: " ⌄"; }
.nw { white-space: nowrap; }  /* сумма, дата, короткая фраза — не рвать посередине */
