/* КИЗ Контроль — демо веб-кабинета.
   Токены — дизайн-система 12.09. Полупрозрачность и размытие — только у навигации и закреплённых панелей;
   под таблицами, текстом и документами — плотный белый фон. */
:root {
  color-scheme: light;
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-muted: #F1F5F9; --surface-sunken: #F8FAFC;
  --border: #E5E9EF; --border-strong: #CBD5E1;
  --text: #0F172A; --text-secondary: #475569; --text-muted: #64748B;
  --accent: #0F766E; --accent-hover: #115E59; --accent-subtle: #F0FDFA; --accent-border: #99F6E4;
  --warning: #F59E0B; --warning-text: #B45309; --warning-subtle: #FFFBEB; --warning-border: #FDE68A;
  --critical: #DC2626; --critical-text: #B91C1C; --critical-subtle: #FEF2F2; --critical-border: #FECACA;
  --glass: rgb(255 255 255 / 72%); --glass-line: rgb(15 23 42 / 8%); --blur: saturate(170%) blur(16px);
  --shadow-xs: 0 1px 2px rgb(15 23 42 / 4%);
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 4%), 0 4px 12px rgb(15 23 42 / 5%);
  --shadow-lg: 0 16px 40px rgb(15 23 42 / 12%), 0 2px 8px rgb(15 23 42 / 6%);
  --ease: cubic-bezier(.2, .8, .2, 1); --t: .16s;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --radius: 14px; --radius-sm: 10px; --radius-xs: 6px;
  --fs-body: 14px; --lh-body: 20px; --btn-h: 40px; --nav-h: 56px;
}
@media (max-width: 767px) { :root { --fs-body: 16px; --lh-body: 24px; --btn-h: 48px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-body)/var(--lh-body) var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; line-height: 26px; font-weight: 600; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--24 { width: 24px; height: 24px; } .icon--20 { width: 20px; height: 20px; } .icon--16 { width: 16px; height: 16px; } .icon--14 { width: 14px; height: 14px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.muted { color: var(--text-muted); } .secondary { color: var(--text-secondary); }
.small { font-size: 13px; line-height: 18px; } .nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; }
.noscript { padding: 24px; }

/* Переходы: короткие, без пружин; при prefers-reduced-motion отключаются ниже */
.btn, .chip, .nav__item, .org-btn, .kpi, .rcard, .menu__item, tbody tr, .icon-btn, .source {
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease),
    color var(--t) var(--ease), transform var(--t) var(--ease);
}

/* Полупрозрачные слои: навигация и закреплённые панели. Запасной вариант — непрозрачный фон. */
.sidebar, .topbar, .bottom-nav, .panel__head, .action-bar, .menu {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar, .topbar, .bottom-nav, .panel__head, .action-bar, .menu { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .topbar, .bottom-nav, .panel__head, .action-bar, .menu { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Демо-лента: заметная, но спокойная */
.demo-ribbon { display: flex; align-items: center; gap: 12px; padding: 6px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; line-height: 18px; }
.demo-ribbon__tag { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--text); color: #fff; font-weight: 600; font-size: 12px; }
.demo-ribbon__text { flex: 1; min-width: 0; }
.demo-ribbon__btn { flex: none; min-height: 32px; }

/* Каркас */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 31px); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px;
  border-right: 1px solid var(--glass-line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand__mark { position: relative; width: 24px; height: 24px; border-radius: 7px; background: var(--accent); }
.brand__mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #D7F16B; }
.topbar { display: none; }
.main { min-width: 0; padding: 28px 32px 56px; max-width: 1440px; outline: none; }
.sidebar__foot { margin-top: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-secondary); font-weight: 500;
  text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.nav__item:hover { background: rgb(15 23 42 / 4%); color: var(--text); }
.nav__item[aria-current="page"] { background: var(--accent-subtle); color: var(--accent); }
.nav__item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--accent); }
.nav__item--secondary { font-weight: 400; color: var(--text-muted); }
.nav__count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: #fff;
  font-size: 12px; line-height: 22px; text-align: center; font-weight: 600; }

