/* Текст в метатегах общего модуля был тусклее, чем в старых: модуль красит цифры
   размера и стрелки в var(--dim) - в админке это нормально, а на цеховом экране
   читается хуже прежнего. Подменяем переменную точечно внутри самих тегов: так
   разом светлеют и цифры, и стрелки (они берут цвет из той же переменной прямо в
   разметке), а подписи параметров под заголовком остаются приглушёнными.
   Значения - ровно те, что были у старых тегов: #7ec8ff. */
.tasks-tags {
    --dim: #7ec8ff;
}

/* Логотип "наш брак". Модуль ссылается на icons/icon-192.png - такой папки в этом
   приложении нет, файл лежит в img/, и вместо логотипа выходила битая картинка.
   Модуль общий с админкой, править его здесь нельзя, поэтому подставляем тот же
   логотип фоном: размеры элемента задаёт модуль, фон рисуется поверх пустого img.
   Если в админке путь сделают настраиваемым - это правило можно убрать. */
.tasks-tag-logo {
    background: url('../img/icon-192.png') center / contain no-repeat;
    color: transparent;
    font-size: 0;
}

.tasks-tag-model {
    color: #7ec8ff;
}

/* Палитра под общий модуль visual-tags.js: он вносит свои стили сам и обращается к
   этим переменным. Значения - те же цвета, что уже используются в терминале, просто
   названные так, как их называет админка. Без них метатеги пришли бы без цвета. */
:root {
    --text: #e8f0f7;
    --dim: #6f93b8;
    --dim2: #4a5f74;
    --accent: #34d5ff;
    --accent-dim: #2a7ba0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }
body {
    background: #04070c;
    color: #e8f0f7;
    font-family: 'Roboto', 'IBM Plex Mono', 'Courier New', monospace;
    min-height: 100vh;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0,10,20,0.08),
        rgba(0,10,20,0.08) 1px,
        transparent 1px,
        transparent 2px
    );
}
body {
    font-family: 'Roboto', 'IBM Plex Mono', 'Courier New', monospace;
    font-variant-numeric: normal;
}
/* Обычный "0" без точки внутри - подкладываем системный шрифт только под этот символ.
   Всё остальное (включая другие цифры) продолжает рисоваться IBM Plex Mono как раньше. */
@font-face {
    font-family: 'IBM Plex Mono';
    src: local('Arial'), local('Helvetica'), local('Roboto');
    unicode-range: U+0030; /* только символ "0" */
}

#app { max-width: 480px; margin: 0 auto; padding: 16px; }

.topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid #1c3350;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.logo {
    font-size: 20px;
    letter-spacing: 2px;
    font-weight: bold;
    color: #34d5ff;
}

