/* GrainFlow 2 — все стили одним файлом (этап 4 переделки, 14.11).
   Собрано из styles.css и next*.css в прежнем порядке; перебитые ниже тем же селектором свойства убраны. */
/* ===== Дизайн-токены (этап 4, 14.11): ВСЕ размеры, скругления, шрифты и кривые берутся отсюда ===== */
:root {
  --r-xs: 8px; --r-s: 12px; --r-m: 14px; --r-l: 18px; --r-pill: 999px;
  --gf-radius: var(--r-l); --gf-radius-s: var(--r-s);
  --fs-2xs: 11px; --fs-xs: 12px; --fs-s: 14px; --fs-m: 16px; --fs-ml: 18px; --fs-l: 20px; --fs-2l: 24px; --fs-xl: 28px; --fs-3xl: 34px;
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --violet: #7c3aed; --violet-soft: rgba(124, 58, 237, .12);
}

/* ===== styles.css ===== */
/* GrainFlow — стили.
   Система: радиусы --r-s / --r-l (+ «таблетка» 999px), шрифты --fs-xs…--fs-xl,
   отступы кратны 4px, один акцентный цвет. Сначала телефон, потом широкий экран. */
@font-face {
  font-family: "Marck Script";
  src: url("../assets/fonts/MarckScript-Regular.ttf") format("truetype");
  font-display: swap;
}
:root { color-scheme: light; --bg: #f3f5f4; --surface: #ffffff; --surface-2: #f1f3f2; --field: #f1f3f2; --line: rgba(17, 24, 39, 0.08); --line-strong: rgba(17, 24, 39, 0.14); --text: #111827; --accent: #0a7cff; --accent-soft: rgba(10, 124, 255, 0.10); --on-accent: #ffffff; --positive: #16a34a; --positive-soft: rgba(22, 163, 74, 0.10); --negative: #dc2626; --negative-soft: rgba(220, 38, 38, 0.09); --warning: #c2410c; --warning-soft: rgba(234, 88, 12, 0.11); --star: #f59e0b; --shadow-0: 0 1px 2px rgba(15, 23, 42, .08); --shadow-1: 0 1px 3px rgba(15, 23, 42, 0.10), 0 8px 22px rgba(15, 23, 42, 0.12); /* выраженная тень блоков — везде одинаково */ --shadow-2: 0 8px 30px rgba(17, 24, 39, 0.12); --tabbar-h: 60px; --safe-b: env(safe-area-inset-bottom, 0px); }
:root.dark { color-scheme: dark; --bg: #0b0e0d; --surface: #161a19; --surface-2: #1d2221; --field: #20262a; --text: #f3f4f6; --accent: #3b9bff; --accent-soft: rgba(59, 155, 255, 0.14); --positive: #34d27b; --positive-soft: rgba(52, 210, 123, 0.12); --negative: #ff6b6b; --negative-soft: rgba(255, 107, 107, 0.12); --warning: #fb923c; --warning-soft: rgba(251, 146, 60, 0.13); --shadow-0: 0 1px 2px rgba(0, 0, 0, .35); --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.45); --shadow-2: 0 12px 40px rgba(0, 0, 0, 0.55); }
/* ---------- База ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
/* страница не ездит вбок даже во время въезда вкладки */
body { overflow-x: clip; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 var(--fs-m)/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--bg-glow); pointer-events: none; }
body.modal-open { overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, label { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-s { width: 18px; height: 18px; }
.icon-xs { width: 14px; height: 14px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
/* ---------- Каркас ---------- */
#app { width: min(100%, 720px); margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.appbar { justify-content: space-between; }
.brand-name { font-size: var(--fs-xl); line-height: 1; }
.brand-signature { color: var(--faint); font-size: var(--fs-xs); font-weight: 600; }
.view { display: none; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.count { color: var(--faint); font-weight: 700; font-size: var(--fs-l); }
/* Нижняя панель вкладок */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; padding: 6px max(8px, calc((100vw - 720px) / 2)) calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); }
.tab { display: grid; justify-items: center; gap: 2px; min-height: 48px; padding: 4px 0; border: 0; border-radius: var(--r-s); background: none; color: var(--faint); font-size: var(--fs-2xs); font-weight: 600; cursor: pointer; }
.tab .icon { width: 24px; height: 24px; }
.tab.is-active { color: var(--accent); }
.tab:active { background: var(--surface-2); }
/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: var(--r-s); font-size: var(--fs-m); font-weight: 650; cursor: pointer; transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease; -webkit-user-select: none; user-select: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--negative); color: var(--on-accent); }
.btn-ghost { background: none; min-height: 40px; padding: 0 8px; color: var(--accent); }
.btn-danger-text { color: var(--negative); }
.btn-s { min-height: 40px; padding: 0 12px; font-size: var(--fs-s); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); cursor: pointer; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn-accent { background: var(--accent); color: var(--on-accent); }
.icon-btn-plain { background: none; box-shadow: none; color: var(--muted); }
.icon-btn-plain:active { background: var(--surface-2); }
/* Кнопки действий с иконкой и подписью (Позвонить, Маршрут…) */
.action-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.action { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 60px; padding: 8px 4px; border: 0; border-radius: var(--r-s); background: var(--surface-2); color: var(--accent); font-size: var(--fs-xs); font-weight: 650; text-align: center; cursor: pointer; }
.action span { color: var(--text); }
.action:active { transform: scale(0.97); }
.action.is-danger, .action.is-danger span { color: var(--negative); }
/* ---------- Карточки и поля ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.form { display: grid; }
.card.form { padding: 16px; }
.field { display: grid; min-width: 0; position: relative; }
.field-label { color: var(--muted); font-size: var(--fs-s); font-weight: 600; }
input, select, textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-s); background: var(--field); font-size: var(--fs-m); outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
textarea { padding: 12px 14px; resize: vertical; min-height: 88px; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.is-invalid { border-color: var(--negative); box-shadow: 0 0 0 4px var(--negative-soft); }
/* Ползунок «Хочу заработать» (0,50–5,00 ₽/кг, шаг 0,10) */
.profit-slider { display: grid; gap: 6px; margin: 14px 0 12px; }
.ps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ps-head span { color: var(--muted); font-size: var(--fs-s); font-weight: 600; }
.ps-head strong { font-size: var(--fs-l); font-weight: 800; color: var(--text); }
.ps-scale { display: flex; justify-content: space-between; color: var(--faint); font-size: var(--fs-xs); }
input[type="range"]:is([data-profit-range], [data-card-range]) { -webkit-appearance: none; appearance: none; width: 100%; min-height: 0; height: 28px; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer; touch-action: pan-y; }
input[type="range"]:is([data-profit-range], [data-card-range]):focus { box-shadow: none; border: 0; background: transparent; }
input[type="range"]:is([data-profit-range], [data-card-range])::-webkit-slider-runnable-track { height: 6px; border-radius: var(--r-pill); background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 0%), var(--line-strong) var(--pct, 0%)); }
input[type="range"]:is([data-profit-range], [data-card-range])::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: var(--line-strong); }
input[type="range"]:is([data-profit-range], [data-card-range])::-moz-range-progress { height: 6px; border-radius: var(--r-pill); background: var(--accent); }
input[type="range"]:is([data-profit-range], [data-card-range])::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.04); transition: transform 0.15s ease; }
input[type="range"]:is([data-profit-range], [data-card-range]):active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:is([data-profit-range], [data-card-range])::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: var(--shadow-0); }
/* ---------- Списки заводов и фермеров ---------- */
/* Фильтры списков — лента с прокруткой вбок; края уходят в «туман» */
.chips-scroll.filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; /* до края экрана: отступ страницы на узких телефонах — 12 px */ margin-right: -12px; padding: 2px 12px; scroll-padding: 0 12px; --fade-l: 0px; --fade-r: 0px; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%); }
.chips-scroll.filter-chips::-webkit-scrollbar { display: none; }
.chips-scroll.filter-chips.fade-l { --fade-l: 40px; }
.chips-scroll.filter-chips.fade-r { --fade-r: 40px; }
.chips-scroll.filter-chips .chip { flex: 0 0 auto; }
.list-tools { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.list-tools .sort-pill { margin-left: auto; }
.list-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-s); font-weight: 600; white-space: nowrap; }
.list-tools .chip, .list-tools .sort-pill { min-height: 32px; height: 32px; padding: 0 10px; font-size: var(--fs-s); font-weight: 600; white-space: nowrap; flex: 0 0 auto; gap: 5px; }
.list-tools .icon { width: 15px; height: 15px; }
.list-tools .sort-pill select { height: 30px; font-size: var(--fs-s); font-weight: 600; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.list-tools .sort-pill { flex: 0 1 auto; min-width: 0; }
.chip-call .icon { color: var(--accent); }
.entity-row { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 10px 12px; }
.entity-row .entity-sub { display: flex; align-items: center; gap: 6px; }
.entity-price { display: grid; justify-items: end; gap: 2px; min-width: 72px; min-height: 44px; padding: 4px 6px; margin: -4px -6px -4px 0; border: 0; border-radius: var(--r-s); background: none; text-align: right; cursor: pointer; }
.entity-price:active { background: var(--surface-2); }
.entity-price strong { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-l); font-weight: 800; }
.entity-price small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.history-time { margin-left: 8px; color: var(--faint); font-size: var(--fs-xs); font-weight: 600; }
/* Вкладка «Все»: столбик цен по всем культурам строки */
.row-prices { display: grid; justify-items: end; gap: 1px; margin: -4px -6px -4px 0; }
.entity-price-line { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 26px; padding: 2px 6px; border: 0; border-radius: var(--r-s); background: none; color: inherit; cursor: pointer; }
.entity-price-line:active { background: var(--surface-2); }
.entity-price-line small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.entity-price-line strong { min-width: 46px; text-align: right; font-size: var(--fs-m); font-weight: 800; }
.best-badge { padding: 1px 6px; border-radius: var(--r-pill); background: var(--positive-soft); color: var(--positive); font-size: var(--fs-2xs); font-weight: 800; text-transform: uppercase; }
.fresh-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.fresh-fresh { background: var(--positive); }
.fresh-week { background: #eab308; }
.fresh-stale { background: var(--warning); }
.fresh-unknown { background: var(--faint); }
.inline-label .fresh-dot { margin-left: 6px; vertical-align: middle; }
.status-pill { flex: 0 0 auto; padding: 1px 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; background: var(--surface-2); color: var(--muted); }
/* История цен в карточке */
.history-block + .history-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.history-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.history-head strong { font-size: var(--fs-s); }
.history-head .num { margin-left: auto; font-size: var(--fs-s); font-weight: 700; }
.sparkline { flex: 1 1 auto; height: 28px; min-width: 60px; }
.sparkline polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sparkline.muted { color: var(--faint); }
/* Шапка результата: маленькая кнопка сортировки и «Поделиться» */
.results-tools { display: flex; align-items: center; gap: 4px; }
.sort-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font-size: var(--fs-s); font-weight: 600; cursor: pointer; }
.sort-pill .icon { color: var(--accent); }
.sort-pill select { width: auto; min-height: 0; height: 34px; padding: 0 14px 0 0; border: 0; background: transparent; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 6px) 15px, calc(100% - 2px) 15px; background-size: 4px 4px; background-repeat: no-repeat; font-size: var(--fs-s); font-weight: 600; cursor: pointer; }
.sort-pill select:focus { box-shadow: none; border: 0; background-color: transparent; }
.sort-pill:focus-within { border-color: var(--accent); }
/* Карточки результата: первая выделена, остальные — такие же по составу, но спокойнее */
.hero.is-secondary { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-1); }
.hero.is-secondary .hero-profit { font-size: var(--fs-xl); }
/* Карточка результата: главное — прибыль, цена завода, расстояние */
.stats.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 14px; }
/* Три плашки в карточке результата: цена завода · логистика · расстояние — всегда в одну строку */
.hero .stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 14px; gap: 6px; }
.hero .stats.stats-3 .stat { grid-column: auto; padding: 9px 8px; }
.hero .stats.stats-3 dd { white-space: nowrap; overflow-wrap: normal; }
/* Цена фермеру — второстепенный блок внизу карточки, без ярких цветов */
/* Ползунок «Целевая прибыль» в карточке результата: подпись и значение над ним, шкала под ним */
/* «Предложить фермеру до 13,30 ₽/кг» и прибыль под ним */
/* Колокольчик уведомлений */
.appbar-actions { display: flex; gap: 8px; }
.notify-btn { position: relative; }
.notify-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--negative); color: var(--on-accent); font-size: var(--fs-2xs); font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); animation: badgePop 0.3s var(--ease-bounce); }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }
/* Список уведомлений */
.notice { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.notice:last-child { border-bottom: 0; }
.notice > .icon { margin-top: 1px; color: var(--muted); }
.notice.is-unread { background: var(--accent-soft); }
.notice.is-unread > .icon { color: var(--accent); }
.notice-main { display: grid; gap: 2px; min-width: 0; }
.notice-text { font-size: var(--fs-s); font-weight: 600; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.notice-time { color: var(--muted); font-size: var(--fs-xs); }
.notice:active { background: var(--surface-2); }
/* Компактный блок ввода (Вес / Закупка / Логистика): подпись слева, число справа */
.inline-list { border-radius: var(--r-s); background: var(--field); overflow: hidden; }
.inline-row { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-bottom: 1px solid var(--line); cursor: text; transition: background 0.15s ease; }
.inline-row:last-child { border-bottom: 0; }
.inline-row:focus-within { background: var(--accent-soft); }
.inline-label { flex: 0 0 auto; color: var(--muted); font-size: var(--fs-s); cursor: text; }
.inline-input { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: var(--fs-m); font-weight: 650; text-align: right; }
.inline-input:focus { background: transparent; box-shadow: none; border-color: transparent; }
.inline-unit { flex: 0 0 auto; color: var(--muted); font-size: var(--fs-s); font-weight: 600; }
.inline-row .tax-switch { margin-left: 6px; }
/* Строка-кнопка «Расчёт: нал 0,87 · посредник 0,2 ₽/кг ›» */
.inline-row-button { width: 100%; border-left: 0; border-right: 0; border-top: 0; background: none; text-align: left; cursor: pointer; }
.inline-row-button:active { background: var(--surface-2); }
.inline-summary { flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: var(--fs-s); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-row-button .row-chevron { color: var(--faint); }
.inline-row .tax-switch-text { min-width: 34px; text-align: right; }
/* Тумблер «нал / НДС» внутри поля «Закупка» */
.tax-switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; gap: 4px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; }
/* Видимый тумблер маленький, а зона нажатия — под палец (44 px) */
.tax-switch::before { content: ""; position: absolute; inset: -12px -8px; }
.tax-switch-text { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-align: right; transition: color 0.2s ease; }
.tax-switch-track { position: relative; width: 32px; height: 20px; border-radius: var(--r-pill); background: var(--line-strong); transition: background 0.2s ease; }
.tax-switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-0); transition: transform 0.22s var(--ease-bounce); }
.tax-switch[aria-checked="true"] .tax-switch-track { background: var(--accent); }
.tax-switch[aria-checked="true"] .tax-switch-knob { transform: translateX(12px); }
.tax-switch[aria-checked="true"] .tax-switch-text { color: var(--accent); }
.tax-switch:active .tax-switch-knob { width: 19px; }
/* Строка «Можно предложить фермеру» в результате */
/* Сегменты */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: var(--r-s); background: var(--field); }
.segment { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); font-size: var(--fs-s); font-weight: 650; white-space: nowrap; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.segment small { font-size: var(--fs-xs); font-weight: 600; opacity: 0.75; }
.segment.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-0); }
/* Чипы (культуры, фильтры) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Культуры и фильтры переносятся на новую строку — без прокрутки вбок и без обрезанных чипов */
.chips-scroll { flex-wrap: wrap; gap: 6px; }
/* Чипы растягиваются и заполняют строку целиком — ровные «плитки» без дыр справа */
.chips-scroll .chip { flex: 1 1 auto; justify-content: center; min-height: 38px; padding: 0 9px; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font-size: var(--fs-s); font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip .icon { width: 16px; height: 16px; }
/* Невидимая галочка внутри чипа: размер 1 px, иначе (width:100% у input) она растягивала форму вбок */
.chip-check { position: relative; }
.chip-check input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.chip-check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filter-chips { margin-bottom: 12px; }
/* две строки фильтров фермеров — ближе друг к другу */
.unknown-volume { color: var(--warning); font-weight: 600; }
/* Карточка фермера: заголовки групп с иконками, партии строками */
.detail-group-title { display: flex; align-items: center; gap: 8px; }
.detail-group-title .icon { width: 17px; height: 17px; color: var(--accent); }
.culture-detail { align-items: flex-start; flex-wrap: wrap; }
.culture-detail-main { min-width: 0; flex: 1 1 0; }
/* партии — на всю ширину под культурой */
.lot-lines { display: grid; gap: 3px; flex: 1 0 100%; grid-column: 1 / -1; margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--line); }
.lot-line { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-s); white-space: nowrap; }
.lot-line span:first-child { color: var(--muted); font-weight: 600; }
/* качество культуры/партии — мелко, в одну-две строки */
.quality-line { display: flex; align-items: flex-start; gap: 5px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.quality-line .icon { flex: 0 0 13px; width: 13px; height: 13px; margin-top: 1px; color: var(--accent); }
.lot-line + .quality-line { margin-bottom: 4px; }
/* Поиск */
.search { display: flex; align-items: center; margin-bottom: 12px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); color: var(--faint); }
.search input { background: transparent; padding-left: 0; }
.search input:focus { box-shadow: none; border-color: transparent; background: transparent; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
/* Подсказки адреса */
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; /* выше нижней панели вкладок (50), но ниже шторок (100+) */ max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); box-shadow: var(--shadow-2); }
.suggestion { display: grid; gap: 2px; width: 100%; min-height: 52px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.suggestion:last-child { border-bottom: 0; }
.suggestion span { color: var(--muted); font-size: var(--fs-s); }
.suggestion.is-active, .suggestion:hover { background: var(--accent-soft); }
/* Культуры в формах */
/* ---------- Калькулятор: результаты ---------- */
#summary { margin-top: 16px; }
.results { display: grid; }
.results:empty { display: none; }
.results-head { display: flex; justify-content: space-between; gap: 12px; }
.results-head h2 { font-size: var(--fs-l); font-weight: 750; }
.results-head p { color: var(--muted); font-size: var(--fs-s); }
.hero { padding: 16px; border-radius: var(--r-l); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface) 55%); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow-2); }
.hero-name { font-size: var(--fs-l); font-weight: 750; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.hero-profit { margin: 14px 0 2px; font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.pill { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 4px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.pill-positive { background: var(--positive-soft); color: var(--positive); }
.pill-negative { background: var(--negative-soft); color: var(--negative); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.stat { padding: 10px; border-radius: var(--r-s); background: var(--surface-2); min-width: 0; }
.stat dt { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.stat dd { margin: 2px 0 0; font-weight: 700; font-size: var(--fs-s); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.hero .stat { background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
/* Остальные варианты — компактные строки, раскрываются по нажатию */
.rows { overflow: hidden; }
.row-item { border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.row-item > summary { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px; list-style: none; cursor: pointer; }
.row-item > summary::-webkit-details-marker { display: none; }
.row-item[open] > summary .row-chevron { transform: rotate(90deg); }
.row-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 750; }
.row-main { min-width: 0; display: grid; gap: 2px; }
.row-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: var(--fs-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-value { text-align: right; font-weight: 750; white-space: nowrap; }
.row-value small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.row-chevron { width: 18px; height: 18px; color: var(--faint); transition: transform 0.15s ease; }
.row-body { padding: 0 14px 14px; }
.row-body .stats { margin-top: 0; }
.compare-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
/* Загрузка */
.skeleton { display: grid; gap: 12px; margin-top: 20px; }
.skeleton div { height: 72px; border-radius: var(--r-l); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton div:first-child { height: 200px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.status-card { margin-top: 16px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; color: var(--negative); }
.status-card p { color: var(--text); }
.fade-up { animation: fadeUp 0.28s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* ---------- Списки: заводы, фермеры ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
/* колонка не шире экрана, даже если строка длинная */
.entity { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); text-align: left; cursor: pointer; }
.entity:active { transform: scale(0.99); background: var(--surface-2); }
/* Плашка слева в строке: объём фермера / спека завода, без разноцветья */
.row-tile { display: grid; place-content: center; justify-items: center; width: 44px; height: 44px; border-radius: var(--r-s); line-height: 1; }
.row-tile b { font-size: var(--fs-s); font-weight: 800; letter-spacing: -0.02em; }
.row-tile small { margin-top: 3px; color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; white-space: nowrap; }
.row-tile.is-contract { background: var(--accent-soft); color: var(--accent); }
.row-tile-unit { margin-left: 1px; font-size: var(--fs-2xs); font-style: normal; font-weight: 700; }
.row-tile.is-contract small { color: var(--accent); opacity: 0.8; }
.row-tile.is-contract .icon { width: 18px; height: 18px; }
.row-tile.is-empty { color: var(--faint); }
.row-tile.is-empty .icon { width: 20px; height: 20px; }
/* Поле «т по спеке» видно, только когда договор подписан */
#plantForm:not(:has([name="contract"][value="signed"]:checked)) .spec-field { display: none; }
/* ---------- «Кто вы?» ---------- */
/* Шапка на узких телефонах: имя «Кто вы?» + колокольчик + тема должны влезать — подпись «by Plaxey23» прячем */
@media (max-width: 400px) {
  .brand-signature { display: none; }
  .appbar-actions { gap: 6px; }
}
.appbar { min-width: 0; }
.brand { min-width: 0; }
.user-picker { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeUp 0.18s ease-out; }
.user-picker-list { display: grid; gap: 8px; }
.user-picker-btn { display: grid; gap: 2px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--fs-m); font-weight: 700; cursor: pointer; }
.user-picker-btn small { color: var(--accent); font-size: var(--fs-2xs); font-weight: 700; }
.user-picker-btn.is-last { border-color: var(--accent); background: var(--accent-soft); }
.user-picker-btn:active { transform: scale(0.98); }
/* ---------- База хозяйств: культуры, погрузка, партии, история ---------- */
/* Культура фермера: название сверху, под ним три равных поля с подписями — цена · наличие · площадь */
.culture-lines.is-farmer .culture-line { display: grid; gap: 6px; padding: 10px 14px 12px; cursor: default; }
.culture-lines.is-farmer .culture-line-name { width: auto; }
/* Выбор культур в формах — компактно, ровно 2 строки по 4 чипа */
/* колонки по длине названий (auto), лишнее место делится поровну — 2 строки без обрезки */
.culture-rows .culture-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; } /* переносится по ширине: жёсткие 4 колонки не влезали после шкалы шрифтов (14.11) */
.culture-rows .culture-pick .chip { justify-content: center; min-width: 0; min-height: 34px; padding: 0 5px; font-size: var(--fs-s); white-space: nowrap; }
@media (max-width: 400px) {
  .culture-rows .culture-pick .chip { font-size: var(--fs-xs); padding: 0 4px; }
}
.culture-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.culture-trio label { display: grid; gap: 3px; min-width: 0; }
.culture-trio small { color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; white-space: nowrap; }
.culture-trio .inline-input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); text-align: right; font-size: var(--fs-m); }
.culture-trio .inline-input:focus { border-color: var(--accent); }
/* Группы формы фермера: отдельные блоки с заголовками */
.form { grid-template-columns: minmax(0, 1fr); }
/* колонка формы не шире экрана, даже если поле длинное */
.form-group { min-width: 0; grid-template-columns: minmax(0, 1fr); }
/* группы формы — выраженная тень, чтобы блоки читались отдельно (в тёмной теме — темнее и плотнее) */
.form-group { box-shadow: var(--shadow-1); }
/* фон формы — как фон приложения, чтобы белые блоки выделялись */
.form-group { display: grid; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.form-group-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-m); font-weight: 800; }
.form-group-title .icon { width: 18px; height: 18px; color: var(--accent); }
.form-group-sub { margin-top: 2px; }
.form-group textarea { width: 100%; }
.form-list .inline-label.inline-label-wide { width: 112px; flex: 0 0 112px; }
/* «Общая площадь», «Ближайшие» — не слипаются с текстом поля */
.scales-far { margin-top: 8px; }
/* Посредник: ФИО и телефон видны, только когда отмечено «Через посредника» */
.broker-rows { margin-top: 8px; }
.broker-field:not(:has([name="viaBroker"]:checked)) .broker-rows { display: none; }
.status-broker { background: var(--violet-soft); color: var(--violet); }
/* Ставка НДС закупки рядом с тумблером «Нал / НДС» */
.vat-rate-select { flex: 0 0 auto; width: auto; min-height: 0; height: 30px; padding: 0 22px 0 8px; border: 1px solid var(--line); border-radius: var(--r-pill); background-color: var(--surface); font-size: var(--fs-s); font-weight: 700; }
.field:has([name="scales"][value="no"]:not(:checked)) .scales-far { display: none; }
.price-row-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
/* Контакты в карточке фермера: человек + роль, под ним телефон, справа кнопка звонка */
.person-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-role { padding: 1px 8px; border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 700; }
.person-role.role-farmer { background: var(--accent-soft); color: var(--accent); }
.person-role.role-broker { background: var(--violet-soft); color: var(--violet); }
.person-phone { margin-top: 2px; font-size: var(--fs-s); font-weight: 600; color: var(--text); }
.person-phone.muted { color: var(--faint); font-weight: 500; }
.person-call { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.person-row:active .person-call { transform: scale(0.94); }
/* ---------- Форма завода: контакты, выбор, отсрочка, приёмка ---------- */
.contact-list { display: grid; gap: 10px; }
.contact-block-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 4px; color: var(--muted); font-size: var(--fs-s); font-weight: 600; }
.call-pick-role { color: var(--accent); font-size: var(--fs-xs); font-weight: 700; }
.contact-remove { flex: 0 0 auto; width: 32px; height: 32px; color: var(--faint); }
.add-contact { justify-self: start; padding: 2px 4px; font-size: var(--fs-s); }
.inline-select { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 22px 0 0; border: 0; background-color: transparent; text-align: right; text-align-last: right; font-size: var(--fs-m); font-weight: 650; color: var(--text); }
.inline-select:focus { box-shadow: none; border: 0; }
.quick-days .chip { min-height: 32px; padding: 0 11px; font-size: var(--fs-s); }
.time-input { flex: 1 1 0; min-width: 0; text-align: center; font-size: var(--fs-m); }
.week-days .chip { flex: 1 1 0; justify-content: center; min-width: 0; padding: 0 4px; }
.person-role.role-manager { background: var(--surface-2); color: var(--muted); }
/* ---------- История: расчёты, группы изменений по объекту, удаление записи ---------- */
.history-day { z-index: 2; margin-left: -4px; margin-right: -4px; }
.history-item.change-item.calc-item { grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; }
/* прибыль — справа, а не под строкой */
.change-fields { color: var(--muted); }
.history-sub-title { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
/* строка расчёта: название переносится, сумма справа не наезжает */
.calc-item .entity-main { min-width: 0; }
.calc-item .row-title { white-space: normal; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.calc-item .row-value { justify-self: end; text-align: right; white-space: nowrap; padding-left: 8px; }
.change-price { font-weight: 600; }
.calc-icon { color: var(--accent); background: var(--accent-soft); }
.change-group > summary { list-style: none; cursor: pointer; }
.change-group > summary::-webkit-details-marker { display: none; }
.change-count { margin-left: 4px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; vertical-align: 2px; }
.change-group[open] > summary { border-bottom: 1px dashed var(--line); }
.change-group-body { display: grid; padding: 4px 14px 8px 60px; }
.change-sub { display: grid; gap: 1px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.change-sub:last-child { border-bottom: 0; }
.change-sub-time { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.history-full-row { grid-template-columns: minmax(0, 1fr) auto; }
.history-del { width: 34px; height: 34px; color: var(--faint); }
.history-del:active { color: var(--negative); }
.confirm-text { margin: 4px 2px 0; line-height: 1.45; }
/* окно «Кому позвонить?» */
.call-pick-list { display: grid; gap: 8px; padding-top: 2px; }
.call-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); color: inherit; text-decoration: none; }
.call-pick-row:active { transform: scale(0.99); }
.call-pick-main { display: grid; gap: 2px; min-width: 0; }
.call-pick-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-pick-phone { color: var(--muted); font-size: var(--fs-s); font-weight: 600; }
/* уведомления: справа — кто сделал */
.notice-who { margin-left: auto; flex: 0 0 auto; align-self: center; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; white-space: nowrap; }
/* тоннаж в наличии рядом с ценой культуры в карточке фермера */
.tons-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: var(--fs-s); font-weight: 800; white-space: nowrap; }
.tons-chip.is-empty { color: var(--faint); font-weight: 700; }
.lot-chips { margin: -4px 0 8px; }
.chip-add { color: var(--accent); border-style: dashed; }
.lot-note { margin: -2px 0 8px; font-size: var(--fs-xs); }
.lot-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -2px 0 10px; padding: 8px 12px; border-radius: var(--r-s); background: var(--surface-2); font-size: var(--fs-s); font-weight: 600; }
.btn-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.btn-link.danger { color: var(--warning); }
button.history-head { width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.history-open { color: var(--faint); transform: rotate(0deg); }
.history-more { margin-top: 4px; padding: 4px 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--fs-s); font-weight: 700; cursor: pointer; }
.history-full-row.is-sold .info-row-label { color: var(--warning); }
/* ---------- История: журнал изменений ---------- */
#historyView .search { margin-bottom: 10px; }
.change-item { display: flex; align-items: flex-start; gap: 12px; text-align: left; }
.change-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: var(--r-s); background: var(--surface-2); color: var(--muted); }
.change-icon .icon { width: 18px; height: 18px; }
.change-item.is-delete .change-icon { color: var(--warning); }
.change-badge { margin-left: 4px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--fs-2xs); font-weight: 700; vertical-align: 2px; }
.change-item.is-delete .change-badge { background: var(--warning-soft); color: var(--warning); }
.change-line { display: block; color: var(--text); font-size: var(--fs-s); line-height: 1.35; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.change-line.muted { color: var(--muted); }
.change-item .entity-sub { margin-top: 2px; }
.history-item.change-item { grid-template-columns: 34px minmax(0, 1fr); align-items: start; }
.change-item .entity-main { flex: 1 1 auto; justify-items: start; text-align: left; }
/* ---------- Форма завода/фермера: компактные блоки ---------- */
.form-list { overflow: visible; }
.form-list > .inline-row:first-child { border-radius: var(--r-s) var(--r-s) 0 0; }
.form-list > .inline-row:last-child { border-radius: 0 0 var(--r-s) var(--r-s); }
.form-list .inline-label { width: 78px; }
.inline-text { text-align: left; font-size: var(--fs-m); font-weight: 600; }
.inline-row.autocomplete { position: relative; }
.inline-row.autocomplete .suggestions { left: -1px; right: -1px; }
.inline-row.is-invalid, .inline-row:has(.is-invalid) { box-shadow: inset 3px 0 0 var(--warning); }
.chips-compact .chip { min-height: 34px; padding: 0 12px; font-size: var(--fs-s); }
.culture-rows { display: grid; gap: 8px; }
.culture-lines .culture-line { gap: 6px; }
.culture-line-name { width: 104px; color: var(--text); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.culture-line .inline-input { min-width: 0; width: 100%; }
.culture-line-extra { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.culture-line-extra .inline-input { width: 46px; flex: 0 0 46px; }
.form-sticky { padding-top: 4px; }
/* кнопка «Сохранить» — в конце формы, не плавает поверх полей */
.entity-main { min-width: 0; display: grid; gap: 2px; }
.entity-title { display: flex; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.entity-title span { overflow: hidden; text-overflow: ellipsis; }
.entity-title .icon { width: 15px; height: 15px; color: var(--star); fill: var(--star); }
.entity-sub { color: var(--muted); font-size: var(--fs-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity .row-chevron { color: var(--faint); }
.empty { display: grid; justify-items: center; gap: 8px; padding: 40px 16px; color: var(--muted); text-align: center; }
.empty .icon { width: 40px; height: 40px; color: var(--faint); stroke-width: 1.5; }
.empty strong { color: var(--text); font-size: var(--fs-m); }
/* ---------- История ---------- */
.group-title { margin: 20px 4px 8px; color: var(--muted); font-size: var(--fs-s); font-weight: 700; }
.group-title:first-child { margin-top: 4px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.history-item:last-child { border-bottom: 0; }
.history-item:active { background: var(--surface-2); }
/* ---------- Шторки ---------- */
.sheet-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0); }
/* Окна поверх: затемнение + лёгкое размытие заднего плана (текст сзади угадывается, но не отвлекает) */
.sheet-overlay.is-open { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
/* «Вся история» — окно поверх карточки */
.popover-overlay { position: fixed; inset: 0; z-index: 250; display: flex; align-items: flex-end; justify-content: center; padding: 0 8px 8px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeUp 0.18s ease-out; }
.popover-card { display: flex; flex-direction: column; width: min(100%, 560px); max-height: 72dvh; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-2); overflow: hidden; margin-bottom: env(safe-area-inset-bottom); }
.popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px 8px 18px; }
.popover-head h2 { margin: 0; font-size: var(--fs-ml); }
.popover-body { padding: 0 14px 16px; }
.sheet { display: flex; flex-direction: column; width: min(100%, 720px); max-height: calc(100dvh - max(24px, env(safe-area-inset-top))); border-radius: var(--r-l) var(--r-l) 0 0; background: var(--surface); box-shadow: var(--shadow-2); transform: translateY(100%); will-change: transform; }
.sheet-overlay.is-open .sheet { transform: translateY(0); }
.sheet.is-dragging { transition: none; }
.sheet-tall .sheet { height: calc(100dvh - max(24px, env(safe-area-inset-top))); }
.sheet-grabber { width: 38px; height: 5px; margin: 8px auto 0; border-radius: var(--r-pill); background: var(--line-strong); flex: 0 0 auto; }
.sheet-head { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 4px 8px 4px 20px; flex: 0 0 auto; }
.sheet-head:has(#detailBack:not([hidden])) { padding-left: 4px; }
.sheet-title { flex: 1; min-width: 0; font-size: var(--fs-l); font-weight: 750; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.sheet-head-actions { display: flex; gap: 4px; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 20px calc(20px + var(--safe-b)); overflow-x: hidden; /* шторка не должна гулять вбок, даже если что-то шире экрана */ }
/* Диалог подтверждения — по центру */
.sheet-dialog { align-items: center; padding: 16px; z-index: 120; }
.sheet-dialog .sheet { width: min(100%, 360px); border-radius: var(--r-l); transform: scale(0.94); opacity: 0; }
.sheet-dialog.is-open .sheet { transform: none; opacity: 1; }
.confirm { display: grid; gap: 8px; padding: 22px 20px 20px; text-align: center; }
.confirm-title { font-size: var(--fs-l); font-weight: 750; }
.confirm-text { color: var(--muted); font-size: var(--fs-s); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
/* Содержимое шторки «карточка завода/фермера» */
.detail { display: grid; }
.detail-section { display: grid; gap: 8px; }
.detail-section h3 { color: var(--muted); font-size: var(--fs-s); font-weight: 700; }
.info-list { border-radius: var(--r-s); background: var(--surface-2); overflow: hidden; }
.info-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row-label { font-weight: 600; }
.info-row-sub { color: var(--muted); font-size: var(--fs-xs); }
.info-row-sub.is-stale { color: var(--warning); font-weight: 600; }
.info-row-value { text-align: right; font-weight: 700; }
.info-row-value small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.info-text { padding: 12px 14px; color: var(--text); white-space: pre-line; }
.price-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; margin-right: -10px; border: 0; border-radius: var(--r-s); background: none; font-weight: 750; cursor: pointer; }
.price-btn .icon { width: 15px; height: 15px; color: var(--accent); }
.price-btn:active { background: var(--surface); }
.price-edit { display: grid; grid-template-columns: minmax(0, 120px) auto; gap: 6px; }
.price-edit input { min-height: 40px; background: var(--surface); text-align: right; }
.price-edit .btn { min-height: 40px; padding: 0 12px; }
.detail-danger { justify-self: center; }
/* Показатели качества */
.indicator-section { border-radius: var(--r-s); background: var(--surface-2); }
.indicator-section h3 { margin-bottom: 8px; color: var(--text); font-size: var(--fs-s); }
.indicator-grid { display: grid; gap: 8px; }
.indicator-row { display: grid; grid-template-columns: minmax(0, auto) minmax(12px, 1fr) minmax(0, auto); align-items: baseline; gap: 6px; font-size: var(--fs-s); }
.indicator-row.is-empty { color: var(--faint); }
.indicator-dots { border-bottom: 1px dotted var(--line-strong); transform: translateY(-3px); }
.indicator-value { font-weight: 700; text-align: right; }
.indicator-input-field { display: grid; gap: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.indicator-input-field input, .indicator-input-field select { min-height: 44px; background: var(--surface); }
.indicator-panel { display: grid; gap: 10px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.compare-table th, .compare-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.compare-table th { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.compare-table td:last-child { text-align: center; }
.compare-table .icon { width: 18px; height: 18px; }
/* Карта связки */
.deal-status { margin-bottom: 8px; }
.deal-map-canvas { height: 38dvh; min-height: 220px; border-radius: var(--r-l); overflow: hidden; margin-bottom: 12px; }
.deal-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); text-align: left; cursor: pointer; }
.deal-item.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.deal-item-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-item-sub { grid-column: 1; color: var(--muted); font-size: var(--fs-s); }
.deal-item-offer { grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; color: var(--accent); font-weight: 800; }
.deal-item-offer small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.deal-detail { margin-bottom: 16px; padding: 14px; border-radius: var(--r-s); background: var(--surface-2); display: grid; gap: 10px; }
.deal-detail h3 { font-size: var(--fs-m); }
/* ---------- Тосты ---------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 200; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
body.modal-open .toast-host { bottom: calc(var(--safe-b) + 16px); }
.toast { display: flex; align-items: center; gap: 12px; width: min(100%, 440px); min-height: 52px; padding: 8px 8px 8px 16px; border-radius: var(--r-s); background: #1f2328; color: #f3f4f6; box-shadow: var(--shadow-2); font-size: var(--fs-s); font-weight: 600; pointer-events: auto; animation: toastIn 0.22s ease-out; }
:root.dark .toast { background: #2b3138; }
.toast.is-error { background: var(--negative); }
.toast span { flex: 1; }
.toast .btn-ghost { color: #7cc0ff; min-height: 36px; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.18s ease, transform 0.18s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* ---------- Цена фермеру ---------- */
.field-hint { font-weight: 600; }
[data-profit-control] .chips { flex-wrap: nowrap; }
[data-profit-control] .chip { flex: 1 1 0; justify-content: center; padding: 0 8px; }
[data-profit-custom] { animation: fadeUp 0.2s ease-out; }
.offer { display: grid; gap: 12px; margin-bottom: 14px; padding: 14px; border-radius: var(--r-s); background: var(--accent-soft); }
/* Коридор торга */
.corridor { display: grid; gap: 6px; }
.corridor-bar { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--positive); overflow: hidden; }
.corridor-fill { position: absolute; inset: 0 auto 0 0; width: var(--fill); border-radius: var(--r-pill); background: color-mix(in srgb, var(--muted) 45%, var(--surface)); animation: growBar 0.6s var(--ease-soft) both; }
.corridor.is-short .corridor-bar { background: var(--negative-soft); }
.corridor.is-short .corridor-fill { background: var(--negative); }
@keyframes growBar { from { width: 0; } }
.corridor-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.corridor-labels b { color: var(--text); }
.corridor-margin { color: var(--positive); font-size: var(--fs-s); font-weight: 700; }
.corridor.is-short .corridor-margin { color: var(--negative); }
/* «Как посчитано» */
/* Карта: лучший вариант и запас */
/* На Android, пока открыта клавиатура, нижняя панель не должна всплывать над ней */
body.keyboard-open .tabbar { transform: translateY(110%); }
.tabbar { transition: transform 0.2s ease; }
/* ---------- Минималистичный результат ---------- */
.results-head { align-items: center; }
.results-caption { color: var(--muted); font-size: var(--fs-s); font-weight: 600; }
.hero-kicker { display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.hero-kicker.negative { color: var(--negative); }
.hero .hero-name { margin-top: 4px; }
.hero .hero-profit { margin-top: 12px; }
/* «Фермеру до 13,30 ₽/кг  +5,30» */
.offer-row { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 12px; padding: 0 14px; border-radius: var(--r-s); background: var(--accent-soft); }
.offer-row-label { color: var(--muted); font-size: var(--fs-s); font-weight: 600; }
.offer-row strong { color: var(--accent); font-size: var(--fs-l); font-weight: 800; letter-spacing: -0.01em; }
.offer-row .pill { margin-left: auto; }
.offer-row.is-low strong { color: var(--negative); }
/* «Подробнее» */
.more { margin-top: 10px; }
.more > summary { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; color: var(--muted); font-size: var(--fs-s); font-weight: 600; list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] .dl { animation: fadeUp 0.22s ease-out; }
.dl { display: grid; gap: 2px; padding: 4px 2px 0; }
.dl-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: var(--fs-s); }
.dl-row span:first-child { color: var(--muted); }
.dl-row.positive span, .dl-row.negative span { color: inherit; font-weight: 700; }
.dl-total { margin-top: 2px; padding-top: 8px; border-top: 1px dashed var(--line-strong); font-weight: 750; }
.dl-total span:first-child { color: var(--text); }
.dl-address { margin: 6px 0 8px; color: var(--muted); font-size: var(--fs-xs); }
.row-body .offer-row { margin-bottom: 8px; }
.row-body .dl { margin-bottom: 12px; }
/* Списки: цены одной строкой */
.deal-detail .offer-row { margin: 4px 0 0; }
/* ---------- Анимации ---------- */
@keyframes viewSlide {
  from { opacity: 0; transform: translateX(calc(var(--view-dir, 0) * 18px)); }
  to { opacity: 1; transform: none; }
}
.stagger > * { animation: fadeUp 0.32s ease-out both; }
.stagger > *:nth-child(2) { animation-delay: 0.03s; }
.stagger > *:nth-child(3) { animation-delay: 0.06s; }
.stagger > *:nth-child(4) { animation-delay: 0.09s; }
.stagger > *:nth-child(5) { animation-delay: 0.12s; }
.stagger > *:nth-child(6) { animation-delay: 0.15s; }
.stagger > *:nth-child(7) { animation-delay: 0.18s; }
.stagger > *:nth-child(n+8) { animation-delay: 0.21s; }
.results.is-silent * { animation: none !important; }
.tab .icon { transition: transform 0.25s var(--ease-bounce); }
.tab.is-active .icon { transform: translateY(-2px) scale(1.08); }
.tab::after { content: ""; width: 18px; height: 3px; border-radius: var(--r-pill); background: var(--accent); transform: scaleX(0); transition: transform 0.25s ease; }
.tab.is-active::after { transform: scaleX(1); }
.chip { transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease; }
.chip:active { transform: scale(0.95); }
.segment:active { transform: scale(0.97); }
.row-item[open] .row-body { animation: fadeUp 0.22s ease-out; }
.entity, .history-item, .action, .deal-item { transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease; }
.deal-item:active { transform: scale(0.99); }
.hero-profit { transition: color 0.2s ease; }
/* ---------- Telegram: главная кнопка внизу заменяет кнопку формы ---------- */
/* ---------- Узкие экраны ---------- */
@media (max-width: 380px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:nth-child(3) { grid-column: span 2; }
  .hero-profit { font-size: var(--fs-xl); }
  .sheet-body { padding-inline: 16px; }
}
/* ---------- Широкий экран: шторки по центру ---------- */
@media (min-width: 760px) {
  .sheet-overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--r-l); max-height: min(86dvh, 860px); }
  .sheet-tall .sheet { height: min(86dvh, 860px); }
  .sheet-grabber { display: none; }
  .tabbar { justify-content: center; }
}
@media (hover: hover) {
  .entity:hover, .history-item:hover { background: var(--surface-2); }
  .btn-primary:hover { filter: brightness(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}
/* ---------- Единый приём «серый фон — белые блоки с тенью» во всех вкладках и окнах (21.10) ---------- */
.sheet-body, .popover-body { background: var(--bg); }
.sheet-body .info-list, .popover-body .info-list { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.sheet-body .action { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.deal-item { background: var(--surface); box-shadow: var(--shadow-1); }
.call-pick-row { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.sheet-body .inline-list:not(.form-list):not(.culture-lines) { box-shadow: var(--shadow-1); }
.detail-section > h3 { margin-left: 4px; }
/* Прибыль: сумма + ₽/кг — главное в карточке, крупно и одним цветом */
.hero-profit-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 12px 0 14px; }
.hero-profit-main { min-width: 0; }
.hero .hero-profit-row .hero-profit { margin: 0; }
.hero-profit-label, .hero-profit-kg span { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.hero-profit-kg { flex: none; text-align: right; padding: 8px 12px; border-radius: var(--r-s); background: color-mix(in srgb, currentColor 10%, transparent); }
.hero-profit-kg strong { display: block; font-size: var(--fs-l); font-weight: 800; line-height: 1.1; white-space: nowrap; }
.hero.is-secondary .hero-profit-kg strong { font-size: var(--fs-ml); }
@media (max-width: 400px) {
  .hero-profit-kg { padding: 6px 10px; }
  .hero-profit-kg strong { font-size: var(--fs-m); }
}
/* Две раскрывашки внизу карточки: «Цена фермеру» и «Расчёт» — рядом, открыта одна */
.card-tabs { display: grid; gap: 8px; margin-top: 14px; }
.card-tab { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2, var(--bg)); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.card-tab > .icon { flex: none; color: var(--accent); }
.card-tab-text { display: grid; min-width: 0; flex: 1; }
.card-tab-text > span { font-size: var(--fs-s); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tab-text small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tab [data-offer-hint] { color: var(--accent); }
.card-tab-chevron { flex: none; color: var(--muted); transform: rotate(90deg); transition: transform .2s ease; }
.card-tab.is-open { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.card-tab.is-open .card-tab-chevron { transform: rotate(-90deg); color: var(--accent); }
.card-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); animation: fade-in .2s ease; }
.card-panel[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 420px) {
  .card-tab { gap: 6px; padding: 9px 8px; }
  .card-tab > .icon:first-child { display: none; }
}
/* «Фермеру»: крупная цена → сравнение с закупкой → ползунок */
.fo-hero { display: grid; justify-items: center; gap: 2px; text-align: center; }
.fo-label { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.fo-price { color: var(--accent); font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.fo-price small { color: var(--muted); font-size: var(--fs-m); font-weight: 700; letter-spacing: 0; }
.fo-note { color: var(--muted); font-size: var(--fs-xs); }
.fo-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.fo-cell { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); }
.fo-cell span { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.fo-cell b { color: var(--text); font-size: var(--fs-m); font-weight: 800; }
.fo-cell.negative, .fo-cell.positive { border-color: transparent; background: color-mix(in srgb, currentColor 10%, transparent); }
.fo-cell.negative b, .fo-cell.positive b { color: inherit; }
/* «Расчёт»: Получаем (+) → Платим (−) → Итог (=); знак в кружке слева, сумма и ₽/кг справа */
.calc-sheet { display: grid; }
.cs-group { padding: 10px 12px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); }
.cs-title { margin: 0 0 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.cs-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 7px 0; }
.cs-row + .cs-row { border-top: 1px dashed var(--line); }
.cs-sign { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: var(--fs-m); font-weight: 800; line-height: 1; }
.cs-row.is-income .cs-sign { background: color-mix(in srgb, var(--positive) 15%, transparent); color: var(--positive); }
.cs-group:not(.cs-result) .cs-row:not(.is-income):not(.cs-subtotal) .cs-sign { background: color-mix(in srgb, var(--negative) 12%, transparent); color: var(--negative); }
.cs-name { min-width: 0; font-size: var(--fs-s); font-weight: 600; }
.cs-name small, .cs-sum small, .cs-ref small { display: block; margin-top: 1px; color: var(--faint); font-size: var(--fs-2xs); font-weight: 500; }
.cs-sum { text-align: right; font-size: var(--fs-s); font-weight: 700; white-space: nowrap; }
.cs-subtotal { border-top: 1px solid var(--line-strong); }
.cs-subtotal .cs-sign { background: none; }
.cs-subtotal .cs-name, .cs-subtotal .cs-sum { font-weight: 800; }
.cs-result .cs-sign { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.cs-net { margin-top: 2px; padding: 10px 0 4px; border-top: 1px solid var(--line-strong); }
.cs-net .cs-name { font-size: var(--fs-m); font-weight: 800; color: var(--text); }
.cs-net .cs-sum { font-size: var(--fs-ml); font-weight: 800; }
.cs-net.negative .cs-sum, .cs-net.negative .cs-sign { color: var(--negative); }
.cs-net.positive .cs-sum, .cs-net.positive .cs-sign { color: var(--positive); }
.cs-net .cs-sum small { font-size: var(--fs-xs); font-weight: 700; color: inherit; opacity: .85; }
.cs-ref { padding: 0 4px; }
.cs-ref .dl-row { font-size: var(--fs-xs); }
/* Населённый пункт под названием завода в карточке расчёта; «при прибыли …» на кнопке «Фермеру» */
.hero-place { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.cs-ref .dl-row > span:last-child { text-align: right; font-weight: 600; }
/* Отсрочка чипами: два нажатия — диапазон; концы — активные, середина — подсвечена */
.quick-days .chip.is-between { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-style: dashed; border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.quick-days .chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.quick-days-hint { margin: 6px 2px 0; color: var(--faint); font-size: var(--fs-2xs); }
/* Две строки фильтров (культуры / области) — разделены тонкой линией */
#farmerFilters:has(+ .filter-chips-2:not([hidden])), #plantFilters:has(+ .filter-chips-2:not([hidden])) { margin-bottom: 8px; }
.filter-chips-2:not([hidden]) { padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--text) 18%, transparent); }
/* Блок фильтров: обе строки (культуры/договор и области) в одной белой рамке, между ними линия */
.filter-box { margin: 0 0 12px; padding: 8px 0; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.filter-box .chips-scroll.filter-chips { margin: 0 !important; padding: 2px 10px; scroll-padding: 0 10px; }
.filter-box .filter-chips-2:not([hidden]) { margin-top: 8px !important; padding-top: 8px; }
.filter-box .filter-chips-2:not([hidden]) { border-top: 1px solid color-mix(in srgb, var(--text) 16%, transparent); }
/* Список заводов/фермеров — на отдельной подложке с заголовком «24 завода»: отделён от фильтров и кнопок */
.list-tray { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--r-l); border: 1px solid var(--line); }
.list-tray-title { display: flex; align-items: baseline; gap: 6px; margin: 0 6px 2px; color: var(--muted); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.list-tray-title small { color: var(--faint); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0; text-transform: none; }
.list-tray-stats { margin-left: auto; color: var(--muted); font-size: var(--fs-2xs); font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }
/* Поиск: вводимый текст — обычным тёмным цветом (раньше наследовал серый), поле ниже — чуть выше текста и лупы */
.search { padding-left: 12px; gap: 8px; }
.search input { color: var(--text); padding-top: 0; padding-bottom: 0; }
.search input::placeholder { color: var(--faint); }
.search > .icon { flex: none; }
.search input { height: 32px; min-height: 32px; }
.search > .icon { width: 16px; height: 16px; }
/* История: по 3 записи в блоке, остальное — под «Показать все · ещё N» */
.history-rest[hidden] { display: none; }
.history-expand { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; border: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); color: var(--accent); font: inherit; font-size: var(--fs-s); font-weight: 700; cursor: pointer; }
.history-expand .icon { transform: rotate(90deg); transition: transform .2s ease; }
.history-expand[aria-expanded="true"] .icon { transform: rotate(-90deg); }
/* История: заголовок дня — заметная плашка с датой и линия до края, чтобы дни не сливались */
.history-day { display: flex; align-items: center; gap: 8px; padding: 8px 4px; font-size: var(--fs-s); }
.history-day:first-child { margin-top: 0; }
.history-day::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.hd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font-size: var(--fs-s); font-weight: 800; white-space: nowrap; }
.hd-pill .icon { width: 14px; height: 14px; }
.hd-date { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
/* «Что нового»: значок версии (в шапке у логотипа и в углу окна «Кто вы?») и окно со списком обновлений */
.version-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--negative); border: 2px solid var(--surface); }
.version-dot[hidden] { display: none; }
.whats-new { z-index: 400; }
.wn-card { max-height: 82dvh; }
.wn-intro { margin: 0 18px 10px; color: var(--muted); font-size: var(--fs-xs); }
.wn-list { gap: 8px; background: var(--bg); padding-top: 10px; }
.wn-release { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.wn-release > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; list-style: none; cursor: pointer; }
.wn-release > summary::-webkit-details-marker { display: none; }
.wn-ver { flex: none; min-width: 42px; padding: 4px 8px; border-radius: var(--r-s); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: var(--fs-s); font-weight: 800; text-align: center; }
.wn-head { display: grid; min-width: 0; flex: 1; }
.wn-head b { font-size: var(--fs-s); }
.wn-head small { color: var(--faint); font-size: var(--fs-2xs); font-weight: 600; }
.wn-chevron { flex: none; color: var(--muted); transform: rotate(90deg); transition: transform .2s ease; }
.wn-release[open] .wn-chevron { transform: rotate(-90deg); }
.wn-body { display: grid; gap: 10px; padding: 2px 14px 14px; border-top: 1px solid var(--line); }
.wn-label { display: inline-block; margin: 10px 0 4px; padding: 2px 8px; border-radius: var(--r-xs); font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.wn-new .wn-label { background: color-mix(in srgb, var(--positive) 14%, transparent); color: var(--positive); }
.wn-better .wn-label { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.wn-fix .wn-label { background: color-mix(in srgb, var(--star) 16%, transparent); color: var(--warning); }
html.dark .wn-fix .wn-label { color: var(--star); }
.wn-group ul { display: grid; gap: 6px; margin: 0; padding-left: 18px; }
.wn-group li { font-size: var(--fs-s); line-height: 1.4; }
.wn-body > .wn-group:first-child .wn-label { margin-top: 12px; }
.wn-list { display: block; }
[data-app-version], .wn-ver { display: inline-block; }
[data-app-version]::first-letter, .wn-ver::first-letter { font-size: .8em; font-weight: 600; opacity: .75; }
/* Подпись автора — как подпись под логотипом: мелко, капсом, с разрядкой, прижата к правому краю «GrainFlow».
   Места по ширине не занимает, поэтому видна и на узких телефонах. */
.brand { display: inline-grid; justify-items: end; align-items: end; gap: 0; }
.brand .brand-name { justify-self: start; }
.brand .brand-signature { display: block; color: var(--faint); font-size: 8.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; line-height: 1; opacity: .85; }
/* Логотип: Cinzel, внутри букв — «поле»: небо сверху, спелая пшеница снизу, тонкие колосья-штрихи */
.brand .brand-name { -webkit-background-clip: text; background-clip: text; }
/* Логотип: Righteous (решение Алексея 21.10) — обычным цветом текста, без «поля» в буквах */
.brand .brand-name { font-family: "Righteous", "Marck Script", sans-serif; font-weight: 400; font-size: var(--fs-xl); letter-spacing: 0; line-height: 1; background: none; color: var(--text); -webkit-text-fill-color: currentColor; filter: none; }
.brand .brand-signature { margin-top: 1px; }
@media (max-width: 360px) {
  .brand .brand-name { font-size: var(--fs-2l); }
}
/* Шрифт логотипа Righteous — файлом в приложении (OFL), без Google Fonts */
@font-face { font-family: "Righteous"; src: url("../assets/fonts/Righteous-Regular-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
/* Шапка: колокольчик и тема — той же высоты, что чип пользователя (36 px) */
.appbar .icon-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; }
.appbar .icon-btn .icon { width: 18px; height: 18px; }
.appbar .notify-badge { top: -3px; right: -3px; }
/* Заголовок страницы (Расчёт рейса, Заводы, Фермеры, История) — меньше и ближе к шапке */
/* Заголовки всех вкладок на одной высоте: строка заголовка всегда 36 px (как кнопка «+»), одинаковые отступы */
/* Шапка — отдельная полоса: светлая подложка во всю ширину, линия и лёгкая тень снизу */
.appbar { margin: calc(-1 * max(8px, env(safe-area-inset-top))) -16px 14px; padding: max(8px, env(safe-area-inset-top)) 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-1); border-radius: 0 0 var(--r-l) var(--r-l); }
html.dark .appbar { box-shadow: var(--shadow-1); }
/* Фон насыщеннее: зелёное и синее свечение крупнее и ярче + тёплое снизу (поле), чтобы градиент читался и под шапкой */
:root { --bg-glow: radial-gradient(130% 70% at 0% 0%, rgba(52, 199, 123, 0.32), transparent 62%),
    radial-gradient(110% 60% at 100% 8%, rgba(56, 152, 236, 0.30), transparent 62%),
    radial-gradient(120% 55% at 50% 110%, rgba(240, 180, 60, 0.22), transparent 65%); }
:root.dark { --bg-glow: radial-gradient(130% 70% at 0% 0%, rgba(34, 170, 104, 0.34), transparent 62%),
    radial-gradient(110% 60% at 100% 8%, rgba(30, 120, 200, 0.32), transparent 62%),
    radial-gradient(120% 55% at 50% 110%, rgba(200, 140, 40, 0.20), transparent 65%); }
/* Логотип с тенью */
/* Шапка в три колонки: пользователь слева, логотип строго по центру, уведомления и тема справа */
.appbar { display: grid; align-items: center; gap: 8px; }
.appbar-left { display: flex; align-items: center; justify-content: flex-start; min-width: 0; }
.appbar .brand { justify-self: center; }
.appbar-actions { justify-self: end; }
/* Окно «Кто вы?»: слева вверху — кнопка «Что нового», справа — номер версии (просто подпись) */
.user-picker-news { position: absolute; top: 12px; left: 12px; }
/* Кнопка обновлений в «Кто вы?»: свежая — яркая с искоркой и точкой, просмотренная — спокойная серая */
.user-picker-news { gap: 5px; padding: 4px 10px; color: var(--muted); border-color: var(--line); background: var(--surface-2); }
.user-picker-news.is-fresh { color: var(--on-accent); border-color: transparent; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #34c77b)); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.news-spark { width: 13px; height: 13px; fill: currentColor; flex: none; }
.user-picker-news.is-fresh .news-spark { animation: sparkle 1.8s ease-in-out infinite; }
@keyframes sparkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.2) rotate(15deg); } }
/* Красная точка на имени в шапке — есть непросмотренное обновление */
/* Плашка «Вышло обновление» над нижним меню */
.news-banner { position: fixed; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 260; display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: 10px 10px 10px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.news-banner-text { display: grid; flex: 1; min-width: 0; }
.news-banner-text b { font-size: var(--fs-s); }
.news-banner-text small { color: var(--muted); font-size: var(--fs-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-banner-open { flex: none; min-height: 34px; padding: 0 12px; font-size: var(--fs-s); }
.news-banner-later { flex: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-xs); font-weight: 600; padding: 6px 4px; cursor: pointer; }
/* Единый шаг 12 px сверху вниз: шапка → заголовок раздела → первый блок → первая подпись внутри блока */
#calculatorView > .card.form { padding-top: 12px; }
.search, .filter-box { margin-bottom: 12px; }
/* Ровные 12 px между фильтрами, строкой «обновить / Обзвон / сортировка» и списком */
.list-tools { margin: 0 0 4px; }
/* Строка заголовка раздела ниже: 30 px, кнопка «+» тоже 30 px */
/* Подпись поля («Культура», «Откуда везём») не прилипает к чипам */
.field { gap: 9px; }
/* Подпись BY PLAXEY23 — по центру под логотипом */
.appbar .brand { justify-items: center; }
.brand .brand-signature { margin-right: 0; justify-self: center; }
/* ===== Единый шаг между блоками по всему приложению: 12 px (решение Алексея 21.10) =====
   Блок от блока — 12 px; строки внутри одного списка — 8 px; чипы в строке — 6 px. */
:root { --space: 12px; --space-row: 8px; }
.form { gap: var(--space); }
.form-group { gap: var(--space); }
.results { gap: var(--space); margin-top: var(--space); }
.detail { gap: var(--space); }
.calc-sheet { gap: var(--space); }
.card-tabs, .card-panel { margin-top: var(--space); }
.history-day { margin-top: var(--space); }
.history-sub-title { margin: var(--space) 6px var(--space-row); }
.list, .list-tray { gap: var(--space-row); }
.wn-release + .wn-release { margin-top: var(--space-row); }
/* Уведомления: предмет изменения строкой под заголовком; «Очистить» — в шапке окна рядом с крестиком */
.notice-subject { display: block; margin-top: 2px; color: var(--text); font-size: var(--fs-xs); font-weight: 600; line-height: 1.3; }
.notice-clear { padding: 6px 8px; color: var(--negative); font-size: var(--fs-s); font-weight: 700; }
/* Заголовок раздела компактнее: строка 26 px, кнопка «+» 26 px; шапка → заголовок 10 px, заголовок → поиск/окно 8 px */
/* Список заводов/фермеров — ровно по краям с поиском и фильтрами (подложка больше не выступает) */
.list-tray { margin: 0; padding: 10px 6px 6px; }
.appbar { margin-bottom: 10px; }
/* Шапка не «прыгает» между вкладками: место под полосу прокрутки зарезервировано всегда
   (короткая страница «Расчёт» без прокрутки была на 15 px шире, чем длинные «Заводы»/«История») */
html { scrollbar-gutter: stable; } /* как на основе (r19); 14.11 вернули — ограничение «только ПК» совпало со скачущей панелью на iPhone */
/* История: заголовок дня без серой подложки (и не липнет при прокрутке — иначе просвечивал бы список) */
.history-day { position: static; background: transparent; }
html { overflow-y: scroll; }
/* на компьютере полоса прокрутки всегда на месте — ширина страницы одинаковая на всех вкладках */
/* Логотип: без размытого ореола (на телефоне он «размывал» название) — только чёткая тонкая тень */
.brand .brand-name { text-shadow: 0 1px 0 rgba(15, 23, 42, .18); }
html.dark .brand .brand-name { text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
/* Карточки ближе к краю экрана: боковой отступ страницы 8 px (было 16, на узких 12) */
:root { --page-x: 8px; }
#app { padding-inline: var(--page-x); }
.appbar { margin-inline: calc(-1 * var(--page-x)); padding-inline: 12px; }
@media (max-width: 380px) {
  #app { padding-inline: var(--page-x); }
  .appbar { margin-inline: calc(-1 * var(--page-x)); padding-inline: 10px; }
}
.news-banner { left: var(--page-x); right: var(--page-x); }
/* Тот же боковой отступ 8 px внутри окон: карточки завода/фермера, формы, «Цена фермеру», всплывающие окна */
.sheet-body { padding-left: var(--page-x); padding-right: var(--page-x); }
.sheet-head { padding-left: 14px; padding-right: 8px; }
.popover-overlay { padding-left: var(--page-x); padding-right: var(--page-x); }
.popover-body { padding-left: var(--page-x); padding-right: var(--page-x); }
/* Прокрутка во всплывающих окнах: тело окна ограничено высотой карточки и прокручивается само,
   прокрутка не «проваливается» на страницу за окном */
.popover-card { min-height: 0; }
.popover-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.popover-overlay, .user-picker { overscroll-behavior: contain; touch-action: pan-y; }
/* ===== 22.10: поиск наверху, заголовок-вкладка слит с фильтрами / окном расчёта ===== */
/* Строка поиска с кнопкой «+» (у истории — «Очистить») */
.view-top { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space); }
.view-top .search { flex: 1; min-width: 0; margin: 0; }
.view-top .icon-btn { flex: none; width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
.view-top .icon-btn .icon { width: 18px; height: 18px; }
.view-top .btn { flex: none; }
/* Вкладка: белая «табличка» с названием раздела, приросшая к верхнему левому углу блока под ней */
.tabbed { display: grid; margin-bottom: var(--space); }
.tabbed > .filter-box, .tabbed > .card { margin: 0 !important; border-top-left-radius: 0; position: relative; z-index: 1; }
.tabbed > .filter-box { border-top-left-radius: 0; }
/* у истории фильтры-чипы внутри рамки — ровно как у заводов */
.tabbed #historyTabs { margin: 0; padding: 2px 10px; }
/* Шапка продолжается вверх: при оттягивании страницы вниз на телефоне над шапкой тот же белый цвет, а не фон */
.appbar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: var(--surface); pointer-events: none; }
/* Подложка списка заводов/фермеров — лёгкий нейтральный мятный градиент (#e4f2f1) */
html.dark .list-tray { box-shadow: none; }
/* Окна «Качество» и «Цены фермерам»: блоки белые с тенью на сером фоне окна — ничего не сливается */
.indicator-section, .deal-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.indicator-section { padding: 12px 14px; }
.deal-map-canvas { border: 1px solid var(--line); box-shadow: var(--shadow-1); background: var(--surface); }
/* Поля выбора, стоящие прямо на сером фоне окна (культура и т. п.), — белые с рамкой */
.sheet-body .detail > .field select, .sheet-body .detail > .field input, .indicator-row .indicator-dots { border-bottom-color: var(--line-strong); }
/* История: длинные названия переносятся, пометка «добавлен/изменён» не уходит за край */
.change-item .entity-main { min-width: 0; }
.change-item .row-title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.change-item .change-badge, .change-item .change-count { display: inline-block; white-space: nowrap; }
/* Вкладка-папка: слева скруглённый угол, справа скошенный край с обводкой (как у папки); текст ближе к левому краю */
/* ===== Плавные анимации (22.10): одна «мягкая» кривая и длительности для всего приложения ===== */
:root { --ease-soft: cubic-bezier(.22, 1, .36, 1); --dur-open: .42s; --dur-fold: .38s; }
/* Раскрывающиеся блоки («Фермеру», «Расчёт», «Показать все»): плавно меняется высота, без рывка */
.fold { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--dur-fold) var(--ease-soft), opacity .3s ease, margin-top var(--dur-fold) var(--ease-soft); margin-top: 0; }
.fold.is-open { grid-template-rows: 1fr; opacity: 1; }
.fold > .fold-inner { min-height: 0; overflow: hidden; }
.fold[data-card-panel].is-open { margin-top: var(--space); }
.fold > .fold-inner > .card-panel { margin-top: 0; animation: none; }
.history-rest.fold[hidden] { display: grid; }
/* Окна снизу: открываются и закрываются мягче и дольше; затемнение — в такт */
.sheet { transition: transform var(--dur-open) var(--ease-soft); }
.sheet-overlay { transition: background var(--dur-open) ease, backdrop-filter var(--dur-open) ease; }
.sheet-dialog .sheet { transition: transform .3s var(--ease-soft), opacity .25s ease; }
/* Всплывающие окна и окно «Кто вы?» — плавное появление снизу */
@keyframes softUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.popover-overlay, .user-picker { animation: fadeIn .3s ease; }
.popover-card { animation: softUp var(--dur-open) var(--ease-soft); }
/* Раскрывающиеся списки (версии в «Что нового», группы в «Истории») — плавно, где браузер умеет */
:root { interpolate-size: allow-keywords; }
details::details-content { height: 0; overflow: clip; transition: height var(--dur-fold) var(--ease-soft), content-visibility var(--dur-fold) allow-discrete; }
details[open]::details-content { height: auto; }
/* Стрелки, переключение вкладок, плашка обновления — тоже мягче */
.card-tab-chevron, .history-expand .icon, .wn-chevron, .row-chevron { transition: transform .3s var(--ease-soft); }
.card-tab { transition: background .25s ease, border-color .25s ease, color .25s ease; }
.view.is-active { animation: viewIn .32s var(--ease-soft); }
.news-banner { animation: softUp .45s var(--ease-soft); }
/* Ручка окна — шире область касания, видно, что за неё тянут */
.sheet-grabber { cursor: grab; }
@media (prefers-reduced-motion: reduce) {
  .fold, .sheet, details::details-content { transition: none; }
}
/* Подложка списка — мятный чуть насыщеннее (22.10) */
/* iPhone: верх шапки чуть ниже — логотип не попадает в полосу размытия у края экрана (Safari / Telegram) */
.appbar { padding-top: max(14px, calc(env(safe-area-inset-top) + 6px)); margin-top: calc(-1 * max(8px, env(safe-area-inset-top))); }
/* Подложка списка — ещё насыщеннее (25.10) */
.list-tray { background: linear-gradient(180deg, #bde2dc 0%, color-mix(in srgb, #c8e7e2 75%, var(--bg)) 100%); border-color: color-mix(in srgb, #5fb0a5 45%, transparent); }
html.dark .list-tray { background: linear-gradient(180deg, color-mix(in srgb, #1e7a70 55%, var(--bg)) 0%, color-mix(in srgb, #1e7a70 28%, var(--bg)) 100%); border-color: color-mix(in srgb, #3fae9f 42%, transparent); }
/* ===== Перевозчики (25.10) ===== */
/* 4 кнопки (История ушла в меню ☰ в v0.58): на телефоне — во всю ширину, на широком экране действует правило выше (по 120 px по центру) */
@media (max-width: 759px) {
  .tabbar { grid-template-columns: repeat(4, 1fr); }
}
.tab span { font-size: var(--fs-2xs); letter-spacing: -0.01em; white-space: nowrap; }
.person-role.role-carrier { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.person-role.role-driver { background: color-mix(in srgb, #0f9d8a 14%, transparent); color: #0b7d6e; }
html.dark .person-role.role-driver { color: #5fd3c2; }
.field-hint { margin: 4px 4px 0; color: var(--faint); font-size: var(--fs-2xs); }
/* Перевозчик: вкладки «Общее / Водители», автопарк, карточки водителей */
.carrier-tabs { margin-top: 2px; }
.carrier-pane { display: grid; gap: var(--space); }
.carrier-pane[hidden] { display: none; }
.fleet-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); }
.fleet-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 10px; border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-s); font-weight: 650; }
.fleet-chip b { color: var(--accent, var(--text)); font-weight: 800; }
.driver-card { gap: 0; border-radius: var(--r-s); background: var(--surface-2); overflow: hidden; }
.driver-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--line); }
.driver-who { min-width: 0; }
.driver-who .info-row-label { text-overflow: ellipsis; }
.driver-call { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); color: var(--accent, var(--text)); }
.driver-vehicle { display: grid; gap: 8px; padding: 10px 14px 12px; }
.driver-type { justify-self: start; padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-xs); font-weight: 700; }
.driver-type.is-empty { color: var(--faint); font-weight: 600; }
.driver-plates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.driver-plate { display: grid; gap: 2px; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface); }
.driver-plate small { color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; }
.driver-plate b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-s); letter-spacing: 0.02em; }
.driver-types { margin-top: 8px; }
.contact-block.is-focus { box-shadow: 0 0 0 2px var(--accent, #2a9d8f); border-radius: var(--r-s); transition: box-shadow 0.3s var(--ease-soft, ease); }
.driver-who .info-row-label { white-space: normal; overflow: visible; }
/* Расчёт → «Перевозчику»: сколько можно отдать за перевозку + кто возит в этой области */
.fo-warn { margin: 10px 0 0; padding: 8px 10px; border-radius: var(--r-s); background: color-mix(in srgb, var(--warning, var(--star)) 12%, transparent); color: var(--text); font-size: var(--fs-xs); line-height: 1.35; }
.carrier-pick { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cp-title { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.cp-empty, .cp-more { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.cp-list { display: grid; gap: 6px; }
.cp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); }
.cp-main { display: grid; gap: 1px; min-width: 0; padding: 2px 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cp-name { overflow: hidden; font-size: var(--fs-s); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cp-main small { overflow: hidden; color: var(--muted); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.cp-row .driver-call { background: var(--surface-2); }
/* Три кнопки под карточкой: «Фермеру» и «Перевозчику» рядом, «Расчёт» — строкой ниже */
.card-tabs { grid-template-columns: 1fr 1fr; }
.card-tabs > .card-tab:nth-child(3), .card-tabs > .card-tab:only-child { grid-column: 1 / -1; }
.card-tabs > .card-tab:nth-child(3) { padding-top: 8px; padding-bottom: 8px; }
.card-tabs > .card-tab:nth-child(3) .card-tab-text { display: flex; align-items: baseline; gap: 8px; }
/* Подбор сделок: фермер → завод, прибыль, цены, перевозчики */
.match-head { display: grid; gap: 8px; margin-bottom: var(--space); }
.match-head .results-head { margin: 0; }
.match-note { margin: 0 4px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.match-card { display: grid; gap: 10px; margin-bottom: var(--space); }
.match-route { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; }
.match-rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 800; }
.match-names { display: grid; gap: 2px; min-width: 0; }
.match-names strong { font-size: var(--fs-m, 16px); font-weight: 800; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.match-arrow { color: var(--accent); }
.match-names small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.match-profit { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); background: color-mix(in srgb, var(--positive, var(--positive)) 10%, transparent); }
.match-profit > div { display: grid; gap: 1px; }
.match-profit > div:last-child { text-align: right; }
.match-profit b { color: var(--positive, var(--positive)); font-size: var(--fs-2l); font-weight: 800; letter-spacing: -0.01em; }
.match-profit > div:last-child b { font-size: var(--fs-m, 16px); }
.match-profit small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.match-stats { margin: 0; }
.match-stats dd { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.match-card .carrier-pick { margin-top: 0; }
.match-open { margin-top: 2px; }
.result-card.is-picked { box-shadow: 0 0 0 2px var(--accent); }
.match-card { padding: 12px; }
.match-card .cp-title { margin-left: 2px; }
/* Логистика «авто»: крестик в поле ставки и блок «Перевозчику до» в карточке завода */
.rate-clear { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; margin-right: 6px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.rate-clear[hidden] { display: none; }
.match-km { display: block; width: 100%; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
/* Пометка ставки к рынку: зелёный — в рынке / выше, жёлтый — ниже рынка, красный — не поедут */
:root { --market-warn: #b7791f; }
:root.dark { --market-warn: #f6c343; }
.mk-line { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.mk { font-weight: 800; }
.mk-ok { color: var(--positive); }
.mk-warn { color: var(--market-warn); }
.mk-bad { color: var(--negative); }
.fo-market { margin: 6px 0 0; }
.inline-row .target-switch { margin-left: auto; }
/* Вкладки над окном расчёта: «Расчёт рейса» | «Подбор» (26.10). Активная слита с окном, вторая — приглушённая рядом */
.calc-tabs { display: flex; align-items: flex-end; justify-self: start; position: relative; z-index: 2; margin-bottom: -1px; }
.tabbed > .calc-tabs + .card, .tabbed > .card[data-pane] { margin: 0 !important; border-top-left-radius: 0; position: relative; z-index: 1; }
#matchForm { padding-top: 12px; }
.match-intro { margin: 0 4px 10px; color: var(--muted); }
.match-target { margin-top: 12px; }
/* ===== Вход по PIN (02.11): экран на весь экран поверх приложения ===== */
.auth-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow-y: auto; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); background: var(--bg); outline: none; }
.auth-screen.is-sheet { background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(6px); }
.auth-card { width: min(340px, 100%); display: grid; justify-items: center; gap: 6px; text-align: center; }
.auth-brand .brand-name { font-family: "Righteous", "Marck Script", sans-serif; font-size: var(--fs-3xl); color: var(--text); line-height: 1; }
.auth-brand { margin-bottom: 18px; }
.auth-title { margin: 0; font-size: var(--fs-2l); font-weight: 800; letter-spacing: -0.01em; }
.auth-sub { margin: 0 0 14px; color: var(--muted); font-size: var(--fs-m); }
.auth-form { width: 100%; display: grid; gap: 10px; }
.auth-input { width: 100%; height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-ml); text-align: center; }
.auth-input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: transparent; }
.auth-dots { display: flex; gap: 16px; margin: 6px 0 22px; }
.auth-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); transition: background-color .12s ease, border-color .12s ease, transform .12s ease; }
.auth-dots i.is-on { background: var(--text); border-color: var(--text); transform: scale(1.05); }
.auth-dots.is-error i { border-color: var(--negative, var(--negative)); }
.auth-dots.is-shake { animation: authShake .38s ease; }
@keyframes authShake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.auth-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; justify-content: center; }
.auth-key { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-xl); font-weight: 500; cursor: pointer; box-shadow: var(--shadow-1, 0 1px 3px rgba(15,23,42,.08)); -webkit-tap-highlight-color: transparent; }
.auth-key:active { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.auth-key.is-del { background: transparent; box-shadow: none; color: var(--muted); }
.auth-key .icon { width: 26px; height: 26px; }
.auth-error { min-height: 20px; margin: 10px 0 0; color: var(--negative, var(--negative)); font-size: var(--fs-s); font-weight: 600; }
.auth-links { display: grid; gap: 8px; margin-top: 6px; }
.auth-links .btn-link { font-size: var(--fs-m); }
.auth-screen.is-busy .auth-keys, .auth-screen.is-busy .auth-form { opacity: .5; pointer-events: none; }
@media (max-height: 640px) {
  .auth-key { width: 64px; height: 64px; font-size: var(--fs-xl); }
  .auth-keys { grid-template-columns: repeat(3, 64px); gap: 10px 20px; }
  .auth-brand { margin-bottom: 8px; }
}
/* Профиль (имя в шапке) */
/* Сотрудники */
.staff-note { margin: 0 4px 12px; }
.staff-row { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.staff-row:last-child { border-bottom: 0; }
.staff-row.is-blocked .staff-main b { color: var(--muted); text-decoration: line-through; }
.staff-main { display: grid; gap: 2px; }
.staff-main small { color: var(--muted); font-size: var(--fs-xs); }
.staff-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-actions .chip.is-danger { color: var(--negative, var(--negative)); }
.staff-empty { padding: 12px; margin: 0; }
.detail-author { margin: 4px 4px 0; color: var(--muted); font-size: var(--fs-xs); }
/* Сотрудник видит только «Фермеры»: нижнее меню и остальные разделы скрыты */
html[data-role="worker"] .tabbar, html[data-role="worker"] #calculatorView, html[data-role="worker"] #plantsView, html[data-role="worker"] #carriersView, html[data-role="worker"] #historyView { display: none; }
html[data-role="worker"] main { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* Экран входа — список имён (как прежнее «Кто вы?») */
.auth-users { width: 100%; max-height: min(52vh, 420px); overflow-y: auto; margin-bottom: 4px; }
.auth-new { margin-top: 4px; gap: 8px; }
.auth-skeleton { width: 100%; }
/* ===== Меню слева (03.11): кнопка ☰ в шапке, панель выезжает слева ===== */
.menu-btn { position: relative; }
.menu-btn.has-news::after { content: ""; position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--negative); border: 2px solid var(--surface); }
.drawer-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, 0); transition: background-color .28s ease; }
.drawer-overlay.is-open { background: rgba(15, 23, 42, .38); }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: 8px 0 32px rgba(15, 23, 42, .18); padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); transform: translateX(-104%); transition: transform .28s var(--ease-soft, ease); overflow: hidden; }
.drawer-overlay.is-open .drawer { transform: translateX(0); }
html.drawer-open, html.drawer-open body { overflow: hidden; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); }
.drawer-avatar { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); font-weight: 800; font-size: var(--fs-ml); }
.drawer-who { flex: 1; min-width: 0; display: grid; }
.drawer-who b { font-size: var(--fs-m); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-who small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 0 8px; -webkit-overflow-scrolling: touch; }
.drawer-label { margin: 14px 8px 4px; color: var(--faint, var(--muted)); font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.drawer-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 8px 10px; border: 0; border-radius: var(--r-s); background: none; color: var(--text); font: inherit; font-size: var(--fs-m); font-weight: 700; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.drawer-switch .tax-switch-track { flex: none; margin-left: auto; }
.drawer-switch[aria-checked="true"] .tax-switch-track { background: var(--accent); }
.drawer-switch[aria-checked="true"] .tax-switch-knob { transform: translateX(12px); }
.drawer-item .icon { flex: none; width: 20px; height: 20px; color: var(--muted); }
.drawer-item small { display: block; margin-top: 1px; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.drawer-item:active { background: var(--surface-2); }
.drawer-item.is-active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.drawer-item.is-active .icon { color: var(--accent); }
.drawer-item.has-news::after { content: ""; position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--negative); }
.drawer-foot { border-top: 1px solid var(--line); padding-top: 6px; }
.drawer-foot .drawer-item { color: var(--negative); }
.drawer-foot .drawer-item .icon { color: var(--negative); }
/* ===== Расчёт ставки (03.11) ===== */
#rateForm { padding-top: 12px; }
#rateForm .autocomplete { position: relative; }
.rate-card { display: grid; gap: var(--space); }
/* Карточка (10.11): маршрут мелко, на виду только цифры — слева км и ₽/км, справа ставка с диапазоном */
.rate-route { margin: 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; line-height: 1.3; }
.rate-warn { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--market-warn); font-size: var(--fs-xs); font-weight: 600; line-height: 1.35; }
.rate-warn .icon { flex: none; margin-top: 1px; }
.rate-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--r-m); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rate-hero > div { display: grid; gap: 2px; min-width: 0; }
.rate-price { text-align: right; }
.rate-hero strong { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; }
.rate-price strong { color: var(--accent); }
.rate-hero small { color: var(--muted); font-size: var(--fs-s); font-weight: 700; white-space: nowrap; }
.rate-km small { color: var(--text); }
@media (max-width: 380px) {
  .rate-hero { padding: 12px; gap: 8px; }
  .rate-hero strong { font-size: var(--fs-2l); }
}
.rate-details { display: grid; gap: var(--space-row, 8px); }
.rate-details .match-note { margin: 0; }
/* Форма: «Откуда» и «Куда» без подписей, вплотную */
.rate-points { display: grid; gap: 6px; }
.rate-factors { display: grid; gap: var(--space-row, 8px); }
.rate-factor { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-s); font-weight: 650; }
.rate-factor small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.rate-factor b { flex: none; }
.rate-factor b.is-up { color: var(--negative); }
.rate-factor b.is-down { color: var(--positive); }
/* Три вкладки над окном расчёта: на телефоне — помельче, чтобы влезли в строку */
.rate-card { padding: 16px; }
.rate-card .rate-trucks { margin: 0; }
/* ===== Разгрузка (черновик): шапка карточки завода со значками ===== */
.rc-head { display: flex; align-items: flex-start; gap: 8px; }
.rc-title { flex: 1 1 auto; min-width: 0; }
.rc-icons { flex: none; display: flex; gap: 6px; }
.rc-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--accent); }
.rc-icon:active { transform: scale(.94); }
/* Тихая пометка в карточке: «закупка не указана» */
.hero-note { display: block; margin-top: 2px; color: var(--faint, var(--muted)); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .01em; }
/* Где реально нашёлся адрес */
.route-found { margin: 0 2px 8px; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; line-height: 1.35; }
.route-found b { color: var(--text); font-weight: 700; }
.rate-card .route-found { margin: 0; }
/* Подбор: разделитель перед старыми ценами и пометка в карточке */
.match-divider { margin: 4px 2px 8px; color: var(--market-warn); font-size: var(--fs-xs); font-weight: 700; }
.match-stale { margin: 8px 0 0; color: var(--market-warn); font-size: var(--fs-xs); font-weight: 600; line-height: 1.35; }
/* ===== Карточка перевозчика: кому звонить (06.11) ===== */
.carrier-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.carrier-card .entity-main { gap: 3px; }
.cc-facts { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; line-height: 1.35; }
.cc-facts b { color: var(--text); font-weight: 750; }
.cc-miss { color: var(--market-warn); font-style: normal; font-weight: 600; }
.cc-rows { display: grid; gap: 3px; margin-top: 3px; }
.cc-fit { display: grid; gap: 3px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.cc-fit .cc-row { grid-template-columns: 96px minmax(0, 1fr); }
.cc-fit .cc-note { margin-top: 0; }
.cc-row { display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: baseline; gap: 6px; color: var(--text); font-size: var(--fs-xs); font-weight: 500; line-height: 1.35; }
.cc-row small { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.cc-row b { font-weight: 750; }
.cc-note { margin-top: 4px; color: var(--accent); font-size: var(--fs-xs); font-weight: 700; line-height: 1.35; }
.cc-note b { color: var(--text); font-weight: 800; }
.carrier-card.is-bad { opacity: .7; }
.carrier-card.is-bad .cc-note { color: var(--negative); }
.carrier-card .driver-call { background: var(--accent); color: var(--on-accent); }
.carrier-finder-box { margin-bottom: var(--space); }
.carrier-finder { display: grid; gap: 8px; padding: 0 12px 12px; }
.finder-title { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; font-size: var(--fs-m); font-weight: 800; list-style: none; cursor: pointer; }
.finder-title::-webkit-details-marker { display: none; }
.finder-title .icon-s { color: var(--accent); }
.finder-chevron { margin-left: auto; transition: transform .2s ease; }
.carrier-finder-box[open] .finder-chevron { transform: rotate(180deg); }
.finder-actions { display: flex; gap: 8px; }
.finder-actions .btn { flex: 1; }
/* ===== Окна редактирования: отдельный раздел, контраст, никакого белого на белом (06.11) ===== */
:root { --edit-bg: #e3e8ec; --edit-card: #ffffff; --edit-line: #c5ced6; --edit-input: #ffffff; --edit-label: #3a4653; }
:root.dark { --edit-head: #1d3b55; --edit-bg: #0d1113; --edit-card: #181e21; --edit-input: #222a2e; --edit-label: #c9d2da; }
.sheet-edit.sheet-overlay.is-open { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.sheet-edit .sheet { height: calc(100dvh - max(16px, env(safe-area-inset-top))); max-height: calc(100dvh - max(16px, env(safe-area-inset-top))); overflow: hidden; box-shadow: var(--shadow-2); }
.sheet-edit .sheet-title { font-weight: 800; }
.sheet-edit .sheet-body { flex: 1 1 auto; gap: 12px; padding-top: 12px; padding-bottom: 0; }
.sheet-edit .form-list .inline-label { width: 96px; }
.sheet-edit .form-group { padding: 14px; border: 1px solid var(--edit-line); border-radius: var(--r-m); background: var(--edit-card); box-shadow: none; }
.sheet-edit .form-group-title { margin: -2px 0 2px; padding-bottom: 10px; border-bottom: 1px solid var(--edit-line); color: var(--text); font-size: var(--fs-m); }
.sheet-edit .inline-list { border: 1px solid var(--edit-line); background: var(--edit-input); box-shadow: none !important; }
.sheet-edit .inline-row { min-height: 50px; border-bottom-color: var(--edit-line); }
.sheet-edit .inline-label, .sheet-edit .field-label { color: var(--edit-label); font-weight: 650; }
.sheet-edit .inline-input { color: var(--text); font-weight: 650; }
.sheet-edit .field-hint { color: var(--muted); }
.sheet-edit input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not(.inline-input), .sheet-edit textarea, .sheet-edit select { border: 1px solid var(--edit-line); background: var(--edit-input); color: var(--text); }
.sheet-edit input:not(.inline-input):focus, .sheet-edit textarea:focus, .sheet-edit select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sheet-edit .inline-row:focus-within { background: var(--accent-soft); }
.sheet-edit ::placeholder { color: var(--muted); }
.sheet-edit .chip { border-color: var(--edit-line); background: var(--edit-input); color: var(--text); font-weight: 600; }
.sheet-edit .chip-check:has(input:checked), .sheet-edit .chip.is-active { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 700; }
.sheet-edit .contact-block { padding: 10px; border: 1px solid var(--edit-line); border-radius: var(--r-s); background: var(--edit-bg); }
.sheet-edit .form-sticky { position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * var(--page-x)); padding: 10px var(--page-x) max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--edit-line); background: var(--edit-bg); }
.sheet-edit .form-sticky .btn { min-height: 50px; font-size: var(--fs-m); font-weight: 800; }
/* Короткие окна (цена, настройки, качество) — по содержимому, а не на весь экран */
#detailSheet.sheet-edit .sheet { height: auto; }
#detailSheet.sheet-edit .sheet-body { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.cc-hint { color: var(--muted); font-size: var(--fs-2xs); font-weight: 500; }
/* Карточки и остальные окна — в стиле окон редактирования (06.11) */
.sheet-edit .detail-section { padding: 12px 14px; border: 1px solid var(--edit-line); border-radius: var(--r-m); background: var(--edit-card); }
.sheet-edit .detail-section > h3 { margin: -2px 0 2px; padding-bottom: 10px; border-bottom: 1px solid var(--edit-line); color: var(--text); font-size: var(--fs-m); font-weight: 800; }
.sheet-edit .detail-section .info-list { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.sheet-edit .detail-section .info-row { padding-left: 0; padding-right: 0; border-bottom-color: var(--edit-line); }
.sheet-edit .detail > .info-list, .sheet-edit .carrier-pane > .info-list { border: 1px solid var(--edit-line); background: var(--edit-card); box-shadow: none; }
.sheet-edit .sheet-body .action { border-color: var(--edit-line); background: var(--edit-card); box-shadow: none; }
/* Расчёт ставки: строка адресов под названиями фермера/завода (11.11) */
.rate-routes { display: grid; gap: 2px; }
/* ===== Автопарк перевозчика (11.11) ===== */
.fleet-form { display: grid; gap: 10px; }
.fleet-line { display: grid; gap: 6px; }
.fleet-line-label { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.fleet-with-us { margin-left: 5px; color: var(--accent); font-size: var(--fs-2xs); font-weight: 700; }
.chip.is-auto { opacity: 1; }
.chip.is-auto input:disabled + span { cursor: default; }
.chip.is-none, .fleet-chip.is-none { font-weight: 600; }
.chip.is-none i, .fleet-chip.is-none i { color: var(--muted); font-style: normal; font-weight: 500; }
span.chip.is-auto.is-none { display: inline-flex; align-items: center; border: 1px dashed var(--line); background: var(--surface); }
.fleet-hint { margin: 0; }
.detail-section .fleet-line + .fleet-line { margin-top: 8px; }
.detail-section .fleet-line { padding: 0 2px; }
/* Водители в форме — свёрнутым блоком */
.drivers-box > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.drivers-box > summary::-webkit-details-marker { display: none; }
.drivers-count { color: var(--muted); font-weight: 600; }
.drivers-chevron { margin-left: auto; color: var(--muted); transform: rotate(90deg); transition: transform .2s ease; }
.drivers-box[open] .drivers-chevron { transform: rotate(-90deg); }
.drivers-box[open] > summary { margin-bottom: 8px; }
/* Расчёт ставки: строка маршрута и значок «Маршрут» справа (11.11) */
.rate-head { display: flex; align-items: flex-start; gap: 8px; }
.rate-head .rate-routes { flex: 1 1 auto; min-width: 0; }
.rate-head .rc-icon { flex: none; margin-top: -4px; }
/* «Расчёт ставки»: 4 кнопки сеткой 2×2 (Своим, Перевозчику / Расчёт, Кто повезёт) */
.card-tabs.is-four > .card-tab:nth-child(3) { grid-column: auto; padding-top: 10px; padding-bottom: 10px; }
.card-tabs.is-four > .card-tab:nth-child(3) .card-tab-text { display: grid; gap: 0; }
.rate-carriers .cp-title { margin-bottom: 8px; }
/* «Обзвоны» (11.11) */
html[data-role="worker"] .admin-only { display: none; }
.call-form { display: grid; }
.call-nophone { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-s); color: var(--muted); font-size: var(--fs-s); }
.call-callback { display: grid; gap: 8px; border-radius: var(--r-s); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.call-callback[hidden] { display: none; }
.rate-call-btn { margin-bottom: 10px; }
.call-row .entity-main, .call-entry .entity-main { display: grid; gap: 2px; min-width: 0; }
.call-agreed-line { color: var(--positive, var(--positive)); font-size: var(--fs-xs); font-weight: 650; }
.call-wait-line { color: var(--warning); font-size: var(--fs-xs); font-weight: 650; }
.call-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; vertical-align: 1px; }
.call-badge-ready, .call-badge-agreed { background: color-mix(in srgb, var(--positive, var(--positive)) 14%, transparent); color: var(--positive, var(--positive)); }
.call-badge-callback { background: var(--warning-soft); color: var(--warning); }
.call-badge-expensive, .call-badge-busy, .call-badge-noanswer { background: var(--surface-2); color: var(--muted); }
.call-entry.is-agreed { background: color-mix(in srgb, var(--positive, var(--positive)) 7%, transparent); }
.call-entry.is-agreed .change-icon { color: var(--positive, var(--positive)); }
.call-entry .row-title { white-space: normal; }
.call-terms { color: var(--text); font-weight: 600; }
.call-note { white-space: pre-wrap; }
.call-row .entity-sub, .call-entry .entity-sub { white-space: normal; overflow: visible; }
/* Обзвон блоками (12.11): белые блоки с тенью на сером фоне — как остальные блоки приложения */
.sheet-edit .call-form .form-group, .sheet-edit .call-session .card { box-shadow: var(--shadow-1); }
.call-form { gap: 14px; }
.call-facts { display: grid; gap: 6px; }
.call-fact { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: var(--fs-s); }
.call-fact small { color: var(--edit-label, var(--muted)); font-size: var(--fs-xs); font-weight: 650; }
.call-fact span { font-weight: 650; }
.call-carrier-facts { font-size: var(--fs-s); }
.call-contacts { display: grid; gap: 8px; }
.call-contact { display: grid; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-s); background: var(--edit-input, var(--surface)); color: var(--text); text-decoration: none; }
.call-contact-main { display: grid; min-width: 0; }
.call-contact-main b { font-size: var(--fs-m); text-overflow: ellipsis; }
.call-contact-main small { color: var(--muted); font-size: var(--fs-xs); }
.call-contact-phone { color: var(--muted); font-size: var(--fs-s); font-weight: 650; }
.call-contact-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.call-contact:active { transform: scale(.99); }
.call-summary { margin: 0; font-size: var(--fs-s); font-weight: 650; }
.call-contact-name { color: var(--muted); font-weight: 600; }
.call-form .call-callback { border: 1px solid var(--edit-line, var(--line)); }
@media (max-width: 380px) {
  .call-contact { grid-template-columns: minmax(0, 1fr) 40px; }
  .call-contact-phone { display: none; }
  .call-fact { grid-template-columns: 96px minmax(0, 1fr); }
}
/* контакты в обзвоне: имя целиком, под ним кто и телефон */
.call-contact { grid-template-columns: minmax(0, 1fr) 40px; }
.call-contact-main b { white-space: normal; overflow: visible; line-height: 1.25; }
.call-contact-main small { margin-top: 2px; font-weight: 600; }
.call-more summary { display: flex; align-items: center; gap: 6px; padding: 4px 2px; color: var(--accent); font-size: var(--fs-s); font-weight: 700; list-style: none; cursor: pointer; }
.call-more summary::-webkit-details-marker { display: none; }
.call-more summary .icon { transform: rotate(90deg); transition: transform .2s ease; }
.call-more[open] summary .icon { transform: rotate(-90deg); }
.call-more > .call-contacts { margin-top: 8px; }
.call-fact span { white-space: pre-wrap; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.call-miss { margin: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
/* ===== Пружины (13.11, принципы Apple) ===== */
/* Шторка на телефоне двигается пружиной из JS (core.js spring): CSS-переходы ей не мешают */
.sheet-overlay.js-motion, .sheet-overlay.js-motion .sheet { transition: none; }
@media (max-width: 759px) {
  .sheet-grabber, .sheet-head { touch-action: none; }
  .sheet-grabber { padding-block: 6px; margin-top: 2px; box-sizing: content-box; background-clip: content-box; }
}
/* Кривые-пружины для CSS: --spring без отскока, --spring-bounce с лёгким отскоком. Старые браузеры берут прежнюю --ease-soft */
@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0, 0.029, 0.097, 0.186, 0.282, 0.376, 0.466, 0.547, 0.619, 0.682, 0.736, 0.782, 0.821, 0.854, 0.881, 0.903, 0.921, 0.936, 0.949, 0.959, 0.967, 0.973, 0.979, 0.983, 0.986, 0.989, 0.991, 0.993, 0.995, 0.996, 1); --spring-bounce: linear(0, 0.032, 0.11, 0.214, 0.328, 0.443, 0.552, 0.649, 0.734, 0.805, 0.864, 0.91, 0.946, 0.972, 0.992, 1.005, 1.013, 1.018, 1.02, 1.02, 1.019, 1.017, 1.015, 1.012, 1.01, 1.008, 1.006, 1.005, 1.003, 1.002, 1.001, 1.001, 1); --dur-spring: .5s; }
  .fold { transition: grid-template-rows var(--dur-spring) var(--spring), opacity .3s ease, margin-top var(--dur-spring) var(--spring); }
  details::details-content { transition: height var(--dur-spring) var(--spring), content-visibility var(--dur-spring) allow-discrete; }
  .card-tab-chevron, .history-expand .icon, .wn-chevron, .row-chevron, .drivers-chevron, .finder-chevron { transition: transform .45s var(--spring-bounce); }
  .view.is-active { animation: viewIn .5s var(--spring); }
  .toast { animation: toastIn .55s var(--spring-bounce); }
  .popover-card { animation: softUp .55s var(--spring-bounce); }
  .news-banner { animation: softUp .55s var(--spring-bounce); }
  .sheet { transition: transform var(--dur-spring) var(--spring); }
  .sheet-dialog .sheet { transition: transform .45s var(--spring-bounce), opacity .25s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .fold, .sheet, details::details-content, .card-tab-chevron, .row-chevron { transition: none; }
  .toast, .view.is-active, .popover-card { animation: none; }
}
/* ===== Этап 2–3 дизайна (13.11, принципы Apple) ===== */
/* Шапка остаётся наверху; пока страница не прокручена — как была, при прокрутке — полупрозрачная,
   содержимое просвечивает под ней, вместо жёсткой линии снизу — мягкий край */
.appbar { position: sticky; top: 0; z-index: 40; transition: background .25s ease, box-shadow .25s ease, -webkit-backdrop-filter .25s ease, backdrop-filter .25s ease; }
html.is-scrolled .appbar { -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: transparent; }
html.dark.is-scrolled .appbar { box-shadow: var(--shadow-1); }
@media (prefers-reduced-transparency: reduce) {
  html.is-scrolled .appbar, html.is-scrolled .appbar::before { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* закреплённые подзаголовки («Сегодня» в Истории) — под шапкой, а не за ней */
.history-day { top: var(--appbar-h, 0px); }
/* Длинные названия в списках — в две строки, а не «Моршанск…» */
.entity-title span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
/* Отклик сразу при касании — у всех нажимаемых элементов одинаково */
.card-tab, .cp-main, .call-contact, .info-row a, .drawer-item, .history-item, .entity { transition: transform .3s var(--spring, ease), background .15s ease; }
.card-tab:active, .cp-main:active, .call-contact:active { transform: scale(.97); transition-duration: .06s; }
.drawer-item:active, .history-item:active { transform: scale(.985); transition-duration: .06s; }
/* Шрифты: размеры от размера текста в настройках телефона (rem), крупный текст — плотнее, мелкие подписи КАПСОМ — чуть свободнее */
:root { }
.fo-price, .rate-hero strong, .match-profit b, .detail-group-title { letter-spacing: -.015em; }
.fo-price, .rate-hero strong, .match-profit b { letter-spacing: -.025em; }
.cp-title, .history-sub-title { letter-spacing: .03em; }
/* ===== Навигация v0.72 (принципы Apple): вкладка «Ещё» вместо ☰, крупные заголовки, сегмент расчётов ===== */
/* Шапка: наверху страницы прозрачная (только колокольчик), при прокрутке — полупрозрачная с названием раздела.
   Логотип — только на «Расчёте». Меню ☰ и смена темы ушли во вкладку «Ещё». */
#menuButton, #themeButton { display: none !important; }
html:not(.is-scrolled) .appbar { background: transparent; border-bottom-color: transparent; box-shadow: none; }
html:not(.is-scrolled) .appbar::before { background: transparent; }
.appbar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); min-height: 48px; }
.appbar .brand, .appbar-title { grid-column: 2; grid-row: 1; justify-self: center; }
html:not([data-view="calculator"]) .appbar .brand { visibility: hidden; }
.appbar-title { font-weight: 700; font-size: var(--fs-m); letter-spacing: -.01em; white-space: nowrap; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .35s var(--spring, ease); pointer-events: none; }
html.is-scrolled:not([data-view="calculator"]) .appbar-title { opacity: 1; transform: none; }
.appbar-back { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 8px 0 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--fs-m); font-weight: 600; }
.appbar-back[hidden] { display: none; }
.appbar-back .icon { width: 22px; height: 22px; }
/* Крупный заголовок раздела: «Заводы 28» */
.large-title { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 12px; line-height: 1.1; }
.large-title .count { font-size: var(--fs-m); font-weight: 600; letter-spacing: 0; color: var(--muted); }
/* на «Расчёте» вместо заголовка — логотип в шапке и сегмент */
/* Фильтры больше не «вкладка» под заголовком — обычный блок со скруглёнными углами */
.tabbed > .filter-box, .tabbed > .card, .tabbed > .card[data-pane], .tabbed > .calc-tabs + .card { border-top-left-radius: var(--r-l); }
/* Сегмент «Рейс / Подбор / Ставка» — как переключатель в iPhone */
.seg-nav { display: grid; gap: 2px; justify-self: stretch; margin: 0 0 12px !important; padding: 3px; border-radius: var(--r-s); }
.seg-nav > .seg-btn { position: relative; min-height: 34px; margin: 0 !important; padding: 6px 4px !important; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); font: inherit; font-weight: 650; box-shadow: none !important; transition: background .25s ease, color .2s ease, box-shadow .25s ease; }
.seg-nav > .seg-btn::after, .seg-nav > .seg-btn::before { display: none; }
.seg-nav > .seg-btn.is-active { background: var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .12), 0 0 0 .5px rgba(15, 23, 42, .04) !important; }
html.dark .seg-nav > .seg-btn.is-active { background: color-mix(in srgb, var(--text) 16%, var(--surface)); }
/* Нижняя панель: пять вкладок; точка «вышла новая версия» — на «Ещё» */
.tab { position: relative; }
.tab.has-news::before { content: ""; position: absolute; top: 4px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--surface); }
/* Сотрудник: только «Фермеры» и «Ещё» */
html[data-role="worker"] nav.tabbar { display: grid; grid-template-columns: repeat(2, 1fr); }
html[data-role="worker"] .tab:not([data-view="farmers"]):not([data-view="more"]) { display: none; }
/* «Ещё» — как «Настройки» iPhone: сгруппированные строки с цветными значками */
.more-list { display: grid; gap: 20px; }
.more-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); }
.more-profile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.more-label { margin: 0 0 6px 16px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.more-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; transition: background .15s ease; }
.more-row + .more-row::before { content: ""; position: absolute; top: 0; right: 0; left: 58px; height: 1px; background: var(--line); }
.more-row:active { background: var(--surface-2); }
.more-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-xs); color: var(--on-accent); }
.more-ico .icon { width: 17px; height: 17px; }
.more-ico-green { background: var(--positive); }
.more-ico-blue { background: var(--accent); }
.more-ico-violet { background: var(--violet); }
.more-ico-red { background: var(--negative); }
.more-ico-dark { background: #3a3f4b; }
.more-ico-orange { background: var(--warning); }
.more-ico-gray { background: var(--muted); }
.more-ico-yellow { background: var(--star); }
.more-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.more-text > span, .more-text > b { font-weight: 600; }
.more-text small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; }
.more-value { color: var(--muted); font-size: var(--fs-s); white-space: nowrap; }
.more-value.is-new { color: var(--negative); font-weight: 700; }
.more-chev { flex: none; width: 16px; height: 16px; color: var(--faint, var(--muted)); }
.more-row.is-danger .more-text > span { color: var(--negative); }
.more-switch .tax-switch-track { flex: none; }
.more-switch[aria-checked="true"] .tax-switch-track { background: var(--positive, var(--positive)); }
.more-switch[aria-checked="true"] .tax-switch-knob { transform: translateX(12px); }
/* ===== v0.72, шаг 4: списки одним блоком со строками через тонкие линии (как в iPhone) =====
   Мятная подложка списка остаётся (решение Алексея 22.10/25.10), внутри неё — один белый блок. */
.list-tray { gap: 0; }
.list-tray > .entity { position: relative; margin: 0; border-radius: 0; border-top: 0; border-bottom: 0; box-shadow: none; min-height: 64px; }
.list-tray > .entity:active { transform: none; background: var(--surface-2); }
.list-tray > .list-tray-title { margin-bottom: 6px; }
.list-tray > .list-tray-title + .entity { border-top: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) 0 0; }
.list-tray > .entity:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--r-l) var(--r-l); }
.list-tray > .list-tray-title + .entity:last-child { border-radius: var(--r-l); }
.list-tray > .entity + .entity::before { content: ""; position: absolute; top: 0; right: 0; left: 70px; height: 1px; background: var(--line-strong); }
.list-tray > .carrier-card + .carrier-card::before { left: 14px; }
.list-tray { box-shadow: none; }
.list-tray > .list-tray-title ~ .entity { box-shadow: 0 1px 0 rgba(15, 23, 42, .02); }
.list-tray > .entity:focus-visible { z-index: 1; }
/* ===== шаг 5: действия в карточке — круглые значки с подписью снизу (как в карточке контакта iPhone) ===== */
.sheet-body .action-grid { gap: 4px; }
.sheet-body .action, .sheet-edit .sheet-body .action { min-height: 0; padding: 4px 2px 2px; gap: 6px; border: 0; background: none; box-shadow: none; }
.sheet-body .action > .icon { box-sizing: content-box; width: 22px; height: 22px; padding: 13px; border-radius: 50%; color: var(--accent); transition: transform .3s var(--spring, ease), background .15s ease; }
.sheet-edit .sheet-body .action > .icon { background: var(--edit-card); border: 1px solid var(--edit-line); }
.sheet-body .action span { color: var(--text); font-size: var(--fs-xs); font-weight: 650; line-height: 1.2; }
.sheet-body .action:active { transform: none; }
.sheet-body .action:active > .icon { transform: scale(.92); background: var(--surface-2); transition-duration: .06s; }
.sheet-body .action.is-danger > .icon { color: var(--negative); }
.sheet-body a.action[href^="tel:"] > .icon, .sheet-body .action[data-detail-action="call-pick"] > .icon { border-color: transparent; }
/* ===== шаг 6: единая сетка — одинаковые блоки выглядят одинаково ===== */
.card, .filter-box, .more-card { border-radius: var(--r-l); }
.large-title + .view-top, .large-title + .tabbed { margin-top: 0; }
/* ===== next.css ===== */
/* GrainFlow 2 (черновик 13.11): «Сегодня», «База» с единым поиском, фильтры в шторке. Поверх styles.css. */
/* ---------- Шапка и заголовки ---------- */
html[data-view="calculator"] #calcTitle { display: flex; }
html[data-view="calculator"] .appbar .brand { visibility: hidden; }
html[data-view="today"] .appbar .brand { visibility: visible; }
html.is-scrolled[data-view="today"] .appbar .brand { visibility: hidden; }
html.is-scrolled[data-view="today"] .appbar-title, html.is-scrolled[data-view="calculator"] .appbar-title { opacity: 1; transform: none; }
/* ---------- «Сегодня» ---------- */
.today { display: grid; gap: 14px; }
.t-hello { display: grid; gap: 2px; margin: 0 2px 2px; }
.t-hello small { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.t-hello .large-title { margin: 0; }
.t-quick { display: grid; }
.t-q { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--text); font: inherit; transition: transform .3s var(--spring, ease); }
.t-q .icon { flex: none; box-sizing: content-box; border-radius: var(--r-s); }
.t-q:active { transform: scale(.97); transition-duration: .06s; }
.t-card { display: grid; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.t-head { display: flex; align-items: center; gap: 10px; }
.t-head-text { display: grid; gap: 1px; min-width: 0; }
.t-head-text b { font-size: var(--fs-m); font-weight: 800; letter-spacing: -.01em; }
.t-head-text small { color: var(--muted); font-size: var(--fs-xs); }
.t-ico { flex: none; display: grid; place-items: center; color: var(--on-accent); }
.t-ico .icon { width: 17px; height: 17px; }
.t-ico-blue { background: var(--accent); }
.t-history { border-top: 1px solid var(--line); }
.t-history .history-item { border-radius: 0; }
.t-link { justify-self: start; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; font-size: var(--fs-s); }
/* ---------- «База» ---------- */
#plantsView > .large-title, #farmersView > .large-title, #carriersView > .large-title { display: none; }
/* общий заголовок «База» */
#plantsView > .view-top .search, #farmersView > .view-top .search, #carriersView > .view-top .search { display: none; }
#plantsView > .view-top, #farmersView > .view-top, #carriersView > .view-top { display: none; }
#plantsView > .tabbed > .filter-box, #farmersView > .tabbed > .filter-box, #carriersView > .tabbed > .filter-box { display: none; }
#plantsView > .tabbed, #farmersView > .tabbed, #carriersView > .tabbed { margin: 0; }
.base-head { display: grid; gap: 10px; margin-bottom: 12px; }
.base-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.base-title .large-title { margin: 0; }
.base-add { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .3s var(--spring, ease); }
.base-add:active { transform: scale(.92); transition-duration: .06s; }
.base-add .icon { width: 20px; height: 20px; }
.base-search { margin: 0 !important; }
.base-row { display: grid; align-items: center; }
.base-row .seg-nav { margin: 0 !important; }
.base-seg .seg-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-0) !important; }
.base-filter { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-s); font-weight: 700; box-shadow: var(--shadow-1); }
.base-filter .icon { width: 16px; height: 16px; color: var(--accent); }
.base-filter.is-on { border-color: var(--accent); color: var(--accent); }
.base-filter-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-style: normal; font-size: var(--fs-2xs); font-weight: 800; }
/* Поиск по всей базе: пока он идёт, обычный список прячется */
.view.is-searching > .list, .view.is-searching > .tabbed, .view.is-searching > .carrier-finder-box { display: none; }
.base-results { display: grid; gap: 6px; }
.base-group-title { margin: 8px 6px 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.base-tray { padding-top: 6px; }
/* Фильтры в шторке: чипы переносятся, а не прокручиваются вбок — всё видно сразу */
.base-filters { display: grid; gap: 12px; }
.filter-box.in-sheet { margin: 0; padding: 4px 0; border: 0; background: none; box-shadow: none; overflow: visible; }
.filter-box.in-sheet .chips-scroll { flex-wrap: wrap; overflow: visible; padding: 2px 0 !important; }
.base-filters-foot { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin: 12px calc(-1 * var(--page-x, 16px)) 0; padding: 10px var(--page-x, 16px) max(12px, env(safe-area-inset-bottom)); background: var(--edit-bg, var(--bg)); border-top: 1px solid var(--edit-line, var(--line)); }
/* ---------- Нижняя панель: 4 вкладки ---------- */
.tabbar { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 760px) {
  .tabbar { grid-template-columns: repeat(4, 120px); }
}
html[data-role="worker"] .tab:not([data-view="base"]):not([data-view="more"]) { display: none; }
html[data-role="worker"] .tab[data-view="base"] { display: grid; }
/* ===== next2.css ===== */
/* GrainFlow 2, заход 2: карусель результатов, жесты, главная цифра, «Сравнить», избранные маршруты */
/* ---------- Результаты расчёта каруселью ---------- */
.rc-bar { display: flex; align-items: center; gap: 10px; margin: 2px 2px 8px; }
.rc-pos { color: var(--muted); font-size: var(--fs-s); font-weight: 700; }
.rc-dots { display: flex; gap: 5px; flex: 1; justify-content: center; }
.rc-dots i { width: 6px; height: 6px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--text) 20%, transparent); transition: width .3s var(--spring, ease), background .2s ease; }
.rc-dots i.is-on { width: 18px; background: var(--accent); }
.rc-mode { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--accent); font: inherit; font-size: var(--fs-xs); font-weight: 700; }
.rc-carousel { display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% - 28px); gap: 10px; align-items: start; margin: 0 calc(-1 * var(--page-x, 16px)) 12px; padding: 4px var(--page-x, 16px) 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--page-x, 16px); scrollbar-width: none; }
.rc-carousel::-webkit-scrollbar { display: none; }
.rc-carousel > .result-card { scroll-snap-align: start; margin: 0 !important; min-width: 0; }
@media (min-width: 760px) {
  .rc-carousel { grid-auto-columns: calc(50% - 6px); }
}
/* ---------- Жесты в списках ---------- */
.list-tray > .entity { z-index: 1; background-clip: padding-box; }
.list-tray > .entity:not(.is-swiping) { transition: transform .45s var(--spring, ease), background .15s ease; }
/* ---------- Карточка: главная цифра сверху ---------- */
.gf-hero { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-l); background: var(--edit-card, var(--surface)); }
.gf-hero-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gf-hero-price b { font-size: var(--fs-3xl); line-height: 1; font-weight: 800; letter-spacing: -.035em; }
.gf-hero-price span { color: var(--muted); font-weight: 700; }
.gf-hero-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gf-hero-main > span { display: grid; gap: 2px; }
.gf-hero-main b { font-size: var(--fs-2l); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.gf-hero-main small { color: var(--muted); font-size: var(--fs-xs); }
.gf-hero-sub { margin: 0; color: var(--muted); font-size: var(--fs-s); }
.gf-hero-sub.is-stale { color: var(--negative); font-weight: 600; }
.gf-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gf-hero-chips span { padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); }
.gf-compare-btn { justify-self: start; padding: 7px 12px; border: 1px solid var(--accent); border-radius: var(--r-pill); background: none; color: var(--accent); font: inherit; font-size: var(--fs-s); font-weight: 700; }
.gf-compare-btn.is-on { background: var(--accent); color: var(--on-accent); }
/* ---------- «Сравнить» ---------- */
.gf-compare-pill { position: fixed; z-index: 45; left: 50%; bottom: calc(var(--tabbar-h, 64px) + var(--safe-b, 0px) + 14px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 0; border-radius: var(--r-pill); color: var(--surface); font: inherit; font-weight: 800; font-size: var(--fs-s); box-shadow: var(--shadow-2); }
.gf-compare-pill[hidden] { display: none; }
.gf-compare-pill .icon { width: 16px; height: 16px; }
body.modal-open .gf-compare-pill { display: none; }
.gf-compare { display: grid; gap: 12px; }
.gf-cmp-scroll { overflow-x: auto; margin: 0 -2px; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-m); background: var(--edit-card, var(--surface)); }
.gf-cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.gf-cmp th, .gf-cmp td { padding: 10px 10px; border-bottom: 1px solid var(--edit-line, var(--line)); text-align: left; vertical-align: top; }
.gf-cmp tbody tr:last-child th, .gf-cmp tbody tr:last-child td { border-bottom: 0; }
.gf-cmp tbody th { color: var(--muted); font-weight: 650; white-space: nowrap; }
.gf-cmp thead th { position: sticky; top: 0; background: var(--edit-card, var(--surface)); }
.gf-cmp-name { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 800; text-align: left; }
.gf-cmp .is-best { color: var(--positive); }
.gf-cmp-note { margin: 0; font-size: var(--fs-xs); }
/* ---------- Мои маршруты ---------- */
.t-route-chips { display: grid; gap: 8px; }
.t-route { display: grid; gap: 1px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); color: var(--text); font: inherit; text-align: left; transition: transform .3s var(--spring, ease); }
.t-route b { font-size: var(--fs-s); font-weight: 750; }
.t-route small { color: var(--muted); font-size: var(--fs-xs); }
.t-route:active { transform: scale(.98); transition-duration: .06s; }
.gf-star { color: var(--muted); }
.gf-star.is-on { color: var(--star); }
.gf-star.is-on .icon { fill: currentColor; }
/* ===== next3.css ===== */
/* GrainFlow 2, заход 3: «Сделка» пошагово, аватары, строки перевозчиков, общий стиль */
/* ---------- «Сделка» пошагово ---------- */
#loadForm.deal-steps { display: grid; gap: 10px; padding: 10px; background: transparent; border: 0; box-shadow: none; }
.tabbed > #loadForm.deal-steps { border-radius: 0; }
.step { display: grid; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.step-head { display: flex; align-items: center; gap: 10px; list-style: none; cursor: default; }
.step-head::-webkit-details-marker { display: none; }
.step-num { flex: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: var(--fs-s); font-weight: 800; transition: background .25s ease; }
.step-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.step-title small { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-done { display: none; }
.step-done .icon { width: 20px; height: 20px; }
.step.is-done .step-num { background: var(--positive); }
.step.is-done .step-done { display: inline-flex; }
.step-body { display: grid; gap: 10px; }
.step-body > .field { margin: 0; }
.step-body .inline-list { margin: 0; }
.step-opt > summary { cursor: pointer; }
.step-opt:not([open]) { padding-bottom: 12px; }
.step-opt .step-num { background: color-mix(in srgb, var(--text) 35%, transparent); }
.step-chev { flex: none; width: 18px; height: 18px; color: var(--muted); transform: rotate(90deg); transition: transform .4s var(--spring, ease); }
.step-opt[open] .step-chev { transform: rotate(-90deg); }
#loadForm.deal-steps > .calc-submit { margin-top: 4px; min-height: 54px; border-radius: var(--r-m); font-size: var(--fs-m); }
/* ---------- Аватары в списках ---------- */
/* ---------- Перевозчики: аватар, одна строка «где · тонн · рейсов», машины плашками ---------- */
.gf-carrier-sub { display: block; color: var(--muted); font-size: var(--fs-s); }
.gf-pills { display: flex; flex-wrap: wrap; margin-top: 5px; }
.gf-pill { border-radius: var(--r-pill); font-size: var(--fs-xs); }
.carrier-card .cc-rows { display: block; }
/* ---------- Общий стиль ---------- */
/* Цифры везде ровными столбиками и плотнее */
.num, .entity-price strong, .hero-name { font-variant-numeric: tabular-nums; }
.hero-name { letter-spacing: -.02em; }
/* Карточки результатов — мягче и крупнее радиус, как остальные блоки */
.result-card { border-radius: var(--r-l); }
/* Плавающие элементы — одна тень */
.gf-compare-pill, .base-add { will-change: transform; }
/* ===== next4.css ===== */
/* GrainFlow 2 — заход 4 (13.11, вечер): спокойный интерфейс.
   Алексей: «слишком цветасто, невозможно смотреть, хочется минимализм, чтобы всё чётко».
   Правило: фон — тёплый почти белый (тёмная тема — почти чёрный), один акцент — приглушённый синий,
   всё остальное — оттенки серого. Красный и зелёный — только текстом там, где это сигнал (цена устарела, прибыль). */
/* 13.11, позже: Алексей — «верни мои цвета из GrainFlow 1: зелёный градиент… это блекло, серо».
   Палитра, фон с зелёным градиентом и мятная подложка списков — как в рабочем приложении (styles.css).
   Здесь меняется только то, что Алексей просил убрать: тёмно-синяя шапка окон (теперь светлая, с переходом). */
:root { --edit-head: var(--edit-bg); }
/* ---------- Шапка: логотип всегда по центру, без отдельных заголовков ---------- */
.appbar .brand { visibility: visible !important; }
.appbar-title { display: none; }
html.is-scrolled .appbar { background: color-mix(in srgb, var(--bg) 82%, transparent); box-shadow: 0 1px 0 var(--line); }
html.is-scrolled .appbar::before { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.brand-name { color: var(--text); }
.large-title { font-size: var(--fs-xl); font-weight: 750; letter-spacing: -.022em; }
/* ---------- Цвет только по делу: никаких цветных плашек-значков ---------- */
.t-ico, .more-ico { background: var(--surface-2); color: var(--text); }
.t-ico { width: 30px; height: 30px; border-radius: var(--r-xs); }
.t-q .icon { background: transparent; padding: 0 !important; }
.gf-hero-chips span { background: var(--surface-2); color: var(--text); font-weight: 600; }
.gf-pill.is-miss { background: transparent; padding: 0; color: var(--warning); }
.gf-pill { background: transparent; padding: 0; color: var(--muted); font-weight: 600; }
.gf-pill + .gf-pill::before { content: "· "; color: var(--faint); }
.gf-pills { gap: 0 6px; }
.tab.has-news::before { background: var(--accent); border-color: var(--bg); }
.gf-compare-pill { background: var(--text); }
/* Значок строки списка — тонкий и серый, без заливки; «договор» и тонны — текстом */
.row-tile { background: transparent !important; border: 0; color: var(--faint) !important; box-shadow: none; }
.row-tile .icon { color: var(--faint); }
.row-tile.is-contract, .row-tile.is-contract * { color: var(--accent) !important; }
.row-tile b { color: var(--text); }
/* Звонок — обычная кнопка, не зелёная */
.sheet-body a.action[href^="tel:"] > .icon, .sheet-body .action[data-detail-action="call-pick"] > .icon { background: var(--surface) !important; color: var(--accent); }
.carrier-card .driver-call, .cp-row .driver-call, .call-contact-icon { background: var(--surface-2); color: var(--accent); }
.sheet-body .action > .icon { box-shadow: none; border: 1px solid var(--line) !important; background: var(--surface) !important; }
/* ---------- Окна снизу: шапка не тёмно-синяя, а мягкий переход от акцента к фону окна ---------- */
.sheet-edit .sheet-head { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--edit-bg)) 0%, var(--edit-bg) 100%) !important; color: var(--text); min-height: 64px; }
.sheet-edit .sheet-title { color: var(--text); font-size: var(--fs-l); letter-spacing: -.015em; }
.sheet-edit .sheet-head .icon-btn { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.sheet-edit .sheet-grabber { background: color-mix(in srgb, var(--text) 22%, transparent) !important; }
.sheet-edit .sheet-body { background: var(--edit-bg); }
.sheet-edit .sheet-grabber + .sheet-head, .sheet-edit .sheet > .sheet-grabber { background-color: transparent; }
.sheet-edit .sheet { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--edit-bg)) 0, var(--edit-bg) 120px); }
.sheet-edit .form-group-title { border-bottom-color: var(--edit-line); }
.sheet-edit.sheet-overlay.is-open { background: rgba(10, 12, 16, .42); }
/* ---------- Вместо чипов — тихие текстовые вкладки с линией под выбранной ---------- */
.chips .chip:not(.chip-check), .filter-chips .chip, #cultureChips .chip, #rateCultures .chip { min-height: 34px; padding: 6px 2px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: var(--muted) !important; font-weight: 600; box-shadow: inset 0 -2px 0 transparent; transition: color .2s ease, box-shadow .3s var(--spring, ease); }
.chips .chip:not(.chip-check).is-active, .filter-chips .chip.is-active, #cultureChips .chip.is-active, #rateCultures .chip.is-active, .chips .chip[aria-pressed="true"], .chips .chip[aria-checked="true"] { color: var(--text) !important; box-shadow: inset 0 -2px 0 var(--accent); background: transparent !important; }
.chips-compact { gap: 4px 16px !important; }
/* Флажки (несколько вариантов): квадратная галочка и текст, без пузырей */
.chip.chip-check { padding: 6px 0 !important; border: 0 !important; background: transparent !important; color: var(--text) !important; gap: 8px; }
.chip.chip-check::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: var(--r-xs); border: 1.5px solid var(--line-strong); background: var(--surface); transition: background .2s ease, border-color .2s ease; }
.chip.chip-check:has(input:checked)::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.chip.chip-check:has(input:checked) { color: var(--text) !important; }
/* ---------- Переключатели с бегунком, который плавно едет ---------- */
.seg-nav { position: relative; background: color-mix(in srgb, var(--text) 6%, transparent); isolation: isolate; }
.seg-nav::before { content: ""; position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 3)); border-radius: var(--r-xs); background: var(--surface); box-shadow: var(--shadow-0); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .5s var(--spring, var(--ease-soft)); }
html.dark .seg-nav::before { background: color-mix(in srgb, var(--text) 14%, var(--surface)); }
.seg-nav > .seg-btn, .seg-nav > .seg-btn.is-active, .base-seg .seg-btn.is-active { background: transparent !important; box-shadow: none !important; }
.seg-nav > .seg-btn.is-active { color: var(--text); }
/* ---------- Плавные переходы: «База» и «Сделка» ---------- */
@keyframes gfFadeSlide { from { opacity: 0; transform: translateX(calc(var(--seg-dir, 1) * 14px)); } to { opacity: 1; transform: none; } }
#plantsView.is-active > .list, #farmersView.is-active > .list, #carriersView.is-active > .list, #plantsView.is-active > .tabbed, #farmersView.is-active > .tabbed, #carriersView.is-active > .tabbed, #carriersView.is-active > .carrier-finder-box { animation: gfFadeSlide .45s var(--spring, ease) both; }
#plantsView.is-active, #farmersView.is-active, #carriersView.is-active { animation: none !important; }
#calculatorView [data-pane]:not([hidden]) { animation: gfFadeSlide .45s var(--spring, ease) both; }
@media (prefers-reduced-motion: reduce) {
  #calculatorView [data-pane], .list, .tabbed { animation: none !important; }
  .seg-nav::before { transition: none; }
}
/* ---------- «Сделка»: без номеров 1-2-3, просто подписи разделов ---------- */
.step-num { display: none; }
.step { gap: 8px; padding: 14px; box-shadow: none; border-color: var(--line); }
.step-title b { font-weight: 700; text-transform: uppercase; }
.step.is-done .step-title b { color: var(--muted); }
.step-done { color: var(--accent); }
.step-opt .step-title b { text-transform: uppercase; }
#loadForm.deal-steps > .calc-submit { box-shadow: none; }
/* ---------- «Сегодня»: компактно ---------- */
.t-card { box-shadow: none; border-color: var(--line); gap: 10px; }
.t-hello .large-title { font-size: var(--fs-2l); }
.t-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.t-q { flex-direction: column; justify-content: center; gap: 6px; min-height: 74px; padding: 8px 4px; font-size: var(--fs-xs); font-weight: 650; text-align: center; box-shadow: none; }
.t-q .icon { width: 22px; height: 22px; color: var(--accent); }
.t-attn { display: grid; }
.t-attn-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 2px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; }
.t-attn-row:first-child { border-top: 0; }
.t-attn-row .icon { flex: none; width: 20px; height: 20px; color: var(--muted); }
.t-attn-row span { flex: 1; min-width: 0; display: grid; gap: 1px; }
.t-attn-row small { color: var(--muted); font-size: var(--fs-xs); }
.t-attn-row b.num { font-size: var(--fs-l); }
.t-attn-row b.is-alert { color: var(--negative); }
.t-chev { width: 16px !important; height: 16px !important; color: var(--faint) !important; }
.t-market-range { width: 100%; accent-color: var(--accent); }
.t-market-km { color: var(--muted); font-size: var(--fs-xs); }
.t-more { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.t-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; list-style: none; font-weight: 700; cursor: pointer; }
.t-more > summary::-webkit-details-marker { display: none; }
.t-more > summary .icon { width: 16px; height: 16px; color: var(--faint); transform: rotate(90deg); transition: transform .4s var(--spring, ease); }
.t-more[open] > summary .icon { transform: rotate(-90deg); }
.t-more-body { display: grid; gap: 10px; padding: 0 14px 14px; }
.t-more .t-card { border: 0; padding: 0; background: none; }
/* ---------- Карточки результатов и окна — спокойнее ---------- */
.result-card { box-shadow: none; border: 1px solid var(--line); }
.hero-kicker { color: var(--muted); }
.pill-positive, .pill-warning { background: var(--surface-2); color: var(--text); }
.gf-hero { box-shadow: none; }
.more-card, .filter-box, .card, .t-card, .step { box-shadow: none !important; }
/* ===== next5.css ===== */
/* GrainFlow 2 — заход 5: «Сделка → Завод», новый обзвон, фильтры списком с галочками */
/* ---------- «Завод» ---------- */
.plant-pane { display: grid; gap: 10px; padding: 12px; }
.tabbed > .plant-pane { border-top-left-radius: var(--r-l); margin-top: 0; }
.plant-pane-intro { margin: 0 2px; color: var(--muted); font-size: var(--fs-s); line-height: 1.35; }
.plant-pane-search { margin: 0 !important; }
.pp-chev { flex: none; width: 16px; height: 16px; color: var(--faint); }
.seg-nav > .seg-btn { font-size: var(--fs-s); }
/* ---------- Новый обзвон: крупные кнопки, всё нажатиями ---------- */
.cq { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-m); background: var(--edit-card, var(--surface)); }
.cq-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.cq-label small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.qb-grid { display: grid; gap: 6px; }
.qb-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qb-rates { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.qb-row { display: flex; gap: 6px; flex-wrap: wrap; }
.qb-trucks .qb { flex: 1; min-width: 44px; }
.qb { display: grid; place-items: center; gap: 1px; min-height: 42px; padding: 6px 8px; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-s); background: var(--edit-input, var(--surface-2)); color: var(--text); font: inherit; font-size: var(--fs-s); font-weight: 650; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .3s var(--spring, ease); }
.qb:active { transform: scale(.96); transition-duration: .06s; }
.qb.is-on, .qb.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.qb-rate b { font-size: var(--fs-s); }
.qb-rate small { font-size: var(--fs-2xs); font-weight: 600; opacity: .75; }
.cq-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.qb-seg { display: flex; gap: 0; padding: 3px; border-radius: var(--r-s); background: var(--edit-input, var(--surface-2)); border: 1px solid var(--edit-line, var(--line)); }
.qb-seg .qb { min-height: 34px; padding: 4px 8px; border: 0; background: transparent; font-size: var(--fs-xs); }
.qb-seg .qb.is-on, .qb-seg .qb.is-active { background: var(--accent); color: var(--on-accent); }
.cq-agreed { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.cq-agreed input { width: 22px; height: 22px; min-height: 0; accent-color: var(--positive); }
.cq textarea { min-height: 64px; }
.call-callback { padding: 10px; }
/* ---------- Фильтры в шторке — список с галочками, как в «Настройках» iPhone ---------- */
.filter-box.in-sheet { display: grid; gap: 14px; }
.filter-box.in-sheet .chips { display: grid; gap: 0; overflow: hidden !important; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-m); background: var(--edit-card, var(--surface)); padding: 0 !important; }
.filter-box.in-sheet .filter-chips-2:not([hidden]) { margin-top: 0; padding-top: 0; border-top: 1px solid var(--edit-line, var(--line)); }
.filter-box.in-sheet .chip { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; color: var(--text); font-weight: 600; text-align: left; box-shadow: none; }
.filter-box.in-sheet .chip + .chip { border-top: 1px solid var(--edit-line, var(--line)); }
.filter-box.in-sheet .chip::after { content: ""; width: 18px; height: 18px; flex: none; }
.filter-box.in-sheet .chip.is-active::after { background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / contain no-repeat; }
/* переключатель подстраивается под число пунктов (в «Сделке» их теперь 4) */
.seg-nav { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
/* ===== next6.css ===== */
/* GrainFlow 2 — заход 6: шрифт и контраст, закупка фермера, фильтры подбора, новые «Цены фермерам» */
/* ---------- Шрифт Manrope (как в первом макете GrainFlow 2) и серый текст контрастнее ---------- */
:root { --muted: #4f5966; --faint: #8a939c; }
:root.dark { --muted: #aab3bb; --faint: #7d868e; }
body, button, input, select, textarea { font-family: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
.brand-name { font-family: inherit; }
/* логотип — как был (свой шрифт в styles.css) */
.appbar .brand-name { font-family: "Righteous", "Marck Script", sans-serif; }
.field-label, .inline-label, .step-title small, .entity-sub, .muted, small { color: var(--muted); }
.inline-label { font-weight: 600; }
.step-title b { color: var(--text) !important; font-size: var(--fs-xs); letter-spacing: .05em; }
input::placeholder, textarea::placeholder { color: var(--faint); }
/* ---------- Карточка фермера в «Сделке» ---------- */
.farmer-info { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.fi-main { display: grid; gap: 1px; }
.fi-main b { font-weight: 800; }
.fi-main small { font-size: var(--fs-xs); }
.fi-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fi-cells span { display: grid; gap: 1px; padding: 8px 10px; border-radius: var(--r-s); background: var(--surface); }
.fi-cells small { font-size: var(--fs-xs); font-weight: 600; }
.fi-cells b { font-size: var(--fs-l); font-weight: 800; letter-spacing: -.01em; }
.fi-cells i { font-style: normal; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.fi-fresh { margin: 0; color: var(--muted); font-size: var(--fs-xs); }
.fi-fresh.is-stale { color: var(--negative); font-weight: 600; }
/* ---------- «Подбор»: кнопка «Фильтры» в форме и строка в результатах ---------- */
.match-filter-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--text); font: inherit; text-align: left; }
.match-filter-btn > .icon { flex: none; width: 18px; height: 18px; color: var(--accent); }
.match-filter-btn span { flex: 1; min-width: 0; display: grid; gap: 1px; }
.match-filter-btn small { font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-filter-btn.is-on { border-color: var(--accent); }
.match-filter-btn.is-on small { color: var(--accent); font-weight: 600; }
.mf-chev { flex: none; width: 16px !important; height: 16px !important; color: var(--faint) !important; }
.match-filter-line { display: block; margin: 6px 0 2px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-s); text-align: left; }
.match-filter-line b { color: var(--accent); }
.mf-title { margin: 6px 4px 6px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
/* ---------- «Цены фермерам» ---------- */
.dm-top { display: grid; gap: 10px; }
.dm-cultures { margin: 0 !important; }
.deal-status { margin: 4px 2px; color: var(--muted); font-size: var(--fs-xs); }
.dm-group-title { display: grid; gap: 1px; margin: 14px 4px 6px; font-weight: 800; font-size: var(--fs-m); }
.dm-group-title small { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.dm-group { overflow: hidden; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-m); background: var(--edit-card, var(--surface)); }
.dm-row + .dm-row { border-top: 1px solid var(--edit-line, var(--line)); }
.dm-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; }
.dm-head:active { background: var(--surface-2); }
.dm-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dm-main b { font-weight: 800; }
.dm-main small { font-size: var(--fs-xs); }
.dm-verdict { justify-self: start; margin-top: 3px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.dm-verdict.is-ok { color: var(--positive); }
.dm-verdict.is-no { color: var(--negative); }
.dm-offer { flex: none; display: flex; align-items: baseline; gap: 3px; }
.dm-offer b { font-size: var(--fs-2l); font-weight: 800; letter-spacing: -.02em; }
.dm-offer small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.dm-row.is-open { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dm-detail { display: grid; gap: 10px; padding: 0 14px 14px; animation: gfFadeSlide .35s var(--spring, ease) both; --seg-dir: 0; }
.dm-calc { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface); font-size: var(--fs-s); }
.dm-calc span { color: var(--muted); }
.dm-calc b { text-align: right; font-weight: 700; }
.dm-calc .dm-total { color: var(--text); font-weight: 800; padding-top: 4px; border-top: 1px solid var(--line); }
.dm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.dm-actions .btn { min-height: 42px; }
.dm-map { margin-top: 12px; border: 1px solid var(--edit-line, var(--line)); border-radius: var(--r-m); background: var(--edit-card, var(--surface)); overflow: hidden; }
.dm-map > summary { padding: 12px 14px; font-weight: 700; color: var(--accent); cursor: pointer; list-style: none; }
.dm-map > summary::-webkit-details-marker { display: none; }
.dm-map .deal-map-canvas { height: 280px; }
/* ===== next7.css ===== */
/* GrainFlow 2 — этап 1 (14.11): единый дизайн-код.
   Одни и те же правила для всех списков, блоков, переключателей и кнопок. Цвета — GrainFlow 1. */
/* ---------- Токены единого кода ---------- */
:root { /* блоки и карточки */ /* кнопки, поля, плашки */ --gf-row-min: 60px; /* строка любого списка */ --gf-row-pad: 12px 14px; --gf-sep: color-mix(in srgb, var(--text) 12%, transparent); /* линия между строками — заметная */ --gf-border: var(--line); /* окантовка блоков */ }
:root.dark { --line: rgba(255, 255, 255, .10); --line-strong: rgba(255, 255, 255, .16); --gf-sep: rgba(255, 255, 255, .13); --gf-border: rgba(255, 255, 255, .14); --edit-line: rgba(255, 255, 255, .16); }
/* ---------- Все блоки: одинаковый радиус и окантовка (в тёмной теме — заметная) ---------- */
.card, .t-card, .step, .more-card, .filter-box, .result-card, .rate-card, .match-card, .gf-hero, .dm-group, .cq, .t-more, .farmer-info, .plant-pane, .base-results .list-tray, .t-q, .match-filter-btn, .base-filter { border: 1px solid var(--gf-border) !important; }
.card, .t-card, .step, .more-card, .result-card, .rate-card, .match-card, .gf-hero, .dm-group, .t-more, .plant-pane { border-radius: var(--gf-radius) !important; }
:root.dark .card, :root.dark .t-card, :root.dark .step, :root.dark .more-card, :root.dark .result-card, :root.dark .rate-card, :root.dark .match-card, :root.dark .gf-hero, :root.dark .dm-group, :root.dark .cq, :root.dark .t-more, :root.dark .t-q, :root.dark .sheet-edit .form-group, :root.dark .call-contact, :root.dark .qb, :root.dark .inline-list { box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 8px 24px rgba(0, 0, 0, .35) !important; }
:root.dark .btn-secondary, :root.dark .icon-btn, :root.dark .sort-pill, :root.dark .list-tools .chip { border: 1px solid var(--gf-border); }
/* ---------- Все списки: одна строка — одна запись, чётко отделены линией ---------- */
.list-tray > .entity, .t-attn-row, .dm-head, .more-row, .card.rows > .history-item, .cp-row, .call-entry { min-height: var(--gf-row-min); }
.list-tray > .entity + .entity::before, .more-row + .more-row::before { background: var(--gf-sep); height: 1px !important; }
.t-attn-row { border-top-color: var(--gf-sep) !important; }
.dm-row + .dm-row { border-top-color: var(--gf-sep); }
.card.rows > .history-item + .history-item, .card.rows > * + * { border-top: 1px solid var(--gf-sep); }
.list-tray > .entity { padding: var(--gf-row-pad) !important; }
.entity-title, .dm-main b, .t-attn-row b, .row-title { font-weight: 750; }
/* ---------- Выбор культуры (и любой выбор вкладкой) — заметнее: плашка акцентного цвета ---------- */
#cultureChips .chip, #rateCultures .chip, .dm-cultures .chip, .chips .chip:not(.chip-check) { padding: 7px 12px !important; border-radius: var(--r-s) !important; box-shadow: none !important; }
#cultureChips .chip.is-active, #rateCultures .chip.is-active, .dm-cultures .chip.is-active, .chips .chip:not(.chip-check).is-active, .chips .chip[aria-pressed="true"], .chips .chip[aria-checked="true"] { background: var(--accent) !important; color: var(--on-accent) !important; font-weight: 750; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent) !important; }
.chips:not(.chips-compact) { gap: 6px 6px; }
/* в шторке фильтров — список с галочками (как было), без плашек */
.filter-box.in-sheet .chip.is-active { background: transparent; color: var(--accent); box-shadow: none; }
.filter-box.in-sheet .chip { padding: 0 16px !important; border-radius: 0; }
/* ---------- Переключатели — всегда на всю ширину; «Фильтры» и «Сортировка» — своей строкой ниже ---------- */
.base-row { grid-template-columns: 1fr; gap: 8px; }
.base-filter { width: 100%; justify-content: center; }
@media (max-width: 380px) {
  .base-filter span { display: inline; }
}
.seg-nav { width: 100%; }
.seg-nav > .seg-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* значки разные: воронка — фильтры, стрелки — сортировка */
.sort-pill > .icon { color: var(--muted); }
/* ---------- Раскрывашки ---------- */
details > summary { cursor: pointer; }
/* высоту ведёт next7.js (одинаково в Chrome и Safari) — встроенный переход Chrome выключен, чтобы не было двойного движения */
details:not([data-no-anim])::details-content { transition: none !important; }
details.is-opening { overflow: hidden; }
/* ---------- Плавность без рывков: анимируем только transform и opacity ---------- */
/* размытие под окнами во весь экран — дорого для телефона, отсюда рывки; затемнение без размытия */
.sheet-overlay.is-open, .popover-overlay, .user-picker, .sheet-edit.sheet-overlay.is-open { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.sheet-overlay.is-open { background: rgba(8, 12, 16, .45); }
/* тени и фон — без анимации (перерисовка каждого кадра) */
.card-tab, .chip, .qb, .t-q, .more-row, .entity { transition-property: transform, opacity, color, background-color !important; }
.sheet { contain: layout paint; }
.rc-carousel > .result-card { contain: content; }
/* ===== next8.css ===== */
/* GrainFlow 2 — этап 2 (14.11): «Прикинуть», «Кто повезёт», подбор карточками, фильтры с несколькими пунктами, «Цены фермерам» */
/* ---------- «Прикинуть» ---------- */
.try { display: grid; gap: 12px; }
.try-out { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--gf-radius-s, 12px); background: color-mix(in srgb, var(--positive) 9%, var(--surface)); }
.try-out.negative { background: color-mix(in srgb, var(--negative) 9%, var(--surface)); }
.try-label { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.try-profit { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.try-out.positive .try-profit { color: var(--positive); }
.try-out.negative .try-profit { color: var(--negative); }
.try-out small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.try-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.try-vals > span { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--gf-border, var(--line)); border-radius: var(--r-s); }
.try-vals small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.try-vals b { font-size: var(--fs-l); font-weight: 800; }
.try-vals i { font-style: normal; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.try-slider { display: grid; gap: 6px; }
.try-slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; }
.try-slider-head small { color: var(--faint); font-size: var(--fs-xs); font-weight: 600; }
.try-slider input[type="range"] { width: 100%; }
.try-target { margin: 0; padding: 8px 10px; border-radius: var(--r-s); background: var(--surface-2); color: var(--muted); font-size: var(--fs-s); }
.try-target b { color: var(--text); }
.try-reset { min-height: 42px; }
/* ---------- Подбор: «Кто повезёт» свёрнуто, карточки листаются ---------- */
.mc-carriers { margin-top: 10px; border: 1px solid var(--gf-border, var(--line)); border-radius: var(--gf-radius-s, 12px); }
.mc-carriers > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; list-style: none; font-weight: 700; }
.mc-carriers > summary::-webkit-details-marker { display: none; }
.mc-carriers > summary > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-carriers > summary > .icon:first-child { color: var(--accent); }
.mc-carriers > summary > b { color: var(--muted); font-weight: 700; }
.mc-chev { color: var(--faint); transform: rotate(90deg); transition: transform .3s var(--spring, ease); }
.mc-carriers[open] .mc-chev { transform: rotate(-90deg); }
.mc-carriers .carrier-pick { margin: 0; padding: 0 12px 10px; }
.mc-carousel > .match-card { scroll-snap-align: start; margin: 0 !important; min-width: 0; contain: content; }
.match-card .match-open { margin-top: 10px; }
/* ---------- Фильтры ---------- */
.mf-hint { margin: 0 4px 2px; color: var(--faint); font-size: var(--fs-xs); }
/* ---------- «Цены фермерам» ---------- */
.dm-cultures .chip small { margin-left: 6px; opacity: .75; font-weight: 700; }
.dm-cultures .chip[data-empty] { opacity: .5; }
.dm-profit b { font-size: var(--fs-l); }
.dm-profit.is-ok b { color: var(--positive); }
.dm-profit.is-no b { color: var(--negative); }
.dm-note { margin: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
/* ---------- «Завод»: каждый завод — отдельная карточка ---------- */
.plant-pane-list { display: grid; gap: 8px; margin: 2px 0 0 !important; border-top: 0; }
.pp-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--gf-border, var(--line)); border-radius: var(--r-m); background: var(--surface); color: var(--text); font: inherit; text-align: left; box-shadow: var(--shadow-0); transition: transform .2s var(--spring, ease), background-color .2s ease; }
.pp-card:active { transform: scale(.985); background: var(--surface-2); }
:root.dark .pp-card { background: color-mix(in srgb, #fff 4%, var(--surface)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 6px 18px rgba(0, 0, 0, .3); }
.pp-tile { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-s); background: var(--surface-2); color: var(--faint); }
.pp-tile .icon { width: 20px; height: 20px; }
.pp-tile.is-signed { background: var(--accent-soft); color: var(--accent); }
.pp-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pp-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-sub { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-signed { color: var(--accent); font-weight: 700; }
.pp-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.pp-pill { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 8px; border-radius: var(--r-xs); background: var(--surface-2); font-size: var(--fs-xs); }
:root.dark .pp-pill { background: rgba(255, 255, 255, .06); }
.pp-pill small { color: var(--muted); font-weight: 600; }
.pp-pill b { font-weight: 800; }
.pp-pill.is-more { color: var(--muted); font-weight: 700; }
.pp-noprice { font-style: italic; }
/* ===== next9.css ===== */
/* GrainFlow 2 — этап 3 (14.11): «Сегодня», тема, вход */
/* ---------- Кнопка темы — всегда в шапке, рядом с колокольчиком ---------- */
#themeButton { display: inline-flex !important; align-items: center; justify-content: center; }
#themeButton.is-manual::after { content: ""; position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
#themeButton { position: relative; }
#themeButton .icon { transition: transform .45s var(--spring, ease); }
#themeButton:active .icon { transform: rotate(40deg) scale(.9); }
/* ---------- «Сегодня»: быстрые кнопки с понятными подписями ---------- */
.t-q span { line-height: 1.15; }
/* ---------- «Договорились» ---------- */
.t-sub-title { margin: 2px 2px 2px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.t-agreed > .icon { color: var(--positive); }
.t-day { padding: 3px 8px; border-radius: var(--r-xs); background: var(--surface-2); font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }
.t-day.is-today { background: color-mix(in srgb, var(--positive) 16%, transparent); color: var(--positive); }
/* ---------- Рынок перевозки: плечо, ставка и ₽/км — каждое в своей ячейке ---------- */
.t-mk { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; margin: 4px 0 10px; }
.t-mk-cell { display: grid; align-content: start; gap: 1px; padding: 9px 10px; border: 1px solid var(--gf-border, var(--line)); border-radius: var(--r-s); }
.t-mk-cell small { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.t-mk-cell b { font-size: var(--fs-ml); font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.t-mk-cell i { font-style: normal; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.t-mk-cell.is-km { border-color: var(--accent); background: var(--accent-soft); }
.t-mk-cell.is-km b { color: var(--accent); }
.t-mk-cell.is-rate { background: color-mix(in srgb, var(--positive) 8%, transparent); }
.t-mk-slider { display: grid; gap: 6px; }
.t-mk-slider > span { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.t-mk-slider input { width: 100%; }
.t-market-km { display: flex; justify-content: space-between; }
/* ---------- PIN: точка «впрыгивает», нажатие отзывается, успех — зелёным ---------- */
.auth-screen { animation: gfAuthIn .38s var(--ease-soft) both; }
@keyframes gfAuthIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes gfAuthCard { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-dots i.is-on:not(:has(+ i.is-on)) { animation: gfPinPop .28s var(--ease-bounce); }
@keyframes gfPinPop { 0% { transform: scale(.4); } 100% { transform: scale(1.05); } }
.auth-key { transition: transform .18s var(--ease-bounce), background-color .15s ease !important; }
.auth-key:active { transform: scale(.88) !important; }
.auth-dots.is-ok i { background: var(--positive); border-color: var(--positive); animation: gfPinOk .38s ease both; }
.auth-dots.is-ok i:nth-child(2) { animation-delay: .04s; }
.auth-dots.is-ok i:nth-child(3) { animation-delay: .08s; }
.auth-dots.is-ok i:nth-child(4) { animation-delay: .12s; }
@keyframes gfPinOk { 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .auth-screen, .auth-card, .auth-dots i { animation: none !important; }
}
/* ===== next10.css ===== */
/* GrainFlow 2 — правки 14.11 (ночь) */
/* ---------- PIN: при вводе двигаются только точки (карточка больше не появляется заново на каждую цифру) ---------- */
.auth-card { animation: none !important; }
/* ---------- Списки: цена — не кнопка, нажатие открывает карточку; цену меняем в «Изменить» ---------- */
.entity [data-quick-price] { pointer-events: none; cursor: default; }
/* ---------- Карточка расчёта: три ячейки ровно — подпись, цифра, пояснение на одних уровнях ---------- */
.rc-stats .stat { display: grid; grid-template-rows: auto auto auto; align-content: start; gap: 2px; }
.rc-stats dt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-stats dd { margin: 0; white-space: nowrap; }
.rc-stats .stat > small { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
/* ---------- Свайп вкладок: соседняя вкладка рядом, без анимаций появления ---------- */
html, body { overflow-x: clip; }
#calculatorView, #calculatorView .tabbed, main { position: relative; }
/* ---------- «Подбор»: цифры в карточке нажимаются — выпадает ползунок ---------- */
.match-card [data-mt] { position: relative; cursor: pointer; border: 1px solid transparent; transition: border-color .2s ease, background-color .2s ease; -webkit-tap-highlight-color: transparent; }
.match-card [data-mt]::after { content: ""; position: absolute; right: 8px; top: 9px; width: 6px; height: 6px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg); }
.match-card [data-mt].is-open { border-color: var(--accent); background: var(--accent-soft); }
.match-card [data-mt].is-open::after { transform: rotate(-135deg); top: 12px; border-color: var(--accent); }
.mt-new { color: var(--accent); }
.mt-slot:empty { display: none; }
.mt-panel { display: grid; gap: 6px; margin-top: 10px; padding: 12px; border: 1px solid var(--gf-border, var(--line)); border-radius: var(--r-s); }
.mt-panel input[type="range"] { width: 100%; }
.mt-panel .try-slider-head b { color: var(--accent); }
.mt-reset { display: block; margin: 8px auto 0; padding: 6px 12px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--accent); font: inherit; font-size: var(--fs-xs); font-weight: 700; }
.match-card.is-trying .match-profit small { color: var(--accent); font-weight: 700; }
/* ---------- Обзвон: «Перевозчик и рейс» и «Переговоры» — два отдельных блока ---------- */
.call-block { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-l); margin-bottom: 14px; }
.call-block-info { background: var(--surface-2); border: 1px solid var(--gf-border, var(--line)); }
.call-block-talk { border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.call-block-title { margin: 0 2px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.call-block-talk > .call-block-title { color: var(--accent); }
.call-block > .form-group, .call-block > .cq { margin: 0 !important; }
/* ---------- Избранное ---------- */
.fav-star { color: var(--faint); }
.fav-star.is-on, .fav-toggle.is-on .icon { color: var(--star); }
.fav-star.is-on .icon { fill: currentColor; }
.fav-mark { width: 13px; height: 13px; margin-right: 4px; vertical-align: -1px; color: var(--star); fill: currentColor; }
.fav-toggle { margin-bottom: 12px; }
.fav { display: grid; gap: 12px; }
.fav-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.fav-tabs::-webkit-scrollbar { display: none; }
.fav-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--gf-border, var(--line)); border-radius: var(--r-s); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-s); font-weight: 650; transition: background-color .2s ease, color .2s ease; }
.fav-tab b { color: var(--muted); font-size: var(--fs-xs); }
.fav-tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fav-tab.is-active b { color: rgba(255, 255, 255, .85); }
.fav-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; align-items: start; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.fav-strip::-webkit-scrollbar { display: none; }
.fav-slide { scroll-snap-align: start; min-width: 0; }
.fav-list { display: grid; gap: 8px; }
.fav-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 12px; border: 1px solid var(--gf-border, var(--line)); border-radius: var(--r-m); background: var(--surface); color: var(--text); font: inherit; text-align: left; transition: transform .2s var(--ease-bounce); }
.fav-row:active { transform: scale(.985); }
.fav-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-s); background: var(--accent-soft); color: var(--accent); }
.fav-ico .icon { width: 18px; height: 18px; }
.fav-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fav-main b { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-main small { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-val { flex: none; font-weight: 800; color: var(--positive); }
.fav-chev { flex: none; width: 16px; height: 16px; color: var(--faint); }
.fav-empty { display: grid; justify-items: center; gap: 6px; margin: 24px 0; color: var(--muted); font-weight: 700; text-align: center; }
.fav-empty .icon { width: 28px; height: 28px; color: var(--faint); }
.fav-empty small { font-weight: 500; font-size: var(--fs-s); }
/* ===== next11.css ===== */
/* GrainFlow 2 — вкладки листает браузер (лента scroll-snap), 14.11 */
.gf-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; align-items: start; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gf-strip::-webkit-scrollbar { display: none; }
.gf-slide { min-width: 0; scroll-snap-align: start; display: grid; gap: 12px; align-content: start; }
.gf-slide > [hidden] { display: revert; }
/* «Сделка»: все вкладки на ленте видны сразу, без анимации появления (иначе моргает при остановке) */
.gf-strip-calc > .gf-slide > [data-pane] { animation: none !important; margin: 0 !important; }
.gf-strip-calc > .gf-slide > [data-pane][hidden] { display: block; }
/* «База»: разделы лежат рядом; лента видна только в «Базе» */
.gf-strip-base { display: none; }
html[data-view="plants"] .gf-strip-base, html[data-view="farmers"] .gf-strip-base, html[data-view="carriers"] .gf-strip-base { display: grid; }
.gf-strip-base > .gf-slide > .view { display: block; animation: none !important; padding-left: 0 !important; padding-right: 0 !important; }
.gf-strip-base > .gf-slide > .view > * { animation: none !important; }
.gf-strip-base .stagger > * { animation: none !important; }
/* «Обзвоны» */
.gf-strip-calls > .gf-slide > div { min-width: 0; }
.gf-strip-calls .stagger > * { animation: none !important; }
/* Вложенные ленты (карточки расчёта, чипы) листаются сами и не утаскивают вкладку */
.gf-strip .rc-carousel, .gf-strip .chips-scroll, .gf-strip .fav-strip { overscroll-behavior-x: contain; }
/* Бегунок переключателя идёт за лентой без запаздывания */
.seg-nav.is-dragging::before { transition: none !important; }
/* «Рейс»: шаги — сами карточки, внешняя рамка формы вокруг них не нужна (Алексей, 14.11) */
.gf-strip #loadForm.deal-steps { border: 0 !important; background: transparent; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* «Подбор»: фильтры — маленький значок рядом с «Списком / Карточками» */
.rc-filter { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--accent); }
.rc-filter .icon { width: 16px; height: 16px; }
.rc-filter.is-on::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
/* шапка «Базы» вынесена над лентой — вне «Базы» её не видно (баг 14.11: оставалась под «Подбором») */
html:not([data-view="plants"]):not([data-view="farmers"]):not([data-view="carriers"]) #baseHead { display: none; }
/* «Подбор» (14.11): без строки «Подбор сделок · …»; сортировка — значком в полоске */
#matchResults .match-head .results-caption { display: none; }
#matchResults.has-rc-bar .match-head .results-head { display: none; }
#matchResults.has-rc-bar .match-head:not(:has(> :not(.results-head):not([hidden]))) { display: none; }
.rc-bar .rc-dots-win { justify-content: center; align-items: center; min-height: 18px; }
/* по центру, как в «Рейсе» */
.rc-dots-win i { flex: 0 0 auto; transition: width .3s var(--spring, ease), transform .25s ease, background .2s ease; }
.rc-dots-win i[hidden] { display: none; }
.rc-dots-win i.is-s { transform: scale(.75); }
.rc-dots-win i.is-xs { transform: scale(.5); }
.rc-sort { overflow: hidden; cursor: pointer; }
.rc-sort select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: var(--fs-m); cursor: pointer; }
/* Приложение с экрана «Домой» (14.11): строка состояния iPhone прозрачная, фон идёт до самого верха.
   Её текст всегда белый — в светлой теме под ним тёмно-зелёная полоса, иначе время и батарею не видно. */
@media (display-mode: standalone) {
  html:not(.dark) body::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: #17352d; z-index: 10000; pointer-events: none; }
}
/* Приложение с экрана «Домой»: iOS размывает полосу под временем и батареей — шапка начинается ниже размытия */
@media (display-mode: standalone) {
  .appbar { padding-top: calc(env(safe-area-inset-top, 0px) + 22px); }
}
/* ===== next12.css ===== */
/* GrainFlow 2 — два режима анимаций (14.11): html.anim-native — ведёт браузер, html.anim-own — мои пружины */
/* ---------- «Браузер»: окно снизу — лента прокрутки. Сверху пустая часть с экран, под ней окно ---------- */
@media (max-width: 759px) {
  html.anim-native .sheet-overlay.ns-on:not(.sheet-dialog) { display: block; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; transition: none; background: transparent; }
  html.anim-native .sheet-edit.sheet-overlay.ns-on { background: transparent; }
  html.anim-native .sheet-overlay.ns-on::-webkit-scrollbar { display: none; }
  html.anim-native .sheet-overlay.ns-on > .ns-spacer { height: 100dvh; scroll-snap-align: start; }
  html.anim-native .sheet-overlay.ns-on > .sheet { margin: 0 auto; transform: none !important; transition: none !important; scroll-snap-align: end; }
}
.ns-spacer { display: none; }
html.anim-native .sheet-overlay.ns-on > .ns-spacer { display: block; }
/* «Браузер»: раскрытый блок — содержимое мягко проявляется средствами CSS */
@keyframes gfNsReveal { from { opacity: 0; } to { opacity: 1; } }
html.anim-native details[open] > :not(summary) { animation: gfNsReveal .22s ease; }
/* ---------- «Свои»: карусели ведёт палец и моя пружина — браузер вбок не листает и не прилипает ---------- */


/* ===== Движение — переработка по apple-design (14.11, поздно) ===== */
/* «Свои»: ленты вкладок и карусели ведёт палец через движок жестов — браузер вбок не листает и не прилипает,
   вертикальная прокрутка остаётся браузеру */
html.anim-own .gf-strip, html.anim-own .rc-carousel, html.anim-own .fav-strip { overflow-x: hidden; scroll-snap-type: none; touch-action: pan-y; }
html.anim-own .is-moving > * { backface-visibility: hidden; }
/* Затемнение под окном — отдельный слой: меняется только его прозрачность (дёшево), фон окна не перекрашивается */
html .sheet-overlay.js-motion, html .sheet-overlay.js-motion.is-open { background: transparent; }
.sheet-overlay.js-motion::before { content: ""; position: fixed; inset: 0; background: rgb(var(--scrim-rgb, 0, 0, 0)); opacity: var(--scrim, 0); pointer-events: none; will-change: opacity; }
.sheet-overlay.js-motion > .sheet { position: relative; z-index: 1; will-change: transform; }
@media (max-width: 759px) {
  html.anim-native .sheet-overlay.ns-on::before { content: ""; position: fixed; inset: 0; background: rgb(8, 12, 16); opacity: calc(.45 * var(--ns-p, 0)); pointer-events: none; will-change: opacity; }
  html.anim-native .sheet-edit.sheet-overlay.ns-on::before { background: rgb(10, 18, 26); opacity: calc(.74 * var(--ns-p, 0)); }
  html.anim-native .sheet-overlay.ns-on > .sheet, html.anim-native .sheet-overlay.ns-on > .ns-spacer { position: relative; z-index: 1; }
}
/* Строки списков: подпись с многоточием должна сжиматься, а не распирать колонку (в сетке нужен min-width: 0) — 14.11 */
.entity-main { grid-template-columns: minmax(0, 1fr); }
.entity-main > *, .entity-sub, .entity-title { min-width: 0; max-width: 100%; } /* при justify-items: start подпись без переноса брала полную длину */
/* Дни недели: 7 равных чипов — общий отступ компактных чипов (16 px, с !important) их сжимал, текст вылезал (14.11) */
.chips-compact.week-days { gap: 6px 12px !important; }
.week-days .chip.chip-check { flex: 0 0 auto; } /* квадратик + «Пн» не влезали в 1/7 ширины — дни по своей ширине, с переносом */

/* Точка прилипания у чипа — только внутри горизонтальной прокрутки чипов. Раньше она стояла у каждого чипа, и в «Рейсе» / «Ставке»
   ряд культур (без своей прокрутки) отдавал свои точки ленте вкладок: лента прилипала к чипу на 236–245 px, а не к вкладке (14.11) */
.chips-scroll > .chip { scroll-snap-align: start; }
.gf-strip .chip { scroll-snap-align: none; } /* внутри лент вкладок у чипов своих точек нет — иначе лента прилипает к чипу */


/* 14.11 (r36): «База» появляется так же, как другие вкладки (внутри ленты анимации выключены, поэтому проявляем ленту и шапку целиком; между Заводами/Фермерами/Перевозчиками — без вспышки) */
.gf-strip-base.gf-enter, #baseHead.gf-enter { animation: viewIn .5s var(--spring, ease-out); } /* класс ставит nextOnView1 только при входе в «Базу» с другой вкладки */
@media (prefers-reduced-motion: reduce) { .gf-strip-base, #baseHead { animation: none !important; } }
/* 14.11: в «системной прокрутке» окно закрывает сама прокрутка — верх окна (ручка, заголовок) должен её пропускать, иначе свайп вниз за край не работал */
html.anim-native .sheet-grabber, html.anim-native .sheet-head { touch-action: pan-y; }
/* ---------- «Выгрузка с чатов» (14.11) ---------- */
.lead-muted { color: var(--muted); font-size: var(--fs-s); }
.lead-search { display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 0 12px; border-radius: var(--r-s); background: var(--field); }
.lead-search .icon { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.lead-search input { background: transparent; padding: 0; }
.lead-chips { gap: 6px; margin-bottom: 8px; }
.lead-chips .chip { min-height: 34px; padding: 0 12px; }
.lead-count { opacity: .6; font-weight: 700; }
.lead-start { margin: 6px 0 12px; }
.lead-list { display: grid; gap: 8px; }
.lead-row .row-tile { background: var(--surface-2); }
.lead-pill.is-done { background: var(--positive-soft); color: var(--positive); }
.lead-pill.is-cb { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.lead-phones { display: grid; gap: 8px; margin-bottom: 8px; }
.lead-call { justify-content: flex-start; font-size: var(--fs-l); font-weight: 750; }
.lead-note.is-ok { padding: 10px 12px; border-radius: var(--r-s); background: var(--positive-soft); }
.lead-card { display: grid; gap: 6px; margin: 10px 0 14px; padding: 14px; }
.lead-card p { margin: 0; }
.lead-more summary { color: var(--accent); font-weight: 700; padding: 6px 0; }
.lead-more p { margin: 4px 0; }
.lead-sample { padding: 8px 10px; border-radius: var(--r-s); background: var(--surface-2); font-size: var(--fs-s); }
.lead-form { display: grid; gap: 4px; }
.lead-label { margin: 10px 0 6px; font-weight: 750; }
.lead-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.lead-log { margin-top: 16px; }
.lead-log p { margin: 4px 0; font-size: var(--fs-s); }
.lead-search input { border: 0; box-shadow: none; }