/* Переключатель организаций — главный ориентир, всегда заметен */
.org-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-xs), inset 3px 0 0 var(--accent); cursor: pointer; text-align: left; }
.org-btn:hover { border-color: var(--accent-border); box-shadow: var(--shadow-sm), inset 3px 0 0 var(--accent); }
.org-btn__text { flex: 1; min-width: 0; }
.org-btn__label { display: block; font-size: 11px; line-height: 14px; color: var(--text-muted); }
.org-btn__name { display: block; font-weight: 600; line-height: 18px; overflow-wrap: anywhere; }
.org-btn__meta { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.org-btn__chev { color: var(--text-muted); }
.org-avatar { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-subtle);
  border: 1px solid var(--accent-border); color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.menu { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--glass-line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu__title { padding: 8px 10px 6px; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.menu__item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; text-align: left; cursor: pointer; min-height: 48px; }
.menu__item:hover, .menu__item:focus-visible { background: rgb(15 23 42 / 5%); }
.menu__item[aria-selected="true"] { background: var(--accent-subtle); }
.menu__name { display: block; font-weight: 500; }
.menu__meta { display: block; font-size: 12px; line-height: 16px; color: var(--text-muted); }

/* Шапка страницы и источники */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head__org { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; margin-bottom: 2px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.source { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.dot--warning { background: var(--warning); } .dot--critical { background: var(--critical); } .dot--neutral { background: var(--text-muted); }
.source--warning .source__time { color: var(--warning-text); font-weight: 500; }
.source--critical .source__time { color: var(--critical-text); font-weight: 500; }

/* Баннеры */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; border-radius: var(--radius); }
.banner__body { flex: 1; min-width: 0; }
.banner__title { font-weight: 600; }
.banner--warning { background: var(--warning-subtle); border-color: var(--warning-border); }
.banner--warning > .icon { color: var(--warning-text); }
.banner--critical { background: var(--critical-subtle); border-color: var(--critical-border); }
.banner--critical > .icon { color: var(--critical-text); }

/* Карточки: плотный белый фон, тонкая граница, мягкая тень */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-xs); }
.section { margin-top: 24px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kpi__label { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-secondary); }
.kpi__value { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; }
.kpi__value--none { color: var(--text-muted); }
.kpi__hint { font-size: 12px; line-height: 16px; color: var(--text-muted); }
.kpi--attention .kpi__label .icon { color: var(--warning-text); }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.todo:first-child { border-top: 0; padding-top: 0; }
.todo__body { flex: 1; min-width: 0; }
.todo__title { margin-top: 6px; font-weight: 500; }
.steps { counter-reset: s; display: grid; gap: 10px; }
.steps li { display: flex; gap: 10px; }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-muted); color: var(--text-secondary); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.wait-line { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-secondary); margin-top: 16px; }

/* Бейджи */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--radius-xs);
  font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.badge--neutral { background: var(--surface-muted); color: var(--text-secondary); }
.badge--outline { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.badge--ready { background: var(--accent-subtle); color: var(--accent); }
.badge--warning { background: var(--warning-subtle); color: var(--warning-text); }
.badge--critical { background: var(--critical-subtle); color: var(--critical-text); }
.badge--lg { height: 28px; padding: 0 10px; font-size: 13px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-muted); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgb(15 118 110 / 25%); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--quiet { border-color: var(--border); color: var(--accent); padding: 0 10px 0 14px; }
.btn--quiet:hover { background: var(--accent-subtle); border-color: var(--accent-border); }
.btn--text { border-color: transparent; background: none; color: var(--accent); padding: 0 8px; }
.btn--text:hover { background: var(--accent-subtle); }
.btn[disabled] { cursor: not-allowed; background: var(--surface-muted); border-color: var(--border); color: var(--text-muted); box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-tag { font-size: 11px; line-height: 16px; padding: 0 5px; border: 1px dashed var(--text-muted); border-radius: 4px; color: var(--text-secondary); font-weight: 500; }
.btn--primary .demo-tag { color: #fff; border-color: rgb(255 255 255 / 70%); }

/* Панель инструментов списка */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 320px; max-width: 480px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search input, .select { width: 100%; min-height: var(--btn-h); padding: 0 12px 0 40px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-xs); }
.select { padding-left: 12px; width: auto; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 500; color: var(--text-secondary); }
.chip:hover { border-color: var(--border-strong); }
.chip[aria-pressed="true"] { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent); }
.chip__n { color: var(--text-muted); font-weight: 400; }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 8px; color: var(--text-muted); font-size: 13px; }