.status {
    font-size: 11px;
    letter-spacing: 1px;
    padding: 4px 10px;
    border: 1px solid #1c3350;
    border-radius: 2px;
    white-space: nowrap;
    color: #6f93b8;
}
#status-pill { display: none; }
.status.online { color: #34d5ff; border-color: #1c3350; }
.status.offline { color: #ff4757; border-color: #7a1a2e; }

.blink { animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }


/* ---------- ВКЛАДКИ-ЛОКАЦИИ ---------- */
.tabbar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #1c3350;
}
.tabbar::-webkit-scrollbar { height: 4px; }
.tabbar::-webkit-scrollbar-thumb { background: #1c3350; }

.tab {
    flex: 0 0 auto;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #6f93b8;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
}
.tab.active { color: #34d5ff; border-color: #2a7ba0; }
.tab.pending::after { content: ' •'; color: #ffb300; }
.tab-add { color: #ff4757; border-color: #7a1a2e; }
/* ---------- ФОРМА ДОБАВЛЕНИЯ ПОЗИЦИИ ---------- */

.add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.add-form input {
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 14px;
    padding: 9px 8px;
    border-radius: 2px;
}
.add-form input:focus { outline: none; border-color: #34d5ff; box-shadow: 0 0 6px rgba(52,213,255,0.4); }

.add-form button {
    flex: 0 0 44px;
    background: #0d1b2e;
    border: 1px solid #34d5ff;
    color: #34d5ff;
    font-size: 16px;
    border-radius: 2px;
    cursor: pointer;
}
.add-form button:active { background: #34d5ff; color: #04070c; }

/* ---------- СПИСОК ОСТАТКОВ ---------- */

.empty { color: #6f93b8; font-size: 13px; padding: 24px 0; text-align: center; }

.stock-row {
    display: grid;
    grid-template-columns: 1fr 68px 60px auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dashed #14304a;
    font-size: 13px;
}
.stock-name { color: #e8f0f7; overflow: hidden; text-overflow: ellipsis; }
.stock-qty, .stock-unit {
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 13px;
    padding: 6px;
    border-radius: 2px;
    width: 100%;
}
.stock-qty:focus, .stock-unit:focus { outline: none; border-color: #34d5ff; box-shadow: 0 0 6px rgba(52,213,255,0.4); }

.tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.tag.queued { color: #ffb300; border: 1px solid #665200; }
.tag.synced { color: #34d5ff; border: 1px solid #1c3350; }
.tag.error { color: #ff4757; border: 1px solid #7a1a2e; }
/* ---------- МОДАЛКА "НОВАЯ ЛОКАЦИЯ" ---------- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 100;
}
.modal.hidden { display: none; }
#production-recipe-modal { z-index: 10100; } /* открывается поверх экрана производства (9999), например по кнопке "+" добавить рецепт в сессию */

.modal-box {
    position: relative;
    background: #05080f;
    border: 1px solid #34d5ff;
    box-shadow: 0 0 24px rgba(52,213,255,0.25);
    padding: 20px;
    width: 90%;
    max-width: 320px;
    margin: auto 0;
    border-radius: 0;
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.modal-box::before,
.modal-box::after {
    content: '';
    position: absolute;
    width: 19.8px;
    height: 1px;
    background: #34d5ff;
    pointer-events: none;
}
.modal-box::before {
    top: 6px;
    left: 6px;
    transform: translate(-50%, -50%) rotate(-45deg);
}
.modal-box::after {
    bottom: 6px;
    right: 6px;
    transform: translate(50%, 50%) rotate(-45deg);
}
.modal-box label {
    display: block;
    font-size: 12px;
    color: #6f93b8;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.modal-box input {
    width: 100%;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 15px;
    padding: 10px;
    border-radius: 2px;
    margin-bottom: 14px;
}
.modal-box input:focus { outline: none; border-color: #34d5ff; box-shadow: 0 0 6px rgba(52,213,255,0.4); }

.modal-actions { display: flex; gap: 8px; }
.modal-actions button {
    flex: 1;
    background: #0d1b2e;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 10px;
    border-radius: 2px;
    cursor: pointer;
}
#location-modal-confirm { border-color: #34d5ff; color: #34d5ff; }


.action-row {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.btn-secondary {
    width: 100%;
    background: #0a0f18;
    border: 1px dashed #1c3350;
    color: #6f93b8;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 16px 12px;
    border-radius: 2px;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

.btn-secondary:active { border-color: #34d5ff; color: #34d5ff; }
.btn-secondary { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.btn-secondary.disabled { opacity: 0.4; pointer-events: none; cursor: not-allowed; }
.confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #ffb300;
    margin-bottom: 14px;
    line-height: 1.4;
    cursor: pointer;
}
.confirm-check input { width: auto; margin-top: 2px; }

.modal-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

/* style.css */
.login-error { color: #ff4757; font-size: 13px; margin: -6px 0 12px; min-height: 14px; }

.user-pill {
    font-size: 11px;
    color: #6f93b8;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.user-pill button, .device-location-label button {
    background: none;
    border: 1px solid #7a1a2e;
    color: #ff4757;
    font-family: inherit;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 2px;
    cursor: pointer;
}
.user-pill button.pin-btn, .device-location-label button.pin-btn {
    border-color: #2a7ba0;
    color: #34d5ff;
}

.items-box { max-width: 420px; }
.items-catalog-list { max-height: 50vh; overflow-y: auto; margin: 12px 0; }
.items-catalog-list .catalog-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #16401f;
    font-size: 13px;
}
.items-catalog-list .cr-unit { color: #6f93b8; }

#item-modal { z-index: 200; }


/* ---------- ПЕРЕУЧЁТ / ДОСЬЕ ---------- */

.stocktake-progress {
    font-size: 12px;
    color: #6f93b8;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-align: right;
}

.stocktake-list { max-height: 60vh; overflow-y: auto; margin-bottom: 14px; }

.dossier {
    border: 1px solid #1c3350;
    border-radius: 2px;
    margin-bottom: 8px;
    background: #070b12;
    overflow: hidden;
    transition: filter .2s ease, opacity .2s ease;
}
.dossier.done { opacity: 0.55; }
.dossier.expanded {
    border-color: #2a5578;
}
.stocktake-list.has-expanded .dossier:not(.expanded) {
    filter: blur(4px);
    opacity: 0.35;
    pointer-events: none;
}

.dossier-header {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
}

.dossier-photo {
    flex: 0 0 42%;
    max-width: 42%;
    aspect-ratio: 1 / 1;
    border: 1px solid #1c3350;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #6f93b8;
    background: #0a0f18;
    overflow: hidden;
}
.dossier.done .dossier-photo { color: #34d5ff; border-color: #2a5578; }

.dossier-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.dossier-name {
    font-size: 16px;
    font-weight: 700;
    color: #e8f0f7;
    white-space: normal;
    word-break: break-word;
    margin-bottom: 6px;
}
.dossier-description {
    font-size: 12px;
    color: #9fb6cc;
    line-height: 1.4;
    margin-bottom: 8px;
}
.dossier-meta { font-size: 12px; color: #6f93b8; }

.dossier-arrow { color: #6f93b8; font-size: 14px; flex: 0 0 auto; align-self: center; }
.dossier.expanded .dossier-arrow { color: #34d5ff; }

.dossier-body {
    display: none;
    padding: 0 10px 12px;
    border-top: 1px dashed #1c3350;
}
.dossier.expanded .dossier-body { display: block; padding-top: 10px; }
.dossier-body label {
    display: block;
    font-size: 11px;
    color: #6f93b8;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.dossier-qty-input {
    width: 100%;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 15px;
    padding: 9px;
    border-radius: 2px;
    margin-bottom: 10px;
}
.dossier-qty-input:focus { outline: none; border-color: #2a7ba0; }

.dossier-photo-btn {
    width: 100%;
    background: #0a0f18;
    border: 1px dashed #1c3350;
    color: #9fb6cc;
    font-family: inherit;
    font-size: 12px;
    padding: 9px;
    border-radius: 2px;
    margin-bottom: 10px;
    cursor: pointer;
}

.dossier-confirm-btn {
    width: 100%;
    background: #0d1b2e;
    border: 1px solid #2a7ba0;
    color: #34d5ff;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 9px;
    border-radius: 2px;
    cursor: pointer;
}
.dossier-confirm-btn:active { background: #34d5ff; color: #04070c; }

.stocktake-location-list {
    -webkit-overflow-scrolling: touch;
}

.stocktake-location-list button {
    width: 100%;
    text-align: left;
    margin-bottom: 6px;
}

body.modal-open {
    overflow: hidden;
}

.dossier-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4,7,12,0.6);
    backdrop-filter: blur(3px);
}
.loading-overlay.hidden { display: none; }

.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 26px 30px;
    background: #05080f;
    border: 1px solid #1c3350;
    border-radius: 3px;
    min-width: 220px;
}
.loading-bar-track {
    width: 100%;
    height: 6px;
    background: #0a0f18;
    border: 1px solid #1c3350;
    border-radius: 3px;
    overflow: hidden;
}
.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: #34d5ff;
    transition: width .25s ease;
}
.loading-percent {
    font-size: 22px;
    font-weight: 700;
    color: #e8f0f7;
}
.loading-label {
    font-size: 13px;
    letter-spacing: 1px;
    color: #9fb6cc;
    text-align: center;
}

.stocktake-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.btn-small {
    flex: 0 0 auto;
    width: auto;
    padding: 6px 10px;
    font-size: 11px;
}

.stocktake-search {
    width: 100%;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 13px;
    padding: 9px;
    border-radius: 2px;
    margin-bottom: 12px;
}
.stocktake-search:focus { outline: none; border-color: #2a7ba0; }
.stocktake-search.hidden { display: none; }

.stocktake-carousel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
}
.stocktake-carousel.hidden { display: none; }

.carousel-nav-btn {
    width: 100%;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #9fb6cc;
    font-size: 16px;
    padding: 8px;
    border-radius: 2px;
    cursor: pointer;
}
.carousel-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.carousel-nav-btn:active { border-color: #2a7ba0; color: #34d5ff; }

.carousel-position {
    text-align: center;
    font-size: 11px;
    color: #6f93b8;
    letter-spacing: 1px;
}

.stocktake-list.hidden { display: none; }

/* Размытие заднего плана для всех модалок */
.modal {
    background: rgba(4, 7, 12, 0.75); /* Делаем подложку чуть темнее */
    backdrop-filter: blur(6px);       /* Эффект размытия фона */
    -webkit-backdrop-filter: blur(6px);
}

/* Повышение контраста для служебного синего текста */
.status, 
.tab, 
.empty, 
.modal-box label, 
.user-pill, 
.items-catalog-list .cr-unit, 
.dossier-meta, 
.dossier-arrow, 
.dossier-body label, 
.carousel-position {
    color: #b5ccde !important; /* Делаем текст ощутимо светлее и чище */
}

/* Облегчаем дизайн досье, убирая лишние внутренние линии */
.dossier-photo {
    border: none !important; /* Удаляем рамку вокруг контейнера фото */
}

.dossier-body {
    border-top: none !important; /* Удаляем пунктирный разделитель внутри карточки */
}

.dossier.expanded {
    border-color: #34d5ff; /* Делаем внешнюю рамку активной карточки чётче */
}

/* Куда: в самый конец css/style.css */

/* Безопасно скрываем нижний блок кнопок переучета */
#stocktake-screen .modal-actions {
    display: none !important;
}

/* Делаем блок окна базой для позиционирования крестика */
#stocktake-screen .modal-box {
    position: relative;
    padding-top: 20px; /* Немного отступим сверху под крестик */
}

/* Еле заметный крестик в верхнем правом углу */
.modal-close-x {
    position: absolute;
    top: 8px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(181, 204, 222, 0.2); /* Очень прозрачный сине-серый цвет */
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10;
    font-family: Arial, sans-serif; /* Обычный ровный крестик */
}

/* При наведении крестик мягко подсвечивается */
.modal-close-x:hover {
    color: rgba(52, 213, 255, 0.6);
    transform: scale(1.05);
}

/* Куда: в самый конец css/style.css */

/* Красная кнопка (Отмена) */
.btn-confirm-red {
    flex: 1;
    padding: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    background: #2a0f12 !important;
    border: 1px solid #ff4a5a !important;
    color: #ff4a5a !important;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}
.btn-confirm-red:hover {
    background: #ff4a5a !important;
    color: #04070c !important;
    box-shadow: 0 0 10px rgba(255, 74, 90, 0.4);
}

/* Зелёная кнопка (Подтвердить) */
.btn-confirm-green {
    flex: 1;
    padding: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    background: #0f2a1d !important;
    border: 1px solid #10b981 !important;
    color: #10b981 !important;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}
.btn-confirm-green:hover {
    background: #10b981 !important;
    color: #04070c !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Куда: в самый конец css/style.css */

/* Контейнер верхней строки состояния */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background: rgba(10, 15, 24, 0.85); /* Тёмный полупрозрачный фон */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid #34d5ff; /* Неоновая нижняя линия */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 99999; /* Поверх абсолютно всех модалок */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateY(-100%);
    opacity: 0;
}

/* Класс для плавного появления */
.status-bar.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Текст статуса */
#global-status-text {
    font-size: 22px;
    font-weight: 700;
    color: #e8f0f7;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Стильное неоновое колёсико */
.spinner-cyber {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(52, 213, 255, 0.1);
    border-top-color: #34d5ff; /* Яркий сектор */
    border-radius: 50%;
    animation: spin-cyber 0.6s linear infinite;
    box-shadow: 0 0 6px rgba(52, 213, 255, 0.4);
}

@keyframes spin-cyber {
    to { transform: rotate(360deg); }
}

/* Основной оверлей переучёта */
.stocktake-terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 20, 0.65); /* Темный полупрозрачный фон */
    backdrop-filter: blur(12px); /* Тот самый размытый фон */
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* Шапка с названием и крестиком */
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    flex-shrink: 0;
}

.terminal-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.terminal-title {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.terminal-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: #34d5ff; /* Кибер-бирюзовый для комнаты */
    letter-spacing: 0.5px;
}

.terminal-close-btn {
    font-size: 32px;
    color: #8c9ba5;
    cursor: pointer;
    line-height: 0.8;
    flex: 0 0 auto; /* никогда не сжимается и не съезжает под другие кнопки в этой строке */
}
#production-session-btn-row .terminal-close-btn {
    padding-left: 8px;
    margin-left: auto; /* прижимает крестик к правому краю ряда, если там есть свободное место */
}
#production-screen .terminal-header-text {
    flex: 0 1 auto;
    min-width: 0;
}
#production-session-actions {
    flex: 0 0 auto;
    margin-left: auto;
}
#production-screen .terminal-header > div {
    justify-content: flex-start !important;
    gap: 16px;
    align-items: flex-start;
}
.terminal-session-finish-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.terminal-close-btn:active {
    color: #ff3366;
}

/* Трек-карусель переучёта: одна активная карточка по центру, соседние размыты и приглушены сверху/снизу.
   scroll-snap-type: proximity (а не mandatory!) — именно mandatory заставлял браузер
   силой утаскивать карточку обратно после инерционного свайпа, из-за чего был виден
   "заброс вперёд и откат назад". Proximity подтягивает мягко, только если остановка и так рядом. */
.terminal-track {
    flex: 1;
    position: relative;
    overflow: hidden; /* больше НЕ нативный скролл — карусель полностью ручная, через transform */
    touch-action: none; /* отдаём жесты целиком нашему JS, браузер не должен вмешиваться */
    padding: 0 20px;
    display: flex;
}

.terminal-track-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative; /* точка отсчёта для offsetTop карточек */
    will-change: transform;
}

/* Карточка-досье */
.terminal-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    flex-shrink: 0;
    background: rgba(20, 26, 35, 0.85);
    border: 1px solid rgba(52, 213, 255, 0.35);
    border-radius: 0;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0.3;
    filter: blur(4px);
    transform: scale(0.85);
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}
.terminal-card::after {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: rgba(52, 213, 255, 0.2);
    clip-path: inherit;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.terminal-card::before,
.terminal-card::after {
    content: '';
    position: absolute;
    width: 22.6px;
    height: 1px;
    background: rgba(52, 213, 255, 0.35);
    pointer-events: none;
}
.terminal-card::before {
    top: 7px;
    left: 7px;
    transform: translate(-50%, -50%) rotate(-45deg);
}
.terminal-card::after {
    bottom: 7px;
    right: 7px;
    transform: translate(50%, 50%) rotate(-45deg);
}
.terminal-card.active {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    cursor: default;
}
/* Переученная позиция (все варианты тары подтверждены) - гаснет, но остаётся в карусели
   до следующего захода в переучёт, чтобы можно было вернуться и поправить. */
.terminal-card.done {
    opacity: 0.45;
}
.terminal-card.done {
    border-color: rgba(0, 255, 102, 0.4);
}
.terminal-card.done::before,
.terminal-card.done::after {
    background: rgba(0, 255, 102, 0.4);
}
.terminal-card:not(.active) .dossier-qty-input,
.terminal-card:not(.active) .dossier-confirm-btn {
    pointer-events: none;
}


/* Модалка подтверждения должна быть поверх экрана переучёта (z-index: 9999) */
#confirm-modal {
    z-index: 10001;
}

/* Кнопка "ПОДТВЕРЖДАЮ" в карточке переучёта — тот же зелёный стиль, что у "ДА, УВЕРЕН" */
.dossier-confirm-btn.done {
    background: #10b981 !important;
    color: #04070c !important;
    border-color: #10b981 !important;
    cursor: default;
}
.dossier-confirm-btn.done:hover {
    box-shadow: none;
}

/* Строка "найдено / переучтено" под полем поиска */
.terminal-search-stats {
    font-size: 11px;
    color: #6f93b8;
    letter-spacing: 0.5px;
    margin-top: 8px;
    text-align: center;
}

/* Переключатель "ВСЕ / ОСТАЛОСЬ / ПЕРЕУЧТЕНЫ" под поиском */
.terminal-status-filter {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}
.terminal-status-filter .tab {
    font-size: 11px;
    padding: 6px 10px;
}

.terminal-finish-btn {
    margin-top: 12px;
    width: 100%;
    background: rgba(52, 213, 255, 0.1);
    border: 1px solid #34d5ff;
    color: #34d5ff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 12px;
    border-radius: 2px;
    cursor: pointer;
}
.terminal-finish-btn:active {
    background: #34d5ff;
    color: #04070c;
}
#stocktake-nav-btn.pending {
    border-color: #ffb300 !important;
    color: #ffb300 !important;
}

.dossier-history {
    margin-top: 12px;
    padding-top: 10px;
    padding-right: 6px;
    border-top: 1px dashed #2a3545;
    scrollbar-width: thin;
    scrollbar-color: #2a3545 transparent;
}
.dossier-history::-webkit-scrollbar { width: 4px; }
.dossier-history::-webkit-scrollbar-track { background: transparent; }
.dossier-history::-webkit-scrollbar-thumb { background: #2a3545; border-radius: 2px; }
.dossier-history-title { font-size: 10px; letter-spacing: 1px; color: #6f93b8; }

/* Заголовок сам стал кнопкой в историю - строки под ним больше нет, поэтому ни
   разделителя снизу, ни отступа ему не нужно. */
.dossier-history-title-row {
    align-items: center;
    border-bottom: none;
    padding: 2px 0;
}
.dossier-history-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    padding: 4px 0;
    border-bottom: 1px dashed #1c3350;
}
.dossier-history-row { padding: 4px 4px 4px 0; }
.dh-date {
    color: #6f93b8;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
    white-space: nowrap;
}
.dh-date-rel { font-size: 9px; color: #4a5f75; }
.dh-type { color: #e8f0f7; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-qty { flex: 0 0 auto; font-weight: 700; }
.dh-qty.plus { color: #34d5ff; }
.dh-qty.minus { color: #ff4757; }
.dossier-history-employee { font-size: 10px; color: #4a5f75; margin: -2px 0 4px; }
.dh-tare { color: #6f93b8; }
.dossier-history-empty { font-size: 11px; color: #4a5f75; text-align: center; padding: 6px 0; }


.dossier-top { display: flex; gap: 14px; align-items: flex-start; }

.dossier-photo-block {
    flex: 0 0 192px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.dossier-photo-frame {
    width: 192px;
    height: 192px;
    position: relative;
    background: #060a10;
    overflow: hidden;
}
.dossier-photo-frame {
    aspect-ratio: 1 / 1; /* всегда квадрат, даже если ширина/высота где-то переопределены */
}
.dossier-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* обрезка строго по центру фото */
    display: block;
}
.dossier-photo-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2a5578;
    font-size: 10px;
    letter-spacing: 1px;
    text-align: center;
    padding: 6px;
}
.dossier-photo-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(52,213,255,0.06) 0 2px, transparent 2px 4px);
    box-shadow: inset 0 0 20px rgba(52,213,255,0.25);
}

.dossier-case-number {
    width: 100%;
    text-align: center;
    border: 1px solid #2a5578;
    background: rgba(52,213,255,0.05);
    padding: 5px 4px;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.dcn-label { font-size: 8px; letter-spacing: 1.5px; color: #6f93b8; }
.dcn-value { font-size: 20px; font-weight: 800; color: #34d5ff; }
.dcn-unit { font-size: 10px; color: #6f93b8; }

.dossier-file {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}
.dossier-file-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid #2a5578;
    position: relative;
}
.dfl-tick {
    position: absolute;
    left: -1px;
    top: 8px;
    width: 8px;
    height: 1px;
    background: #2a5578;
}
.dfl-text { font-size: 12px; line-height: 1.4; color: #9fb6cc; }
.dossier-name-text { font-size: 16px; font-weight: 700; color: #e8f0f7; }
.dossier-desc-text { color: #9fb6cc; }


.terminal-session-actions { flex: 0 0 auto; }
.terminal-session-btn {
    background: rgba(52, 213, 255, 0.1);
    border: 1px solid #34d5ff;
    color: #34d5ff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 12px;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
}
.terminal-session-btn:active { background: #34d5ff; color: #04070c; }
.terminal-session-btn.finish { border-color: #ff4757; color: #ff4757; background: rgba(255, 71, 87, 0.08); }
.terminal-session-btn.finish:active { background: #ff4757; color: #04070c; }
.terminal-session-icon-btn { font-size: 22px; padding: 6px 10px; }
.terminal-session-close-btn {
    background: none;
    border: none;
    color: #8c9ba5;
    font-size: 40px;
    padding: 0 4px;
    cursor: pointer;
    line-height: 1;
}
.terminal-session-close-btn:active { color: #ff3366; }

#terminal-session-date::-webkit-calendar-picker-indicator { filter: invert(0.7) sepia(1) saturate(4) hue-rotate(160deg); }

/* было в .dossier-history: max-height: 160px; overflow-y: auto; — убрать эти две строки */

.dossier-history-more {
    display: block;
    width: 100%;
    margin-top: 8px;
    background: none;
    border: 1px dashed #2a3545;
    color: #6f93b8;
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 8px;
    border-radius: 2px;
    cursor: pointer;
}
.dossier-history-more:active { border-color: #34d5ff; color: #34d5ff; }

.history-modal-list {
    max-height: 60vh;
    overflow-y: auto;
    margin: 12px 0;
}

#history-modal {
    z-index: 10000;
}

.terminal-stats-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.terminal-stats-filter-row .terminal-search-stats { margin-top: 0; text-align: left; }
.terminal-stats-filter-row .terminal-status-filter { margin-top: 0; }

.terminal-session-finish-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.production-active-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255,159,77,0.08);
    border: 1px solid #7a4a1f;
    color: #ff9f4d;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.production-active-hint.hidden { display: none; }
.production-recipe-active {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border-color: #ff9f4d !important;
}
.production-recipe-active-label {
    font-size: 10px;
    color: #ff9f4d;
    letter-spacing: 1px;
}
.production-active-hint button {
    background: none;
    border: 1px solid #ff9f4d;
    color: #ff9f4d;
    font-family: inherit;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
}
.terminal-session-start-label {
    font-size: 10px;
    color: #6f93b8;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.terminal-status-filter {
    margin-top: 8px;
}

/* Шапка карточки досье - название товара сверху, в стиле терминала */
.dossier-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 10px 16px;
    margin: -16px -16px 14px -16px;
    background: rgba(52,213,255,0.08);
    border-bottom: 1px solid #2a5578;
}
.dossier-header .production-quick-row {
    flex-basis: 100%;
    margin: 4px 0 0;
}
.dossier-header-counter {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: #6f93b8;
    letter-spacing: 0.5px;
    font-family: 'Roboto', 'IBM Plex Mono', 'Courier New', monospace;
}
.dossier-header-name {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #7ec8ff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    line-height: 1.3;
}

/* Фаска на фоторамке (только тут и ещё в паре мест - не везде) */
.dossier-photo-frame {
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.dossier-photo-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: #2a5578;
    clip-path: inherit;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Фаска на блоке "должно быть" - с другого угла, для разнообразия */
.dossier-case-number {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

/* Подпись стала длиннее - уменьшаем и разрешаем перенос */
.dcn-label {
    font-size: 7px;
    letter-spacing: 0.5px;
    display: block;
    line-height: 1.3;
}

.dossier-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.dossier-tag {
    font-size: 10px;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 2px;
    white-space: nowrap;
    text-transform: uppercase;
}
.tag-color { color: #7ec8ff; border: 1px solid #2a5578; background: rgba(52,213,255,0.06); }
.tag-state { color: #9fb6cc; border: 1px solid #2a3f55; background: rgba(159,182,204,0.06); }
.tag-defect { color: #ff8a7a; border: 1px solid #7a3a2e; background: rgba(255,90,60,0.08); }

.dossier-history-row-clickable {
    cursor: pointer;
    padding: 4px 6px;
    margin: -4px -6px 0;
    border-radius: 2px;
    transition: background .15s ease;
}
.dossier-history-row-clickable:hover,
.dossier-history-row-clickable:active {
    background: rgba(52,213,255,0.08);
}
.dh-arrow {
    color: #4a5f75;
    font-size: 14px;
    flex: 0 0 auto;
    margin-left: 2px;
}
.dh-qty.eq { color: #9fb6cc; }

.dcn-value,
.dh-qty,
.stock-qty,
.dossier-qty-input,
.loading-percent {
    font-family: 'Roboto', 'IBM Plex Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}



.dossier-should-be {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    padding: 10px 0;
    margin: 2px 0;
    box-sizing: border-box;
}
.dossier-should-be-label {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    color: #9fb6cc;
    margin: 8px 0 2px;
}
.dossier-should-be-value {
    font-size: 24px;
    font-weight: 800;
    color: #7ec8ff;
    font-family: 'Roboto', 'IBM Plex Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
}
.dossier-should-be-unit {
    font-size: 12px;
    color: #6f93b8;
    margin-left: 4px;
}

.should-be-batch-row-OLD-UNUSED {
    display: none;
}
.should-be-batch-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(0,0,0,0.25);
    border: 1px solid #2a5578;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.should-be-batch-btn.active { border-color: #34d5ff; color: #34d5ff; }
.should-be-batch-actions {
    display: flex;
    width: 100%;
    gap: 8px;
    box-sizing: border-box;
}
.should-be-batch-actions button {
    flex: 1;
    width: 100%;
    padding: 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
}
.should-be-batch-input-row {
    display: flex;
    gap: 8px;
}
.should-be-batch-input-row input {
    flex: 1;
    background: #0a0f18;
    border: 1px solid #34d5ff;
    color: #e8f0f7;
    font-family: inherit;
    padding: 10px;
    border-radius: 4px;
}
.should-be-batch-input-row button {
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
}
.should-be-batch-resolved {
    color: #0ee673;
    font-size: 13px;
    padding: 8px 0;
}

.dossier-verify-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.dossier-action-btn {
    padding: 14px 10px !important;
    font-size: 13px !important;
}

.dossier-dispute-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.dossier-dispute-qty-input {
    width: 100%;
    background: rgba(0,0,0,0.5);
    border: 1px solid #3a4b5c;
    color: #fff;
    font-family: 'Roboto', 'IBM Plex Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    padding: 12px;
    border-radius: 0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    outline: none;
}
.dossier-dispute-qty-input:focus { border-color: #34d5ff; }
.dossier-dispute-actions {
    display: flex;
    gap: 8px;
}
.dossier-dispute-actions button {
    flex: 1;
    padding: 12px;
    font-size: 12px;
    letter-spacing: 0.5px;
    font-weight: 700;
    border-radius: 2px;
    cursor: pointer;
}
.dossier-dispute-cancel-btn {
    background: transparent;
    border: 1px solid #3a4b5c;
    color: #9fb6cc;
}
.dossier-dispute-cancel-btn:hover {
    border-color: #6f93b8;
    color: #e8f0f7;
}

.dossier-result-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    padding: 12px;
    border: 1px solid #1f6b4a;
    background: rgba(16,185,129,0.08);
    color: #34d399;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}
.dossier-result-row.mismatch {
    border-color: #7a5a1a;
    background: rgba(255,179,0,0.08);
    color: #ffb300;
}

.topbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar-userrow {
    display: flex;
    align-items: center;
    margin-top: 10px;
}
.hq-stamp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transform: rotate(-4deg);
    align-self: flex-start;
    border: 2px solid #34d5ff;
    border-radius: 2px;
    padding: 6px 10px;
    position: relative;
}
.hq-stamp::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed rgba(52, 213, 255, 0.4);
    pointer-events: none;
}
.hq-stamp-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    /* тонируем чёрный лого в акцентный синий цвет темы */
    filter: brightness(0) saturate(100%) invert(70%) sepia(90%) saturate(2000%) hue-rotate(160deg) brightness(1.1);
    flex: 0 0 auto;
}
.hq-stamp-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.hq-stamp-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #34d5ff;
    text-shadow: 0 0 8px rgba(52, 213, 255, 0.6);
}
.hq-stamp-subtitle {
    font-size: 16px;
    letter-spacing: 1.5px;
    color: #6f93b8;
    text-transform: uppercase;
}

.stocktake-location-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.stocktake-loc-session-badge {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: #34d5ff;
    text-transform: none;
}

.stocktake-location-option.no-history {
    opacity: 0.4;
}

.stocktake-by-product-btn {
    width: 100%;
    text-align: left;
    margin-bottom: 12px;
    border-color: #34d5ff;
    color: #34d5ff;
}

.stocktake-product-group-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
    text-transform: uppercase;
    margin: 16px 0 6px;
}

.stocktake-product-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.stocktake-product-shape-cell {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.stocktake-product-shape-cell .production-quick-visual {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    min-width: 0;
}

.stocktake-product-model-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.stocktake-product-name-cell {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.dossier-mega-tags-col {
    margin-bottom: 6px;
}

.dossier-mega-tags-col .production-quick-visual {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.stocktake-shape-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stocktake-shape-color-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    min-width: 56px;
    min-height: 56px;
}

.stocktake-shape-color-option .production-quick-visual {
    flex-wrap: nowrap;
}

.stocktake-loc-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid #3a4b5c;
    background: rgba(0, 0, 0, 0.5);
}

.stocktake-loc-nav-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #3a4b5c;
    color: #fff;
    padding: 0;
    font-size: 26px;
    line-height: 1;
    border-radius: 0;
}

.stocktake-loc-nav-btn:active {
    background: #34d5ff;
    color: #04070c;
}

/* Пустой слот вместо стрелки на крайних складах - чтобы название не прыгало по центру */
.stocktake-loc-nav-spacer {
    flex: 0 0 auto;
    width: 44px;
}

.stocktake-focus-group-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.stocktake-focus-group-name {
    white-space: normal;
}

.stocktake-location-name {
    text-align: center;
}

/* Ряд переключения складов ужат примерно в полтора раза: кнопки 30px вместо 44px и
   вдвое меньше поля. Он служебный - место под карточками нужнее. */
.stocktake-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-top: 1px solid #3a4b5c;
    background: rgba(0, 0, 0, 0.5);
}

.stocktake-footer .stocktake-loc-nav-btn,
.stocktake-footer .stocktake-loc-nav-spacer {
    width: 30px;
}

.stocktake-footer .stocktake-loc-nav-btn {
    height: 30px;
    font-size: 20px;
}

.stocktake-footer .stocktake-location-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #34d5ff; /* Кибер-бирюзовый для комнаты, как было в шапке */
    letter-spacing: 0.5px;
}

.delivery-field-label {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    color: #6f93b8;
    text-transform: uppercase;
    margin: 10px 0 4px;
}

.delivery-stamp {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-12deg);
    border: 3px solid #0ee673;
    color: #0ee673;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 18px;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    border-radius: 6px;
    background: transparent;
    pointer-events: none;
    z-index: 5;
    white-space: normal;
}
.delivery-stamp.hidden { display: none; }

#delivery-amount-modal input:disabled,
#delivery-amount-modal textarea:disabled {
    opacity: 0.4;
}

.production-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.production-tab {
    flex: 1;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #6f93b8;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
}
.production-tab.active { color: #34d5ff; border-color: #34d5ff; background: rgba(52,213,255,0.08); }
/* Модалка деталей позиции должна быть ПОВЕРХ полноэкранного терминала производства (z-index: 9999) */
#production-item-modal {
    z-index: 10000;
}
.production-terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 20, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}
.production-terminal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 20px 20px;
}

.production-tab-indicator {
    position: relative;
    display: flex;
    width: 100%;
    border: 1px solid #1c3350;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.production-tab-btn {
    flex: 1;
    position: relative;
    z-index: 1;
    background: none;
    border: none;
    color: #6f93b8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px;
    cursor: pointer;
    transition: color 0.25s ease;
}
.production-tab-btn.active { color: #04141c; }
.production-tab-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%; /* та самая полоска на полширины экрана */
    height: 100%;
    background: #34d5ff;
    transition: transform 0.25s ease;
    z-index: 0;
}

.production-swipe-track {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.production-swipe-track::-webkit-scrollbar { display: none; }
.production-swipe-page {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-align: start;
    padding-right: 4px;
}
.production-swipe-page {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-align: start;
    padding-right: 4px;
    scrollbar-width: none;
}
.production-swipe-page::-webkit-scrollbar { display: none; }

.production-line-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    padding: 18px 16px;
    margin-bottom: 10px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    gap: 12px;
}
.production-line-btn:active { border-color: #34d5ff; background: rgba(52,213,255,0.08); }
.production-line-name { font-size: 15px; font-weight: 700; }
.production-line-sub { font-size: 11px; color: #6f93b8; margin-top: 4px; }
.production-line-qty { font-size: 16px; font-weight: 800; color: #0ee673; white-space: nowrap; }

/* ---------- КАРУСЕЛЬ ПРОИЗВОДСТВА (та же механика, что у переучёта, свои классы) ---------- */
.production-track {
    flex: 1;
    position: relative;
    overflow: hidden;
    touch-action: none;
    padding: 0 20px;
    display: flex;
}
.production-track-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    will-change: transform;
}
.production-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    flex-shrink: 0;
    background: rgba(20, 26, 35, 0.85);
    border: 1px solid rgba(52, 213, 255, 0.35);
    border-radius: 0;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0.3;
    filter: blur(4px);
    transform: scale(0.85);
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}
.production-card.active {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    cursor: default;
}

.production-photo-frame {
    width: 100%;
    height: 220px;
    border: 1px solid #1c3350;
    border-radius: 4px;
    overflow: hidden;
    background: #0a0f18;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #6f93b8;
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.production-photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.production-role-badge {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 2px;
    margin-bottom: 8px;
    align-self: flex-start;
}
.production-role-badge.input { color: #ff9f4d; border: 1px solid #7a4a1f; background: rgba(255,159,77,0.08); }
.production-role-badge.output { color: #0ee673; border: 1px solid #1f5e3a; background: rgba(14,230,115,0.08); }

.production-card-name { font-size: 18px; font-weight: 800; color: #e8f0f7; margin-bottom: 6px; }
.production-card-qty { font-size: 15px; font-weight: 700; color: #34d5ff; }

.production-action-bar { padding: 16px 20px; }
.production-action-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.production-action-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 18px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
}
.production-tare-unit-hint {
    display: flex;
    justify-content: center;
    margin-top: 28px; /* заметный отступ от чипсов тары, чтобы не путать со "Сдать на склад" ниже */
    cursor: pointer;
}
.production-tare-back-chip {
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 700;
}
/* Замок в шапке карточки, справа от метатегов: там его видно, но он далеко от чипов
   тары - задеть тем же движением, каким выбирают тару, уже нельзя. */
/* Шапка карточки читается сверху вниз: название группы, параметры позиции по
   строке на каждый, метатеги. Родитель по умолчанию раскладывает детей в ряд -
   здесь это не нужно, поэтому колонка. */
.production-item-modal-box .dossier-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
/* Метатеги и замок - в одной строке, замок сразу за последним чипом. Строка НЕ
   растягивается на всю ширину: иначе замок уезжал вправо, к крестику закрытия, и
   читался как вторая кнопка закрытия. Метатегов может не быть вовсе - тогда замок
   просто стоит первым в этой строке. */
.production-item-modal-headline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    align-self: flex-start;
}
/* Внутри шапки карточки ряд метатегов не занимает всю ширину: он должен кончаться
   там, где кончился последний чип, чтобы замок встал вплотную. */
.production-item-modal-box .dossier-header .production-quick-row {
    flex-basis: auto;
    margin: 4px 0 0;
}
.production-tare-more {
    display: block;
    flex: 0 0 auto;
    font-family: inherit;
    margin: 0;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #6f93b8;
    border: 1px solid #2a3f55;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.production-tare-more:active { background: rgba(111, 147, 184, 0.15); }

.production-tare-chip-wrap {
    display: inline-flex;
    align-items: center;
}
.production-tare-split-badge {
    position: relative;
    margin-left: 14px; /* место под стрелку-хвостик */
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: transparent;
    color: #ffb300;
    border: 1.5px solid #ffb300;
    border-radius: 4px;
    cursor: pointer;
}
.production-tare-split-badge::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 10px solid #ffb300;
}
.production-tare-split-badge:active { background: rgba(255, 179, 0, 0.15); }
.production-action-btn.role-input { background: #ff9f4d; color: #1a0f00; }
.production-action-btn.role-output { background: #0ee673; color: #04140a; }
.production-action-btn:active { filter: brightness(0.9); }

.production-line-photo {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border: 1px solid #1c3350;
    border-radius: 4px;
    overflow: hidden;
    background: #0a0f18;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #6f93b8;
}

/* Карточка позиции производства — как досье: шапка с именем + фото 192x192 со скосом */
.production-item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    text-align: left;
    background: rgba(20, 26, 35, 0.85);
    border: 1px solid rgba(52, 213, 255, 0.35);
    border-radius: 0;
    clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
    padding: 16px;
    cursor: pointer;
    font-family: inherit;
    color: #e8f0f7;
    --card-accent: rgba(52, 213, 255, 0.35);
}
.production-item-card::after {
    content: '';
    position: absolute;
    z-index: 5;
    inset: 0;
    padding: 1px;
    background: var(--card-accent);
    clip-path: inherit;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Подпись рецепта собирается общим модулем; здесь только размеры под терминал -
   в цеху на неё смотрят с вытянутой руки. */
#production-recipe-name .entity-label { gap: 4px; }

/* Имя группы - то, по чему рецепт узнают с расстояния, поэтому крупно. Описание и
   параметры ровно вдвое мельче: их читают, уже подойдя к экрану, и они не должны
   спорить с заголовком за внимание. */
#production-recipe-name .entity-label-group { font-size: 30px; line-height: 1.15; color: #34d5ff; }
#production-recipe-name .entity-label-desc { font-size: 15px; color: #a8c4de; }
#production-recipe-name .entity-label-param { font-size: 15px; color: #a8c4de; }
#production-recipe-name .entity-label-param-name { color: #6f93b8; }
#production-recipe-name .entity-label-tags { margin-top: 8px; }

/* Блок пустует, когда подпись рецепта собрана общим модулем: без этого под ней
   висела пустая полоса с разделительной линией. */
.production-recipe-params:empty { display: none; }
.production-recipe-params { padding: 10px 0; border-bottom: 1px solid #1c3350; margin-bottom: 10px; }
.production-recipe-param-row { font-size: 26px; color: #a8c4de; }
.prp-label { color: #6f93b8; }
.production-recipe-fullname { margin-top: 8px; font-size: 12px; color: #6f93b8; font-style: italic; }
.production-quick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0; }
.production-quick-visual { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
#production-recipe-params .production-item-model { flex: 0 0 auto; }
.production-quick-size-arrow { width: 10px; }
.production-multiselect-bar {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 10060;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}
.production-multiselect-chip {
    background: rgba(52, 213, 255, 0.1);
    border: 1px solid #34d5ff;
    color: #34d5ff;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 2px;
}
.production-multiselect-start-btn {
    position: fixed;
    bottom: 16px;
    left: 12px;
    right: 12px;
    z-index: 10060;
    background: #2ecc71;
    color: #04141c;
    border: none;
    font-weight: 800;
    font-size: 18px;
    padding: 16px;
    border-radius: 2px;
    cursor: pointer;
}
.production-multiselect-start-btn:active { background: #27ae60; }
.production-sum-input-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.production-sum-value-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    background: #0a0f18;
    border: 1px solid #1c3350;
    border-radius: 2px;
    padding: 10px;
}
.production-sum-input-row .delivery-tap-value {
    flex: 0 1 auto;
    margin-bottom: 0;
    background: none;
    border: none;
    padding: 0 !important;
}
.production-sum-input-row .delivery-currency-sign {
    position: static;
    transform: none;
    color: #ffffff;
    font-size: 30px;
    font-weight: 400;
    padding: 0;
}
.production-sum-mode-toggle {
    flex: 0 0 auto;
    width: 52px;
    height: auto;
    padding: 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#production-sum-section .delivery-price-breakdown-row {
    margin-top: 6px;
}
.production-sum-comment {
    width: 100%;
    resize: vertical;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
}
#production-sum-section .delivery-price-breakdown-text {
    color: #cfe3f5;
}
.production-sum-toggle-btn {
    flex: 0 0 70px;
    background: rgba(52, 213, 255, 0.08);
    border: 1px solid #34d5ff;
    color: #34d5ff;
    font-size: 26px;
    font-weight: 700;
    border-radius: 2px;
}
.production-sum-toggle-btn:active { background: #34d5ff; color: #04141c; }
.production-inspection-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #2a5578;
    background: rgba(52,213,255,0.06);
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.production-inspection-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 2px;
}
.production-quick-size {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #2a5578;
    background: rgba(52,213,255,0.06);
    padding: 4px 8px;
    border-radius: 2px;
}
.device-location-label { font-size: 22px; text-align: left; line-height: 1.6; display: flex; align-items: center; gap: 10px; }
.pin-btn.device-location-btn-small { font-size: 15px !important; padding: 8px 12px !important; }
.device-location-value { color: #fff; }
.production-item-wrong-location {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    background: #ff4757;
    margin-top: 4px;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    display: block;
    width: 100%;
    box-sizing: border-box;
}
.wrong-location-mark { color: #ff4757; font-weight: 900; }
.production-item-card:active { border-color: #34d5ff; }

.production-grid {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.production-grid::-webkit-scrollbar { display: none; }
.production-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.production-item-card[data-role="input"] { --card-accent: rgba(52, 213, 255, 0.6); }
.production-item-card[data-role="input"] {
    background: linear-gradient(90deg, rgba(52,213,255,0.16), rgba(20,26,35,0.85) 45%);
    border: 1px solid rgba(52, 213, 255, 0.6);
    border-left: 4px solid #34d5ff;
}
.production-item-card[data-role="input"]:active { border-color: #34d5ff; }
.production-item-card[data-role="output"] { --card-accent: rgba(14, 230, 115, 0.6); }
.production-item-card[data-role="output"] {
    background: linear-gradient(90deg, rgba(14,230,115,0.16), rgba(20,26,35,0.85) 45%);
    border: 1px solid rgba(14,230,115, 0.6);
    border-left: 4px solid #0ee673;
}
.production-item-card[data-role="output"]:active { border-color: #0ee673; }
.production-item-card[data-role="output"] .dossier-header {
    background: rgba(14,230,115, 0.10);
    border-bottom-color: rgba(14,230,115, 0.4);
}

.production-grid .production-item-body { flex-direction: column; }
.production-grid .production-item-body .dossier-photo-frame { width: 100%; height: auto; }
.production-grid .production-item-desc { padding-top: 8px; }

.production-item-body { display: flex; gap: 14px; align-items: flex-start; }
.production-item-body .dossier-photo-frame {
    flex-shrink: 0;
}
.production-item-desc { flex: 1 1 auto; min-width: 0; padding-top: 4px; }
.production-item-params { font-size: 12px; color: #6f93b8; margin-top: 6px; }
.production-item-description { font-size: 12px; color: #9fb6cc; margin-top: 6px; line-height: 1.4; }

.production-item-modal-box {
    max-width: 380px;
    padding: 16px;
    position: relative;
}

.production-item-modal-photo {
    width: 100%;
    aspect-ratio: 1 / 1; /* всегда квадрат, независимо от пропорций исходного фото */
    position: relative;
    background: #060a10;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
    margin-bottom: 18px;
}
.production-item-modal-photo::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: #2a5578;
    clip-path: inherit;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.production-item-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.production-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}
.production-qty-btn {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    background: rgba(52, 213, 255, 0.08);
    border: 1px solid #34d5ff;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    color: #34d5ff;
    font-family: inherit;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}
.production-qty-btn:active { background: #34d5ff; color: #04141c; }

.production-qty-value {
    font-size: 80px;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Roboto', 'IBM Plex Mono', 'Courier New', monospace;
    text-align: center;
    line-height: 1;
}
.production-qty-unit-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.production-qty-unit {
    font-size: 80px;
    font-weight: 800;
    color: #ffffff;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
    display: block;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}
.production-qty-multiplier-line {
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}
.production-qty-multiplier-number {
    display: inline-block;
    cursor: pointer;
    border-bottom: 2px dashed #34d5ff;
    padding: 0 4px;
}
/* Правка запрещена - убираем и пунктир, и курсор-палец: подсказка "сюда можно
   нажать" там, где нажимать нельзя, только сбивает. */
.production-qty-multiplier-number.locked {
    cursor: default;
    border-bottom: none;
}

/* Блок переехал в шапку, под название группы: выравнивание по левому краю, как у
   остальной подписи, и каждый параметр отдельной строкой. По центру он смотрелся
   подписью к чипу тары - у пупырки описание "Рулон" читалось как название тары. */
.production-item-modal-meta { margin: 4px 0 6px; }
.production-item-modal-meta .production-item-params { margin-top: 2px; text-align: left; }
/* Описание в шапке - тем же голосом, что и название группы, только тише: тот же
   цвет, вес и заглавные буквы, размер в полтора раза меньше (17 -> 11px, на
   телефоне 51 -> 34px). Так видно, что это продолжение подписи, а не примечание. */
.production-item-modal-meta .production-item-description {
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    color: #7ec8ff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.3;
    margin-top: 2px;
}

.production-tare-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 10px 0;
}
.production-tare-chip {
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #9fb6cc;
    font-family: inherit;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    text-transform: uppercase;
}
.production-tare-chip:active { background: rgba(52,213,255,0.1); }
.production-tare-chip.active {
    border-color: #34d5ff;
    color: #34d5ff;
    background: rgba(52,213,255,0.12);
}
.production-tare-chip-more {
    flex: 0 0 auto;
    width: 32px;
    padding: 8px 0;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #6f93b8;
}
.production-tare-options {
    position: relative;
    margin-top: -6px;
    margin-bottom: 10px;
    background: #0a0f18;
    border: 1px solid #1c3350;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 20;
}
.production-tare-options.hidden { display: none; }
.production-tare-option {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    padding: 10px;
    cursor: pointer;
}
.production-tare-option:last-child { border-bottom: none; }
.production-tare-option:active { background: rgba(52,213,255,0.1); }
.production-tare-multiplier-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-bottom: 10px;
}
.production-tare-multiplier-row.hidden { display: none; }
.production-tare-label {
    font-size: 15px;
    color: #6f93b8;
    text-transform: uppercase;
    flex: 0 0 auto;
}
.production-tare-multiplier {
    flex: 0 0 auto;
    width: 6ch;
    background: #0a0f18;
    border: 1px solid #34d5ff;
    color: #e8f0f7;
    font-family: inherit;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
}
.production-tare-suffix {
    font-size: 15px;
    color: #6f93b8;
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
}
#delivery-tare-multiplier-row {
    flex-wrap: nowrap !important;
    justify-content: center;
    align-items: baseline !important;
}
#delivery-tare-multiplier-row .production-tare-label {
    font-size: 30px !important;
    color: #e8f0f7 !important;
}
#delivery-tare-multiplier-row .production-tare-suffix {
    font-size: 30px !important;
    color: #e8f0f7 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    text-transform: uppercase !important;
}
#delivery-tare-multiplier-display {
    background: none;
    border: none;
    border-bottom: 2px dashed #34d5ff;
    border-radius: 0;
    padding: 4px 10px;
    margin-bottom: 0;
}
.production-tare-total { text-align: center; color: #34d5ff; font-size: 13px; font-weight: 700; min-height: 18px; margin-bottom: 8px; }

/* ---------- РЕЖИМ ПРОИЗВОДИТЕЛЬНОСТИ: слабый планшет-терминал ---------- */
* {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.terminal-card,
.production-card,
.stocktake-list.has-expanded .dossier:not(.expanded) {
    filter: none !important;
}
.loading-overlay { background: rgba(4,7,12,0.95) !important; }
.modal { background: rgba(4,7,12,0.96) !important; }
.status-bar { background: rgba(10,15,24,0.97) !important; }
.stocktake-terminal-overlay,
.production-terminal-overlay { background: rgba(6,9,13,0.97) !important; }

/* ---------- АДАПТИВ ПОД ПЛАНШЕТ (~700–1200px, напр. 1000x768) ---------- */
/* Для ПК будет отдельная раскладка позже — этот блок десктоп не трогает. */
@media (min-width: 700px) and (max-width: 1200px) {
    #app { max-width: 900px !important; }

.modal-box,
    .items-box,
    .production-item-modal-box {
        width: 95vw !important;
        max-width: 95vw !important;
    }

    .terminal-card,
    .production-card { max-width: 720px !important; }

    .modal-box,
    .items-box {
        font-size: 16px !important;
        padding: 18px !important;
    }

    .psh-row {
        font-size: 30px !important;
        gap: 20px !important;
        padding: 16px 0 !important;
    }
    .psh-time-block {
        font-size: 18px !important;
        flex-basis: 0 !important;
        max-width: 140px !important;
    }
    .psh-item {
        flex: 2 1 0 !important;
    }

    /* Панель правки под строкой: на планшете текст был мобильного размера (11-12px) -
       поднимаем до размера строки истории, чтобы "ПО N ШТ" читалось. */
    .psh-edit-stock { font-size: 16px !important; }
    .psh-edit-pencil { font-size: 20px !important; }
    .psh-edit-input { font-size: 20px !important; }
    .psh-edit-unit { font-size: 20px !important; }
    .psh-edit-btn { font-size: 20px !important; }
    .psh-edit-delete { font-size: 18px !important; }

    /* Вторая строка количества в самой строке истории ("по 20 шт") жёстко стояла
       11px и не росла вместе с .psh-row - выравниваем по размеру строки. */
    .psh-qty-mult { font-size: inherit !important; }
    .psh-qty-warn { font-size: inherit !important; }
    .psh-item-desc { font-size: 20px !important; }
    .psh-relative { font-size: 18px !important; }

    /* Высота горизонтальных кнопок увеличена втрое относительно мобильных значений —
       вертикальный padding утроен, горизонтальный оставлен как на телефоне. */
/* ГЛАВНОЕ МЕНЮ (кнопки типа "ПЕРЕУЧЁТ", "ПОЗИЦИИ СКЛАДА", "ПОСТАВКА", "ПРОИЗВОДСТВО")
       и кнопка выбора тары в модалке (чипы) — текст увеличен втрое (12px -> 36px). */
    .btn-secondary,
    .production-tare-select {
        font-size: 36px !important;
        padding: 30px 10px !important;
    }
    .production-tare-chip {
        font-size: 18px !important;
        padding: 15px 5px !important;
    }
    .production-tare-more {
        width: 44px !important;
        height: 44px !important;
        font-size: 26px !important;
    }
    .production-tare-split-badge {
        width: 52px !important;
        height: 52px !important;
        font-size: 20px !important;
        margin-left: 12px !important;
    }
    .production-tare-split-badge::before {
        left: -9px !important;
        border-top-width: 7px !important;
        border-bottom-width: 7px !important;
        border-right-width: 9px !important;
    }
    /* Подпись активной сессии под кнопками главного меню — тоже втрое (12px -> 36px) */
    .production-active-hint {
        font-size: 36px !important;
        padding: 20px 16px !important;
    }
    .production-active-hint button {
        font-size: 24px !important;
        padding: 10px 20px !important;
    }
    /* Блок сессии внутри панели рецепта: кнопка НАЧАТЬ/ЗАВЕРШИТЬ, подпись с временем начала
       и подпись "Сейчас идёт: ..." — тоже втрое */
    .terminal-session-btn {
        font-size: 30px !important;
        padding: 16px 24px !important;
    }
    .terminal-session-icon-btn {
        font-size: 44px !important;
        padding: 12px 20px !important;
    }
    .terminal-session-close-btn {
        font-size: 80px !important;
    }
    .terminal-session-start-label {
        font-size: 30px !important;
    }
    .production-tare-option {
        font-size: 15px !important;
        padding: 30px 10px !important;
    }
    
    .production-tare-label,
    .production-tare-suffix {
        font-size: 15px !important;
    }
    .modal-actions button {
        font-size: 15px !important;
        padding: 30px 10px !important;
    }
    .production-action-btn {
        font-size: 18px !important;
        padding: 54px 18px !important;
    }
    .dossier-confirm-btn {
        font-size: 15px !important;
        padding: 27px 9px !important;
    }
    .terminal-session-start-label {
        font-size: 15px !important;
    }

    /* МЕНЮ ВЫБОРА ОПЕРАЦИИ (вкладки "ВХОД"/"ВЫХОД" в производстве) — 12px -> 36px */
    .production-tab-btn {
        font-size: 36px !important;
    }

    /* СПИСОК ПОЗИЦИЙ РЕЦЕПТА (название товара в карточке) — 17px -> 51px */
    .dossier-header-name {
        font-size: 51px !important;
    }
    /* Описание - в полтора раза мельче названия группы. */
    .production-item-modal-meta .production-item-description {
        font-size: 34px !important;
    }
    .production-inspection-tag {
        font-size: 51px !important;
        padding: 12px 24px !important;
        gap: 18px !important;
    }
    .production-inspection-logo {
        width: 51px !important;
        height: 51px !important;
    }
    .production-header-extras .production-recipe-param-row {
        font-size: 36px !important;
    }
    .production-quick-shape {
        width: 54px !important;
        height: 54px !important;
    }
.production-quick-size-arrow {
        width: 28px !important;
        height: 60px !important;
    }

    /* ЗАГОЛОВКИ: подпись сверху модалок ("ПОСТАВКА: ...", "НОВАЯ ЛОКАЦИЯ" и т.п.),
       и заголовок/подзаголовок полноэкранных терминалов (переучёт/производство) */
    .modal-box label {
        font-size: 36px !important;
    }
    .terminal-subtitle {
        font-size: 26px !important;
    }

    /* Кнопки +/- увеличены втрое по размеру (52px -> 156px) — чтобы легко попадать
       пальцем на вытянутой руке на планшете. */
    .production-qty-btn {
        width: 156px !important;
        height: 156px !important;
        flex-basis: 156px !important;
        font-size: 78px !important;
    }

    /* Стрелки количества (◀▶ вертикальный стек рядом с цифрой) - отдельно от общего
       правила выше: тут кнопки нужны в 2 раза больше по размеру, но сама стрелка
       внутри - того же размера, что и на обычных экранах, не увеличивается вместе с кнопкой. */
    .production-qty-btn-arrow {
        width: 112px !important;
        height: 128px !important;
        flex-basis: 128px !important;
        font-size: 30px !important;
        padding: 8px 4px !important;
    }
    .production-qty-control-vertical {
        max-width: 620px !important;
        grid-template-columns: 112px auto minmax(0, 1fr) !important;
    }
    .production-qty-value {
        font-size: 140px !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        padding: 14px !important;
    }
/* СПИСОК РЕЦЕПТОВ в модалке выбора рецепта — у него нет своего класса, только
       общий .tab, поэтому раньше общий трёхкратный размер сюда не попадал.
       white-space:normal - иначе длинное название рецепта обрезается по краю
       кнопки (у .tab по умолчанию nowrap, что нормально для маленьких вкладок,
       но не для 36px текста). Увеличенный margin-bottom - отступ между кнопками. */
    #production-recipe-list .tab,
    #main-menu-recipe-list .tab {
        font-size: 36px !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.3 !important;
        padding: 24px 16px !important;
        margin-bottom: 20px !important;
        display: block !important;
    }

    /* Кнопка ОТМЕНА в той же модалке - раньше попадала только под общее
       .modal-actions button (15px), теперь тоже увеличена втрое, как и
       остальные кнопки в этом экране. */
    #production-recipe-cancel {
        font-size: 36px !important;
        padding: 24px 16px !important;
    }

/* Большой крестик закрытия именно в модалке "Взять"/"Положить" */
    #production-item-modal-close {
        font-size: 180px !important;
        padding: 24px !important;
        top: -20px !important;
        right: -20px !important;
    }

/* Модалка занимает ровно высоту экрана (95vh — небольшой отступ по краям),
       а всё внутри выстраивается колонкой. Фото — единственный "резиновый"
       элемент: забирает весь остаток высоты после того, как все остальные
       (название, кнопки, поля, тара) заняли своё естественное место. */
    .production-item-modal-box {
        height: 95vh !important;
        max-height: 95vh !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .production-item-modal-box > *:not(.production-item-modal-photo) {
        flex: 0 0 auto !important;
    }

    .production-item-modal-photo {
        width: auto !important;
        aspect-ratio: unset !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        margin: 0 auto 14px auto !important;
    }
    .production-item-modal-photo img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    /* Слова "ЗАГРУЗКА" и колёсико — крупнее, как и весь остальной текст в этой модалке */
    .production-tare-loading {
        font-size: 36px !important;
        gap: 18px !important;
    }
    .production-tare-loading .spinner-cyber {
        width: 42px !important;
        height: 42px !important;
        border-width: 5px !important;
    }

    /* Текст "ВЗЯТЬ"/"ПОЛОЖИТЬ" на кнопке — раньше был 18px, теперь как остальной крупный текст */
    .production-action-btn {
        font-size: 36px !important;
    }

    /* Боковые отступы в кнопках выбора тары — увеличены (было 10px с каждой стороны) */
    .btn-secondary,
    .production-tare-chip,
    .production-tare-select {
        padding-left: 26px !important;
        padding-right: 26px !important;
    }
    #logout-btn,
    .pin-btn {
        font-size: 30px !important;
        padding: 20px 14px !important;
    }
    .user-pill-name {
        font-size: 20px !important;
    }
    .main-menu-recipe-label {
        font-size: 30px !important;
    }
    .production-item-model {
        font-size: 36px !important;
        padding: 14px 18px !important;
    }

    /* Метатеги общего модуля (классы tasks-tag-*) в заголовке рецепта, на карточках
       позиций и в модалке позиции. Под правила для старых классов выше они не
       попадают, а размеры нужны те же. Строку фильтров переучёта сюда намеренно не
       включаем: там теги должны оставаться по высоте строки, иначе шапка разъедется. */
    .production-item-card .tasks-tags,
    #production-item-modal-quick-row .tasks-tags,
    #production-recipe-name .tasks-tags {
        gap: 18px !important;
    }
    .production-item-card .tasks-tag-shape,
    #production-item-modal-quick-row .tasks-tag-shape,
    #production-recipe-name .tasks-tag-shape {
        width: 54px !important;
        height: 54px !important;
    }
    .production-item-card .tasks-tag-arrow,
    #production-item-modal-quick-row .tasks-tag-arrow,
    #production-recipe-name .tasks-tag-arrow {
        width: 28px !important;
        height: 60px !important;
    }
    .production-item-card .tasks-tag-size,
    #production-item-modal-quick-row .tasks-tag-size,
    #production-recipe-name .tasks-tag-size {
        font-size: 36px !important;
        gap: 10px !important;
    }
    .production-item-card .tasks-tag-model,
    #production-item-modal-quick-row .tasks-tag-model,
    #production-recipe-name .tasks-tag-model {
        font-size: 36px !important;
        padding: 14px 18px !important;
    }
    .production-item-card .tasks-tag-inspection,
    #production-item-modal-quick-row .tasks-tag-inspection,
    #production-recipe-name .tasks-tag-inspection {
        font-size: 51px !important;
        padding: 12px 24px !important;
        gap: 18px !important;
    }
    .production-item-card .tasks-tag-logo,
    #production-item-modal-quick-row .tasks-tag-logo,
    #production-recipe-name .tasks-tag-logo {
        width: 51px !important;
        height: 51px !important;
    }

    /* Планшет стоит на столе, а не в руках: с полуметра штамп версии в 10px и строка
       локации в 22px не читаются. Обе - вдвое. */
    .app-build-stamp {
        font-size: 20px !important;
    }
    .device-location-label {
        font-size: 44px !important;
    }
    .device-location-value {
        font-size: 44px !important;
    }
}

.production-tare-selected-name {
    font-size: 12px;
    color: #34d5ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    margin-bottom: -4px;
}

.production-tare-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 6px 0;
    color: #6f93b8;
}

.production-action-btn.production-action-btn-locked {
    background: #0a0f18;
    border: 1px dashed #1c3350;
    color: #6f93b8;
    cursor: not-allowed;
    letter-spacing: 0.5px;
}
.production-action-btn.production-action-btn-locked:active {
    filter: none;
}

.stock-toast {
    position: fixed;
    top: 44px; /* статус-бар подрос из-за крупного текста, сдвигаем тост ниже */
    left: 0;
    width: 100%;
    padding: 10px 16px;
    background: rgba(10, 15, 24, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid #0ee673;
    color: #e8f0f7;
    font-size: 24px;
    text-align: center;
    z-index: 99998; /* чуть ниже статус-бара, но выше всего остального */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateY(-100%);
    opacity: 0;
}
.stock-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.terminal-session-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 0;
}
.terminal-session-loading .spinner-cyber {
    width: 22px;
    height: 22px;
    border-width: 3px;
}

.main-menu-recipe-label {
    display: block;
    margin-bottom: 12px;
    color: #6f93b8;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-modal-box { max-width: 340px; }

.login-user-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 18px;
}
.login-user-chip {
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #9fb6cc;
    font-family: inherit;
    font-size: 33px;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
}
.login-user-chip.active {
    border-color: #34d5ff;
    color: #34d5ff;
    background: rgba(52,213,255,0.12);
}

.login-pin-dots {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 20px 0;
}
.login-pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #34d5ff;
    background: transparent;
    transition: background 0.15s ease;
}
.login-pin-dot.filled { background: #34d5ff; box-shadow: 0 0 8px rgba(52,213,255,0.7); }
.login-pin-dots.error .login-pin-dot { border-color: #ff4757; animation: pin-shake 0.3s; }
@keyframes pin-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.login-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.login-key {
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 60px;
    font-weight: 700;
    padding: 50px 0;
    border-radius: 4px;
    cursor: pointer;
}
.login-key:active { border-color: #34d5ff; color: #34d5ff; background: rgba(52,213,255,0.1); }
.login-key-action { font-size: 30px; letter-spacing: 1px; color: #6f93b8; }
#login-key-submit { color: #34d5ff; border-color: #34d5ff; font-size: 30px;}

/* Телефон: крупные размеры выше рассчитаны на планшет терминала, на смартфоне экран
   входа с ними был выше экрана. Здесь размеры от высоты экрана - влезает целиком. */
@media (max-width: 699px) {
    .login-user-chip { font-size: clamp(14px, min(2.4vh, 4.2vw), 33px); padding: clamp(5px, 1vh, 10px) 12px; }
    .login-key { font-size: clamp(24px, 4.6vh, 60px); padding: clamp(6px, 2.4vh, 50px) 0; }
    .login-key-action,
    #login-key-submit { font-size: clamp(15px, 2.8vh, 30px); }
}

.login-link-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #6f93b8;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-decoration: underline;
    padding: 6px 0;
    cursor: pointer;
    text-align: center;
}

.login-pin-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #34d5ff;
    font-size: 12px;
    letter-spacing: 1px;
    margin: -10px 0 14px;
}
.login-pin-loading.visible { display: flex; }
.login-keypad.disabled { opacity: 0.4; pointer-events: none; }

.login-submit-full {
    display: block;
    width: 100%;
    margin-top: 4px;
    color: #34d5ff;
    border-color: #34d5ff;
}
.production-item-modal-location {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    color: #ff8a8a;
    letter-spacing: 0.5px;
    margin: 10px 0 4px;
    text-transform: uppercase;
}

/* Блокирующий спиннер на время определения, какой экран открыть после входа */
.route-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(5, 8, 12, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.route-loading-overlay.hidden { display: none; }
.route-spinner {
    width: 44px;
    height: 44px;
    border-width: 4px;
}
.production-item-model {
    display: inline-block;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #7ec8ff;
    border: 1px solid #2a5578;
    background: rgba(52,213,255,0.06);
    padding: 4px 8px;
    border-radius: 2px;
    margin-bottom: 0px;
}

.production-tare-multiplier-row {
    justify-content: center !important;
    text-align: center !important;
}
.production-tare-multiplier {
    width: 6ch !important;
    box-sizing: content-box !important;
    padding: 8px 4px !important;
    text-align: center !important;
}
#production-tare-multiplier-suffix,
#delivery-tare-multiplier-suffix {
    font-size: 36px !important;
    text-align: center !important;
    flex: 0 1 auto !important;
}
.production-item-modal-box .production-tare-label {
    font-size: 36px !important;
    text-align: center !important;
}
#production-tare-multiplier {
    font-size: 36px !important;
}

.production-keypad {
    position: fixed;
    bottom: 20px;
    right: 8px;
    left: auto;
    width: 260px;
    background: #0a0f18;
    border: 2px solid #34d5ff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 10060;
    user-select: none;
    touch-action: none;
}
.production-keypad.hidden { display: none; }
.production-keypad-body {
    display: flex;
}

.production-keypad-side {
    flex: 0 0 44px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #1c3350;
}
.production-keypad-drag-fill {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6f93b8;
    font-size: 18px;
    cursor: grab;
    touch-action: none;
}
.production-keypad-drag-fill:active { cursor: grabbing; background: rgba(52,213,255,0.06); }
.production-keypad-side-close {
    flex: 0 0 auto;
    background: none;
    border: none;
    border-bottom: 1px solid #1c3350;
    color: rgba(181, 204, 222, 0.4);
    font-size: 18px;
    padding: 8px 0;
    cursor: pointer;
    font-family: Arial, sans-serif;
}
.production-keypad-side-close:hover { color: #34d5ff; }
.production-keypad-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px;
}
.production-keypad-key-short {
    height: 40px;
}
.production-keypad-key {
    background: rgba(52,213,255,0.08);
    border: 1px solid #34d5ff;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 30px;
    font-weight: 700;
    padding: 0;
    height: 64px;
    border-radius: 6px;
    cursor: pointer;
}
.production-keypad-key:active { background: #34d5ff; color: #04141c; }
.production-keypad-ok {
    background: rgba(14,230,115,0.12);
    border-color: #0ee673;
    color: #0ee673;
}
.production-keypad-ok:active { background: #0ee673; color: #04141c; }

.should-be-column { display: flex; flex-direction: column; gap: 6px; width: 100%; box-sizing: border-box; }

.production-tare-option-add {
    color: #34d5ff;
    border-color: #34d5ff;
    font-weight: 700;
}

.should-be-add-tare-btn {
    border-style: dashed;
    border-color: #34d5ff;
    color: #34d5ff;
    background: none;
}

.should-be-add-tare-btn {
    border-style: dashed;
    border-color: #34d5ff;
    color: #34d5ff;
    background: none;
}
.should-be-new-tare-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.should-be-new-tare-title {
    font-size: 11px;
    letter-spacing: 1px;
    color: #9fb6cc;
    margin-bottom: 2px;
}
.should-be-new-tare-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
}
.should-be-new-tare-row .new-tare-qty-input { flex: 0 0 44px; width: 44px; }
.should-be-new-tare-row .new-tare-select { flex: 1 1 auto; min-width: 0; }
.should-be-new-tare-row .new-tare-multiplier-input { flex: 0 0 40px; width: 40px; }
.should-be-new-tare-suffix {
    font-size: 11px;
    color: #9fb6cc;
    white-space: nowrap;
    flex: 0 0 auto;
}
.should-be-new-tare-row input,
.should-be-new-tare-row select {
    background: #0a0f18;
    border: 1px solid #34d5ff;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 12px;
    padding: 6px 4px;
    border-radius: 4px;
    box-sizing: border-box;
    text-align: center;
}
.should-be-new-tare-row select { text-align: left; }
.should-be-new-tare-cancel {
    width: 100%;
    background: none;
    border: 1px dashed #7a4a1f;
    color: #ff9f4d;
    font-family: inherit;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}

.production-tare-select {
    width: 100%;
    text-align: left;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.production-tare-select:active { border-color: #34d5ff; }

.should-be-new-tare-row .new-tare-picker {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}
.should-be-new-tare-row .new-tare-select-btn {
    font-size: 12px;
    padding: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.should-be-new-tare-row .new-tare-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
}

.new-tare-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.new-tare-actions-row button { flex: 1; }

.should-be-new-tare-block { position: relative; }
.should-be-new-tare-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    color: #6f93b8;
    font-size: 14px;
    padding: 4px 8px;
    cursor: pointer;
}
.should-be-new-tare-close:active { color: #ff4757; }
.new-tare-select-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: none;
    z-index: 2;
    font-size: 16px;
}

.should-be-batch-btn.resolved {
    border-color: #0ee673;
    color: #0ee673;
}
.should-be-batch-check {
    color: #0ee673;
    margin-right: 6px;
    font-weight: 800;
}

.should-be-batch-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border: 1px solid #2a5578;
    border-radius: 4px;
    padding: 8px 10px;
    width: 100%;
    box-sizing: border-box;
}
.should-be-batch-main { display: flex; align-items: center; gap: 6px; flex: 1; cursor: pointer; min-width: 0; }
/* Число - по содержимому, иначе при коротком количестве ("7") остаётся дыра до тары.
   Фиксированная ширина нужна только полю ввода, чтобы не прыгало при наборе. */
.should-be-batch-count { flex: 0 0 auto; text-align: right; }
.batch-qty-input { width: 60px; flex: 0 0 auto; }
.should-be-batch-tare-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.should-be-batch-row .batch-confirm-btn {
    width: auto !important;
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 10px;
}

.should-be-batch-row .batch-confirm-btn { padding: 6px 12px; font-size: 16px; line-height: 1; }

.should-be-batch-resolved { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: left; }

.dossier-discrepancy-warning {
    color: #ffb300;
    margin-left: 6px;
    cursor: help;
}

.production-header-extras {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.production-header-extras .production-recipe-param-row {
    font-size: 17px;
    color: #7ec8ff;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.production-header-extras .prp-label,
.production-header-extras .prp-value {
    color: #7ec8ff;
}

html, body {
    touch-action: pan-x pan-y; /* разрешены только скролл/свайп - зум щипком и двойным тапом запрещены */
    -webkit-touch-callout: none; /* меню iOS по долгому тапу (сохранить фото и т.п.) */
    -webkit-user-select: none;
    user-select: none;
}
input, textarea {
    -webkit-user-select: text;
    user-select: text; /* поля ввода должны оставаться выделяемыми/редактируемыми */
}

button,
.production-tare-chip,
.production-tare-split-badge,
.terminal-card,
.stocktake-location-option,
.catalog-row,
[onclick] {
    touch-action: manipulation;
}

.wd-sep { font-size: 0.75em; margin: 0 1px; }

.nfc-scan-overlay-text {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 700;
    color: #3ddc84;
    text-align: center;
    letter-spacing: 0.5px;
}

.terminal-session-btn-row { display: flex; gap: 8px; }
.terminal-session-btn.history { border-color: #6f93b8; color: #6f93b8; background: rgba(111,147,184,0.08); padding: 8px 10px; }
.terminal-session-btn.history:active { background: #6f93b8; color: #04070c; }

#production-session-history-modal {
    z-index: 10000;
}

.psh-relative { color: #6f93b8; font-weight: 400; }

.psh-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #1c2733;
    font-size: 12px;
}
.psh-time-block { display: flex; flex-direction: column; flex: 0 0 auto; }

/* Плашка-разделитель: с неё начинаются операции очередной смены */
/* Вся смена - рецепт вместе со своими операциями - в общей синей рамке */
.psh-session-block {
    border: 1px solid rgba(52, 213, 255, 0.55);
    border-radius: 6px;
    margin: 12px 0;
    padding: 0 8px 4px;
    overflow: hidden;
}
.psh-session-block .psh-row:last-of-type { border-bottom: none; }
.psh-session-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin: 0 -8px 4px;
    padding: 6px 8px;
    background: rgba(52, 213, 255, 0.08);
    overflow: hidden;
}
/* Теги отдельной строкой, в один ряд */
.psh-session-tags {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
}
.psh-session-name {
    color: #34d5ff;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
.psh-session-header .production-quick-visual { flex: 0 0 auto; flex-wrap: nowrap; }
.psh-session-date { color: #6f93b8; font-size: 11px; white-space: nowrap; }
.psh-time { color: #6f93b8; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.psh-relative { color: #4a5f75; flex: 0 0 auto; white-space: nowrap; }

.psh-item { flex: 1 1 auto; min-width: 0; white-space: normal; word-break: break-word; color: #e8f0f7; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.psh-item-name { overflow-wrap: anywhere; }

/* Отключаем браузерный pull-to-refresh (свайп вниз обновлял страницу) */
html, body { overscroll-behavior: none; overscroll-behavior-y: none; }

/* Свой выбор даты/времени: системный input, но в видимой карточке - на телефоне
   невидимый input со showPicker() ничего не показывал */
.datetime-pick-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    background: rgba(5, 8, 12, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.datetime-pick-box {
    background: #0d141d;
    border: 1px solid #34d5ff;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 260px;
    max-width: 100%;
}
.datetime-pick-box label { color: #34d5ff; font-size: 12px; letter-spacing: 1px; }
.datetime-pick-box input {
    font-size: 18px;
    padding: 10px;
    background: #050a10;
    color: #e8f0f7;
    border: 1px solid #24405a;
    border-radius: 4px;
    width: 100%;
}
.datetime-pick-actions { display: flex; gap: 10px; justify-content: flex-end; }
.datetime-pick-actions button {
    padding: 10px 16px;
    font-size: 14px;
    background: #12202e;
    color: #e8f0f7;
    border: 1px solid #34d5ff;
    border-radius: 4px;
}
.psh-item-desc { color: #6f93b8; font-size: 11px; overflow-wrap: anywhere; }
.psh-session-desc { color: #6f93b8; font-size: 11px; overflow-wrap: anywhere; max-width: 100%; }
.psh-item-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.psh-item-tags .production-quick-visual { flex: 0 0 auto; flex-wrap: nowrap; }
.psh-qty { flex: 0 0 auto; font-weight: 700; color: #9fb6cc; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
/* Направление операции: взяли со склада - красный минус, сдали - зелёный плюс.
   Красим обе строки блока, включая "по N ед.изм." */
.psh-qty.in .psh-qty-main, .psh-qty.in .psh-qty-mult { color: #ff4757; }
.psh-qty.out .psh-qty-main, .psh-qty.out .psh-qty-mult { color: #3ddc84; }
.psh-qty-mult { font-weight: 400; font-size: 11px; color: #6f93b8; }
/* Остаток на складе ушёл в минус именно после этой операции */
.psh-qty-warn { font-size: 13px; line-height: 1; }

.psh-row-clickable { cursor: pointer; }
.psh-row-clickable.expanded { background: rgba(52, 213, 255, 0.06); }

/* Панель правки, раскрывается под строкой */
.psh-edit {
    padding: 8px 10px 12px;
    border-bottom: 1px solid #1c3350;
    background: rgba(0, 0, 0, 0.35);
}
.psh-edit-stock {
    font-size: 11px;
    color: #6f93b8;
    margin-bottom: 8px;
}
.psh-edit-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;      /* строго одна строка */
    gap: 6px;
    min-width: 0;
}
.psh-edit-pencil { font-size: 15px; line-height: 1; flex: 0 0 auto; }
.psh-edit-input {
    flex: 1 1 40px;         /* сжимается, чтобы влезло остальное */
    min-width: 40px;
    width: 40px;
    background: #0a0f18;
    border: 1px solid #1c3350;
    color: #e8f0f7;
    font-size: 16px;
    font-family: inherit;
    text-align: center;
    padding: 6px 2px;
    border-radius: 0;
    outline: none;
}
.psh-edit-input:focus { border-color: #34d5ff; }
/* прячем спиннеры - они съедают ширину */
.psh-edit-input::-webkit-outer-spin-button,
.psh-edit-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.psh-edit-input[type=number] { -moz-appearance: textfield; }

.psh-edit-unit {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 12px;
    color: #9fb6cc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.psh-edit-btn {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid #3a4b5c;
    padding: 6px 10px;
    font-size: 16px;
    line-height: 1;
    border-radius: 0;
}

.psh-edit-delete {
    width: 100%;
    margin-top: 8px;
    background: transparent;
    border: 1px solid #ff4757;
    color: #ff4757;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 0;
}
.psh-edit-delete:active { background: #ff4757; color: #04070c; }
.psh-edit-delete.restore { border-color: #6f93b8; color: #6f93b8; }
.psh-edit-delete.restore:active { background: #6f93b8; color: #04070c; }
.psh-row-deleted { opacity: 0.5; text-decoration: line-through; }
#production-session-history-list { overflow-x: auto; }

#app-update-overlay { z-index: 20000; }
.app-update-box { text-align: center; }
.app-update-spinner { margin: 0 auto 16px; }
.app-update-percent { font-size: 28px; font-weight: 700; color: #34d5ff; margin-top: 8px; }

.main-menu-recipe-label {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #05080f;
    padding-top: 4px;
    padding-bottom: 8px;
}

@media (max-width: 699px) {
    /* Выбор режима переучёта переехал из списка складов прямо в модалку, поэтому
       #stocktake-location-list его больше не покрывает - добавлен сам модальный блок,
       иначе на телефоне эти кнопки остались бы мелкими, в отличие от меню производства. */
    #production-recipe-list .tab,
    #main-menu-recipe-list .tab,
    #stocktake-location-list .tab,
    #stocktake-location-modal .tab,
    .wizard-back-btn {
        padding-top: 16px !important;
        padding-bottom: 16px !important;
        font-size: 18px !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.3 !important;
        height: auto !important;
    }

    .main-menu-recipe-label {
        font-size: 26px !important;
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.3 !important;
    }
}

.app-build-stamp {
    margin-top: 18px;
    text-align: center;
    color: #4a5f74;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Приглушённая, не как основные кнопки меню: жать её надо редко, а стоит она внизу,
   где случайное нажатие обошлось бы полной перезагрузкой приложения. */
.app-build-refresh {
    display: block;
    margin: 8px auto 0;
    background: transparent;
    border: 1px solid #2a3545;
    color: #6f93b8;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 2px;
    cursor: pointer;
}

.app-build-refresh:active {
    border-color: #34d5ff;
    color: #34d5ff;
}

.production-tare-freshness-spinner {
    display: inline-block;
    margin-bottom: 6px;
}

#app-boot-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #05080f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.25s ease;
}
#app-boot-splash.hidden { opacity: 0; pointer-events: none; }
.app-boot-splash-percent {
    font-size: 15px;
    color: #34d5ff;
    letter-spacing: 1px;
    font-weight: 700;
}

.modal-close-x-corner {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(181, 204, 222, 0.35);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
    font-family: Arial, sans-serif;
    transition: color 0.2s ease, transform 0.2s ease;
}
.modal-close-x-corner:hover { color: rgba(52, 213, 255, 0.7); transform: scale(1.05); }

#delivery-location-modal .modal-box label {
    font-size: 18px;
}
#delivery-location-modal .tab {
    font-size: 18px;
    padding: 16px 24px;
}
#delivery-location-modal #delivery-location-toggle-all {
    font-size: 15px;
    padding: 14px 20px;
}

.delivery-tare-option { width: 100%; text-align: left; }
#delivery-amount-modal .modal-box { text-align: center; }
#delivery-amount-modal .delivery-field-label { font-size: 22px; }
#delivery-price-label {
    font-size: 15px;
    white-space: nowrap;
    display: block;
}
#delivery-amount-modal .modal-box { max-width: min(420px, calc(100vw - 70px)); }

.delivery-tap-value {
    cursor: pointer;
    font-size: 30px;
    font-weight: 400;
    color: #e8f0f7;
    font-family: inherit;
    background: #0a0f18;
    border: 1px solid #1c3350;
    border-radius: 2px;
    padding: 10px;
    margin-bottom: 14px;
}
.delivery-qty-inline {
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 0;
    display: inline-block;
}
.delivery-qty-tare-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}
.delivery-qty-inline {
    border-bottom: 2px dashed #34d5ff !important;
    padding: 4px 10px !important;
}
.delivery-tare-select-inline {
    background: #0a0f18;
    border: 1px solid #1c3350;
    border-radius: 2px;
    padding: 10px 16px;
    font-size: 30px;
    color: #e8f0f7;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}
.delivery-tare-select-arrow {
    font-size: 18px;
    color: #6f93b8;
}
.delivery-tare-list {
    position: fixed;
    z-index: 10050;
    background: #05080f;
    border: 1px solid #34d5ff;
    border-radius: 2px;
    max-height: 50vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(52,213,255,0.25);
    padding: 8px;
}
.delivery-tare-list .tab {
    font-size: 30px;
    width: 100%;
    text-align: left;
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
}

.keypad-editing {
    background: rgba(52,213,255,0.15) !important;
    border-color: #34d5ff !important;
    position: relative;
}
.keypad-editing::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: #34d5ff;
    margin-left: 4px;
    vertical-align: middle;
    animation: keypad-cursor-blink 1s step-start infinite;
}
@keyframes keypad-cursor-blink {
    50% { opacity: 0; }
}

.production-keypad-close:hover { color: #34d5ff; }
.production-keypad-backspace {
    background: rgba(255,71,87,0.1) !important;
    border-color: #ff4757 !important;
    color: #ff4757 !important;
}
.production-keypad-backspace:active { background: #ff4757 !important; color: #04141c !important; }

.delivery-amount-header-location { font-size: 13px; color: #6f93b8; margin-top: 2px; }
.delivery-price-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: -6px 0 14px;
}
.delivery-price-breakdown-text { font-size: 13px; color: #4a7ba8; text-transform: uppercase; }
.delivery-price-mode-toggle {
    background: none;
    border: 1px solid #1c3350;
    color: #6f93b8;
    border-radius: 2px;
    font-size: 16px;
    padding: 2px 8px;
    cursor: pointer;
    flex: 0 0 auto;
}
.delivery-price-mode-toggle:hover { color: #34d5ff; border-color: #34d5ff; }

.delivery-amount-photo { width: 100%; height: 160px; margin-bottom: 14px; }
.delivery-price-input-wrap { position: relative; }
.delivery-price-input-wrap .delivery-tap-value { padding-right: 40px; }
.delivery-currency-sign {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6f93b8;
    font-size: 22px;
    pointer-events: none;
}

.delivery-price-section-divider { border-top: 1px solid #34d5ff; margin: 14px 0; }

#delivery-amount-modal { align-items: flex-start; }
#delivery-amount-modal .modal-box { margin-top: 8px; }

#confirm-modal-message { white-space: pre-line; }

.delivery-quick-tare-chips { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }

.production-tare-big-confirm {
    font-size: 30px;
    font-weight: 700;
    color: #34d5ff;
    text-align: center;
    margin: 10px 0 14px;
    padding: 10px;
    border: 2px solid #34d5ff;
    border-radius: 2px;
    background: rgba(52,213,255,0.08);
}

.production-qty-stack { display: contents; }
.production-qty-unit-block { display: contents; }

#production-qty-plus { grid-area: plus; align-self: center; }
#production-qty-minus { grid-area: minus; align-self: center; }
#production-qty-value { grid-area: value; align-self: baseline; }
#production-qty-unit { grid-area: unit; align-self: baseline; }
#production-qty-multiplier-line { grid-area: mult; align-self: start; }

.production-qty-btn-arrow {
    flex: 0 0 64px;
    width: 56px;
    height: 64px;
    box-sizing: border-box;
    padding: 8px 4px;
    font-size: 30px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.production-qty-control-vertical {
    display: grid;
    grid-template-columns: 56px auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
        "plus  value unit"
        "minus .     mult";
    align-items: center;
    column-gap: 14px;
    row-gap: 2px;
    max-width: 380px; /* на широких экранах блок не растягивается во всю ширину модалки */
    margin-left: auto;  /* центрируется по горизонтали, как чипс над ним */
    margin-right: auto; /* но margin-top/bottom не трогаем - они настраиваются отдельным правилом .production-qty-control */
}
#production-qty-unit,
#production-qty-multiplier-line {
    text-align: left;
}

/* ---------- Чипы-фильтры по тегам в переучёте по локации ---------- */
.stocktake-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.stocktake-filter-group {
    position: relative;
}

.stocktake-filter-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #3a4b5c;
    border-radius: 0;
}

.stocktake-filter-chip .production-quick-visual {
    flex-wrap: nowrap;
}

/* Пунктирная нейтральная заглушка - тот же язык, что и "форма не указана" в мегатегах:
   пунктир значит "неопределённость/любое значение", здесь - "фильтр не выбран". */
.stocktake-filter-chip-empty {
    display: block;
    width: 18px;
    height: 18px;
    border: 1.5px dashed #6f93b8;
    border-radius: 5px;
}

.stocktake-filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: min(260px, calc(100vw - 16px));
    padding: 8px;
    background: #0a1620;
    border: 1px solid #3a4b5c;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.stocktake-filter-option {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #3a4b5c;
    border-radius: 0;
}

.stocktake-filter-option.active {
    border-color: #34d5ff;
    box-shadow: 0 0 0 1px #34d5ff inset;
}

.stocktake-filter-option .production-quick-visual {
    flex-wrap: nowrap;
}

.stocktake-stale-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #3a4b5c;
    white-space: nowrap;
}

/* Вторая строка шапки: поиск, дни без переучёта, проблемные, чипы метатегов - всё в
   один ряд. Поиск тянется на остаток ширины, остальное занимает столько, сколько нужно.
   Рамки у фильтров и у поля дней убраны: в одном ряду десяток одинаковых прямоугольных
   рамок читается как сетка, а не как набор кнопок, и мешает видеть саму строку поиска. */
/* Высота у всех элементов ряда одна - иначе поиск, чипы и значки стоят на разных
   уровнях и строка выглядит рваной. Зазор 2px: ровно вдвое толще рамки блока, чтобы
   соседние рамки не сливались в одну линию, но и не разъезжались. */
.stocktake-toolbar {
    --stk-row-h: 42px;
    display: flex;
    align-items: center;
    gap: 2px;
    width: 100%;
    margin-top: 10px;
}

.stocktake-toolbar-search {
    flex: 1 1 auto;
    min-width: 50px;
    height: var(--stk-row-h);
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #3a4b5c;
    color: #fff;
    padding: 0 5px;
    border-radius: 0;
    font-size: 16px;
    outline: none;
}

.stocktake-toolbar .stocktake-stale-chip {
    border: none;
    background: transparent;
    padding: 2px 0;
    gap: 2px;
}

/* Рамка не вокруг всего чипа, а только вокруг числа - и вплотную к часам, чтобы
   значок и значение читались как одно целое, а не как два соседних элемента ряда. */
/* Часы и число - в одной рамке: это одна сущность "сколько дней", а не значок рядом
   с полем. Рамку поэтому носит сам чип, а не число внутри него. */
.stocktake-stale-value {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 100%;
    box-sizing: border-box;
    color: #fff;
    font-size: 14px;
    text-align: center;
}

/* Селектор с двумя классами намеренно: ниже идёт общее правило
   .stocktake-toolbar .stocktake-filter-chip { border: none }, и при равной
   специфичности выигрывало бы оно - рамка вокруг часов и числа пропадала. */
.stocktake-toolbar .stocktake-filter-chip.stocktake-stale-chip {
    gap: 2px;
    padding: 0 3px;
    border: 1px solid #3a4b5c;
    box-sizing: border-box;
}

.stocktake-toolbar .stocktake-filter-chip.stocktake-stale-chip.active {
    border-color: #34d5ff;
}

/* Часы внутри общей рамки - без своей рамки и фона, иначе рамок будет две. */
.stocktake-toolbar .stocktake-stale-chip .production-inspection-tag {
    border: none;
    background: transparent;
    padding: 0;
}

.stocktake-stale-chip.active .stocktake-stale-value {
    color: #34d5ff;
}

/* 34 варианта в одну колонку не влезут - список плиткой, со скроллом. */
.stocktake-stale-dropdown {
    max-height: min(45vh, 320px);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.stocktake-stale-dropdown .stocktake-filter-option {
    min-width: 40px;
    min-height: 36px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

.stocktake-toolbar .stocktake-filter-bar {
    margin-top: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 2px;
}

.stocktake-toolbar .stocktake-filter-chip {
    border: none;
    background: transparent;
    min-width: 0;
    height: var(--stk-row-h);
    min-height: 0;
    padding: 0;
}

/* Внутренности чипов - тег осмотра, размер, модель - изначально нарисованы для карточки,
   где строка высокая. В ряду фильтров они должны занимать его целиком: одна высота,
   компактные поля, ничего не переносится. */
.stocktake-toolbar .production-quick-visual {
    flex-wrap: nowrap;
    gap: 2px;
    height: 100%;
}

.stocktake-toolbar .production-inspection-tag,
.stocktake-toolbar .production-quick-size,
.stocktake-toolbar .production-item-model {
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 3px;
    font-size: 12px;
}

/* Значок осмотра и стрелка размера - маленькая графика в широкой рамке: при поле в
   3px они липнут к краям и читаются хуже, чем текстовая модель рядом. */
.stocktake-toolbar .production-inspection-tag,
.stocktake-toolbar .production-quick-size {
    padding: 0 6px;
}

/* То же самое для разметки общего модуля метатегов (классы tasks-tag-*). Переучёт
   рисует чипы фильтров уже им, а высоту ряда задаём здесь - модуль про наш терминал
   ничего не знает и ставит размеры под админку. */
.stocktake-toolbar .tasks-tags {
    height: 100%;
    gap: 2px;
}

.stocktake-toolbar .tasks-tag-model,
.stocktake-toolbar .tasks-tag-inspection,
.stocktake-toolbar .tasks-tag-size {
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    font-size: 12px;
}

.stocktake-toolbar .tasks-tag-model {
    padding: 0 3px;
}

.stocktake-toolbar .tasks-tag-inspection,
.stocktake-toolbar .tasks-tag-size {
    padding: 0 6px;
}

.stocktake-toolbar .tasks-tag-shape {
    width: calc(var(--stk-row-h) - 14px);
    height: calc(var(--stk-row-h) - 14px);
}

.stocktake-toolbar .tasks-tag-arrow {
    height: calc(var(--stk-row-h) - 18px);
}

/* Кружки и квадратики формы/цвета - по высоте блока, а не 18px как в карточке. */
.stocktake-toolbar .production-quick-shape {
    width: calc(var(--stk-row-h) - 12px);
    height: calc(var(--stk-row-h) - 12px);
}

.stocktake-toolbar .stocktake-filter-chip-empty {
    width: calc(var(--stk-row-h) - 16px);
    height: calc(var(--stk-row-h) - 16px);
}

.stocktake-toolbar .production-quick-size-arrow {
    height: calc(var(--stk-row-h) - 16px);
}

/* Кнопка проблемных: состояние показываем яркостью, а не рамкой - рамок в этом ряду больше нет. */
.stocktake-toolbar .stocktake-problem-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff5470;
    font-size: 17px;
    line-height: 1;
    height: var(--stk-row-h);
    box-sizing: border-box;
    padding: 0 4px;
    border: 1px solid #ff5470;
    background: transparent;
    opacity: 0.5;
}

.stocktake-toolbar .stocktake-problem-chip.active {
    opacity: 1;
    background: rgba(255, 84, 112, 0.18);
    text-shadow: 0 0 8px rgba(255, 84, 112, 0.9);
}

.stocktake-stale-input {
    width: 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #3a4b5c;
    color: #fff;
    font-size: 16px;
    text-align: center;
    padding: 2px 0;
    outline: none;
    border-radius: 0;
}

.stocktake-stale-input:focus {
    border-bottom-color: #34d5ff;
}

/* прячем спиннеры числового поля - на терминале они только мешают попадать пальцем */
.stocktake-stale-input::-webkit-outer-spin-button,
.stocktake-stale-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.stocktake-stale-input[type=number] {
    -moz-appearance: textfield;
}

.stocktake-stale-suffix {
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #8c9ba5;
}