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

:root {
  --paper: #f3f5f2;
  --sheet: #ffffff;
  --ink: #14201b;
  --ink-2: #5b6862;
  --ink-3: #8a958f;
  --hair: #e3e8e4;
  --pine: #0e6b50;
  --pine-press: #0a5741;
  --pine-soft: #e3f1ea;
  --mint: #2fbf7f;
  --amber: #a35400;
  --amber-soft: #fff2df;
  --amber-line: #f1d3a6;
  --rose: #b42d23;
  --rose-soft: #fdebe8;
  --series-in: #2a6fdb;
  --series-out: #e0702f;
  --r-sheet: 22px;
  --r-ctl: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  color-scheme: light;

  /* старые имена — для экранов товара */
  --bg: var(--paper);
  --surface: var(--sheet);
  --text: var(--ink);
  --muted: var(--ink-2);
  --line: var(--hair);
  --accent: var(--pine);
  --on-accent: #ffffff;
  --warn: var(--amber);
  --warn-bg: var(--amber-soft);
  --warn-line: var(--amber-line);
  --ok: var(--pine);
  --ok-bg: var(--pine-soft);
  --danger: var(--rose);
  --danger-bg: var(--rose-soft);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Onest', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.previewing { padding-top: 46px; }
body.kb-open { padding-bottom: 16px; }
body.kb-open .tabs { display: none; }
body.sheet-open { overflow: hidden; }

/* Защита экрана сотрудников (ТЗ, раздел 24): водяной знак плиткой, не мешает читать и нажимать */
.watermark {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 36px 28px;
  transform: rotate(-30deg) scale(1.6); opacity: 0.08;
  color: #000; font-size: 15px; font-weight: 600; white-space: nowrap; user-select: none;
}
body.protected { -webkit-user-select: none; user-select: none; }
body.protected input, body.protected textarea { -webkit-user-select: text; user-select: text; }
body.screen-hidden #screen, body.screen-hidden .sheet { filter: blur(24px); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, .rowline:focus-visible {
  outline: 2px solid var(--pine); outline-offset: 2px;
}

main { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; }
main.enter > * { animation: rise 0.32s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: 0.03s; }
main.enter > *:nth-child(3) { animation-delay: 0.06s; }
main.enter > *:nth-child(n+4) { animation-delay: 0.09s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Типографика --- */

.title { font-size: 28px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.12; margin: 0; }
.subtitle { font-size: 13px; color: var(--ink-2); }
.lead { font-size: 15px; color: var(--ink-2); margin: -6px 0 0; line-height: 1.45; }
.note { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.section { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-top: 6px; }
.group-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 4px 4px 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* --- Листы и строки --- */

.card {
  background: var(--sheet); border-radius: var(--r-sheet); padding: 14px 16px;
  border: 1px solid transparent;
}
.card.warn { background: var(--amber-soft); border-color: var(--amber-line); text-align: left; }
.card .label { font-size: 12px; color: var(--ink-2); }
.card.warn .label { color: var(--amber); font-weight: 650; }
.card .value { font-size: 19px; font-weight: 750; margin-top: 2px; letter-spacing: -0.01em; }

.group-wrap { display: flex; flex-direction: column; gap: 8px; }
.group { background: var(--sheet); border-radius: var(--r-sheet); overflow: hidden; }
.rowline {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px;
  padding: 10px 14px; background: transparent; border: 0; text-align: left; position: relative;
  transition: background-color 0.15s;
}
.rowline + .rowline::before {
  content: ''; position: absolute; top: 0; right: 0; left: 62px; height: 1px; background: var(--hair);
}
button.rowline:active { background: #eef2ef; }
.rowline.dim .row-text, .rowline.dim .avatar { opacity: 0.5; }
.rowline.danger .row-text b, .rowline.danger .row-icon { color: var(--rose); }
.rowline.danger .row-icon { background: var(--rose-soft); }
.row-icon {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; background: var(--pine-soft); color: var(--pine);
}
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.row-text b { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-text small { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; }
.row-value { font-size: 14px; font-weight: 650; white-space: nowrap; color: var(--ink); }
.row-chevron { color: var(--ink-3); display: flex; margin-right: -4px; }
.code { font-family: inherit; letter-spacing: 0.14em; }

.badge {
  font-style: normal; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px;
  background: var(--paper); color: var(--ink-2); white-space: nowrap;
}
.badge.accent { background: var(--pine-soft); color: var(--pine); }
.badge.ok { background: var(--pine-soft); color: var(--pine); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--rose-soft); color: var(--rose); }

.live { display: inline-flex; align-items: center; gap: 6px; color: var(--pine); font-weight: 550; }
.live i, .avatar.online::after {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mint); display: inline-block;
  box-shadow: 0 0 0 0 rgba(47, 191, 127, 0.5); animation: beat 2.4s ease-out infinite;
}
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(47, 191, 127, 0.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(47, 191, 127, 0); } }
.lead .live { margin-left: 10px; }
.seen { color: var(--ink-3); font-size: 13px; }
.row-text small .seen { flex-basis: 100%; }
.row-text small span + span::before { content: none; }
.seen.on { color: var(--pine); font-weight: 550; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  background: #e8ece9; color: var(--ink);
}
.avatar.big { width: 64px; height: 64px; font-size: 22px; }
.avatar.online::after { content: ''; position: absolute; right: 0; bottom: 1px; border: 2px solid var(--sheet); }
.avatar.big.online::after { width: 12px; height: 12px; }

/* --- Кнопки и поля --- */

.btn {
  min-height: 54px; border-radius: var(--r-ctl); border: 0; padding: 0 18px;
  background: var(--sheet); font-size: 16px; font-weight: 650;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.12s var(--ease), background-color 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.primary { background: var(--pine); color: #fff; }
.btn.primary:active:not(:disabled) { background: var(--pine-press); }
.btn.link { color: var(--pine); }
.btn.danger-text { color: var(--rose); background: transparent; }
.btn:disabled { opacity: 0.45; }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pill-btn {
  height: 38px; padding: 0 14px 0 10px; border-radius: 999px; border: 0; flex: none; white-space: nowrap;
  background: var(--pine); color: #fff; font-size: 14px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 4px;
}
.pill-btn:active { background: var(--pine-press); }
.text-btn { border: 0; background: transparent; color: var(--pine); font-weight: 650; font-size: 14px; padding: 8px 4px; white-space: nowrap; }
.text-btn.danger { color: var(--rose); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; flex: none;
}
.icon-btn:active { background: var(--hair); }
.icon-btn-space { width: 40px; flex: none; }
.row-buttons { display: flex; flex-direction: column; gap: 10px; }
.small-btn {
  height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--pine);
  background: transparent; color: var(--pine); font-size: 14px; font-weight: 650; flex-shrink: 0; white-space: nowrap;
}

.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form-hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.form-error { color: var(--rose); font-size: 14px; margin: 0; min-height: 1em; }
.input {
  width: 100%; height: 50px; border-radius: var(--r-ctl); border: 1.5px solid var(--hair);
  background: var(--sheet); padding: 0 14px; font-size: 16px; outline: none; appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
.input:focus { border-color: var(--pine); box-shadow: 0 0 0 4px rgba(14, 107, 80, 0.1); }
.input::placeholder { color: var(--ink-3); }

/* Переключатель: каждая кнопка не уже своей подписи, свободное место делится поровну;
   не помещаются — ряд листается, а не обрезает текст многоточием */
.segmented {
  display: flex; gap: 4px; padding: 4px; border-radius: var(--r-ctl); background: #e8ece9;
  overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 1 0 auto; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s, box-shadow 0.2s;
}
.segmented button[aria-checked="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 32, 27, 0.12); }

/* Поле количества в операции товара — крупное */
.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field input {
  height: 76px; border-radius: 20px; border: 2px solid var(--pine);
  background: var(--sheet); font-size: 38px; font-weight: 750; text-align: center; outline: none;
  letter-spacing: -0.02em;
}

/* --- Уведомления на экране --- */

.notice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--r-sheet); border: 0;
  background: var(--pine); color: #fff;
}
.notice span { display: flex; flex-direction: column; gap: 2px; }
.notice b { font-weight: 650; }
.notice small { opacity: 0.8; font-size: 13px; }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.notice.warn small { color: var(--ink-2); opacity: 1; }
.alert { padding: 12px 14px; border-radius: var(--r-ctl); font-size: 14px; font-weight: 550; line-height: 1.45; white-space: pre-line; margin: 0; }
.alert.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-line); }
.alert.error { background: var(--rose-soft); color: var(--rose); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); font-size: 14px; line-height: 1.5; background: var(--sheet); border-radius: var(--r-sheet); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 40;
  padding: 13px 16px; border-radius: 16px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 550; line-height: 1.4;
  box-shadow: 0 10px 30px rgba(20, 32, 27, 0.25);
  transform: translateY(16px); opacity: 0; transition: transform 0.3s var(--spring), opacity 0.2s;
  max-width: 600px; margin: 0 auto;
}
.toast.show { transform: none; opacity: 1; }
.toast.error { background: var(--rose); }

/* --- Нижняя панель: плавающая, выбранная вкладка подсвечена «таблеткой», которая переезжает --- */

.tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  height: 64px; padding: 6px; border-radius: 22px; max-width: 616px; margin: 0 auto;
  display: flex; gap: 2px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(20, 32, 27, 0.12), 0 0 0 1px rgba(20, 32, 27, 0.04);
}
.tab-pill {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: 0;
  border-radius: 16px; background: var(--pine-soft);
  transition: transform 0.38s var(--spring), width 0.3s var(--ease);
}
.tab-pill.none { opacity: 0; }
/* Вкладка — по ширине подписи плюс поровну свободного места: «Аналитика» не жмётся,
   «Журнал» не растянут */
.tabs button {
  position: relative; flex: 1 1 auto; min-width: 0; padding: 0 8px; border: 0; background: transparent; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; white-space: nowrap; transition: color 0.2s;
}
.tabs button[aria-current="page"] { color: var(--pine); }
.tabs button:active svg { transform: scale(0.9); }
.tabs svg { transition: transform 0.15s; }

/* --- Окно снизу --- */