/* Таблица */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-xs); }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; background: var(--surface-sunken); text-align: left; padding: 10px 12px; font-size: 12px; line-height: 16px;
  font-weight: 500; color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.is-open { background: var(--surface-sunken); }
td .mono, td .small.muted { white-space: nowrap; }
.status-hint { font-size: 12px; line-height: 16px; color: var(--text-muted); max-width: 240px; }
.row-link { color: var(--text); font-weight: 500; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.thumb { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-muted); color: var(--text-muted); display: grid; place-items: center; flex: none; }
.cell-product { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.status-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.move { display: flex; gap: 8px; align-items: flex-start; min-width: 170px; }
.move > .icon { color: var(--text-muted); margin-top: 1px; }
.stale { color: var(--warning-text); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }

/* Карточки на телефоне */
.cards { display: none; }
.rcard { display: block; width: 100%; text-align: left; padding: 16px; margin-bottom: 10px; background: var(--surface); text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); cursor: pointer; font: inherit; color: inherit; }
.rcard:active { background: var(--surface-sunken); }
.rcard__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.rcard__name { font-weight: 600; }
.rcard__meta { color: var(--text-secondary); font-size: 14px; line-height: 20px; }
.rcard__move { display: flex; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  color: var(--text-secondary); font-size: 14px; line-height: 20px; }

/* Пустые состояния и скелетоны */
.empty { text-align: center; padding: 36px 20px; }
.empty__icon { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--surface-muted); color: var(--text-secondary); }
.empty__icon--ready { background: var(--accent-subtle); color: var(--accent); }
.empty p { max-width: 520px; margin: 6px auto 0; color: var(--text-secondary); }
.skeleton { border-radius: var(--radius-xs); background: linear-gradient(90deg, var(--surface-muted) 25%, #E9EEF4 50%, var(--surface-muted) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-line { height: 14px; margin: 8px 0; }

/* Карточка возврата: панель — сама контейнер прокрутки, шапка и нижняя панель закреплены внутри */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(15 23 42 / 18%); }
.panel { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; background: var(--bg); box-shadow: var(--shadow-lg); border-left: 1px solid var(--glass-line); }
.panel--enter { animation: slide-in .2s var(--ease); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.panel__head { position: sticky; top: 0; z-index: 3; display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--glass-line); }
.panel__head-body { flex: 1; min-width: 0; }
.panel__body { flex: 1 0 auto; padding: 16px 20px 24px; display: grid; gap: 14px; align-content: start; }
.icon-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-secondary); }
.icon-btn:hover { background: rgb(15 23 42 / 5%); }
.status-line { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.next { border-left: 3px solid var(--accent); }
.next--warning { border-left-color: var(--warning); } .next--critical { border-left-color: var(--critical); } .next--neutral { border-left-color: var(--border-strong); }
.next__label { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.next__note { margin-top: 10px; font-size: 13px; line-height: 18px; color: var(--text-muted); }
.next__move { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-sunken);
  border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; line-height: 18px; }
.next__move .icon { color: var(--text-muted); margin-top: 1px; }
.action-bar { display: none; }

/* Где товар / код в Честном знаке — два отдельных столбца */
.split { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; }
.split__col { padding: 16px 18px; min-width: 0; }
.split__col + .split__col { border-left: 1px solid var(--border); }
.split__label { display: flex; gap: 6px; align-items: center; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-muted); }
.split__value { font-size: 16px; line-height: 22px; font-weight: 600; margin: 6px 0 10px; }
.mini { margin: 0; display: grid; gap: 8px; }
.mini dt { font-size: 12px; line-height: 16px; color: var(--text-muted); }
.mini dd { margin: 0; }
.mini__src { display: block; font-size: 12px; line-height: 16px; color: var(--text-muted); margin-top: 2px; }
.split__note { display: flex; gap: 6px; margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--surface-sunken);
  border: 1px solid var(--border); font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.split__note .icon { margin-top: 1px; }
.split__foot { grid-column: 1 / -1; padding: 10px 18px; background: var(--surface-sunken); border-top: 1px solid var(--border);
  font-size: 12px; line-height: 16px; color: var(--text-secondary); }