.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 32, 27, 0.32); opacity: 0; transition: opacity 0.25s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  max-width: 640px; margin: 0 auto;
  background: var(--paper); border-radius: 26px 26px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
  transform: translateY(100%); transition: transform 0.34s var(--ease);
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: #cfd6d1; margin: 0 auto -6px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
.sheet-text { font-size: 15px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.sheet-text.center { text-align: center; }

/* --- Загрузка --- */

.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton i {
  display: block; height: 58px; border-radius: 18px;
  background: linear-gradient(90deg, #e8ece9 0%, #f6f8f6 50%, #e8ece9 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton i:first-child { height: 30px; border-radius: 10px; }
.skeleton i.tall { height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading { padding: 48px 0; text-align: center; color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.boot { min-height: 70vh; display: grid; place-items: center; }
.boot-mark { width: 64px; height: 64px; border-radius: 20px; background: var(--pine) url('/static/logo.svg') center / cover no-repeat; animation: breathe 1.4s var(--ease) infinite alternate; }
@keyframes breathe { from { transform: scale(0.88); opacity: 0.6; } to { transform: scale(1); opacity: 1; } }
.boot-error { display: flex; flex-direction: column; gap: 12px; padding-top: 30vh; }

/* --- Пин-код --- */

.pin-screen {
  min-height: calc(100vh - 36px); display: flex; flex-direction: column; align-items: center;
  padding-top: 7vh; gap: 18px; text-align: center;
}
.pin-head { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin-mark {
  width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center;
  background: var(--pine); color: #fff; font-size: 22px; font-weight: 750; letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.pin-mark.warn { background: var(--amber-soft); color: var(--amber); }
.pin-title { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; margin: 0; max-width: 320px; }
.pin-sub { margin: 0; color: var(--ink-2); max-width: 300px; min-height: 1.4em; }
.pin-dots { display: flex; gap: 20px; margin-top: 10px; height: 18px; align-items: center; }
.pin-dots i {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c3ccc6; background: transparent;
  transition: transform 0.25s var(--spring), background-color 0.15s, border-color 0.15s;
}
.pin-dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.12); }
.pin-dots.ok i { background: var(--mint); border-color: var(--mint); transform: scale(0.9); }
.pin-dots.ok i:nth-child(2) { transition-delay: 0.04s; }
.pin-dots.ok i:nth-child(3) { transition-delay: 0.08s; }
.pin-dots.ok i:nth-child(4) { transition-delay: 0.12s; }
.pin-dots.shake { animation: shake 0.42s var(--ease); }
.pin-dots.shake i.on { background: var(--rose); border-color: var(--rose); }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-12px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.pin-msg { color: var(--rose); font-size: 14px; font-weight: 550; margin: 0; min-height: 20px; max-width: 300px; }
.keypad {
  display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 30px; margin-top: auto; padding-bottom: 6vh;
}
.key {
  width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--sheet);
  font-size: 30px; font-weight: 550; display: grid; place-items: center;
  transition: transform 0.1s, background-color 0.12s;
}
.key:active { transform: scale(0.92); background: #e3e9e5; }
.key-text { background: transparent; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.key-icon { background: transparent; color: var(--ink-2); }
.locked-help { background: var(--sheet); border-radius: var(--r-sheet); padding: 16px; text-align: left; line-height: 1.5; max-width: 360px; }
.pin-screen.locked .btn { width: 100%; max-width: 360px; }

/* --- Анкета --- */

.onboarding { min-height: calc(100vh - 36px); display: flex; flex-direction: column; gap: 22px; }
.ob-top { display: flex; align-items: center; gap: 8px; }
.ob-progress { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.ob-progress i { height: 4px; border-radius: 2px; background: #dde3df; overflow: hidden; position: relative; }
.ob-progress i::after { content: ''; position: absolute; inset: 0; background: var(--pine); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.ob-progress i.done::after, .ob-progress i.now::after { transform: scaleX(1); }
.ob-progress i.now::after { animation: fill 0.6s var(--ease) both; }
@keyframes fill { from { transform: scaleX(0); } }
.ob-page { display: flex; flex-direction: column; gap: 10px; }
.ob-page.from-right { animation: from-right 0.38s var(--ease) both; }
.ob-page.from-left { animation: from-left 0.38s var(--ease) both; }
@keyframes from-right { from { opacity: 0; transform: translateX(28px); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-28px); } }
.ob-title { font-size: 30px; font-weight: 750; letter-spacing: -0.028em; line-height: 1.1; margin: 0; }
.ob-sub { color: var(--ink-2); margin: 0 0 10px; line-height: 1.5; }
.ob-hint { color: var(--pine); font-size: 14px; font-weight: 550; margin: 14px 2px 0; min-height: 1.4em; }
.ob-footer { margin-top: auto; position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.ob-footer .btn { box-shadow: 0 10px 24px rgba(14, 107, 80, 0.22); }
.ob-footer .btn:disabled { box-shadow: none; }

.kind-list { display: flex; flex-direction: column; gap: 10px; }
.kind-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px; border-radius: var(--r-sheet); background: var(--sheet); border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.15s var(--ease), background-color 0.2s;
}
.kind-card:active { transform: scale(0.985); }
.kind-card[aria-checked="true"] { border-color: var(--pine); background: #f7fbf9; }
.kind-icon {
  width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center;
  background: var(--pine-soft); color: var(--pine); transition: background-color 0.2s, color 0.2s;
}
.kind-card[aria-checked="true"] .kind-icon { background: var(--pine); color: #fff; }
.kind-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.kind-text b { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.kind-text small { font-size: 13px; color: var(--ink-2); line-height: 1.4; }

.niche-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.niche {
  display: inline-flex; align-items: center; gap: 0; height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--hair); background: var(--sheet); font-size: 15px; font-weight: 550;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, gap 0.2s var(--ease), padding 0.2s var(--ease);
}
.niche-check {
  width: 0; height: 18px; display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: #fff; color: var(--pine); transition: width 0.22s var(--spring);
}
.niche[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; gap: 8px; padding-left: 12px; }
.niche[aria-pressed="true"] .niche-check { width: 18px; }
.niche-grid.compact .niche { height: 38px; font-size: 14px; padding: 0 13px; }
.locked-kind { padding: 14px 16px; border-radius: 16px; background: var(--sheet); display: grid; gap: 2px; }
.locked-kind small { font-size: 12.5px; color: var(--ink-3); }
.locked-kind b { font-size: 16px; font-weight: 700; }
.locked-kind p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }

.welcome { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 12px; }
.welcome-mark {
  width: 64px; height: 64px; border-radius: 22px; background: var(--pine); color: #fff;
  display: grid; place-items: center; animation: pop 0.6s var(--spring) both;
}
.welcome-mark path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw-check 0.5s 0.25s var(--ease) forwards; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

.coming { background: var(--sheet); border-radius: var(--r-sheet); padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.coming-lead { margin: 0; font-size: 16px; line-height: 1.5; }
.coming-list { display: flex; flex-direction: column; gap: 14px; }
.coming-row { display: flex; gap: 12px; align-items: flex-start; }
.coming-row > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.coming-row b { font-weight: 650; }
.coming-row small { color: var(--ink-2); font-size: 13px; line-height: 1.45; }

/* --- Раздел «Бизнес» --- */

.biz-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 2px; }
.biz-mark {
  width: 58px; height: 58px; border-radius: 19px; flex: none; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 20px; font-weight: 750;
}
.kind-line { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.kind-line::first-letter { text-transform: uppercase; }
.whoami { text-align: center; font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }
.member-head { display: flex; align-items: center; gap: 16px; }
.member-head .title { font-size: 24px; }
.member-head .lead { margin: 4px 0 0; }
.member-head .seen { margin: 4px 0 0; }

.invite-code { display: flex; justify-content: center; gap: 8px; padding: 6px 0; }
.invite-code span {
  width: 44px; height: 56px; border-radius: 14px; background: var(--sheet); display: grid; place-items: center;
  font-size: 26px; font-weight: 750; animation: flip-in 0.45s var(--spring) both; animation-delay: calc(var(--i) * 0.05s);
}
@keyframes flip-in { from { transform: translateY(12px) rotateX(70deg); opacity: 0; } }

.money-hero { background: var(--ink); color: #fff; border-radius: var(--r-sheet); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 4px; }
.hero-label { font-size: 13px; opacity: 0.7; }
.hero-num { font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; }
.hero-split { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; opacity: 0.85; }
.hero-split span { display: inline-flex; align-items: center; gap: 6px; }
.hero-split i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.swatch-a { background: #8fd6b4; }
.swatch-b { background: #f0b46a; }

.dues { display: flex; flex-direction: column; gap: 8px; }
.due {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px 10px 10px; border: 0;
  border-radius: 18px; background: var(--sheet); text-align: left;
  transition: transform 0.12s var(--ease), opacity 0.2s;
}
.due:active { transform: scale(0.985); }
.due.paid { opacity: 0.62; }
.due-date {
  width: 48px; height: 52px; flex: none; border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: var(--paper); line-height: 1.05;
}
.due-date b { font-size: 20px; font-weight: 750; }
.due-date small { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.due-date.danger { background: var(--rose-soft); color: var(--rose); }
.due-date.warn { background: var(--amber-soft); color: var(--amber); }
.due-date.ok { background: var(--pine-soft); color: var(--pine); }
.due-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.due-right b { font-size: 15px; font-weight: 700; white-space: nowrap; }

/* Мои налоги: карточка месяца */
.tax-months { display: flex; flex-direction: column; gap: 8px; }
.tax-month { background: var(--sheet); border-radius: 18px; padding: 14px 16px; display: block; }
.tax-month > * + * { display: block; margin-top: 6px; }
.tax-month.payable { box-shadow: inset 0 0 0 2px var(--amber-line); }
.tax-month-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; list-style: none; cursor: pointer; }
.tax-month-head::-webkit-details-marker { display: none; }
details.tax-month:not([open]) .tax-total { color: var(--ink-2); }
.tax-month-head b { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tax-total { font-size: 17px; font-weight: 750; white-space: nowrap; }
.tax-source, .tax-cash { font-size: 13px; color: var(--ink-2); }
.tax-cash { color: var(--pine); font-weight: 600; }
.tax-lines { list-style: none; margin: 2px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.tax-lines li { display: block; }
.tax-line {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  padding: 4px 0; border: 0; background: none; text-align: left; font: inherit; color: inherit;
}
button.tax-line:active { opacity: 0.6; }
.tax-line-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tax-line-text > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tax-line-text small { color: var(--ink-2); font-size: 12px; }
.tax-line > b { font-weight: 650; white-space: nowrap; }
.tax-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 2px; }
.tax-totals div { display: flex; flex-direction: column; gap: 2px; }
.tax-totals small { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.tax-totals b { font-size: 16px; font-weight: 750; white-space: nowrap; }
/* Серии сравнения налогов: проверены валидатором палитры (CVD ΔE ≥ 21) */
.chart .tax-paid, .swatch.tax-paid { fill: #0f8a5f; background: #0f8a5f; }
.chart .tax-est, .swatch.tax-est { fill: #2a6fdb; background: #2a6fdb; }
.chart .tax-est-other, .swatch.tax-est-other { fill: #9dbcf0; background: #9dbcf0; }
.chart .tax-cash-bar, .swatch.tax-cash-bar { fill: #e0702f; background: #e0702f; }
.chart .tax-paid, .chart .tax-est, .chart .tax-est-other, .chart .tax-cash-bar { transform-origin: 50% 100%; }
.legend { flex-wrap: wrap; }
.cash-lines { display: flex; flex-direction: column; gap: 10px; }
.cash-channel { display: flex; flex-direction: column; gap: 4px; }
.cash-channel > b { font-size: 13px; color: var(--ink-2); font-weight: 650; }
.cash-line { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; background: var(--sheet); border-radius: 12px; }
.cash-sign { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 750; background: var(--paper); color: var(--ink-3); }
.effect-plus .cash-sign { background: var(--pine-soft); color: var(--pine); }
.effect-minus .cash-sign { background: var(--rose-soft); color: var(--rose); }
.cash-type { display: flex; flex-direction: column; gap: 1px; font-size: 14px; min-width: 0; }
.cash-type small { font-size: 12px; color: var(--ink-2); }
.cash-amount { font-weight: 650; white-space: nowrap; font-size: 14px; }
.cash-split { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); }

.release-card { background: var(--sheet); border-radius: var(--r-sheet); padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--pine); }
.release-card .btn:not(.primary) { background: var(--paper); }
.release-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--pine); font-weight: 700; }
.release-sub { color: var(--ink-2); font-size: 13px; margin-top: -6px; }
.release-notify { padding: 10px 12px; background: var(--paper); border-radius: 12px; }
.notes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }

.preview-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 45; height: 46px; padding: 0 6px 0 16px;
  display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; font-size: 13px;
}
.preview-bar > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-bar button { height: 32px; border: 0; border-radius: 10px; padding: 0 12px; background: var(--mint); color: var(--ink); font-weight: 700; font-size: 13px; }
.preview-bar button.ghost { background: transparent; color: #fff; padding: 0 8px; display: grid; place-items: center; }

/* --- Экраны товара --- */

.search {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px; border-radius: var(--r-ctl);
  background: var(--sheet); color: var(--ink-3);
  transition: box-shadow 0.15s;
}
.search:focus-within { box-shadow: 0 0 0 2px var(--pine); }
.search input { flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 16px; min-width: 0; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.chip {
  flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 18px;
  border: 0; background: var(--sheet);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chip .count { opacity: 0.55; }
/* Периоды и точки: чип по ширине подписи, лишнее место делится между ними; длинные названия
   точек не наезжают друг на друга — ряд листается */
.chips[role="group"] .chip { flex: 1 0 auto; padding: 0 14px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 16px; border-radius: 18px; background: var(--sheet); border: 0;
  transition: transform 0.12s var(--ease);
}
.item:active { transform: scale(0.985); }
.item .name {
  font-size: 15px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item .meta { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.item .qty { text-align: right; flex-shrink: 0; }
.item .qty b { display: block; font-size: 19px; font-weight: 750; letter-spacing: -0.01em; }
.item .qty span { font-size: 12px; color: var(--ink-2); }
.low b { color: var(--amber); }
.negative b { color: var(--rose); }

.big { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.big small { font-size: 16px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.facts { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink-2); }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts b { color: var(--ink); font-weight: 600; }
.facts .who-title { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: 12px; }
.who summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; cursor: pointer; padding: 4px 0; }
.who summary::-webkit-details-marker { display: none; }
.who summary b { display: flex; align-items: center; gap: 4px; }
.who summary svg { width: 16px; height: 16px; color: var(--ink-2); transition: transform 0.2s var(--ease); }
.who[open] summary svg { transform: rotate(180deg); }
.who-rows { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px 12px; padding-left: 10px; border-left: 2px solid var(--hair); }
.who-rows .who-item { font-size: 12px; margin: -2px 0 0 10px; align-items: baseline; }
.who-item span:first-child { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.who-item span:last-child { flex: none; white-space: nowrap; }
.who-item.more span { color: var(--ink-2); }
.who-rows .who-item + div:not(.who-item) { margin-top: 6px; }

.compare { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 20px; font-weight: 750; }
.compare s { color: var(--ink-2); }
.compare .new { color: var(--pine); }

.hero { background: var(--ink); color: #fff; border-radius: var(--r-sheet); padding: 18px; }
.hero .big { font-size: 34px; }
.hero .subtitle { color: inherit; opacity: 0.72; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  min-height: 78px; padding: 12px; border-radius: 18px; border: 0;
  background: var(--sheet); text-align: left;
  display: flex; align-items: center; gap: 10px;
  transition: transform 0.12s var(--ease);
}
.tile:active { transform: scale(0.97); }
.tile-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pine-soft); color: var(--pine);
}
.tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-text b { font-size: 15px; font-weight: 700; line-height: 1.2; }
.tile-text small { font-size: 12px; color: var(--ink-2); line-height: 1.3; }

/* Графики: столбики вырастают, линия прорисовывается — один раз, когда данные пришли */
.charts { display: flex; flex-direction: column; gap: 12px; }
.chart-card { padding: 14px 16px 10px; }
.chart-title { font-size: 15px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.chart-title span { font-size: 12px; font-weight: 550; color: var(--ink-2); }
.chart-loading, .chart-empty { padding: 28px 0; text-align: center; color: var(--ink-2); font-size: 14px; }
.chart-loading { padding: 40px 0; }
.chart-wrap { position: relative; margin-top: 8px; touch-action: pan-y; }
.chart { display: block; overflow: visible; }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .axis { stroke: var(--ink-3); stroke-width: 1; opacity: 0.6; }
.chart .tick { fill: var(--ink-3); font-size: 10px; font-weight: 550; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .bar { transition: opacity 0.15s; transform-box: fill-box; animation: grow 0.6s var(--ease) both; }
.chart .bar-main, .chart .bar-in { transform-origin: 50% 100%; }
.chart .bar-out { transform-origin: 50% 0; }
.chart .bar-main { fill: var(--pine); }
.chart .bar-in { fill: var(--series-in); }
.chart .bar-out { fill: var(--series-out); }
.chart .dim { opacity: 0.3; }
.chart .line { fill: none; stroke: var(--pine); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s var(--ease) forwards; }
.chart .area { fill: var(--pine); opacity: 0.08; animation: fade-in 0.9s var(--ease) both; }
.chart .dot { fill: var(--pine); stroke: var(--sheet); stroke-width: 2; }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%);
  padding: 7px 10px; border-radius: 11px; pointer-events: none; white-space: nowrap;
  background: var(--ink); color: #fff; font-size: 12px; line-height: 1.4;
  box-shadow: 0 6px 18px rgba(20, 32, 27, 0.2);
}
.tip b { font-weight: 700; }
.legend { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--ink-2); font-weight: 550; }
.legend span { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch-in { background: var(--series-in); }
.swatch-out { background: var(--series-out); }
.chart-table { margin-top: 4px; font-size: 13px; }
.chart-table summary { color: var(--ink-2); font-size: 12px; font-weight: 650; padding: 6px 0; cursor: pointer; }
.chart-table table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.chart-table th, .chart-table td { padding: 5px 0; text-align: right; border-bottom: 1px solid var(--hair); }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { color: var(--ink-2); font-weight: 550; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats .card { padding: 11px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.stats .value { font-size: 16px; overflow-wrap: anywhere; margin-top: 0; }
.share { height: 4px; border-radius: 2px; background: var(--hair); margin-top: 8px; overflow: hidden; }
.share span { display: block; height: 100%; border-radius: 2px; background: var(--pine); transform-origin: left; animation: grow-x 0.7s var(--ease) both; }
@keyframes grow-x { from { transform: scaleX(0); } }

.list-box { display: flex; flex-direction: column; gap: 10px; }
.btn.more { min-height: 46px; font-size: 15px; color: var(--pine); }

/* --- Аналитика (ТЗ, раздел 20): главная цифра, плитки, динамика, водопад, кольцо, разрезы --- */

.head-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn.soft { background: var(--sheet); border: 1px solid var(--hair); }
.bi-filters { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.bi-filters .subtitle { padding-left: 2px; }
.bi { display: flex; flex-direction: column; gap: 14px; }
.bi > * { animation: rise 0.42s var(--ease) both; }
.bi > *:nth-child(2) { animation-delay: 0.05s; }
.bi > *:nth-child(3) { animation-delay: 0.1s; }
.bi > *:nth-child(4) { animation-delay: 0.15s; }
.bi > *:nth-child(n+5) { animation-delay: 0.2s; }
.neg { color: var(--rose) !important; }
.pos { color: var(--pine); }

.bi-hero {
  position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: var(--r-sheet);
  background: linear-gradient(150deg, #0e6b50 0%, #0b5a43 55%, #0a4a38 100%); color: #fff;
}
.bi-hero::after {
  content: ''; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 191, 127, 0.45), rgba(47, 191, 127, 0) 70%); pointer-events: none;
}
.bi-hero-label { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.85); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bi-hero-delta { display: inline-flex; align-items: center; gap: 2px; }
.bi-hero-delta small { font-weight: 500; opacity: 0.8; }
/* На зелёной карточке — светлые плашки с тёмным текстом: красный текст на зелёном не читался.
   Селекторы на ступень сильнее общих .delta.up/.down, которые идут ниже */
.bi-hero .delta { background: rgba(255, 255, 255, 0.16); color: #fff; }
.bi-hero .delta.up { background: #ffffff; color: var(--pine); }
.bi-hero .delta.down { background: #ffffff; color: var(--rose); }
.bi-hero .delta.flat, .bi-hero .delta.new { background: rgba(255, 255, 255, 0.16); color: #fff; }
.bi-hero-num { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 6px 0 14px; }
.bi-hero-num.neg { color: #ffd2cc !important; }
.bi-hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; position: relative; z-index: 1; }
.bi-hero-split span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bi-hero-split small { font-size: 11px; opacity: 0.75; font-weight: 550; }
.bi-hero-split b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-hero-split b.neg { color: #ffd2cc !important; }

.delta { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.delta.up { background: var(--pine-soft); color: var(--pine); }
.delta.down { background: var(--rose-soft); color: var(--rose); }
.delta.flat { background: transparent; color: var(--ink-3); padding-left: 0; font-weight: 550; }
.delta.new { background: var(--paper); color: var(--ink-2); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--sheet); border-radius: 18px; padding: 12px 13px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi.warn { background: var(--amber-soft); }
.kpi-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
/* Цифра плитки не обрезается многоточием: не влезла — «руб.» уходит на вторую строку */
.kpi-value { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.kpi.wide { grid-column: 1 / -1; }
.kpi.wide .kpi-value { font-size: 28px; letter-spacing: -0.03em; }
.kpis.three .kpi-value { font-size: 16px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; }
.kpi-foot .delta.flat { font-size: 11px; white-space: normal; line-height: 1.2; }
.kpi-hint { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.spark { flex: none; overflow: visible; }
.spark path { fill: none; stroke: var(--mint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s var(--ease) 0.2s forwards; }
.spark.cost path { stroke: var(--series-out); }

.chart .bar-cost { fill: #f2b48c; transform-origin: 50% 0; }
.chart .bar-main.down { transform-origin: 50% 0; fill: var(--rose); }
.chart .profit-line { stroke: var(--ink); stroke-width: 2; }
.swatch-main { background: var(--pine); }
.swatch-line { background: var(--ink); height: 3px; border-radius: 2px; width: 14px; }
.legend .swatch-out { background: #f2b48c; }
.chart-note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }

.bi-block { display: flex; flex-direction: column; gap: 10px; }
/* Разделы «Аналитики» — заметными заголовками, а не серой подписью: экран длинный, по ним
   глазом находят нужное. Подзаголовки внутри раздела (вкладки, списки) — мельче */
.bi-block > .group-title { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin: 26px 2px 2px; }
.stock-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 4px 4px 2px; }
.stock-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.stock-head.tone-warn i { background: #e0a429; }
.stock-head.tone-accent i { background: #2a6fdb; }
.stock-head.tone-muted i { background: #7b5cd6; }
.stock-head b { font-size: 16px; font-weight: 750; }
.stock-head em { font-style: normal; font-size: 13px; font-weight: 750; padding: 2px 9px; border-radius: 99px; background: var(--sheet); color: var(--ink-2); }
.stock-head p { grid-column: 1 / -1; margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.stock-lists { display: flex; flex-direction: column; gap: 8px; }
.stock-ok { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-sheet); background: var(--pine-soft); color: var(--pine); font-weight: 600; font-size: 15px; }
.bi-block .segmented button { font-size: 13.5px; padding-left: 10px; padding-right: 10px; }
.card.bi-block { padding: 14px 16px; gap: 12px; }

.falls { display: flex; flex-direction: column; gap: 9px; }
.fall { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.fall-name { color: var(--ink-2); display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.fall-name small { font-size: 11px; color: var(--ink-3); }
.fall.total .fall-name, .fall.profit .fall-name, .fall.neg .fall-name { color: var(--ink); font-weight: 650; }
.fall-track { position: relative; height: 14px; }
.fall-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink-3); opacity: 0.5; }
.fall-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; transform-origin: left; animation: grow-x 0.7s var(--ease) both; }
.fall.total .fall-bar { background: var(--pine); }
.fall.profit .fall-bar { background: var(--mint); }
.fall.neg .fall-bar { background: var(--rose); }
.fall.minus .fall-bar { background: #f2c2a2; }
.fall-sum { font-size: 13px; font-weight: 700; white-space: nowrap; text-align: right; }
.fall.minus .fall-sum { color: var(--ink-2); font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-box { position: relative; flex: none; width: 132px; height: 132px; }
.donut { transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--paper); stroke-width: 16; }
.donut-arc { fill: none; stroke-width: 16; stroke-linecap: butt; animation: fade-in 0.8s var(--ease) both; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center b { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.donut-center small { font-size: 11px; color: var(--ink-3); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.donut-legend div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cards-list { display: flex; flex-direction: column; gap: 8px; }
.slice {
  display: block; width: 100%; text-align: left; border: 0; background: var(--sheet); border-radius: 18px;
  padding: 12px 14px; transition: transform 0.15s var(--ease);
}
button.slice:active { transform: scale(0.985); }
.slice-head { display: flex; align-items: center; gap: 10px; }
.slice-head > b { flex: 1; min-width: 0; font-size: 15px; }
.slice-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slice-who b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slice-who small { font-size: 12px; color: var(--ink-2); }
.slice-num { font-size: 15px; font-weight: 750; white-space: nowrap; }
.slice .share { margin-top: 9px; height: 5px; border-radius: 3px; }
.slice-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.rank {
  flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  background: var(--paper); color: var(--ink-2); font-size: 12px; font-weight: 750;
}
.rank.num { width: 28px; height: 28px; border-radius: 9px; }
.rank.top1 { background: var(--pine); color: #fff; }
.rank.top2 { background: var(--mint); color: #fff; }
.rank.top3 { background: var(--pine-soft); color: var(--pine); }
.badge.muted { background: var(--paper); color: var(--ink-3); }
.badge.abc-a { background: var(--pine); color: #fff; }
.badge.abc-b { background: var(--pine-soft); color: var(--pine); }
.badge.abc-c { background: var(--paper); color: var(--ink-2); }
.abc { padding: 14px; }
.abc-bar { display: flex; height: 38px; border-radius: 10px; overflow: hidden; gap: 2px; }
.abc-bar span, .abc-bar button { display: grid; place-items: center; font-size: 12px; font-weight: 700; min-width: 44px; transform-origin: left; animation: grow-x 0.7s var(--ease) both; }
.abc-bar button { border: 0; padding: 0 8px; white-space: nowrap; transition: opacity 0.2s, box-shadow 0.2s; }
.abc-bar button[aria-pressed="false"] { opacity: 0.55; }
.abc-bar button[aria-pressed="true"] { box-shadow: inset 0 -3px 0 rgba(20, 32, 27, 0.35); }
.abc-bar .abc-a { background: var(--pine); color: #fff; }
.abc-bar .abc-b { background: var(--mint); color: #fff; }
.abc-bar .abc-c { background: var(--hair); color: var(--ink-2); }
.abc-bar .abc-idle { background: repeating-linear-gradient(45deg, var(--amber-soft) 0 6px, #fbe3c2 6px 12px); color: var(--amber); }
.abc-head { display: flex; flex-direction: column; gap: 4px; padding: 4px 4px 2px; }
.abc-head b { font-size: 15px; }
.abc-head .note { margin: 0; }
.abc .note { margin: 10px 0 0; }
.bi-foot { display: flex; flex-direction: column; gap: 8px; }
.bi-foot .note { margin: 0; }
.empty-state { background: var(--sheet); border-radius: var(--r-sheet); padding: 28px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state b { font-size: 17px; }
.empty-state p { margin: 0; color: var(--ink-2); font-size: 14px; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--pine-soft); color: var(--pine); display: grid; place-items: center; }

/* --- Остатки по точкам --- */
.point-chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.list-group { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 4px 2px; font-size: 13px; color: var(--ink-2); }
.list-group b { font-size: 14px; color: var(--ink); font-weight: 700; }
.item .meta.points-line { color: var(--pine); font-weight: 550; }
.points-card .badge { margin-left: 6px; }

/* Полоса «Продано сегодня» над остатками */
.today-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; text-align: left;
  padding: 14px 16px; border-radius: var(--r-sheet); color: #fff;
  background: linear-gradient(150deg, #0e6b50 0%, #0a4a38 100%);
}
.today-banner span { display: flex; flex-direction: column; }
.today-banner small { font-size: 12px; opacity: 0.8; font-weight: 550; }
.today-banner b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.today-banner .today-count { flex-direction: row; align-items: center; gap: 4px; font-size: 13px; opacity: 0.9; font-weight: 600; }
.stock-cards .card.warn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--amber); }

/* Перемещение: плитка во всю ширину, выбор товаров со своим количеством, кнопка внизу */
.tile.wide { grid-column: 1 / -1; min-height: 64px; }
.swap-row { display: flex; justify-content: flex-end; margin: -8px 0 -4px; }
.transfer-route { gap: 12px; }
.pick {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px;
  background: var(--sheet); border: 1.5px solid transparent; transition: border-color 0.2s, background-color 0.2s;
}
.pick.on { border-color: var(--pine); background: #f4faf7; }
/* Инвентаризация: недостача и излишек видны по рамке, не только по тексту */
.pick.on.short { border-color: var(--rose); background: var(--rose-soft); }
.pick.on.found { border-color: var(--amber); background: var(--amber-soft); }
.pick-name .meta .neg { color: var(--rose); }
.pick-name .meta .pos { color: var(--amber); }
.pick-name { flex: 1; min-width: 0; border: 0; background: transparent; padding: 4px 0; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.pick-name .name { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-name .meta { font-size: 12px; color: var(--ink-2); }
.pick-step { display: flex; align-items: center; gap: 4px; flex: none; }
.pick-step .icon-btn { width: 36px; height: 36px; border-radius: 12px; font-size: 20px; font-weight: 600; color: var(--ink); }
.pick .pick-in { flex: none; width: 46px; height: 36px; font-size: 17px; border-radius: 10px; background: var(--paper); }
.pick.on .pick-in { background: var(--sheet); color: var(--pine); }
.sticky-action { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; }
.sticky-action .btn { width: 100%; box-shadow: 0 10px 24px rgba(14, 107, 80, 0.22); }
.sticky-action .btn:disabled { box-shadow: none; opacity: 1; background: #c9d3cd; }
body.kb-open .sticky-action { bottom: 8px; }

/* --- Печать этикеток --- */
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: 10px; align-items: center; }
.stepper .icon-btn { width: 48px; height: 48px; font-size: 24px; font-weight: 600; border-radius: 14px; }
.stepper-input { text-align: center; font-size: 22px; font-weight: 750; }
.label-frame.small { max-height: 150px; }
.label-frame.small img { max-height: 130px; }

/* --- Журнал --- */

.journal { display: flex; flex-direction: column; gap: 4px; }
.day-title { margin-top: 10px; }
.today-strip { background: var(--sheet); border-radius: var(--r-sheet); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.today-strip.empty-strip { color: var(--ink-2); font-size: 14px; }
.today-main { display: flex; align-items: baseline; gap: 8px; }
.today-main b { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--pine); }
.today-main span { color: var(--ink-2); font-weight: 550; }
.today-types { display: flex; flex-wrap: wrap; gap: 8px; }
.today-types span { display: flex; flex-direction: column; background: var(--paper); border-radius: 12px; padding: 6px 10px; }
.today-types small { font-size: 11px; color: var(--ink-2); }
.today-types b { font-size: 14px; }
.today-who { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ink-2); }
.rowline.doc { align-items: flex-start; }
.doc-mark {
  flex: none; width: 46px; padding: 5px 0; border-radius: 10px; text-align: center; font-size: 12px; font-weight: 700;
  background: var(--paper); color: var(--ink-2);
}
.doc-mark.ok { background: var(--pine-soft); color: var(--pine); }
.doc-mark.accent { background: #e4edfb; color: var(--series-in); }
.doc-mark.warn { background: var(--amber-soft); color: var(--amber); }
.doc-mark.danger { background: var(--rose-soft); color: var(--rose); }
.rowline.doc .row-text small:first-of-type { color: var(--ink); }
.chips.pad { padding: 12px 14px 4px; }
.member-work { display: flex; flex-direction: column; gap: 8px; }
.member-work .group-title { margin: 0; }

@media (max-width: 360px) {
  .bi-hero-num { font-size: 32px; }
  .kpi-value { font-size: 17px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut-box { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .chart .line { stroke-dashoffset: 0; }
}

@media (max-width: 360px) {
  .keypad { grid-template-columns: repeat(3, 68px); gap: 12px 24px; }
  .key { width: 68px; height: 68px; }
  .form-row { grid-template-columns: 1fr; }
}

/* --- Товар по шаблону (ТЗ, раздел 17) --- */

.item-desc { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }

/* Размерная сетка модели: каждая ячейка — размер и остаток; текущий — залит */
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.size-cell {
  height: 58px; border-radius: 14px; border: 1.5px solid var(--hair); background: var(--sheet);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: transform 0.12s var(--ease), background-color 0.2s;
}
.size-cell b { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.size-cell small { font-size: 11px; color: var(--ink-2); font-weight: 550; }
.size-cell:active { transform: scale(0.95); }
.size-cell.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.size-cell.current small { color: rgba(255, 255, 255, 0.7); }
.size-cell.empty:not(.current) { border-style: dashed; color: var(--ink-3); }
.size-cell.empty:not(.current) small { color: var(--rose); }

.attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.attr { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attr span { font-size: 12px; color: var(--ink-2); }
.attr b { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.swatch-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; box-shadow: inset 0 0 0 1px rgba(20, 32, 27, 0.18); }

/* Этикетка как наклейка на бумаге: превью ровно того, что напечатает принтер */
.label-preview { display: flex; flex-direction: column; gap: 10px; }
.label-frame {
  align-self: center; width: 100%; max-width: 360px; padding: 14px; border-radius: 18px;
  background: repeating-linear-gradient(45deg, #eceeea 0 10px, #e6e9e5 10px 20px);
  display: grid; place-items: center; min-height: 150px; position: relative;
}
.label-img {
  width: 100%; height: auto; display: block; border-radius: 6px; background: #fff;
  box-shadow: 0 6px 18px rgba(20, 32, 27, 0.16), 0 1px 2px rgba(20, 32, 27, 0.12);
  transition: opacity 0.25s;
}
.label-frame[data-size="30x20"] .label-img { width: 62%; }
.label-frame[data-size="40x30"] .label-img { width: 80%; }
.label-frame.loading-frame .label-img { opacity: 0.25; }
.label-frame.loading-frame::after {
  content: ''; position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid rgba(14, 107, 80, 0.25); border-top-color: var(--pine); animation: spin 0.7s linear infinite;
}

.empty-stock {
  background: var(--sheet); border-radius: var(--r-sheet); padding: 26px 18px 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.empty-stock b { font-size: 18px; font-weight: 700; }
.empty-stock p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.5; max-width: 320px; }
.empty-stock .row-buttons { width: 100%; }
.empty-mark { width: 60px; height: 60px; border-radius: 20px; background: var(--pine-soft); color: var(--pine); display: grid; place-items: center; margin-bottom: 4px; }

.opt-box { display: flex; flex-direction: column; gap: 8px; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--hair); background: var(--sheet);
  font-size: 14px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.input.small { height: 42px; font-size: 15px; }
.opt.ghost { border-style: dashed; color: var(--ink-2); }
.opt.ghost[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--ink-3); }
.input.area { height: auto; min-height: 76px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.form-label.between { display: flex; justify-content: space-between; }
.grid-total { color: var(--pine); font-weight: 650; }

.qty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.qty-cell {
  border-radius: 14px; background: var(--sheet); border: 1.5px solid var(--hair);
  display: flex; flex-direction: column; align-items: center; padding: 7px 4px 4px;
  transition: border-color 0.2s, background-color 0.2s;
}
.qty-cell b { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.qty-cell.filled { border-color: var(--pine); background: #f4faf7; }
.qty-cell.filled b { color: var(--pine); }
.qty-in {
  width: 100%; border: 0; background: transparent; text-align: center; outline: none;
  font-size: 20px; font-weight: 750; height: 32px; padding: 0;
}
.qty-in::placeholder { color: #c6cdc8; }
.inline-add { display: flex; gap: 8px; align-items: center; }
.inline-add .input { flex: 1; }

/* --- Запись клиентов (ТЗ, раздел 18) --- */

.day-strip { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; scroll-behavior: smooth; }
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: none; width: 50px; height: 66px; border-radius: 16px; border: 0; background: var(--sheet);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: background-color 0.2s, color 0.2s, transform 0.12s var(--ease);
}
.day-chip:active { transform: scale(0.95); }
.day-chip small { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.day-chip b { font-size: 19px; font-weight: 750; }
.day-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--pine); margin-top: 2px; }
.day-chip i.none { background: transparent; }
.day-chip.today:not(.on) b { color: var(--pine); }
.day-chip.on { background: var(--ink); color: #fff; }
.day-chip.on small { color: rgba(255, 255, 255, 0.7); }
.day-chip.on i { background: var(--mint); }
.day-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 2px; }
.day-sum b { font-size: 17px; font-weight: 700; }
.day-sum span { font-size: 13px; color: var(--ink-2); }

.agenda { display: flex; flex-direction: column; gap: 8px; }
.booking-card {
  display: flex; align-items: stretch; gap: 12px; width: 100%; text-align: left; border: 0;
  padding: 12px 14px 12px 12px; border-radius: 18px; background: var(--sheet); position: relative; overflow: hidden;
  transition: transform 0.12s var(--ease);
}
.booking-card::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--pine); }
.booking-card.done::before { background: var(--mint); }
.booking-card.no_show::before { background: var(--rose); }
.booking-card.cancelled { opacity: 0.55; }
.booking-card.cancelled::before { background: var(--ink-3); }
button.booking-card:active { transform: scale(0.985); }
.bc-time { display: flex; flex-direction: column; min-width: 48px; padding-left: 4px; }
.bc-time b { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.bc-time small { font-size: 12px; color: var(--ink-3); }
.bc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bc-body b { font-size: 15px; font-weight: 650; }
.bc-body small { font-size: 13px; color: var(--ink-2); }
.bc-addr { display: inline-flex; align-items: center; gap: 4px; }
.bc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.bc-side b { font-size: 14px; font-weight: 700; }
.gap {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 1.5px dashed #cdd5d0; background: transparent;
  border-radius: 16px; padding: 10px 14px; color: var(--ink-2); font-size: 13px; text-align: left;
}
.gap span { min-width: 92px; font-weight: 600; }
.gap b { flex: 1; font-weight: 550; color: var(--pine); }
.gap:active { background: var(--pine-soft); }
.break-line { text-align: center; font-size: 12px; color: var(--ink-3); padding: 2px 0; }

.setup { display: flex; flex-direction: column; gap: 12px; }
.sheet-client { display: flex; flex-wrap: wrap; gap: 6px; }
.status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-actions .btn.primary { grid-column: 1 / -1; }
.status-actions .btn.danger-text { grid-column: 1 / -1; }
a.btn { text-decoration: none; color: var(--ink); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.slot {
  height: 46px; border-radius: 14px; border: 1.5px solid var(--hair); background: var(--sheet);
  font-size: 16px; font-weight: 650; transition: background-color 0.18s, color 0.18s, transform 0.12s var(--ease);
}
.slot:active { transform: scale(0.95); }
.slot[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }

.svc-list { display: flex; flex-direction: column; gap: 6px; }
.svc {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: left;
  padding: 13px 14px; border-radius: 16px; border: 1.5px solid transparent; background: var(--sheet);
}
.svc b { font-weight: 650; }
.svc small { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.svc[aria-pressed="true"] { border-color: var(--pine); background: #f4faf7; }

.suggest { display: flex; flex-direction: column; gap: 6px; }
.suggest-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--sheet); text-align: left; }
.suggest-row small { color: var(--ink-2); }
.suggest-row.add { justify-content: flex-start; align-items: center; color: var(--pine); background: transparent; border: 1.5px dashed var(--line, #d5ddd8); }
.suggest-row.add b { font-weight: 650; }
.picked-client { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--mint-soft, #e3f4ec); color: var(--pine); font-weight: 600; }
.client-filters { display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row select.input.compact {
  flex: 1 1 calc(50% - 4px); min-width: 0; height: 40px; font-size: 14px; padding: 0 28px 0 12px;
  text-overflow: ellipsis; background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
}
.client-count { margin: -4px 2px 0; }
.client-count:empty { display: none; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }

.load-list { display: flex; flex-direction: column; gap: 14px; }
.load-row span { font-size: 13px; color: var(--ink-2); }
.load-row .share { height: 8px; border-radius: 4px; }

.switch {
  width: 50px; height: 30px; border-radius: 15px; border: 0; background: #d5dbd7; position: relative; flex: none;
  transition: background-color 0.2s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(20, 32, 27, 0.25); transition: transform 0.25s var(--spring);
}
.switch[aria-checked="true"] { background: var(--pine); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.5; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--ink-2); font-size: 13px; }

.week { display: flex; flex-direction: column; gap: 6px; }
.wd { background: var(--sheet); border-radius: 16px; padding: 10px 14px; }
.wd-head { display: flex; align-items: center; gap: 10px; }
.wd-head b { width: 32px; font-weight: 750; }
.wd-state { flex: 1; font-size: 13px; color: var(--ink-3); }
.wd.on .wd-state { color: var(--pine); }
.wd-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.wd-hours, .wd-break { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.wd-break span { font-size: 13px; min-width: 62px; }
.time-in {
  appearance: none; -webkit-appearance: none; text-align: center;
  height: 40px; border-radius: 12px; border: 1.5px solid var(--hair); background: var(--paper);
  padding: 0 10px; font-size: 16px; font-weight: 650; color: var(--ink); outline: none; min-width: 0;
}
.time-in:focus { border-color: var(--pine); }

.link-card { background: var(--ink); color: #fff; border-radius: var(--r-sheet); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.link-text { font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.link-card .btn:not(.primary) { background: rgba(255, 255, 255, 0.1); color: #fff; }
.link-card .btn.primary { background: var(--mint); color: var(--ink); }

.cb-head { display: flex; align-items: center; gap: 14px; }
.cb-summary { margin: -10px 0 0; color: var(--pine); font-weight: 600; font-size: 14px; }
.cb-price { font-weight: 700; white-space: nowrap; align-self: flex-start; }
.my-booking { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--sheet); border-radius: 16px; padding: 12px 14px; }
.my-booking > div { display: flex; flex-direction: column; gap: 2px; }
.my-booking small { color: var(--ink-2); font-size: 13px; }
.cb-done .card { width: 100%; }
.cb-done .btn { width: 100%; }
.day-chip.on i.none { background: transparent; }

/* --- Выезды: карта и маршрут (ТЗ, раздел 19) --- */

.map { position: relative; border-radius: 18px; overflow: hidden; background: #eef1ee; isolation: isolate; }
.map .leaflet-control-attribution { font-size: 9px; background: rgba(255, 255, 255, 0.75); padding: 0 4px; }
.map .leaflet-control-attribution a { color: var(--ink-2); }
.map-loading { position: absolute; inset: 0; background: linear-gradient(90deg, #e8ece9 0%, #f6f8f6 50%, #e8ece9 100%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.map-svg { display: block; }
.map-note { position: absolute; left: 10px; right: 10px; bottom: 8px; font-size: 12px; color: var(--ink-2); background: rgba(255, 255, 255, 0.85); border-radius: 10px; padding: 6px 8px; }
.route-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s var(--ease) 0.2s forwards; }
.svg-stop, .pin-stop { cursor: pointer; }
.pin-stop span, .pin-base {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pine); color: #fff; font: 800 13px/1 'Onest', sans-serif;
  border: 3px solid #fff; box-shadow: 0 3px 10px rgba(20, 32, 27, 0.28); box-sizing: border-box;
  animation: pop 0.45s var(--spring) both;
}
.pin-stop.done span { background: #9aa8a0; font-size: 15px; }
.pin-stop.next span { width: 34px; height: 34px; margin: -2px; font-size: 14px; }
.pin-stop.next::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--pine); opacity: 0; animation: ring 1.8s ease-out 0.5s infinite; pointer-events: none; }
.pin-stop.onway span { background: var(--amber); }
.pin-stop.late span { background: var(--rose); }
.pin-stop.bounce span { animation: bounce 0.6s var(--spring); }
.pin-me span { display: block; width: 22px; height: 22px; border-radius: 50%; background: #2f7bf6; border: 3px solid #fff; box-sizing: border-box; box-shadow: 0 2px 8px rgba(47, 123, 246, 0.45); }
.pin-me::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; background: rgba(47, 123, 246, 0.22); animation: ring 2s ease-out infinite; pointer-events: none; }
@keyframes ring { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-10px); } 60% { transform: translateY(0); } 80% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .pin-stop.next::after, .pin-me::after { animation: none; opacity: 0.4; } }
.pin-base { border-radius: 9px; background: var(--ink); color: #fff; }
.pin-pick span {
  display: block; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--rose); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(20, 32, 27, 0.3); box-sizing: border-box;
}

.route-card { background: var(--sheet); border-radius: var(--r-sheet); padding: 8px; display: flex; flex-direction: column; gap: 10px; }
.route-card > .btn, .route-card > .note { margin: 0 6px; }
.route-map-wrap { position: relative; }
.route-map { transition: height 0.25s var(--ease); }
.map-tools { position: absolute; top: 8px; right: 8px; left: 8px; display: flex; justify-content: flex-end; gap: 6px; z-index: 500; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.map-fab, .map-chip { height: 34px; border: 0; border-radius: 17px; background: rgba(255, 255, 255, 0.94); color: var(--ink); box-shadow: 0 2px 10px rgba(20, 32, 27, 0.18); display: inline-flex; align-items: center; gap: 6px; }
.map-fab { width: 34px; justify-content: center; }
.map-chip { padding: 0 12px; font-size: 13px; font-weight: 650; margin-right: auto; }
.map-chip.on { background: #2f7bf6; color: #fff; }
.map-chip:disabled { opacity: 0.7; }
.route-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 8px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.route-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.route-legend .lg::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--pine); }
.route-legend .lg.done::before { background: #9aa8a0; }
.route-legend .lg.next::before { background: var(--pine); box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3.5px var(--pine); }
.route-legend .lg.ahead::before { background: var(--pine); opacity: 0.75; }
.route-legend .lg.late::before { background: var(--rose); }
.route-legend .lg.me::before { background: #2f7bf6; }
.stop-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 6px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.stop-strip::-webkit-scrollbar { display: none; }
.stop-chip { flex: none; scroll-snap-align: start; display: flex; align-items: center; gap: 8px; min-width: 132px; max-width: 180px; padding: 8px 10px 8px 8px; border-radius: 14px; border: 1.5px solid var(--hair); background: var(--paper); text-align: left; }
.stop-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--pine); color: #fff; font-weight: 800; font-size: 12px; }
.stop-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.stop-text b { font-size: 14px; }
.stop-text small { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-text .stop-state { color: var(--ink-3); font-weight: 600; }
.stop-chip.done { opacity: 0.6; }
.stop-chip.done .stop-num { background: #9aa8a0; }
.stop-chip.next { border-color: var(--pine); background: var(--pine-soft); }
.stop-chip.next .stop-state { color: var(--pine); }
.stop-chip.onway .stop-num { background: var(--amber); }
.stop-chip.late { border-color: var(--rose); }
.stop-chip.late .stop-num { background: var(--rose); }
.stop-chip.late .stop-state { color: var(--rose); }
.route-card > .btn:last-child, .route-card > .note:last-child { margin-bottom: 6px; }
.route-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0 6px; }
.rs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rs small { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.rs b { font-size: 16px; font-weight: 750; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-warn {
  margin: 0 6px; padding: 9px 12px; border-radius: 12px; border: 0; text-align: left;
  background: var(--amber-soft); color: var(--amber); font-size: 13px; font-weight: 550; line-height: 1.4;
}

.leg { display: flex; align-items: center; gap: 10px; padding: 0 0 0 30px; min-height: 22px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.leg-line { width: 2px; align-self: stretch; min-height: 22px; background: repeating-linear-gradient(to bottom, #c3ccc6 0 4px, transparent 4px 8px); border-radius: 1px; }
.leg.late { color: var(--amber); }
.leg.late .leg-line { background: repeating-linear-gradient(to bottom, var(--amber) 0 4px, transparent 4px 8px); }
.leg b { font-weight: 700; }

.field-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-actions .wide { grid-column: 1 / -1; }

.btn.ink { background: var(--ink); color: #fff; }

/* Представление и «Как пользоваться» (guide.js) */
.intro { display: flex; flex-direction: column; gap: 22px; padding-bottom: 90px; }
.intro section, .guide-features { display: flex; flex-direction: column; gap: 10px; }
.intro-mark path { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; stroke-width: 2; }
.guide-feature { display: flex; gap: 12px; align-items: flex-start; background: var(--sheet); border-radius: 18px; padding: 13px 14px; }
.guide-feature > span:last-child, .guide-say { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.guide-steps li b, .guide-steps li small { display: block; }
.guide-steps li small { margin-top: 3px; }
.guide-feature b, .guide-steps b { font-weight: 650; font-size: 15px; }
.guide-feature small, .guide-steps small, .guide-say small { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.guide-icon { flex: none; width: 40px; height: 40px; border-radius: 13px; background: var(--pine-soft); color: var(--pine); display: grid; place-items: center; }
.guide-steps { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 12px; }
.guide-steps li::marker { color: var(--pine); font-weight: 700; }
.guide-chat { display: flex; flex-direction: column; gap: 8px; }
.guide-say { background: var(--sheet); border-radius: 16px; padding: 11px 13px; }
.guide-say code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--ink); }
.guide-tip { display: flex; align-items: center; gap: 6px; background: var(--pine-soft); border-radius: var(--r-sheet); padding: 4px 6px 4px 4px; }
.guide-tip-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; color: var(--pine); text-align: left; padding: 10px 12px; }
.guide-tip-open span { display: flex; flex-direction: column; gap: 2px; }
.guide-tip-open b { font-weight: 650; }
.guide-tip-open small { color: var(--ink-2); font-size: 13px; }
.text-btn.danger-text { color: var(--rose); }
.row-text b .badge { margin-left: 6px; vertical-align: 1px; }
.input.area.tall { min-height: 140px; }

/* «Перекос по точкам»: карточки (bi.js, biImbalance) */
.imb-list { display: flex; flex-direction: column; gap: 12px; }
.imb-card {
  background: var(--sheet); border-radius: var(--r-sheet); padding: 16px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 2px rgba(16, 40, 30, 0.05), 0 6px 18px rgba(16, 40, 30, 0.05);
}
/* Ждёт, когда доедет до экрана: скрыта только пока за ней следят (revealOnScroll) */
.imb-card.pending { opacity: 0; transform: translateY(14px) scale(0.98); }
.imb-card:not(.in) .imb-bar i { transform: scaleX(1); }
.imb-card.pending .imb-bar i { transform: scaleX(0); }
.imb-card.in { animation: imb-in 0.5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes imb-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.imb-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.imb-name { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; text-align: left; font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.imb-name svg { color: var(--ink-3); flex: none; }
.imb-frozen { font-size: 12.5px; font-weight: 600; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 3px 10px; }
.imb-points { display: flex; flex-direction: column; gap: 12px; }
.imb-point { display: flex; flex-direction: column; gap: 6px; }
.imb-point small { font-size: 12.5px; color: var(--ink-2); }
.imb-point-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.imb-point-name { font-size: 14.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.imb-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; border-radius: 999px; padding: 3px 9px; background: var(--paper); color: var(--ink-2); }
.imb-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.imb-chip.hot { background: var(--pine-soft); color: var(--pine); }
.imb-chip.cold { background: var(--amber-soft); color: var(--amber); }
.imb-chip.few { color: var(--ink-3); }
.imb-chip.store { background: #e8eefb; color: #2c4f9e; }
.imb-frozen.store { background: #e8eefb; color: #2c4f9e; }
.imb-card.in .imb-chip.hot i { animation: beat 1.8s 0.6s ease-out 2; }
.imb-bar { height: 8px; border-radius: 4px; background: var(--paper); overflow: hidden; }
.imb-bar i { display: block; height: 100%; width: var(--w); border-radius: 4px; background: var(--ink-3); transform-origin: left; }
.imb-point.hot .imb-bar i { background: linear-gradient(90deg, #2fbf7f, var(--pine)); }
.imb-point.cold .imb-bar i { background: linear-gradient(90deg, #f0b45e, var(--amber)); }
.imb-card.in .imb-bar i { animation: imb-fill 0.9s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 0.25s); }
@keyframes imb-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.imb-move { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--paper); }
.imb-route { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; font-weight: 600; }
.imb-from { color: var(--amber); }
.imb-to { color: var(--pine); }
.imb-arrow { display: inline-grid; place-items: center; color: var(--ink-3); }
.imb-card.in .imb-arrow svg { animation: imb-nudge 1.1s 0.8s var(--ease) 2; }
@keyframes imb-nudge { 0%, 100% { transform: none; } 50% { transform: translateX(4px); } }
.imb-qty { margin-left: auto; background: var(--sheet); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.imb-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.imb-size { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; background: var(--sheet); border-radius: 10px; padding: 4px 9px; }
.imb-size b { color: var(--pine); }
.imb-go { width: 100%; }
.imb-wait { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); padding: 10px 12px; border-radius: 14px; background: var(--paper); }
@media (prefers-reduced-motion: reduce) {
  .imb-card, .imb-card.in, .imb-card.in .imb-bar i, .imb-bar i, .imb-card.in .imb-arrow svg, .imb-card.in .imb-chip.hot i { animation: none; opacity: 1; transform: none; }
}

/* Правка перевозки в «Перекосе»: откуда, куда, сколько каждого размера */
.imb-move-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.imb-move-head small { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.imb-edit { display: flex; flex-direction: column; gap: 10px; animation: rise 0.25s var(--ease) both; }
.imb-edit-points { display: grid; grid-template-columns: 1fr; gap: 8px; }
.imb-edit .form-field { gap: 4px; }
.imb-size-rows { display: flex; flex-direction: column; gap: 6px; }
.imb-size-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--sheet); border-radius: 12px; padding: 6px 6px 6px 12px; }
.imb-size-name { display: flex; flex-direction: column; min-width: 0; }
.imb-size-name b { font-size: 15px; overflow-wrap: anywhere; }
.imb-size-name small { font-size: 12px; color: var(--ink-2); }
.imb-manual { display: inline-flex; align-items: center; gap: 6px; }
.imb-size-row .pick-in { flex: none; width: 52px; height: 36px; font-size: 17px; border-radius: 10px; background: var(--paper); text-align: center; }

/* Онлайн-записи, которые ждут подтверждения */
.pending-banner { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--amber-soft); color: var(--amber); text-align: left; }
.pending-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pending-banner small { color: var(--amber); opacity: 0.85; }
.pending-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); animation: pending-pulse 1.8s infinite; flex: none; }
@keyframes pending-pulse { 0% { box-shadow: 0 0 0 0 rgba(163, 84, 0, 0.45); } 70% { box-shadow: 0 0 0 10px rgba(163, 84, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(163, 84, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .pending-dot { animation: none; } }
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--paper); }
.pending-head { display: flex; justify-content: space-between; gap: 10px; }
.pending-head span { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.pending-item small { color: var(--ink-2); }
.confirm-box { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--amber-soft); color: var(--amber); }
.confirm-box small { color: var(--amber); opacity: 0.85; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }

/* Как оплатили продажу (ТЗ, раздел 28) */
.pay-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--paper); }
.pay-summary span { color: var(--ink-2); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pay-summary b { font-size: 20px; font-weight: 800; white-space: nowrap; }
.pay-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pay-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px 14px; border-radius: 18px;
  border: 1.5px solid var(--hair); background: var(--sheet); color: var(--ink); text-align: center;
  transition: transform 0.15s var(--ease), border-color 0.15s, background 0.15s;
}
.pay-tile:active { transform: scale(0.96); border-color: var(--pine); background: var(--pine-soft); }
.pay-tile b { font-size: 15px; }
.pay-tile small { font-size: 11.5px; color: var(--ink-3); line-height: 1.25; }
.pay-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; }
.pay-tile.pay-card .pay-icon { background: #e7efff; color: #2f62d6; }
.pay-tile.pay-cash .pay-icon { background: var(--pine-soft); color: var(--pine); }
.pay-tile.pay-account .pay-icon { background: var(--amber-soft); color: var(--amber); }
.pay-tile.pay-debt .pay-icon { background: #efe9fc; color: #6d4fc2; }
/* Четыре способа (с «В долг») — сеткой 2 × 2: в ряд по четыре плитки на телефоне тесно */
.pay-grid:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pay-seg.pay-debt, .pay-row.pay-debt .pay-dot, .ph-split .pay-debt { background: #9a6fe0; }
.pay-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.pay-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--hair); }
.pay-seg { min-width: 4px; }
.pay-seg.pay-card, .pay-row.pay-card .pay-dot { background: #2f62d6; }
.pay-seg.pay-cash, .pay-row.pay-cash .pay-dot { background: var(--pine); }
.pay-seg.pay-account, .pay-row.pay-account .pay-dot { background: var(--amber); }
.pay-seg.pay-none, .pay-row.pay-none .pay-dot { background: #b9c3bd; }
.pay-dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.alert.info { background: var(--pine-soft); color: var(--pine); }
.pay-filter { font-size: 13px; }

/* Хранение данных и удаление бизнеса (ТЗ, раздел 30) */
.kind-card.dim { opacity: 0.55; }
.storage-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.storage-head { display: flex; align-items: center; gap: 12px; }
.storage-head > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.storage-head small { color: var(--ink-2); font-size: 13px; }
.storage-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.storage-line b { color: var(--ink); }
.danger-zone { margin-top: 18px; }
.btn.danger { background: var(--rose); color: #fff; }
.btn.danger:disabled { opacity: 0.4; }
.hold-btn {
  position: relative; overflow: hidden; width: 100%; height: 54px; border-radius: var(--r-ctl);
  border: 1.5px solid var(--rose); background: var(--rose-soft); color: var(--rose);
  font: inherit; font-weight: 700; font-size: 15px; touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none;
}
.hold-fill {
  position: absolute; inset: 0; background: rgba(180, 45, 35, 0.3); transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s var(--ease);
}
.hold-btn.holding .hold-fill { transform: scaleX(1); transition-timing-function: linear; }
.hold-text { position: relative; }

/* Налоги: разбивка по работникам и видам деятельности, выбор видов патента */
.tax-breakdown { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--sheet); border-radius: 14px; }
.tax-breakdown > b { font-size: 13px; color: var(--ink-2); }
.tax-breakdown-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.tax-breakdown-row small { color: var(--ink-2); }
.tax-breakdown-row b { white-space: nowrap; }
.tax-breakdown-row.used span { font-weight: 650; }
.activity-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.activity-row { display: flex; flex-direction: column; gap: 6px; }
.activity { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border: 1.5px solid var(--hair); border-radius: 14px; background: var(--sheet); text-align: left; font: inherit; color: inherit; }
.activity[aria-pressed="true"] { border-color: var(--pine); background: #f7fbf9; }
.activity .niche-check { width: 20px; height: 20px; flex: none; margin-top: 1px; border: 1.5px solid var(--hair); color: transparent; }
.activity[aria-pressed="true"] .niche-check { background: var(--pine); color: #fff; border-color: var(--pine); }
.activity-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; }
.activity-text small { color: var(--ink-2); font-size: 12px; }
.qty-input { max-width: 160px; }
.scale-box { display: flex; flex-direction: column; gap: 8px; }
.scale-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; align-items: center; }
.scale-head small { color: var(--ink-2); font-size: 13px; }

/* Касса АПБ «Внешний ФР»: ход чека, команда моста */
.kassa-job { display: flex; flex-direction: column; gap: 10px; }
.kassa-state { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-ctl); background: var(--pine-soft); color: var(--pine); }
.kassa-state.warn { background: var(--amber-soft); color: var(--amber); }
.kassa-state.danger { background: var(--rose-soft); color: var(--rose); }
.kassa-state.muted { background: var(--paper); color: var(--ink-2); }
.kassa-state > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kassa-state b { font-size: 16px; }
.kassa-state small { color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.spinner { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 3px solid currentColor; border-top-color: transparent; animation: spin 0.8s linear infinite; }
.code-box { margin: 0; padding: 12px; border-radius: var(--r-ctl); background: var(--sheet); border: 1px solid var(--hair); font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }

/* --- Налоги: лимит ввоза и схемы режимов в админке (ТЗ, раздел 31) --- */
.import-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.import-card .share { height: 8px; border-radius: 4px; margin-top: 2px; }
.import-card.warn .share span { background: var(--amber); }
.import-card.danger .share span { background: var(--rose); }
.import-card .note { margin: 0; }
.scheme-card { background: var(--sheet); border-radius: var(--r-sheet); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.scheme-card h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scheme-card .summary { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.scheme-params { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scale-rows { display: flex; flex-direction: column; gap: 8px; }
.scale-rows .scale-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; align-items: center; }
.scheme-title { margin: 8px 4px 0; font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }

/* Доставка (ТЗ, раздел 33): форма заказа по шагам, итог и кнопка — внизу окна */
.dform-sec { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 18px; background: var(--sheet); }
.dform-sec h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.dform-sec .input { background: var(--paper); }
.dform-sec .search { background: var(--paper); }
.dform-sec .suggest-row { background: var(--paper); }
.dform-map { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.dform-map .chip { display: inline-flex; align-items: center; gap: 6px; }
.dlines { display: flex; flex-direction: column; gap: 10px; }
.dlines .note { margin: 0; }
.dline { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--hair); }
.dline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dline-name { font-size: 15px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.dline-name small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.dline-row { display: grid; grid-template-columns: minmax(0, 150px) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.dline-row .stepper { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 6px; }
.dline-row .stepper .icon-btn { width: 40px; height: 44px; font-size: 22px; border-radius: 12px; }
.dline-row .qty-input { height: 44px; padding: 0 4px; text-align: center; min-width: 0; }
.dline-x { color: var(--ink-3); font-size: 15px; }
.dline-price { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dline-price .input { height: 44px; min-width: 0; }
.dline-price span { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.dform-footer {
  position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); z-index: 2;
  margin: 0 -16px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border-top: 1px solid var(--hair);
}
.dform-footer .btn { flex: 0 0 auto; width: auto; padding: 0 22px; }
.dform-total { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dform-total span { font-size: 12px; color: var(--ink-3); }
.dform-total b { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; white-space: nowrap; }
.dform-total small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Дата и время на iPhone: поле не шире своей ячейки, значение слева, высота как у остальных */
input.input[type="date"], input.input[type="time"] {
  display: block; min-width: 0; max-width: 100%; min-height: 50px; line-height: 48px; text-align: left; -webkit-appearance: none;
}
input.input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input.input::-webkit-datetime-edit { padding: 0; }
.dform-sec .chip { background: var(--paper); border: 1px solid var(--hair); }
.dform-sec .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Заказ доставки в списке: одна колонка — время и статус, кто, куда, курьер и сумма */
.dorder {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; text-align: left;
  padding: 14px 16px; border: 0; border-radius: 20px; background: var(--sheet); color: var(--ink);
  transition: transform 0.12s var(--ease);
}
.dorder:active { transform: scale(0.985); }
.dorder.done, .dorder.cancelled { opacity: 0.62; }
.dorder-top { display: flex; align-items: center; gap: 8px; }
.dorder-n {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--pine); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 750; font-style: normal;
}
.dorder.onway .dorder-n { background: var(--amber); }
.dorder-time { flex: 1; min-width: 0; font-size: 16px; font-weight: 750; letter-spacing: -0.01em; white-space: nowrap; }
.dorder-top .badge { flex: none; }
.dorder-who { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.dorder-addr { font-size: 14px; color: var(--ink-2); line-height: 1.4; overflow-wrap: anywhere; }
.dorder-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.dorder-foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dorder-foot b { flex: none; font-size: 16px; font-weight: 750; color: var(--ink); white-space: nowrap; }

/* Общепит (ТЗ, раздел 34): касса плитками, чек снизу, техкарта блюда */
.pos-day {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; width: 100%;
  padding: 16px 18px 14px; border: 0; border-radius: 24px; text-align: left; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, rgba(143, 227, 189, 0.28), transparent 55%),
    linear-gradient(150deg, #13775a 0%, #0b4a35 55%, #072a1f 100%);
  box-shadow: 0 18px 34px -20px rgba(7, 42, 31, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease;
}
.pos-day:active { transform: scale(0.985); }
.pos-day::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.10) 50%, transparent 65%);
  transform: translateX(-100%); animation: ph-sheen 5s ease-in-out 0.6s infinite;
}
@keyframes ph-sheen { 0%, 75% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.ph-top { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.72); }
.ph-top small { font-size: 13px; font-weight: 550; }
.ph-top svg { margin-left: auto; opacity: 0.6; }
.ph-change { font-style: normal; font-size: 12px; font-weight: 750; padding: 3px 8px; border-radius: 99px; }
.ph-change.up { background: rgba(143, 227, 189, 0.2); color: #8fe3bd; }
.ph-change.down { background: rgba(242, 193, 78, 0.2); color: #f2c14e; }
.ph-main { display: flex; align-items: baseline; gap: 8px; margin-top: -4px; }
.ph-sum { font-size: 38px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ph-main small { font-size: 17px; font-weight: 650; color: rgba(255, 255, 255, 0.7); }
.ph-chart { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.ph-chart i {
  flex: 1; height: var(--h); min-height: 3px; border-radius: 3px 3px 1px 1px; background: rgba(143, 227, 189, 0.75);
  transform-origin: bottom; animation: ph-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--k) * 25ms);
}
.ph-chart i.zero { background: rgba(255, 255, 255, 0.16); }
.ph-chart i.later { background: transparent; box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.12); }
.ph-chart i.now { background: #fff; min-height: 6px; box-shadow: 0 0 12px rgba(143, 227, 189, 0.9); }
@keyframes ph-grow { from { transform: scaleY(0); } }
.ph-axis { position: relative; display: flex; justify-content: space-between; height: 14px; margin-top: -4px; font-size: 11px; color: rgba(255, 255, 255, 0.5); }
.ph-axis span:nth-child(2) { position: absolute; transform: translateX(-50%); color: #fff; font-weight: 650; }
.ph-stats { display: flex; gap: 8px; }
.ph-stats > span { flex: 1; padding: 7px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.09); font-size: 13.5px; color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-stats b { font-size: 17px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.ph-empty { font-size: 13.5px; color: rgba(255, 255, 255, 0.72); }
.ph-split { display: flex; flex-direction: column; gap: 6px; }
.ph-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; }
.ph-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: rgba(255, 255, 255, 0.72); }
.ph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ph-legend i { width: 8px; height: 8px; border-radius: 2px; }
.ph-split .pay-cash { background: #8fe3bd; }
.ph-split .pay-card { background: #6fb6ff; }
.ph-split .pay-account { background: #f2c14e; }
@media (prefers-reduced-motion: reduce) { .pos-day::after, .ph-chart i { animation: none; } }
.pos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pos-tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  min-height: 88px; padding: 12px 13px; border-radius: 18px; border: 1.5px solid transparent;
  background: var(--sheet); color: var(--ink); text-align: left;
  transition: transform 0.12s var(--ease), background-color 0.15s, border-color 0.15s;
}
.pos-tile:active { transform: scale(0.97); }
.pos-tile.on { border-color: var(--pine); background: var(--pine-soft); }
.pos-tile.out { opacity: 0.5; }
.pos-name {
  font-size: 15px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; padding-right: 26px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pos-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.pos-foot b { font-size: 15px; font-weight: 750; white-space: nowrap; }
.pos-foot small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-count {
  position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
  display: grid; place-items: center; background: var(--pine); color: #fff; font-style: normal; font-size: 13px; font-weight: 750;
}
.pos-bar { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; }
.pos-bar[hidden] { display: none; }
.pos-bar-btn {
  width: 100%; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 8px 0 10px;
  border: 0; border-radius: 19px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(20, 32, 27, 0.25);
}
.pos-bar-count { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); font-weight: 750; font-size: 15px; }
.pos-bar-btn b { flex: 1; text-align: left; font-size: 19px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-bar-go { display: inline-flex; align-items: center; gap: 2px; height: 42px; padding: 0 10px 0 16px; border-radius: 13px; background: var(--pine); font-size: 15px; font-weight: 700; }
.cart-lines { display: flex; flex-direction: column; gap: 8px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--sheet); }
.cart-name { font-size: 15px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; }
.cart-name small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.cart-step { display: flex; align-items: center; gap: 6px; }
.cart-step .icon-btn { width: 38px; height: 38px; font-size: 20px; font-weight: 600; border-radius: 12px; }
.cart-step b { min-width: 22px; text-align: center; font-size: 16px; }
.cart-sum { text-align: right; font-size: 15px; white-space: nowrap; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 4px 0; }
.cart-total span { color: var(--ink-2); font-weight: 600; }
.cart-total b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.cart-cash { display: flex; flex-direction: column; gap: 8px; }
.cart-change { font-size: 15px; font-weight: 700; color: var(--pine); min-height: 1px; }
.cart-change.short { color: var(--rose); }
.cart-pay-title { margin: 4px 4px 0; font-size: 15px; font-weight: 700; }
.rline { display: grid; grid-template-columns: minmax(0, 1fr) 128px 32px; align-items: center; gap: 8px; padding: 10px 6px 10px 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--hair); }
.rline-name { font-size: 15px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; }
.rline-name small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.rline-qty { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rline-qty .input { height: 44px; min-width: 0; padding: 0 8px; text-align: center; }
.rline-unit { font-size: 13px; color: var(--ink-3); white-space: nowrap; min-width: 26px; }
.rline-qty .rline-select { width: 64px; flex: none; padding: 0 4px; }
.rline .icon-btn { width: 32px; height: 32px; color: var(--ink-3); }

/* QR для клиентов (ТЗ, раздел 18): предпросмотр, формат, цвет, подпись */
.qr-maker { display: flex; flex-direction: column; gap: 12px; }
.qr-maker .note { margin: -4px 4px 0; }
.qr-preview {
  position: relative; display: grid; place-items: center; min-height: 260px; padding: 18px;
  border-radius: var(--r-sheet); background: var(--sheet);
}
.qr-preview img {
  display: block; width: 100%; max-width: 260px; height: auto; border-radius: 14px;
  box-shadow: 0 14px 34px -14px rgba(20, 32, 27, 0.45); transition: opacity 0.2s;
}
.qr-preview[data-format="story"] img { max-width: 190px; }
.qr-preview[data-format="qr"] img { max-width: 230px; box-shadow: 0 0 0 1px var(--hair); }
.qr-preview.loading img { opacity: 0.4; }
.qr-preview.loading::after {
  content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--hair); border-top-color: var(--pine); animation: spin 0.8s linear infinite;
}
.qr-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.qr-swatch {
  position: relative; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); transition: transform 0.15s var(--ease);
}
.qr-swatch:active { transform: scale(0.92); }
.qr-swatch i { position: absolute; right: -1px; bottom: -1px; width: 16px; height: 16px; border-radius: 50%; background: var(--ac); box-shadow: 0 0 0 2px var(--paper); }
.qr-swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--pine); }

/* Аналитика услуг и выездов (bi_visits.js): анимация — когда блок доехал до экрана (.vis.in) */
.vis-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.vis-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vis-stat { background: var(--paper); border-radius: 14px; padding: 10px 11px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vis-stat small { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.vis-stat b { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.vis-stat em { font-style: normal; font-size: 11.5px; color: var(--ink-3); line-height: 1.25; }
.vis-stat.mint b { color: #1f9d66; }
.vis-stat.pine b { color: var(--pine); }
.vis-stat .delta { align-self: flex-start; }
.vis .chart-title { flex-wrap: wrap; row-gap: 2px; }
.vis-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.vis-sub span { font-size: 12px; font-weight: 550; color: var(--ink-2); text-align: right; white-space: normal; }
.vis-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.chart .vis-back, .swatch-vis-back { fill: var(--pine); background: var(--pine); }
.chart .vis-new, .swatch-vis-new { fill: var(--mint); background: var(--mint); }
.chart .vis-back, .chart .vis-new { transform-origin: 50% 100%; }

.vis-split { margin-top: 12px; }
.vis-split-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--paper); gap: 2px; }
.vis-split-bar i { display: block; height: 100%; transform-origin: left; }
.vis-split-bar i:first-child { background: var(--pine); border-radius: 5px 0 0 5px; }
.vis-split-bar i:last-child { background: var(--mint); border-radius: 0 5px 5px 0; }
.vis-split-text { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.vis-split-text b { color: var(--ink); }

.vis-segbar { display: flex; height: 14px; gap: 2px; margin-top: 14px; border-radius: 7px; overflow: hidden; }
.vis-segbar i { display: block; height: 100%; min-width: 3px; transform-origin: left; }
.vis-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.vis-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.vis-legend-row.empty { opacity: 0.45; }
.vis-legend-row > i { width: 10px; height: 10px; border-radius: 3px; }
.vis-legend-row span { display: flex; flex-direction: column; min-width: 0; }
.vis-legend-row span b { font-size: 13.5px; font-weight: 650; }
.vis-legend-row span small { font-size: 11.5px; color: var(--ink-3); }
.vis-legend-row .num { align-items: flex-end; }
.vis-legend-row .num b { font-size: 15px; font-weight: 750; }

.vis-histo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; height: 104px; margin-top: 8px; }
.vis-histo > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.vis-histo small { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.vis-histo-col { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; background: var(--paper); border-radius: 8px; overflow: hidden; }
.vis-histo-col i { display: block; width: 100%; background: linear-gradient(180deg, var(--mint), var(--pine)); border-radius: 8px; transform-origin: 50% 100%; }
.vis-histo em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

.vis-remind { display: flex; flex-direction: column; gap: 6px; }
.vis-person { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); text-align: left; }
.vis-person .rank { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fde9dc; color: #b4561c; font-size: 13px; font-weight: 750; }
.vis-person-who { display: flex; flex-direction: column; min-width: 0; }
.vis-person-who b { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vis-person-who small { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vis-overdue { display: flex; flex-direction: column; align-items: flex-end; }
.vis-overdue b { font-size: 13px; font-weight: 750; color: #b4561c; white-space: nowrap; }
.vis-overdue small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.vis-cohorts { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; overflow-x: auto; }
.vis-cohort-row { display: grid; grid-template-columns: 84px repeat(var(--cols), minmax(42px, 1fr)); gap: 4px; align-items: stretch; }
.vis-cohort-row.head span { font-size: 10.5px; font-weight: 650; color: var(--ink-3); text-align: center; }
.vis-cohort-row.head span:first-child { text-align: left; }
.vis-cohort-name { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.vis-cohort-name b { font-size: 13px; font-weight: 700; }
.vis-cohort-name small { font-size: 10.5px; color: var(--ink-3); }
.vis-cell { display: grid; place-items: center; height: 34px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--pine); background: rgba(14, 107, 80, var(--a, 0)); }
.vis-cell.light { color: #fff; }
.vis-cell.none { background: transparent; color: var(--ink-3); font-weight: 500; }

.vis-funnel { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px; }
.vis-stage { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.vis-stage-bar { height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; transform-origin: 50% 50%; }
.vis-stage:nth-child(1) .vis-stage-bar { background: #9dd9bd; color: var(--pine); }
.vis-stage:nth-child(2) .vis-stage-bar { background: var(--mint); }
.vis-stage:nth-child(3) .vis-stage-bar { background: var(--pine); }
.vis-stage-bar b { font-size: 15px; font-weight: 750; }
.vis-stage > span { font-size: 12px; color: var(--ink-2); font-weight: 600; display: flex; gap: 6px; }
.vis-stage > span small { color: var(--pine); font-weight: 750; }
.vis-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.vis-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.vis-source { background: var(--paper); border-radius: 14px; padding: 10px 11px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink-2); }
.vis-source small { font-weight: 650; }
.vis-source > b { font-size: 18px; color: var(--ink); font-weight: 750; }
.vis-source span b { color: var(--pine); }

.vis-leads { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.vis-lead { display: grid; grid-template-columns: minmax(84px, 0.9fr) minmax(0, 1.4fr) auto; gap: 4px 10px; align-items: center; font-size: 12.5px; }
.vis-lead > span:first-child { color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vis-lead-bar { height: 8px; border-radius: 4px; background: var(--paper); overflow: hidden; }
.vis-lead-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--mint), var(--pine)); transform-origin: left; }
.vis-lead > b { font-size: 13px; font-weight: 750; text-align: right; }
.vis-lead.wide { grid-template-columns: minmax(110px, 1.3fr) minmax(0, 1fr) auto; }
.vis-lead > small { grid-column: 1 / -1; font-size: 11px; color: var(--ink-3); margin-top: -4px; }
.vis-lead > small.neg { color: var(--rose); }

.vis-heat { display: grid; grid-template-columns: 22px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; margin-top: 14px; }
.vis-heat-corner { display: block; }
.vis-heat-hour { font-size: 9.5px; color: var(--ink-3); text-align: center; font-weight: 600; }
.vis-heat-day { font-size: 11px; color: var(--ink-2); font-weight: 650; display: flex; align-items: center; }
.vis-heat-cell { aspect-ratio: 1; min-height: 14px; border: 0; padding: 0; border-radius: 5px; background: rgba(14, 107, 80, var(--a)); }
.vis-heat-cell.none { background: var(--paper); }
.vis-heat-cell.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.vis-heat-tip { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); min-height: 18px; }

.vis-road { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.vis-road .donut-box { width: 112px; height: 112px; }
.vis-road .vis-stats { flex: 1; grid-template-columns: 1fr; margin-top: 0; }
.vis-road .donut-track, .vis-road .donut-arc { stroke-width: 14; }
.vis-road .donut-arc { stroke-linecap: round; }

.vis-load { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; font-size: 12px; }
.vis-load small { color: var(--ink-2); font-weight: 600; }
.vis-load-bar { height: 6px; border-radius: 3px; background: var(--paper); overflow: hidden; }
.vis-load-bar i { display: block; height: 100%; border-radius: 3px; background: var(--mint); transform-origin: left; animation: grow-x 0.8s var(--ease) both; }
.vis-load-bar i.hot { background: #e0702f; }
.vis-load-bar i.cold { background: #9dbcf0; }
.vis-load b { font-size: 12.5px; font-weight: 750; }

/* Появление: полосы растут, клетки проявляются волной */
.vis.pending { opacity: 0; transform: translateY(14px); }
.vis.in { animation: rise 0.5s var(--ease) both; }
.vis.pending .vis-segbar i, .vis.pending .vis-split-bar i, .vis.pending .vis-lead-bar i, .vis.pending .vis-stage-bar { transform: scaleX(0); }
.vis.pending .vis-histo-col i { transform: scaleY(0); }
.vis.pending .vis-cell, .vis.pending .vis-heat-cell { opacity: 0; transform: scale(0.6); }
.vis.pending .bar { animation: none; transform: scaleY(0); }
.vis.pending .donut-arc { stroke-dasharray: 0 999; }
.vis.in .vis-segbar i, .vis.in .vis-split-bar i, .vis.in .vis-lead-bar i { animation: grow-x 0.8s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 0.15s); }
.vis.in .vis-stage-bar { animation: grow-x 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 160ms + 0.15s); transform-origin: 50% 50%; }
.vis.in .vis-histo-col i { animation: grow 0.8s var(--spring) both; animation-delay: calc(var(--i, 0) * 80ms + 0.2s); }
.vis.in .vis-cell, .vis.in .vis-heat-cell { animation: vis-pop 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms + 0.2s); }
.vis.in .donut-arc { animation: vis-arc 1.1s var(--ease) both; }
@keyframes vis-pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes vis-arc { from { stroke-dasharray: 0 999; } }
@media (prefers-reduced-motion: reduce) {
  .vis, .vis.in, .vis.pending { animation: none !important; opacity: 1 !important; transform: none !important; }
  .vis .vis-segbar i, .vis .vis-split-bar i, .vis .vis-lead-bar i, .vis .vis-stage-bar, .vis .vis-histo-col i,
  .vis .vis-cell, .vis .vis-heat-cell, .vis .bar, .vis-load-bar i { animation: none !important; opacity: 1 !important; transform: none !important; }
  .vis .donut-arc { animation: none !important; }
}

/* График: выходные периодом и разовые перерывы */
.off-list { display: flex; flex-direction: column; gap: 8px; }
.off-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--sheet); animation: rise 0.35s var(--ease) both; }
.off-card.warn { background: var(--amber-soft); }
.off-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--pine-soft); color: var(--pine); }
.off-icon.pause { background: #fde9dc; color: #b4561c; }
.off-card.warn .off-icon { background: #ffffff; color: var(--amber); }
.off-icon b { font-size: 12px; font-weight: 750; letter-spacing: -0.02em; }
.off-text { display: flex; flex-direction: column; min-width: 0; }
.off-text b { font-size: 14.5px; font-weight: 650; }
.off-text small { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.off-total { font-size: 14px; font-weight: 650; color: var(--pine); min-height: 20px; margin: 0; }

/* Услуга с ожиданием (краска, выдержка): работа · ожидание · работа */
.wait-box { display: flex; flex-direction: column; gap: 10px; background: var(--paper); border-radius: 16px; padding: 12px; }
.wait-box .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wait-box .switch-row span { display: flex; flex-direction: column; }
.wait-box .switch-row small { font-size: 12px; color: var(--ink-2); }
.wait-body { display: flex; flex-direction: column; gap: 10px; }
.wait-bar { display: flex; height: 28px; gap: 3px; border-radius: 10px; overflow: hidden; }
.wait-bar i { display: grid; place-items: center; min-width: 6px; font-style: normal; font-size: 11.5px; font-weight: 650; transition: flex 0.3s var(--ease); }
.wait-bar .work { background: var(--pine); }
.wait-bar .wait { background: repeating-linear-gradient(135deg, var(--pine-soft) 0 8px, #d3ebde 8px 16px); color: var(--pine); }
.wait-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wait-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.wait-field b { font-size: 15px; color: var(--ink); padding: 8px 0; }
.wait-field .time-in { width: 100%; font-size: 14px; padding-left: 6px; padding-right: 6px; text-align: center; }
.bc-wait { color: var(--pine) !important; }
.parallel-row { display: flex; flex-direction: column; gap: 10px; }
.parallel-row > span { display: flex; flex-direction: column; gap: 2px; }
.parallel-row small { font-size: 12.5px; color: var(--ink-2); }

/* Долги (ТЗ, раздел 35) */
.debt-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; }
.debt-hero.client .hero-num { color: var(--pine); }
.debt-hero.supplier .hero-num { color: #6d4fc2; }
.debt-head { display: flex; align-items: center; gap: 14px; }
.debt-head .lead { margin: 2px 0 0; }
.debt-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.debt-entry .debt-sign { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.debt-sign.debt { background: var(--amber-soft); color: var(--amber); }
.debt-sign.pay { background: var(--pine-soft); color: var(--pine); }
.debt-entry.cancelled .row-text b, .debt-entry.cancelled .row-value { text-decoration: line-through; color: var(--ink-3); }
.debtor-picker { display: flex; flex-direction: column; gap: 8px; }
.debtor-hints { display: flex; flex-wrap: wrap; gap: 6px; }
.debtor-hints:empty { display: none; }
.debtor-hints .chip small { opacity: 0.6; font-weight: 500; }