.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.facts dt { color: var(--text-secondary); } .facts dd { margin: 0; }
.checks-group + .checks-group { margin-top: 16px; }
.checks-group__head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.check { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.check:first-of-type { border-top: 0; }
.check__icon--ok { color: var(--accent); } .check__icon--fail { color: var(--critical-text); }
.check__icon--pending, .check__icon--skipped { color: var(--text-muted); } .check__icon--unavailable { color: var(--warning-text); }
.check__body { flex: 1; min-width: 0; }
.check__result { font-size: 13px; line-height: 18px; font-weight: 500; }
.check__result--ok { color: var(--accent); } .check__result--fail { color: var(--critical-text); }
.check__result--pending, .check__result--skipped { color: var(--text-secondary); } .check__result--unavailable { color: var(--warning-text); }
.check__note { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 0 0 14px; }
.timeline li::before { content: ""; position: absolute; left: 100px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.timeline li.is-last::before { background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 103px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline__time { font-size: 13px; color: var(--text-muted); }
.timeline__body { padding-left: 20px; }
.timeline__src { font-size: 12px; color: var(--text-muted); }
.timeline--compact li { grid-template-columns: 1fr; gap: 0; padding-left: 20px; }
.timeline--compact li::before { left: 0; } .timeline--compact li::after { left: 3px; }
.timeline--compact .timeline__body { padding-left: 0; }
.demo-note { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }

/* Панель демо-сценариев */
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.switch-row:first-of-type { border-top: 0; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }

.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: var(--radius-sm); background: rgb(15 23 42 / 90%); color: #fff; box-shadow: var(--shadow-lg);
  animation: pop .16s var(--ease); }
.bottom-nav { display: none; }
.only-mobile { display: none; } .only-narrow { display: none; }

/* Планшет и телефон */
@media (max-width: 1023px) {
  .only-desktop { display: none; } .only-mobile { display: inline; }
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { display: block; position: sticky; top: 0; z-index: 30; padding: 8px 16px; border-bottom: 1px solid var(--glass-line); }
  .org-btn { min-height: 52px; padding: 8px 12px; }
  .main { padding: 16px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
  .page-head__org { display: none; } /* организация и так закреплена в верхней панели */
  .bottom-nav { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--glass-line); }
  .bottom-nav .nav__item { flex: 1; flex-direction: column; gap: 2px; justify-content: center; min-height: var(--nav-h);
    font-size: 11px; line-height: 14px; border-radius: 0; text-align: center; }
  .bottom-nav .nav__item:hover { background: none; }
  .bottom-nav .nav__item[aria-current="page"] { background: none; color: var(--accent); }
  .bottom-nav .nav__item[aria-current="page"]::before { display: none; }
  .bottom-nav .nav__count { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  .table-wrap { display: none; }
  .cards { display: block; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .two-col { grid-template-columns: 1fr; }
  /* Карточка на телефоне: над нижней навигацией, чтобы та оставалась видимой */
  .panel { width: 100vw; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); border-left: 0; box-shadow: none; }
  .panel--enter { animation: none; }
  .scrim { display: none; }
  .action-bar { display: flex; position: sticky; bottom: 0; z-index: 3; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 10px 16px; border-top: 1px solid var(--glass-line); }
  .action-bar .btn { flex: 1 1 auto; }
  .action-bar__why { flex: 1 1 100%; display: flex; gap: 6px; align-items: center; margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
}
@media (max-width: 767px) {
  .only-wide { display: none; } .only-narrow { display: inline; }
  .demo-ribbon { padding: 6px 16px; }
  .card { padding: 16px; }
  .section { margin-top: 20px; }
  .kpi { padding: 12px 14px; }
  .kpi__value { font-size: 24px; line-height: 30px; }
  .sources { flex-direction: column; align-items: flex-start; gap: 4px; }
  .search { flex-basis: 100%; max-width: none; }
  .toolbar > label { flex: 1 1 100%; }
  .toolbar .select { width: 100%; }
  .chip { min-height: 44px; }
  .todo { flex-wrap: wrap; }
  .todo .btn { width: 100%; }
  .panel__head { padding: 8px 12px; }
  .panel__body { padding: 12px 16px 20px; }
  .split { grid-template-columns: 1fr; }
  .split__col + .split__col { border-left: 0; border-top: 1px solid var(--border); }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .timeline li { grid-template-columns: 1fr; gap: 0; padding-left: 20px; }
  .timeline li::before { left: 0; } .timeline li::after { left: 3px; }
  .timeline__body { padding-left: 0; }
  .next .btn { width: 100%; }
  .menu { left: 16px !important; right: 16px; width: auto; }
}
/* Правки после проверки 375/390 px */
.shell { grid-template-columns: 264px minmax(0, 1fr); }
.next .btn, .action-bar .btn { white-space: normal; text-align: center; min-width: 0; padding-top: 8px; padding-bottom: 8px; line-height: 20px; }
@media (max-width: 1023px) { .shell { display: block; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kpi:hover { transform: none; }
}

/* ---------- Вход ----------
   Кабинет без входа показывает форму, а не чужие выдуманные данные.
   Демо остаётся, но только по явной ссылке ?demo=1. */
.signin { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 24px; background: var(--bg); overflow: auto; }
.signin__card { width: 100%; max-width: 380px; padding: 28px; border-radius: var(--radius);
  background: var(--surface); box-shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 8%); }
.signin__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  font-weight: 650; font-size: 17px; }
.signin__field { display: block; margin-bottom: 14px; }
.signin__label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.signin__input { width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; color: var(--text); background: var(--surface); }
.signin__input:focus-visible { outline: 2px solid var(--accent, #0F766E); outline-offset: 1px; }
.signin__submit { width: 100%; margin-top: 6px; padding: 11px 16px; border: 0;
  border-radius: var(--radius-sm); background: var(--text); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; }
.signin__submit[disabled] { opacity: .6; cursor: default; }
.signin__error { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: #FEF2F2; color: #991B1B; font-size: 14px; }
.signin__foot { margin: 18px 0 0; font-size: 13px; color: var(--text-muted); }

/* ---------- План работы: общая кнопка и что за ней ----------
   Кнопка одна, но не слепая: лишний вывод из оборота — настоящая беда,
   и подписывать вслепую тут нельзя. */
.plan { padding: 4px 0 18px; }
.plan__line { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.plan__line:last-of-type { border-bottom: 0; }
.plan__title { font-weight: 600; }
.plan__codes { margin-top: 2px; font-size: 14px; color: var(--text-secondary); }
.plan__why { margin-top: 2px; font-size: 13px; }
.plan__go { display: block; width: calc(100% - 40px); margin: 14px 20px 0;
  padding: 13px 18px; border: 0; border-radius: var(--radius-sm);
  background: var(--text); color: #fff; font: inherit; font-weight: 650;
  font-size: 15px; cursor: pointer; }
.plan__go:hover { opacity: .92; }
.plan__note { margin: 10px 20px 0; font-size: 13px; }

/* Ход подписания: что происходит прямо сейчас и чем кончилось. */
.signbox { margin: 12px 20px 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-muted); font-size: 14px; white-space: pre-wrap; }
.signbox--ok { background: #ECFDF5; color: #047857; }
.signbox--bad { background: #FEF2F2; color: #B91C1C; }

/* ---------- Раздел «Выводы» ---------- */
.wcard { padding: 16px 20px; margin-bottom: 12px; }
.wcard__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px; }
.wcard__date { margin-left: auto; font-size: 13px; }
.wcard__sum { font-weight: 650; font-size: 16px; }
.wcard__goods, .wcard__doc { margin-top: 3px; font-size: 13px; }
.wcard__checks { margin-top: 12px; }
.wcard__checks summary { cursor: pointer; font-size: 14px;
  color: var(--text-secondary); }
.chks { list-style: none; margin: 10px 0 0; padding: 0; }
.chk { display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px;
  padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.chk__mark { text-align: center; font-weight: 700; }
.chk__note { grid-column: 2; font-size: 13px; }
.chk--ok .chk__mark { color: #047857; }
.chk--bad .chk__mark { color: #B91C1C; }
.chk--wait .chk__mark { color: #B45309; }
.chk--muted .chk__mark { color: var(--text-muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-muted); font-size: 12px; font-weight: 600; }
.pill--ready { background: #ECFDF5; color: #047857; }
.pill--critical { background: #FEF2F2; color: #B91C1C; }

/* ---------- Обзор: одна строка дела и разбивка, которая сходится ----------
   Переделано 22.09.2026: четыре плитки читались как четыре разные величины,
   хотя были одним числом, разрезанным на четыре. Теперь итог стоит под
   чертой, и сложение видно глазом. */
.lead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lead__num { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -.02em;
  color: var(--warning-text); flex: none; }
.lead--calm .lead__num { color: var(--text-muted); }
.lead__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
.lead__body strong { font-size: 16px; line-height: 22px; font-weight: 600; }
.lead__body .muted { font-size: 13px; line-height: 18px; }
.lead__cta { flex: none; }

.tally { padding: 6px 8px; }
.tally__row { display: flex; align-items: baseline; gap: 12px; width: 100%;
  padding: 11px 12px; border: 0; background: none; border-radius: 9px;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.tally__row:hover { background: var(--surface-muted); }
.tally__label { flex: 1 1 auto; min-width: 0; color: var(--text-secondary); font-size: 14px; }
.tally__value { flex: none; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tally__row--last { border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; margin-top: 4px; }
.tally__row--last .tally__label { color: var(--text); font-weight: 500; }
.tally__row--last .tally__value { font-size: 20px; }

@media (max-width: 640px) {
  .lead { gap: 12px; }
  .lead__num { font-size: 32px; line-height: 36px; }
  .lead__cta { width: 100%; text-align: center; }
  .tally__label { font-size: 13px; }
}

/* Витрина демо не показывается тому, кто вошёл в свой кабинет.
   22.09.2026 владелец увидел кнопку «Сценарии демо» в углу своего живого
   кабинета и справедливо спросил, что это. Полосу «Демо» снимает adopt(),
   а эта кнопка жила в подвале меню и оставалась. Прячем по тому же признаку,
   что и всё остальное демо: как только данные живые — витрины нет. */
body[data-live] [data-action="open-demo-panel"] { display: none !important; }

/* Строка «идёт само»: то, что не требует действий, не должно занимать
   карточку на экране работы. */
.quiet-line { display: flex; align-items: flex-start; gap: 8px; margin: 16px 20px 0;
  color: var(--text-muted); font-size: 13px; line-height: 18px; }
.quiet-line .icon { flex: none; margin-top: 1px; }

/* Кнопка «Обновить данные Wildberries». Сбор делает бот: у кабинета нет
   ключа шифрования токена, а к Wildberries должно ходить одно место. */
.collect { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 12px; }
.collect__body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.collect__body strong { font-size: 15px; font-weight: 600; }
.collect__body .muted { font-size: 13px; line-height: 18px; }
.collect__go { flex: none; }
.collect__state { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; line-height: 18px;
  color: var(--text-secondary); }
.collect__state--busy { color: var(--accent); }
@media (max-width: 640px) { .collect__go { width: 100%; } }

/* Кнопка выгрузки под сводкой раздела. Переехала из раздела «Сверка»:
   сверять хочется там же, где смотришь. */
.download-line { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin: 12px 20px 0; }
.download-line .muted { flex: 1 1 260px; min-width: 0; font-size: 13px; line-height: 18px; }

/* Экран «поставьте плагин»: это не ошибка, а незаконченная установка, и
   одной строкой человеку не помочь. */
.signbox strong { display: block; margin-bottom: 6px; }
.signbox p { margin: 6px 0; }
.signbox ol.steps { margin: 8px 0 8px 18px; padding: 0; }
.signbox ol.steps li { margin: 4px 0; }

/* Вопросик: объяснение есть, но его надо попросить. Если писать всё прямо
   на экране, экран становится учебником — с чем мы весь день и боролись. */
.hint { width: 18px; height: 18px; margin-left: 6px; padding: 0; flex: none;
  border: 1px solid var(--border-strong); border-radius: 50%; background: none;
  color: var(--text-muted); font: 600 11px/16px var(--font); cursor: pointer;
  vertical-align: middle; }
.hint:hover { border-color: var(--accent); color: var(--accent); }
.hint[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.hint__text { flex-basis: 100%; margin: 8px 0 0; padding: 10px 12px;
  border-radius: 9px; background: var(--surface-muted);
  font-size: 13px; line-height: 19px; color: var(--text-secondary); }

/* Пункт «Сменить пароль» в списке организаций — не организация, поэтому без
   аватара и без отметки выбора. */
.menu__item--plain { justify-content: flex-start; padding: 10px 12px;
  border-top: 1px solid var(--border); border-radius: 0 0 10px 10px;
  color: var(--text-secondary); font-size: 13px; }

/* Пока висит вход или «подключите магазин», содержимого под ним нет вовсе.
   Оно было визуально закрыто, но оставалось в дереве: читалось с экрана и
   попадало в заголовок вкладки. Выдуманные заказы не должны попадаться на
   глаза тому, кто пришёл работать. */
body[data-gated] .shell { display: none !important; }

/* Проверка токена Wildberries на экране подключения магазина. */
.shopcheck { margin: 12px 0 0; padding: 12px; border-radius: 10px;
  background: var(--surface-muted); font-size: 13px; line-height: 19px; }
.shopcheck--ok { background: var(--accent-subtle); }
.shopcheck--bad { background: #FEF2F2; }
.shopcheck strong { display: block; margin-bottom: 4px; }
.shopcheck .chks { margin: 8px 0; padding: 0; list-style: none; }
.shopcheck p { margin: 6px 0 0; }
textarea.signin__input { resize: vertical; font-family: var(--mono, monospace);
  font-size: 12px; line-height: 16px; }

/* Под общей кнопкой — выбор поменьше: подписать только выводы или только
   возвраты. Осторожный человек в первый раз захочет шаг поменьше. */
.plan__apart { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.plan__apart .btn { flex: 1 1 160px; }

/* ---------- Индикатор ожидания ----------
   23.09.2026 владелец: «как будто завис — надо крутилку, как у Apple».

   Взят их принцип: не скачущая полоса и не проценты, которых мы не знаем, а
   спокойное вращение из восьми лучей с затуханием. Лучи не мигают по
   очереди — они стоят на месте, а вращается затухание, поэтому движение
   выходит плавным и не дёргает глаз.

   Плюс честный счётчик секунд: он не выдумывает прогресс, но показывает,
   что время идёт, а не остановилось. */
.spinner {
  display: inline-block; position: relative;
  width: 18px; height: 18px; flex: none; vertical-align: -3px;
  animation: spinner-turn 1s steps(8, end) infinite;
}
.spinner span {
  position: absolute; left: 50%; top: 0;
  width: 2px; height: 5px; margin-left: -1px;
  border-radius: 1px; background: currentColor;
  transform-origin: 1px 9px; opacity: .18;
}
.spinner span:nth-child(1) { transform: rotate(0deg);   opacity: 1;   }
.spinner span:nth-child(2) { transform: rotate(45deg);  opacity: .80; }
.spinner span:nth-child(3) { transform: rotate(90deg);  opacity: .65; }
.spinner span:nth-child(4) { transform: rotate(135deg); opacity: .50; }
.spinner span:nth-child(5) { transform: rotate(180deg); opacity: .38; }
.spinner span:nth-child(6) { transform: rotate(225deg); opacity: .30; }
.spinner span:nth-child(7) { transform: rotate(270deg); opacity: .24; }
.spinner span:nth-child(8) { transform: rotate(315deg); opacity: .18; }

@keyframes spinner-turn { to { transform: rotate(360deg); } }

/* Кому мешает движение — тому его не показываем. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
}

.waiting { display: inline-flex; align-items: center; gap: 8px; }
.waiting__time { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Строка плана, под которой документ ещё не собран: работа видна,
   но кнопка о ней ничего не обещает. */
.plan__line--waiting { opacity: .72; }
.plan__wait { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 500; vertical-align: 2px;
  background: var(--warn-subtle, #fff4e5); color: var(--warn, #92400e); }

/* Надпись на месте кнопки, когда подписывать нечего: то же место,
   тот же размер, но ничего не обещает и не нажимается. */
.plan__go--idle { margin: 0; text-align: center; font-weight: 500;
  color: var(--text-muted); background: var(--surface-subtle, #f5f5f4);
  border: 1px dashed var(--border, #e7e5e4); border-radius: 12px;
  padding: 14px 16px; cursor: default; }

/* Отметка «ушло в Честный знак» рядом с названием документа. */
.plan__done { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 500; vertical-align: 2px;
  background: var(--ok-subtle, #e8f5ee); color: var(--ok, #136c3a); }
.plan__why code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; background: var(--surface-subtle, #f5f5f4); padding: 1px 5px;
  border-radius: 5px; }
