/* system.css — how this system looks and moves: text, links, buttons, fields, tables, status and
   notices, the page frame, and this system's own components.
   Written in the Design stage and approved by Yarik; loaded after base.css and theme.css by every page
   and mockup. Every colour comes from a token in theme.css (var(--…), color-mix() of tokens, or a
   relative colour from a token); no colour is written here directly. The reasons are in
   design/direction.md, and every component here is shown in every state in design/sheet.html. */

/* =========================================================== text */
body { line-height: 1.45; font-weight: var(--w-text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul.plain, ol.plain, .rows { padding: 0; margin: 0; list-style: none; }
h1 { font-size: var(--t-2xl); font-weight: var(--w-strong); letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: var(--t-lg); font-weight: 660; letter-spacing: -0.015em; line-height: 1.2; }
h3 { font-size: var(--t-md); font-weight: 600; line-height: 1.3; }
strong, b { font-weight: 620; }
a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.prose { max-width: var(--measure); text-wrap: pretty; }
.tnum, time, .fig { font-variant-numeric: tabular-nums; }
kbd { font: inherit; font-size: 0.92em; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-xs); color: var(--ink-2); background: var(--surface); }
::selection { background: var(--accent-soft); }
/* one scroll bar everywhere: thin, a --line-strong thumb on the paper (Yarik's walk row 21, D-170) */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); background-clip: padding-box; border: 3px solid transparent; border-radius: 5px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

/* =========================================================== frame: bar, freshness, page */
.top { position: sticky; top: 0; z-index: 20; background: var(--canvas); border-bottom: 1px solid var(--line); }
.bar { height: var(--bar-h); display: flex; align-items: stretch; gap: var(--s-6); padding-inline: var(--pad); }
.bar__name { align-self: center; font-weight: 720; font-size: var(--t-md); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bar__nav { display: flex; gap: var(--s-5); }
.bar__nav a { display: flex; align-items: center; color: var(--ink-2); text-decoration: none; font-weight: 450; border-bottom: 2px solid transparent; padding-top: 2px; white-space: nowrap; }
.bar__nav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.bar__nav a[aria-current="page"] { color: var(--ink); font-weight: 620; border-bottom-color: var(--ink); }
.bar__user { margin-left: auto; display: flex; align-items: center; gap: var(--s-4); font-size: var(--t-sm); white-space: nowrap; }
.bar__who { color: var(--ink); font-weight: var(--w-medium); }
.bar__role { color: var(--ink-3); margin-left: 6px; font-weight: var(--w-text); }
.bar__user a { color: var(--ink-2); }

/* «Данные Clients на …» — under the bar on every page; amber when late, red when stale */
.fresh { min-height: var(--fresh-h); display: flex; align-items: center; gap: var(--s-2); padding-inline: var(--pad); font-size: var(--t-xs); color: var(--ink-3); border-top: 1px solid var(--line); }
.fresh[data-state="warn"] { color: var(--warn); background: var(--warn-soft); font-weight: var(--w-medium); }
.fresh[data-state="bad"] { color: var(--bad); background: var(--bad-soft); font-weight: var(--w-medium); }
.fresh[data-state="warn"]::before { content: "!"; font-weight: 700; }
.fresh[data-state="bad"]::before { content: "✕"; font-weight: 700; }

/* a page is the sheet, optionally with the rail on the right */
.page { padding: var(--s-6) var(--pad) var(--s-7); min-width: 0; }
.page--form { max-width: calc(var(--measure) + 2 * var(--pad)); }
/* a page narrower than the window stands in the middle of it (Yarik's walk row 17, D-169); so does the form of
   «Записать действие» on its own page, in the middle of its left pane */
.page--form, .page--wide, .page--portfolio { width: 100%; margin-inline: auto; }
.page--log > * { max-width: var(--measure); margin-inline: auto; }
/* the sheet and the rail run to the bottom of the window, so the 1 px rule between them never stops part-way (row 18) */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail); min-height: calc(100vh - var(--head-h)); }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-5); padding-bottom: var(--s-5); }
.head__meta { margin-top: var(--s-2); color: var(--ink-2); display: flex; flex-wrap: wrap; column-gap: var(--s-4); }
.head__acts { display: flex; flex-wrap: wrap; gap: var(--s-2); flex-shrink: 0; }
.back { display: inline-block; margin-bottom: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); }

/* a section of a page: a title on the sheet, never a card */
.section + .section { margin-top: var(--s-7); }
.section__h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding-bottom: var(--s-3); }
.section__h p { color: var(--ink-3); font-size: var(--t-sm); }
.stack { display: grid; gap: var(--s-3); }

/* =========================================================== buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: var(--w-medium); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.btn:hover { border-color: var(--ink-2); background: var(--paper-deep); text-decoration: none; }
.btn:active { background: color-mix(in oklch, var(--paper-deep), var(--ink) 6%); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in oklch, var(--accent), var(--ink) 22%); border-color: color-mix(in oklch, var(--accent), var(--ink) 22%); }
.btn--primary:active { background: color-mix(in oklch, var(--accent), var(--ink) 38%); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--paper-deep); border-color: transparent; color: var(--ink); }
.btn--danger { color: var(--bad); border-color: color-mix(in oklab, var(--bad), var(--surface) 35%); }
.btn--danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: var(--t-sm); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--none-soft); border-color: var(--line); color: var(--ink-3); }
.btn[aria-busy="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[aria-busy="true"]::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* the row's one action: soft until the row is in hand, solid when it is */
.btn--row { border-color: transparent; background: var(--accent-soft); color: var(--accent-text); min-height: 34px; padding: 0 14px; font-size: var(--t-sm); font-weight: 560; }
.btn--row.btn--plain { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.row:hover .btn--row:not(.btn--plain), .row:focus-within .btn--row:not(.btn--plain), .btn--row:not(.btn--plain)[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); }
.row:hover .btn--plain, .btn--row.btn--plain[aria-expanded="true"] { border-color: var(--ink-2); }   /* slice 14, C1-1: an open «Изменить» stays plain */
.btn--row:not(.btn--plain):active { background: color-mix(in oklch, var(--accent), var(--ink) 30%); }

/* «⋯» — the row's other actions */
.more { position: relative; align-self: center; }
.more > summary { list-style: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); color: var(--ink-2); cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover, .more[open] > summary { background: var(--paper-deep); color: var(--ink); }
.more__list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 210px; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-float); }
.more__list > button, .more__list > a { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; }
.more__list > button:hover, .more__list > a:hover { background: var(--paper-deep); }

/* a small form that opens from a row action: «Закрыть без записи» (reason), «Перенести» (date), «Отклонить» (reason) */
.pop { display: grid; gap: var(--s-3); width: min(340px, 90vw); padding: var(--s-4); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-float); }
.pop--contact, .pop--kp { width: 100%; max-width: 340px; box-sizing: border-box; scroll-margin-bottom: var(--s-6); }   /* never wider than its rail or drawer (critique C1-2) */
.pop__h { font-weight: 620; }
.pop__acts { display: flex; gap: var(--s-2); }
.row > .pop { grid-column: 2 / -1; justify-self: end; margin-top: var(--s-3); }   /* the form under its row (sheet: «Короткая форма из строки») */
.more__list > form > button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); cursor: pointer; }
.more__list > form > button:hover { background: var(--paper-deep); }

/* =========================================================== notices */
.notice { display: flex; align-items: baseline; gap: var(--s-3); padding: 10px 14px; border-left: 3px solid var(--none); background: var(--none-soft); border-radius: 0 var(--r-xs) var(--r-xs) 0; color: var(--ink); }
.notice::before { content: "–"; font-weight: 700; color: var(--none); }
.notice[data-state="ok"] { border-left-color: var(--ok); background: var(--ok-soft); }
.notice[data-state="ok"]::before { content: "✓"; color: var(--ok); }
.notice[data-state="warn"] { border-left-color: var(--warn); background: var(--warn-soft); }
.notice[data-state="warn"]::before { content: "!"; color: var(--warn); }
.notice[data-state="bad"] { border-left-color: var(--bad); background: var(--bad-soft); }
.notice[data-state="bad"]::before { content: "✕"; color: var(--bad); }
.notice__text { flex: 1; min-width: 0; }
.notice__text > * + * { margin-top: 2px; }
.notice .btn { align-self: center; }
.notice ul { margin: 4px 0 0; padding-left: 1.1em; }
.notice[role="status"] { animation: land var(--dur-base) var(--ease); }
.notice.is-pinned { position: sticky; top: var(--top-h, 0px); z-index: 5; }   /* after «Перенести»: the confirmation stays in view above the moved row */
.row { scroll-margin-top: calc(var(--bar-h) * 2); }
@keyframes land { from { opacity: 0; transform: translateY(-6px); } }

/* «Вы смотрите задачи … — только просмотр.» — a petrol strip under the bar, the page read-only */
.viewing { padding: 8px var(--pad); background: var(--accent-soft); color: var(--accent-text); font-weight: var(--w-medium); font-size: var(--t-sm); border-bottom: 1px solid color-mix(in oklch, var(--accent), var(--canvas) 70%); }

/* status from base.css: weight only; colour and symbol are base's */
.status { font-weight: 560; white-space: nowrap; }

/* a tag: a quiet word attached to a name — «моя работа», «пилот», «не ведёт клиентов» */
.tag { display: inline-block; padding: 1px 7px; border-radius: var(--r-xs); background: var(--paper-deep); color: var(--ink-2); font-size: var(--t-xs); font-weight: var(--w-medium); white-space: nowrap; vertical-align: 0.1em; }
.tag--accent { background: var(--accent-soft); color: var(--accent-text); }

/* =========================================================== the sheet: dated lists on the ruler */
.sheet { position: relative; container: sheet / inline-size; margin-top: var(--s-5); }
.sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--ruler) + var(--gap) / 2); width: 1px; background: var(--line); z-index: 1; pointer-events: none; }

.grp + .grp, .sheet > * + .grp { margin-top: var(--s-6); }
.grp__h { display: grid; grid-template-columns: var(--ruler) 1fr; column-gap: var(--gap); align-items: baseline; padding-bottom: var(--s-3); font-size: var(--t-lg); font-weight: 660; letter-spacing: -0.015em; }
.grp__h > :first-child { grid-column: 2; }
.grp__h--sub { font-size: var(--t-md); font-weight: 620; letter-spacing: 0; padding-bottom: var(--s-2); }
.grp__n { font-weight: var(--w-text); color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.grp__h .and { margin-left: var(--s-5); }

.row { position: relative; display: grid; grid-template-columns: var(--ruler) minmax(0, 1fr) auto; column-gap: var(--gap); align-items: first baseline; padding: 14px 0 15px; border-top: 1px solid var(--line); }
.rows > .row:last-child { border-bottom: 1px solid var(--line); }
.row:hover { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 45%); }
.row.is-current { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.row.is-leaving { overflow: hidden; opacity: 0; padding-block: 0; border-top-color: transparent;
  transition: height var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), padding var(--dur-fast) var(--ease); }

/* the ruler cell: the date large, what it means small under it */
.due { display: grid; justify-items: start; padding-left: 10px; font-variant-numeric: tabular-nums; }
/* «Срок прошёл:» and its count each on a line of their own, so the count stands in one place on every row (critique C1-1) */
.due__meta > .status + .nowrap { display: block; }
.due__date { font-size: var(--t-xl); font-weight: var(--w-light); line-height: 1; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.due__pre { font-size: var(--t-sm); font-weight: 400; letter-spacing: 0; color: var(--ink-3); margin-right: 5px; }
.due__meta { margin-top: 7px; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.35; }
.due__none { font-size: var(--t-sm); color: var(--ink-2); }

.what { min-width: 0; }
.what__t { color: var(--ink); text-wrap: pretty; overflow-wrap: anywhere; }
.what__t b { font-weight: var(--w-strong); }
.what__src { margin-top: 3px; font-size: var(--t-sm); color: var(--ink-3); }
.what__body { margin-top: 6px; color: var(--ink-2); max-width: var(--measure); overflow-wrap: anywhere; }
.acts { display: flex; align-items: center; gap: 2px; padding-right: 6px; }

/* «… ещё 41 — …» */
.rest { display: grid; grid-template-columns: var(--ruler) 1fr; column-gap: var(--gap); padding: 12px 0 14px; border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--ink-3); }
.rest > * { grid-column: 2; }

/* THE SIGNATURE — «черта сегодня»: today's petrol line across the whole sheet; «Срок прошёл» above it, the rest below */
.cherta { position: relative; z-index: 2; display: grid; grid-template-columns: var(--ruler) 1fr; column-gap: var(--gap); align-items: baseline; margin: var(--s-6) 0 0; padding: 0 0 8px; color: var(--accent-text); }
.cherta::after { content: ""; position: absolute; left: calc(-1 * var(--pad)); right: 0; bottom: 0; height: 2px; background: var(--accent); }
.cherta__date { padding-left: 10px; font-size: var(--t-xl); font-weight: 540; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cherta__label { font-size: var(--t-lg); font-weight: var(--w-title); letter-spacing: -0.015em; }
.cherta__label .grp__n { color: var(--accent-text); font-weight: 420; }
.cherta + .rows > .row:first-child { border-top: 0; }
.cherta--flush::after { left: 0; }

/* folded groups — «Зависшие шаги», «Ещё по правилам», «Показать ещё» */
.fold { position: relative; border-top: 1px solid var(--line); }
.fold:last-child { border-bottom: 1px solid var(--line); }
.fold > summary { display: grid; grid-template-columns: var(--ruler) 1fr auto; column-gap: var(--gap); align-items: center; min-height: 52px; padding: 8px 6px 8px 0; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; justify-self: end; margin-right: 2px; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
.fold[open] > summary::before { transform: rotate(45deg); }
.fold > summary:hover .fold__t { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; }
.fold__t { font-weight: 560; color: var(--ink); }
.fold__t .muted { font-weight: var(--w-text); }
.fold__acts { display: flex; gap: var(--s-2); }
.fold__body { margin-left: calc(var(--ruler) + var(--gap)); padding: 0 0 var(--s-4); }
.fold--more > .fold__body { margin-left: 0; }   /* «Подробнее» on «Команда продаж»: its lines and folds keep the table's left edge (D-176) */

@container sheet (width < 540px) {
  .row { grid-template-columns: var(--ruler) minmax(0, 1fr); row-gap: 10px; }
  .acts { grid-column: 2; justify-self: start; }
}

/* =========================================================== the rail: «Разбор» and the drawer */
.rail { border-left: 1px solid var(--line); background: var(--canvas); min-width: 0; }
.rail__in { position: sticky; top: var(--head-h); max-height: calc(100vh - var(--head-h)); overflow: hidden auto; display: grid; overscroll-behavior: contain; }
.rail__in > * { grid-area: 1 / 1; min-width: 0; }
.rail__block { padding: var(--s-6); }
.rail__block + .rail__block { padding-top: 0; }

.razbor__lines { margin-top: var(--s-4); }
.razbor__lines > p { padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink-2); text-wrap: pretty; }
.razbor__lines > p:last-child { border-bottom: 1px solid var(--line); }
.razbor__note { display: block; margin-top: 2px; font-size: var(--t-sm); color: var(--ink-3); }
.razbor .fig, .fig--lead { font-size: var(--t-md); font-weight: var(--w-strong); color: var(--ink); }
a.fig { color: var(--ink); text-decoration-color: var(--line-strong); }
a.fig:hover { color: var(--accent-text); text-decoration-color: currentColor; }
.razbor__start { margin-top: var(--s-5); font-size: var(--t-md); color: var(--ink); }
.razbor__start strong { font-weight: var(--w-title); }
.razbor__start a { font-weight: 560; }

/* a share as a filled track — «51 из 151 (34%)» */
.share { display: block; height: 4px; margin-top: 8px; background: var(--accent-soft); border-radius: 2px; overflow: hidden; min-width: 60px; }
.share > span { display: block; height: 100%; background: var(--accent); }
/* the bar is exactly as wide as the figure above it — «47 из 182 (26%)» (row 27, D-175) */
.fig-share { display: inline-grid; justify-items: stretch; }
.fig-share > .share, .panel-tbl .fig-share > .share { min-width: 0; }

.drawer { z-index: 2;   /* above the rail's sticky table headers (z-index 1, base.css) — Show 04 point 1 */
  /* the drawer is the window's height under the top bar, whatever the rail holds, and scrolls inside (row 19) */
  position: sticky; top: 0; align-self: start; height: calc(100vh - var(--head-h)); overflow: hidden auto; overscroll-behavior: contain;
  background: var(--surface); box-shadow: var(--shadow-drawer); border-left: 1px solid var(--line-strong); margin-left: -1px;
  transform: translateX(105%); visibility: hidden; transition: transform var(--dur-fast) var(--ease), visibility 0s linear var(--dur-fast); }
.rail.has-drawer .drawer { transform: none; visibility: visible; transition: transform var(--dur-base) var(--ease), visibility 0s; }
.drawer > form { display: flex; flex-direction: column; min-height: 100%; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-4) 0 var(--s-5); }
.drawer__body { padding: var(--s-4) var(--s-5); display: grid; gap: var(--s-4); }
.drawer__foot { position: sticky; bottom: 0; margin-top: auto; padding: var(--s-4) var(--s-5) var(--s-5); background: var(--surface); border-top: 1px solid var(--line); }
.x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink-2); cursor: pointer; font-size: 18px; }
.x:hover { background: var(--paper-deep); color: var(--ink); }

/* what will be written, under whose name */
.writes-as { padding: 10px 14px; background: var(--paper-deep); border-radius: var(--r-xs); color: var(--ink-2); font-size: var(--t-sm); }
.writes-as strong { color: var(--ink); }
.closes { font-size: var(--t-sm); color: var(--ink-3); }

/* the brand's last Clients row, set directly above the new one (D-61, borrowed from «Картотека») */
.last-rec { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-3); align-items: baseline; padding: 10px 0; border-block: 1px solid var(--line); font-size: var(--t-sm); color: var(--ink-2); }
.last-rec__k { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--ink-3); margin-bottom: 2px; }
.last-rec__d { font-weight: var(--w-medium); color: var(--ink); font-variant-numeric: tabular-nums; }
.last-rec + .field, .last-rec + .pair { margin-top: calc(-1 * var(--s-1)); }

/* =========================================================== forms */
.form { display: grid; gap: var(--s-4); max-width: var(--measure); }
.form__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding-top: var(--s-2); }
.form__keys { margin-top: var(--s-3); display: flex; flex-wrap: wrap; column-gap: var(--s-4); row-gap: 2px; font-size: var(--t-xs); color: var(--ink-3); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field > label, .field > .line > label, .field__label { font-size: var(--t-sm); font-weight: 560; color: var(--ink); }
.req { color: var(--accent-text); margin-left: 2px; }
.ro { font-size: var(--t-md); font-weight: 560; color: var(--ink); padding: 4px 0 2px; border-bottom: 1px dashed var(--line-strong); overflow-wrap: anywhere; }
.hint { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.4; }
.err { font-size: var(--t-sm); color: var(--bad); line-height: 1.4; font-weight: var(--w-medium); }
.input, .sel > select, textarea.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); transition: border-color var(--dur-fast) var(--ease); }
.input:hover, .sel > select:hover { border-color: var(--ink-2); }
.input:focus-visible, .sel > select:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.input:disabled, .sel > select:disabled { background: var(--none-soft); color: var(--ink-3); border-color: var(--line); }
.input::placeholder { color: var(--ink-3); }
textarea.input { resize: vertical; line-height: 1.45; min-height: 96px; }
.input--date { width: 150px; }
.sel { position: relative; }
.sel > select { appearance: none; padding-right: 32px; cursor: pointer; text-overflow: ellipsis; }
.sel::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg); pointer-events: none; }
.input[aria-invalid="true"], .sel > select[aria-invalid="true"] { border-color: var(--bad); border-width: 1.5px; background: color-mix(in oklab, var(--surface), var(--bad-soft) 60%); }
.counter { justify-self: end; font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.counter[data-state="bad"] { color: var(--bad); font-weight: var(--w-medium); }
.line { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: var(--t-sm); color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.choices { display: grid; gap: 2px; }
.choices--pick { margin: var(--s-2) 0 0 var(--s-5); }
fieldset:not(:has(input[value="chosen"]:checked)) > .choices--pick { display: none; }   /* names only once «Выбрать…» is chosen; no script needed */
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 5px; font-size: var(--t-sm); font-weight: 560; color: var(--ink); }

/* the summary on top of a refused form: what is wrong, by field, linked */
.summary { padding: 12px 14px; border-left: 3px solid var(--bad); background: var(--bad-soft); border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.summary__h { font-weight: 620; color: var(--bad); }
.summary ul { margin: 4px 0 0; padding-left: 1.1em; }
.summary a { color: var(--ink); font-weight: var(--w-medium); }

/* =========================================================== tables: the heads' pages */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 11px 14px 11px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.tbl th:last-child, .tbl td:last-child { padding-right: 6px; }
.tbl thead th { padding-top: 0; padding-bottom: 8px; border-top: 0; border-bottom: 1px solid var(--line-strong); font-size: var(--t-sm); font-weight: var(--w-medium); color: var(--ink-2); vertical-align: bottom; background: var(--canvas); }
.table-wrap .tbl thead th { background: var(--canvas); }
.tbl tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.tbl tbody tr:hover td { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 40%); }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }
.tbl td.num { font-size: var(--t-md); font-weight: 420; }
.tbl tr.is-worst td { background: color-mix(in oklch, var(--canvas), var(--paper-deep) 70%); }
.tbl tr.is-worst td:first-child { box-shadow: inset 3px 0 0 var(--ink); padding-left: 14px; }
.tbl--compact td { padding-block: 7px; }
.tbl caption { text-align: left; }
.tbl a.fig { font-weight: inherit; }
.tbl .plus { color: var(--ink-3); font-size: var(--t-sm); margin-left: 4px; }

/* a person in a table: the name, and under it the reason in words */
.who__n { font-weight: 600; color: var(--ink); }
.who__why { margin-top: 2px; font-size: var(--t-sm); color: var(--ink-2); }
/* a book holder who does not log, set as a sentence under the table */
.holders { margin-top: var(--s-3); display: grid; gap: 0; }
.holders > p { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: var(--t-sm); }
.holders b { color: var(--ink); }

/* =========================================================== tabs */
.tabs { display: flex; flex-wrap: wrap; column-gap: var(--s-5); box-shadow: inset 0 -1px 0 var(--line); margin-bottom: var(--s-5); }
/* the hairline is an inset shadow the tab's 2 px line lies on, so nothing overflows the bar and it never scrolls (row 20) */
.tabs > a, .tabs > button { display: inline-flex; align-items: baseline; gap: 6px; padding: 10px 0 9px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font-weight: var(--w-medium); text-decoration: none; white-space: nowrap; cursor: pointer; }
.tabs > a:hover, .tabs > button:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.tabs > [aria-current="page"], .tabs > [aria-selected="true"] { color: var(--ink); font-weight: 620; border-bottom-color: var(--ink); }
.tabs .grp__n { margin-left: 0; }

/* =========================================================== this system's own pieces */
/* loyalty checklist: twelve marks per brand, ✓ done, – not done */
.ticks { display: grid; grid-template-columns: repeat(12, 1.6em); gap: 2px; font-weight: 620; }
.tick { display: grid; place-items: center; height: 1.6em; border-radius: var(--r-xs); color: var(--ink-3); background: var(--none-soft); }
.tick[data-state="ok"] { color: var(--ok); background: var(--ok-soft); }

/* a rating, 1 to 5, as five radio buttons in a row */
.scale { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.scale > label { position: relative; display: grid; place-items: center; width: 38px; height: 34px; cursor: pointer; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.scale > label:first-child { border-left: 0; }
.scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.scale > label:hover { background: var(--paper-deep); }
.scale > label:has(input:checked) { background: var(--accent); color: var(--accent-ink); font-weight: 620; }
.scale > label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.scale[aria-invalid="true"] { border-color: var(--bad); }

/* the reporting tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 22px; border-left: 1px solid var(--line-strong); }
.tree li { padding: 5px 0 5px 16px; position: relative; }
.tree ul > li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 11px; border-top: 1px solid var(--line-strong); }

/* empty states: a sentence of what to do next, and the action */
.empty { padding: var(--s-5) 0; }
.empty__text { max-width: 52ch; color: var(--ink-2); font-size: var(--t-md); margin-bottom: var(--s-4); }
.sheet .empty__text, .sheet .empty > .btn { margin-left: calc(var(--ruler) + var(--gap)); }

/* sign-in: the sheet with one ruled column */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); }
.login__aside { padding: var(--s-7) var(--pad); display: flex; flex-direction: column; }
.login__sheet { position: relative; margin-top: var(--s-7); max-width: 640px; border-bottom: 1px solid var(--line); }
.login__sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--ruler) + var(--gap) / 2); width: 1px; background: var(--line); }
.login__sheet > i { display: block; height: 52px; border-top: 1px solid var(--line); }
.login__sheet > .cherta { margin: 0; height: 52px; align-items: end; }
.login__sheet > .cherta::after { left: calc(-1 * var(--pad)); }
.login__name { font-size: var(--t-2xl); font-weight: var(--w-title); letter-spacing: -0.025em; line-height: 1.05; }
.login__main { padding: var(--s-7) var(--s-6); background: var(--surface); border-left: 1px solid var(--line-strong); display: grid; align-content: center; gap: var(--s-4); }


/* =========================================================== added from the pages (step 8) */
/* «Следующий шаг» on «Бренд»: the value large in the text column, its reason under it */
/* «Бренд»: three blocks, each between full hairlines; the ruler's rule only beside dated rows (row 30, D-177) */
.sheet--blocks::before { content: none; }
.sheet--blocks .grp__h { border-bottom: 1px solid var(--line); }
.sheet--blocks > .grp { border-bottom: 1px solid var(--line); }
.sheet--blocks .rows > .row:first-child { border-top: 0; }
.sheet--blocks .rows > .row:last-child { border-bottom: 0; }
.sheet--blocks .next { border-block: 0; }
.sheet--blocks .row:has(.due__date)::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--ruler) + var(--gap) / 2); width: 1px; background: var(--line); pointer-events: none; }
.next { display: grid; grid-template-columns: var(--ruler) minmax(0, 1fr); column-gap: var(--gap); padding: 14px 0 18px; border-block: 1px solid var(--line); }
.next > * { grid-column: 2; }
.next__v { font-size: var(--t-xl); font-weight: var(--w-light); line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
.next__why { margin-top: var(--s-2); max-width: var(--measure); color: var(--ink-2); }

/* a row's short facts, each in its own place: who, Контакт, attempts */
.what__facts { display: flex; flex-wrap: wrap; column-gap: var(--s-5); row-gap: 2px; }
.kv { display: flex; flex-wrap: wrap; column-gap: var(--s-5); row-gap: 2px; margin: 6px 0 0; font-size: var(--t-sm); }
.kv > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* facts in the rail: the label small over its value, on hairlines */
.facts { display: grid; margin: var(--s-4) 0 0; }
.facts > dt { margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-3); }
.facts > dd { margin: 0; padding: 1px 0 10px; color: var(--ink); overflow-wrap: anywhere; }
.facts > dd:last-of-type { border-bottom: 1px solid var(--line); }
.facts .hint { display: block; margin-top: 2px; }
.facts .status { white-space: normal; }
.section__p, .rest--plain { font-size: var(--t-sm); color: var(--ink-3); }
.rest--plain { margin-top: var(--s-3); }
.rail__block > h2 + .section__p { margin-top: 4px; }
.list-ruled > li { padding: 9px 0; border-top: 1px solid var(--line); }
.list-ruled > li:last-child { border-bottom: 1px solid var(--line); }

/* a table's lead figure — the number the rows are sorted by, set like the ruler dates */
.tbl__fig { font-size: var(--t-xl); font-weight: var(--w-light); line-height: 1; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tbl__unit { font-size: var(--t-sm); font-weight: var(--w-text); letter-spacing: 0; color: var(--ink-3); }
.tbl th .th__sub { display: block; font-weight: inherit; }
.tbl th.num { white-space: normal; }
.tbl td.act, .tbl td.menu { text-align: right; white-space: nowrap; }
.tbl td.menu { width: 1%; }
.tbl td.act .btn + .btn { margin-left: var(--s-1); }
.tbl tbody tr:hover .btn--row:not(.btn--plain), .tbl tbody tr:focus-within .btn--row:not(.btn--plain) { background: var(--accent); color: var(--accent-ink); }
.table-wrap.has-menu { overflow: visible; }   /* a table with «⋯» menus that fits at 1024 */
.rail .tbl th, .rail .tbl td { padding-right: var(--s-2); }   /* on the scale; 10 px left the КП table 2 px over the rail at 1024 in Linux Chromium (check after fix-2) */
.rail .tbl th:last-child, .rail .tbl td:last-child { padding-right: 2px; }
.rail .table-wrap { margin-top: var(--s-3); }
.rail .table-wrap .tbl .status { white-space: normal; }   /* «Подтверждено РК» breaks so every sum fits the rail at 1024 (critique C2-1) */
.tbl .sub { display: block; margin-top: 1px; font-size: var(--t-xs); color: var(--ink-3); }
.pops { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-start; }


/* «Панель руководителя»: a wider table and a 360 px rail; under 1180 px the rail goes under the table */
.desk--panel { grid-template-columns: minmax(0, 1fr) 360px; }
.panel-tbl th, .panel-tbl td { padding-right: 0; padding-left: 12px; }
.panel-tbl th:first-child, .panel-tbl td:first-child { padding-left: 14px; }
.panel-tbl td:first-child { min-width: 10.5em; }
.panel-tbl td.acts-cell { width: 40px; padding-right: 6px; text-align: right; }
.panel-tbl .who__n .tag { margin-left: 6px; }
.panel-tbl .plus { display: inline-block; min-width: 2.4em; text-align: left; }
.tbl-note { margin-top: var(--s-4); max-width: var(--measure); }
.rail h2 { text-wrap: balance; }
.rail .tbl th.num { width: 9em; }
/* a team's total under its people */
.tbl tfoot td, .tbl tfoot th { border-top: 2px solid var(--line); padding-top: 12px; padding-bottom: 12px; }   /* Show 36-1 point 6: one rule */
.tbl tfoot .who__n { white-space: nowrap; }
.tbl tfoot .who__n, .tbl tfoot td.num { font-weight: var(--w-strong); }
/* a row's small form opened under it, inside a table */
.tbl tr.pop-row td { padding: 0 0 var(--s-4); border-top: 0; }
.tbl tr.pop-row:hover td { background: none; }
.tbl tr.pop-row .pop { margin-left: auto; }
/* Slice 41 Show 4 point 1 (D-575): below 1400 px the nine-column team table does not fit beside the 360 px pane (at 1366
   it ran 8 px under it, at 1200 190 px, «Продажи, млн ₽» hidden), so the pane stands under the table, as at 1024 */
@media (max-width: 1399px) {
  .desk--panel { grid-template-columns: minmax(0, 1fr); }
  .desk--panel .rail { border-left-width: 0; }
  .desk--panel .rail__in { position: static; max-height: none; overflow: visible; }
  .desk--panel .rail__in > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); padding-inline: calc(var(--pad) - var(--s-6)); }
  .desk--panel .rail__block + .rail__block { padding-top: var(--s-6); }
  .desk--panel .rail__block:first-child { grid-row: span 2; }
}
@media (max-width: 1180px) {
  .panel-tbl th, .panel-tbl td { padding-left: 6px; }
  .panel-tbl thead th { font-size: var(--t-xs); }
  .panel-tbl td.num { font-size: var(--text-body); }
  .panel-tbl .share { min-width: 40px; }
}

/* «брендов: 13 ▸» — a list opened in place inside a sentence */
.inline-more { display: inline; }
.inline-more > summary { display: inline; list-style: none; cursor: pointer; color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.inline-more > summary::-webkit-details-marker { display: none; }
.inline-more > summary:hover { text-decoration-thickness: 2px; }

/* «Встречи»: a meeting row with the two ratings, and the rating form under its row */
.row--meet { grid-template-columns: var(--ruler) minmax(0, 1fr) 13.5rem minmax(96px, auto); }
.marks { display: grid; grid-template-columns: max-content max-content; column-gap: var(--s-3); row-gap: 2px; margin: 0; align-content: start; }
.marks > dt, .marks > dd { margin: 0; }
.marks > dt { font-size: var(--t-xs); color: var(--ink-3); padding-top: 2px; }
.marks > dd { font-variant-numeric: tabular-nums; }
.row > .rate { grid-column: 2 / -1; margin-top: var(--s-4); }
.rate { width: min(560px, 100%); }
.crits { display: grid; gap: var(--s-2); }
.crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-4); }
.crit > span:first-child { font-size: var(--t-sm); font-weight: 560; }
@container sheet (width < 720px) {
  .row--meet { grid-template-columns: var(--ruler) minmax(0, 1fr) auto; row-gap: 10px; }
  .row--meet > .marks { grid-column: 2; grid-row: 2; }
  .row--meet > .acts { grid-column: 3; grid-row: 1; }
}

/* «Лояльность»: numbered heads over the twelve marks, and their legend */
.ticks--head { grid-template-columns: repeat(12, calc(1.6 * var(--text-body))); font-weight: inherit; }
.ticks--head > abbr { text-align: center; text-decoration: none; cursor: help; }
.legend { margin-top: var(--s-2); padding: var(--s-4) 0; border-block: 1px solid var(--line); }
.legend ol { margin: var(--s-3) 0 0; padding-left: 1.6em; columns: 3; column-gap: var(--s-6); }
.legend li { break-inside: avoid; padding: 2px 0; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }

/* =========================================================== mockups only: the states block */
.mock-states { border-top: 2px solid var(--ink); margin-top: var(--s-7); padding: var(--s-6) var(--pad) var(--s-7); }
.st { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: var(--s-6); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.mock-states > h2 + .st, .mock-states > .st:first-of-type { margin-top: var(--s-4); border-top: 1px solid var(--line); }
.st > h3 { font-size: var(--t-md); font-weight: 600; }
.st__body { display: grid; gap: var(--s-3); max-width: 920px; min-width: 0; }
.mock-note { margin-top: var(--s-5); font-size: var(--t-xs); color: var(--ink-3); max-width: 90ch; }
.print-only { display: none; }

/* =========================================================== narrow (1024) */
@media (max-width: 1180px) {
  .bar { gap: var(--s-4); }
  .bar__nav { gap: var(--s-3); font-size: var(--t-sm); }
  .bar__role { display: none; }
  .btn--row { padding: 0 12px; }
  .st { grid-template-columns: 190px minmax(0, 1fr); }
  .tbl th, .tbl td { padding-right: 10px; }
}

/* =========================================================== print */
@media print {
  .top, .fresh, .tbl thead th { position: static; border: 0; background: none; }
  h1 { font-size: 15pt; }
  .what__src { font-size: 8.5pt; }
  .head { padding-bottom: 6pt; }
  .razbor h2, .grp__h, .cherta__label { font-size: 12pt; }
  .razbor__lines { margin-top: 4pt; }
  .razbor__lines > p { padding: 2pt 0; }
  .razbor__note { display: inline; margin-left: 6pt; font-size: inherit; }
  .sheet { margin-top: 8pt; }
  .grp + .grp, .sheet > * + .grp { margin-top: 8pt; }
  .grp__h { padding-bottom: 2pt; }
  .bar { height: auto; padding: 0; }
  .fresh { min-height: 0; padding: 0 0 4pt; }
  .due { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5pt; padding-left: 0; }
  .due__meta { margin-top: 0; }
  .what__src { margin-top: 0; }
  .bar__nav, .bar__user, .rail, .mock-states, .mock-note, .fold, .head__acts, .acts, .notice, .viewing, .tabs, .more, .no-print { display: none !important; }
  .print-only { display: block; }
  .desk, .login { display: block; min-height: 0; }
  .page { padding: 0; margin-inline: 0; }
  .sheet::before { display: none; }
  .row { padding: 2pt 0; break-inside: avoid; }
  .row:hover, .row.is-current, .tbl tr.is-worst td { background: none; box-shadow: none; }
  .due__date { font-size: 12pt; }
  .cherta { margin-top: 6pt; border-bottom: 1.5pt solid; color: inherit; }
  .cherta::after { display: none; }
  .tbl thead th, .table-wrap .tbl thead th { background: none; }
  .tbl td.num { font-size: 10pt; }
  .panel-tbl th:first-child, .panel-tbl td:first-child { padding-left: 0; }
  .holders > p { padding: 3pt 0; }
  a, a.fig, .razbor__start a { color: inherit; }
  .next { padding: 4pt 0 6pt; }
  .next__v, .tbl__fig { font-size: 13pt; }
  .tree li { padding-block: 2pt; break-inside: avoid; }
  .tree .tag { background: none; padding: 0; color: inherit; }
}

/* A table inside a fold scrolls with the page; its header row sticks just below the sticky bar (Show 01, point 2). */
.fold__body .table-wrap { overflow: visible; }
.fold__body .table-wrap thead th { top: var(--head-h); }

/* =========================================================== slice 03: «Записать действие», «Обмен с Clients» (layout only, from the mockups) */
.log-form { margin-top: var(--s-2); }
.rail-ctx { display: grid; gap: var(--s-4); }
.rail .razbor__lines .status { display: inline-block; margin-top: 4px; }

/* =========================================================== slice 04: «Бренд», «Рабочие портфели», «Приоритетные клиенты» (layout only, from the mockups) */
.brandinfo > .rail__block { padding-inline: var(--s-5); }
.print-facts { margin-top: 0; }
.print-kp { margin-top: var(--s-6); }
.page--portfolio { max-width: calc(1180px + 2 * var(--pad)); }
.page--portfolio .head__acts { align-items: center; }
.page--portfolio .head__acts .sel { width: 13em; }
.page--portfolio .head__acts form { margin: 0; }
.page--portfolio .tabs { margin-bottom: var(--s-4); }
.pf-tbl th:first-child { width: 30%; }
.pf-tbl th:nth-child(3) { width: 11em; }
.pf-tbl td.acts-cell { width: 8em; text-align: right; }
.pf-tbl td { vertical-align: middle; }
.pf-note { margin-top: var(--s-4); }
.page--priority .tbl th:first-child, .page--priority .tbl td.days { padding-left: var(--s-3); }
.page--priority .tbl td.days { width: 1%; padding-right: var(--s-6); white-space: nowrap; }
.page--priority .tbl td.days .status { display: block; margin-top: 6px; }
.page--priority .tbl td.co { min-width: 22ch; }
.page--priority .tbl td.co:first-child { padding-left: var(--s-3); }   /* Show 36-2 point 2: «Список на дату» — names under «Компания», as th:first-child */
.page--priority #brands { margin-top: var(--s-7); }
.page--priority #brands .section__h p { max-width: var(--measure); }
.page--priority #companies .table-wrap { overflow: visible; }
.page--priority td.act form { display: inline; }
.page--priority .pops .pop { margin-bottom: var(--s-5); }
@media print {
  .print-facts { grid-template-columns: max-content minmax(0, 1fr); column-gap: 14pt; margin-bottom: 6pt; }
  .print-facts > dt, .print-facts > dd { padding: 2pt 0; border-top: 0; border-bottom: 0; }
  .print-kp { margin-top: 10pt; }
}
/* a brand name in a list opens «Бренд»; it keeps the name's look and shows it is a link on hover */
a.brand-link { color: inherit; text-decoration: none; }
a.brand-link:hover { text-decoration: underline; text-underline-offset: 2px; }
/* in a table row the brand name is the way to «Бренд», so it looks like a link (Yarik's walk row 22, D-171);
   the quiet link stays in the desk's ruler rows */
td a.brand-link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
td a.brand-link:hover { text-decoration-thickness: 2px; }

/* =========================================================== slice 05: rule tasks, «Разбор», the desk on one A4 page */
.razbor__stale { margin-top: var(--s-3); }
@media print {
  /* «Рабочий стол» prints on one A4 page (TC-05-04): one line per row — due, brand and what; sources and states stay on screen */
  .desk .sheet .rows { font-size: 7.5pt; line-height: 1.12; }
  .desk .sheet .row { padding: 0.2pt 0; min-height: 0; }
  .desk .sheet .due__date { font-size: 7.5pt; }
  .desk .sheet .due__meta, .desk .sheet .what__src, .desk .sheet .due__pre { display: none; }
  .desk .sheet .what__t { margin: 0; }
  .desk .grp__h, .desk .cherta__label { font-size: 9.5pt; }
  .desk .cherta { margin-top: 3pt; }
  .desk .razbor__lines > p { padding: 1pt 0; font-size: 8.5pt; }
  .desk .razbor h2 { font-size: 10pt; }
  .desk .head { padding-bottom: 2pt; }
  .desk h1 { font-size: 13pt; }
  .desk .razbor .share { display: none; }
  .desk .razbor__start { margin-top: 2pt; font-size: 8.5pt; }
  .desk .razbor .fig { font-size: inherit; }
}
.razbor__src { margin-top: var(--s-6); }

/* =========================================================== slice 06: «Панель руководителя», «Без работы» */
/* C1-4: the panel has no ruler, so its fold starts at the table's edge */
.desk--panel .fold > summary { grid-template-columns: 12px 1fr auto; column-gap: 8px; padding-left: 0; }
.desk--panel .fold > summary::before { justify-self: start; }
.desk--panel .fold__body { margin-left: 0; }
/* Show 1 point 3: «РК идёт» under its date, «Чей бренд» on one line, as head-unworked.html */
.tbl td.when .when__st { display: flex; width: fit-content; margin-top: 2px; }
.tbl td.whose { white-space: nowrap; }
/* Show 2 point 2: a gap under the order line, each header on one line (head-unworked.html) */
p.order { margin-bottom: var(--s-3); }
@media (min-width: 1200px) { .tbl--unworked thead th, .tbl--unworked thead th.num { white-space: nowrap; } }
/* slice 38 (W-1, R-156): at 1024 the row's «Назначить задачу» stays whole at the wrap's right edge, as on «Лояльность» */
.tbl--unworked td.act { position: sticky; right: 0; z-index: 1; background: var(--canvas); }
/* slice 38 (W-2, R-156): at 1024 «Реестр встреч» is no wider than its wrap, «Согласовать» whole inside it */

/* slice 38 (R-156, D-515): «Ждут согласования: N» may wrap the head line; the gaps give the line back, so «Главная» stays one screen */
.page--home .head:has(#approve-n) { padding-bottom: var(--s-2); }
.page--home:has(#approve-n) .attn { margin-top: var(--s-3); }
@page wide { size: A4 landscape; margin: 10mm 12mm; }
@media print {
  body.print-wide { page: wide; }
  .panel-tbl tr, .tbl tr { break-inside: avoid; }
  .printed-unworked { margin-top: 8pt; }
  .printed-unworked h2 { font-size: 11pt; margin: 0; }
  .printed-unworked p { margin: 0 0 2pt; }
  .printed-unworked ul { columns: 9; column-gap: 5pt;   /* slice 17: 106 live names (R-91) still on one page; slice 30: seven columns, room for the sales line; slice 42: 6.5pt, the RK dates carry their year */ font-size: 6.5pt; line-height: 1.2; list-style: none; padding: 0; margin: 2pt 0 0; }
  .panel-tbl th, .panel-tbl td { padding-top: 2pt; padding-bottom: 2pt; font-size: 9pt; }
  .panel-tbl td.num { font-size: 9pt; }
  .panel-tbl .share { display: none; }
  .panel-tbl .who__why, .panel-tbl .who__n .tag { display: inline; font-size: 8pt; margin: 0 0 0 4pt; padding: 0; background: none; }
  .print-wide .head { padding-block: 0 4pt; }
  .print-wide .holders > p { padding: 1pt 0; font-size: 8pt; }
  .printed-unworked li { break-inside: avoid; }
}

/* =========================================================== slice 07: «Встречи» prints who and the brands (TC-07-08) */
@media print {
  .desk .sheet .row--meet .what__src { display: flex; }
  .row--meet .inline-more { display: none; }
  .row--meet .what__src .print-only { display: inline; }
  .head h1 .print-only { display: inline; }              /* slice 22 C1-3: the date beside the printed title */
}

/* slice 07 fixes after critique: the mockups' page rules, so every band lines up (C1-1) and the R-60 mark has its own line (C1-2) */
.page--wide { max-width: 1240px; }
.scope { margin-top: var(--s-2); }
.scope .muted { margin-left: var(--s-3); }
.band { margin-top: var(--s-6); }
.loy td { vertical-align: middle; }
.loy th:first-child, .loy td:first-child { width: 100%; }
.loy .ticks, .loy .num, .loy .act { white-space: nowrap; }
.loy .num { padding-right: var(--s-5); }
.loy .act { text-align: right; }
.what__body .status { display: block; margin-top: 2px; }
.loy thead th.num { white-space: nowrap; }

/* =========================================================== slice 08: «Просрочено» under «Следующий шаг» on «Бренд» (D-149) */
.next__late { margin-top: var(--s-2); }

/* slice 09 (D-153): «Ваши задачи» — a «Разбор» line with its row action and «⋯» under it; the decline form opens below */
.razbor__lines > .yours { padding: 12px 0; border-top: 1px solid var(--line); }
.razbor__lines > .yours:last-child { border-bottom: 1px solid var(--line); }
.yours > p { color: var(--ink-2); text-wrap: pretty; }
.yours__acts { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }
.yours > .pop { margin-top: var(--s-3); width: 100%; box-sizing: border-box; }
/* critique C1-1: when the rail stacks under the table, «Ваши задачи» stands above it (the only task list of a head) */
.yours-narrow { display: none; }
@media (max-width: 1399px) {   /* D-575: wherever the pane stacks */
  .desk--panel .yours-narrow { display: block; max-width: 40rem; margin-bottom: var(--s-6); }
  .desk--panel #yours-block { display: none; }
}

/* slice 10 (D-162): «Отнести бренд к компании» on the sheet — two `.field`s and one `.btn` in a row, no box */
.page--priority .attach { display: grid; gap: var(--s-3); padding: var(--s-4) 0 var(--s-5); }
.page--priority .attach__fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-4); }
.page--priority .attach__fields .field { flex: 1 1 260px; max-width: 360px; }
.page--priority .attach__act { padding-top: calc(var(--t-sm) * 1.5 + var(--s-2)); }
.page--priority #placed { margin-top: var(--s-6); }

/* =========================================================== slice 15: «Команда продаж» read at a glance (rows 38, 39, 42) */
/* row 38: every heading and value centred but «Сотрудник»; the share bar centred under its figure; team rows and print alike */
.panel-tbl th, .panel-tbl td, .panel-tbl th.num, .panel-tbl td.num, .panel-tbl td.acts-cell { text-align: center; }
.panel-tbl th:first-child, .panel-tbl td:first-child { text-align: left; }
.panel-tbl .fig-share { justify-items: stretch; }
.panel-tbl td .sub { margin-top: 2px; font-size: var(--t-xs); color: var(--ink-2); font-weight: var(--w-normal, 400); white-space: normal; max-width: 8.5em; margin-inline: auto; line-height: 1.3; }
.panel-tbl th, .panel-tbl td { padding-left: 4px; padding-right: 4px; }   /* Show 1 point 1: nine columns beside the rail at 1440; slice 38: 4 px, so «2,2 из 12,5» with a plan keeps the table in its wrap in every browser */
.panel-tbl th:first-child, .panel-tbl td:first-child { padding-left: 10px; }
.panel-tbl td.acts-cell { padding-right: 2px; padding-left: 0; width: 26px; }
.panel-tbl td:first-child { min-width: 9em; }
@media (max-width: 1180px) { .panel-tbl th, .panel-tbl td { padding-left: 4px; padding-right: 4px; } .panel-tbl th:first-child, .panel-tbl td:first-child { padding-left: 0; } }
.panel-tbl a.sub { text-decoration: none; }
.panel-tbl td .sub[data-words] { width: 0; min-width: 100%; }   /* slice 35 (R-144): the words under a figure take the column's width, never widen it */
.panel-tbl a.sub[data-col="kpsum"] { white-space: nowrap; }
/* slice 30: «Продажи, млн ₽» as narrow as «РК с начала года» was — «с начала года: X» on two short lines and a tighter
   inner padding — so a director's table still ends before the rail at 1440 px (TC-15-43) */
.panel-tbl td[data-col="rk_year"] .sub { max-width: 5.5em; }
.panel-tbl td[data-col="rk_year"], .panel-tbl thead th:nth-last-child(2) { padding-left: 0; padding-right: 2px; }
.panel-tbl td[data-col="kp"], .panel-tbl thead th:nth-last-child(3) { padding-right: 1px; }
/* slice 30 (D-362): the rows under a company's table — groups, «(не продаёт)», «Не засчитано никому», «Всего» — are quieter
   than a sum row: one hairline between them, the sum row's rule only above the first; printed once, after the table */
.panel-tbl tfoot tr.panel-foot td { border-top: 1px solid var(--line); padding-top: var(--s-1); padding-bottom: var(--s-1); }
.panel-tbl tfoot tr:first-child td { border-top: 2px solid var(--line); }
@media print {
  .panel-tbl tfoot { display: table-row-group; }
  .panel-tbl td[data-col="rk_year"] .sub { max-width: none; white-space: nowrap; }   /* no rail in print: one line each */
  .panel-tbl td[data-col="points"] .sub:not([data-words]) { max-width: none; white-space: nowrap; }   /* slice 35: «норматив не утверждён» on one line, the page stays one sheet */
  .panel-tbl tfoot tr.panel-foot td { padding-top: 1pt; padding-bottom: 1pt; }
  .panel-tbl tfoot tr.panel-foot { display: none; }      /* printed as the paragraph .printed-sales under the table */
  .panel-tbl tfoot tr.panel-foot--g[data-summed] { display: table-row; }   /* slice 42 (D-587): a group's summed row on paper */
  .panel-tbl tfoot tr[data-summed] td .sub, .panel-tbl tfoot tr[data-summed] .share { display: none; }   /* its figures only, so the page stays one sheet */
  .panel-tbl td[data-col="points"] .sub[data-plan] { display: none; }      /* slice 42: on paper «не загружено» alone, one sheet */
  .panel-tbl td p.who__unplaced { display: inline; font-size: 8pt; margin: 0 0 0 4pt; }   /* as .who__why on paper */   /* as .who__why on paper */
  .panel-tbl td.num .muted, .panel-tbl td.num a.fig[data-unloaded] { white-space: nowrap; }
  .panel-tbl tfoot tr[data-summed] td, .panel-tbl tr[data-unplaced] td { padding-top: 0; padding-bottom: 0; font-size: 8pt; line-height: 1.2; }
  .panel-tbl tr[data-unplaced] td.num .sub, .panel-tbl tr[data-unplaced] .share { display: none; }   /* a seller with no line: her figures only on paper */
  .panel-tbl tr[data-unplaced] td:first-child p { display: inline; }
  .panel-tbl tr[data-unplaced] td:first-child p.who__why, .panel-tbl tr[data-unplaced] td:first-child p.who__unplaced { display: none; }   /* one line on paper: her name; the note stands on screen */
  .panel-tbl tr[data-unplaced] td:first-child, .panel-tbl tfoot tr[data-summed] td:first-child, .panel-tbl tfoot tr[data-summed] td p.who__n { white-space: nowrap; }
  main .printed-holders div.holders { display: block; }
  main .printed-holders div.holders > p { display: inline; margin: 0 8pt 0 0; }     /* slice 42: the holder lines run on, so the page stays one sheet */
  .panel-tbl tfoot tr[data-summed] td.num, .panel-tbl tfoot tr[data-summed] td.num a.fig { white-space: nowrap; overflow-wrap: normal; }
  .printed-sales { max-width: none; margin: 0; font-size: 7.5pt; line-height: 1.2; }
}
.panel-tbl a.sub:hover { text-decoration: underline; }
/* row 42, D-200: «?» beside a heading, its rule in a pop-over under it — the sheet's surface, hairline and type */
.colhelp { position: relative; display: inline; }
.colhelp__tail { white-space: nowrap; }               /* the last word and its «?» never part (slice 18, C1-1) */
.colhelp__q { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; padding: 0; vertical-align: 1px;
  font: inherit; font-size: 11px; line-height: 1; color: var(--ink-3); background: none; border: 1px solid var(--line-strong); border-radius: 50%; cursor: help; }
.colhelp__q:hover, .colhelp__q[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-3); }
.colhelp__pop { position: fixed; z-index: 30; display: block; width: max-content; max-width: min(340px, calc(100vw - 16px)); padding: var(--s-3) var(--s-4);
  text-align: left; white-space: normal; font-size: var(--t-sm); font-weight: var(--w-normal, 400); line-height: 1.45; color: var(--ink);
  text-transform: none; letter-spacing: normal;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
  opacity: 0; transform: translateY(-4px); visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility 0s linear var(--dur-fast); }
.colhelp.is-open .colhelp__pop { opacity: 1; transform: none; visibility: visible; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility 0s; }
.colhelp__h { display: block; margin-bottom: 4px; font-size: var(--t-xs); color: var(--ink-2); }
.colhelp__p, .colhelp__li { display: block; }
.colhelp__ul { display: grid; gap: 4px; margin-top: 4px; }
.colhelp__li { position: relative; padding-left: 12px; }
.colhelp__li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }
.drill-how ul, .how ul { margin: 4px 0 0; padding-left: 1.2em; }
@media print {
  .colhelp__q, .colhelp__pop { display: none !important; }
  .panel-tbl td .sub { font-size: 8pt; }
}

/* slice 15, row 36: «Контакты бренда» one per row — the name, the position under it quiet, a hairline between */
.ct-head { position: relative; flex-wrap: nowrap; }
.ct-head h2 { margin: 0; }
.ct-head .ct-add { flex: none; }
.contacts > li.contact { display: block; padding: 6px 0; border-top: 1px solid var(--line); }
.contacts > li.contact:first-child { border-top: 0; }
.contacts-more > .fold__body > .contacts > li.contact:first-child { border-top: 1px solid var(--line); }
.contact__n { display: block; }
.contact__p { display: block; font-size: var(--t-sm); color: var(--ink-2); }
/* slice 34 (R-137, critique C1-3): the messenger after the position, and the owner's text-width control under the contact */
.contact__m { display: block; font-size: var(--t-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.ct-msg { margin-top: var(--s-1, 4px); }
.ct-msg > summary { list-style: none; display: inline-flex; width: auto; height: auto; cursor: pointer; }
.ct-msg > summary::-webkit-details-marker { display: none; }
.ct-msg > .pop { margin-top: var(--s-1, 4px); }
.contacts-more { margin-top: 0; }
.contacts-more > summary .fold__t { font-size: var(--t-sm); color: var(--ink-2); }
.pop--float { position: absolute; right: 0; top: calc(100% - var(--s-3) + 4px); z-index: 20; width: 340px; max-width: calc(100vw - 16px); overflow: auto; overscroll-behavior: contain; }
@media print { .contacts-more > .fold__body { display: block; } }
/* slice 15, Show 1 point 1: the team's name may wrap, so the head's table stays inside its column beside the rail */
.panel-tbl tfoot .who__n { white-space: normal; }
.panel-tbl td:first-child { max-width: 12em; }
.panel-tbl td[data-col="worked"] a.fig { white-space: normal; }   /* Show 1 point 1: «(61%)» may drop under «125 из 204» */

/* R-90, D-207 (slice 16): a history row's text with structure — paragraphs, line breaks, lists in the sheet's type;
   past 400 characters the rest waits behind a quiet «Показать полностью» that opens it in place, without motion */
.what__body > p + p, .what__body > p + ul, .what__body > p + ol, .what__body > ul + p, .what__body > ol + p,
.what__rest > p + p, .what__rest > p + ul, .what__rest > p + ol, .what__rest > ul + p, .what__rest > ol + p,
.what__body > p + .what__rest, .what__body > ul + .what__rest, .what__body > ol + .what__rest { margin-top: 6px; }
.what__body ul, .what__body ol { margin: 4px 0 0; padding-left: 1.3em; }
.what__body ul { list-style: "– "; }
.what__body li + li { margin-top: 2px; }
.what__body .what__kp { color: var(--ink); }
.what__body:has(> details.what__more:not([open])) > .what__rest { display: none; }
.what__more { margin-top: 4px; }
.what__more > summary { display: inline-block; list-style: none; cursor: pointer; font-size: var(--t-sm); color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.what__more > summary::-webkit-details-marker { display: none; }
.what__more > summary:hover { color: var(--ink-2); }
.what__more[open] .what__open, .what__more:not([open]) .what__close { display: none; }
@media print { .what__body > .what__rest { display: block !important; } }

/* critique C1-1 (slice 19): a name keeps its initial on the drill table; a head's long reason under it still wraps */
.tbl.drill td.nowrap .sub { white-space: normal; }

/* Show 1 point 5 (slice 16): the open «?» pop-over is a tooltip — a click falls through to the figure under it */

/* row 46 (slice 17): «+ Добавить компанию» opens its .pop floating under the button, at its right edge; nothing moves */
.head__acts:has(> [data-pop-add]) { position: relative; }
.head__acts > .pop--float { top: calc(100% + 4px); margin: 0; }
/* slice 17, critique C1-2, C1-3: the sheet's ruler does not strike through a block of full-width tables; a sub-heading
   after a table stands apart from it */
.grp--tables > p, .grp--tables > .table-wrap { position: relative; z-index: 2; background: var(--canvas); }
.table-wrap + .grp__h--sub { margin-top: var(--s-5); }

/* =========================================================== 20.11.2026 — the add-on from Igor's and Yuri's feedback of 19.11:
   «Главная», «Реестр встреч», «Лояльность» as a register, «Планы». Three components, each in every state in design/sheet.html:
   the figure against its plan (.kpi), the table edited in place (.tbl--edit, .cell), a row's «История изменений» (.hist). */

/* ---- «Показатель»: a figure against its plan, set as lines on the sheet — a label, the figure in the ruler's light numerals,
   a sentence. One lead row on a page (the 64 px figure and the plan bar); the rows under it are quiet. Never a tile, never a
   status colour: a seller behind the plan reads the two numbers and the bar, not a red mark. */
.kpi { border-bottom: 1px solid var(--line); }
.kpi__row { display: grid; grid-template-columns: 11rem 9.5rem minmax(0, 1fr); column-gap: var(--gap); align-items: baseline; padding: 12px 0 13px; border-top: 1px solid var(--line); }
.kpi__label { font-size: var(--t-md); font-weight: 620; color: var(--ink); }
.kpi__period { margin-left: var(--s-2); font-size: var(--t-sm); font-weight: var(--w-text); color: var(--ink-3); }
.kpi__v { font-size: var(--t-xl); font-weight: var(--w-light); line-height: 1; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi__unit, .kpi__of { font-size: var(--t-sm); font-weight: var(--w-text); letter-spacing: 0; color: var(--ink-3); }
.kpi__note { color: var(--ink-2); text-wrap: pretty; }
.kpi__none { font-size: var(--t-md); font-weight: var(--w-text); letter-spacing: 0; color: var(--ink-3); }
.kpi a.fig { font-weight: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.14em; }
.kpi__fig a.fig { text-decoration: none; }                       /* the sentence under the bar carries the link; the 64 px figure stays clean */
.kpi__fig a.fig:hover { text-decoration: underline; text-decoration-thickness: 2px; }
/* the lead row: the label on its own line, the figure large, the bar the full width of the sheet, the sentence under it */
.kpi__row--lead { display: block; padding: 0 0 var(--s-4); border-top: 0; }
.kpi__row--lead .kpi__label { font-size: var(--t-lg); font-weight: 660; letter-spacing: -0.015em; }
.kpi__fig { margin-top: var(--s-2); font-size: var(--t-3xl); font-weight: var(--w-light); line-height: 1; letter-spacing: -0.035em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi__fig .kpi__of { margin-left: 0.2em; font-size: var(--t-xl); font-weight: var(--w-light); letter-spacing: -0.02em; }
.kpi__fig .kpi__none { margin-left: var(--s-3); }
/* sweep A5: the month on the quarter's figure line — secondary type, its figure a plain underlined link */
.kpi__fig .kpi__month { margin-left: var(--s-5); font-size: var(--t-sm); font-weight: var(--w-text); letter-spacing: 0; color: var(--ink-2); }
.kpi__fig .kpi__month a.fig { text-decoration: underline; text-decoration-thickness: 1px; }
.kpi__row--lead .share { height: 8px; margin-top: var(--s-3); border-radius: 4px; }
.kpi__row--lead .kpi__note { margin-top: var(--s-2); }
/* slice 38 (R-158, D-489): «Как считается» on the line of «С начала года»; opened, its sentences under it, in place */
#sales-basis { margin-left: var(--s-2); }
#sales-basis .kpi__basis { display: block; margin-top: var(--s-1); }

/* a row with no date: the text and its one action — «Обратите внимание» on «Главная». Not on the ruler: it has no date. */
.row--plain { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px 0 9px 10px; }
.row--plain .what__t b { font-weight: 620; }
.attn { margin-top: var(--s-5); }
.attn > h2 { padding-bottom: var(--s-2); }
.page--home { padding-top: var(--s-5); padding-bottom: var(--s-5); }
.page--home .head { padding-bottom: var(--s-4); flex-wrap: nowrap; }
.page--home .head > :first-child { min-width: 0; }   /* a long line under the title wraps; the button keeps its place */
.page--home .head__meta a { font-weight: 560; }
/* a priority company in the rail: the name, what is wrong in words, its action beside them */
.razbor__lines > .yours--side { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: center; }
.yours--side > p { color: var(--ink); }
.yours--side .status { display: block; margin-top: 1px; font-size: var(--t-sm); white-space: normal; }
.rail .razbor__lines .yours--side .status { display: block; margin-top: 1px; }
.rail__more { margin-top: var(--s-4); font-size: var(--t-sm); }

/* ---- «Редактируемая таблица»: the same table, its cells edited in place — the habit of Excel kept, nothing reloads.
   A cell that can be edited is a button that looks like its text until the pointer or the focus is on it; then it is an
   input of the system. Enter saves, Esc cancels, Tab saves and goes to the next cell. Without script each row has «Изменить». */
.tbl--edit td { position: relative; }
.cell { display: block; width: calc(100% + 16px); min-height: calc(1.45em + 10px); margin: -5px -8px; padding: 4px 7px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; color: inherit; font: inherit; font-variant-numeric: tabular-nums; text-align: inherit; cursor: text; }
.cell:hover { background: var(--surface); border-color: var(--line-strong); }
.cell:disabled, .cell:disabled:hover { background: none; border-color: transparent; cursor: auto; }
tr:hover .cell--empty:not(.cell--show):disabled, .cell--empty:not(.cell--show):disabled:hover { color: transparent; }   /* without script a cell is text (sheet; Show 21-2 point 1) */
.cell:focus-visible, input.cell { background: var(--surface); border-color: var(--accent); outline-offset: 1px; }
.cell--empty { color: transparent; }                      /* an empty cell is empty, as in Excel; its word shows when the row is in hand */
tr:hover .cell--empty, .cell--empty:hover, .cell--empty:focus-visible, .cell--empty[aria-expanded="true"], .cell--show { color: var(--ink-3); }
.cell[aria-busy="true"] { color: var(--ink-3); background: var(--paper-deep); border-color: var(--line); }
.cell[aria-busy="true"]::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; vertical-align: -1px; border-radius: 50%; border: 2px solid var(--ink-3); border-right-color: transparent; animation: spin 0.8s linear infinite; }
.cell[data-saved]::after { content: "✓"; margin-left: 6px; color: var(--ok); font-weight: 700; }
.cell[aria-invalid="true"] { border-color: var(--bad); border-width: 1.5px; background: color-mix(in oklab, var(--surface), var(--bad-soft) 60%); }
.cell + .err { display: block; margin-top: 9px; white-space: normal; min-width: 16ch; }
.tbl--edit td.num .cell { text-align: right; }
.tbl--edit td.num { font-size: var(--text-body); font-weight: var(--w-text); }
.tbl--edit td.sum { font-size: var(--t-md); font-weight: 620; }
.tbl--edit td .status { display: block; margin-top: 2px; font-size: var(--t-sm); white-space: normal; }
.tbl--edit .code { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
/* a score of three: the .scale of the system, floating under its cell, no motion */
.cell-pop { position: absolute; z-index: 10; right: 0; top: calc(100% - 4px); padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-float); }
.cell-pop .scale > label { width: 44px; }
/* a group inside one table: «Ноябрь 2026», «Идёт РК» */
.tbl__grp > th { padding: var(--s-5) 0 var(--s-2); border-top: 0; font-size: var(--t-md); font-weight: 620; color: var(--ink); background: none; }
.tbl tbody:first-of-type > .tbl__grp > th { padding-top: var(--s-4); }
.tbl__grp + tr > td, .tbl__grp + tr > th { border-top: 1px solid var(--line-strong); }
.tbl tr.tbl__grp:hover th { background: none; }
/* a fold on a page without the ruler: its mark at the left edge of the table */
.fold--flat > summary { grid-template-columns: 12px 1fr auto; column-gap: 8px; padding-left: 0; }
.fold--flat > summary::before { justify-self: start; }
.fold--flat > .fold__body { margin-left: 0; }
.reg-more { margin-top: var(--s-6); }
/* the drawer on a page that has no rail: over the right edge of the table, under the bar, to the bottom of the window */
.drawer--over { position: fixed; z-index: 15; top: var(--head-h); right: 0; width: var(--rail); margin-left: 0; }
.drawer--over.is-open { transform: none; visibility: visible; transition: transform var(--dur-base) var(--ease), visibility 0s; }

/* «Реестр встреч»: twelve columns of the Excel in its order, on the whole width */
.reg th { white-space: normal; }
.reg th.num { text-align: right; }
.reg td.brand { min-width: 12rem; }   /* Show 35-2 point 2: was 13rem — the room «Запись встречи» needs to keep its words whole at 1440 */
.reg td.brand .muted { overflow-wrap: anywhere; }       /* Show 22-1 point 2: a long Excel «Бренд» word breaks in its cell */
.reg td.brand .sub, .reg td .sub { display: block; margin-top: 1px; font-size: var(--t-xs); color: var(--ink-3); white-space: normal; }
.reg td.when { white-space: nowrap; }
.reg td.link { white-space: normal; }   /* Show 35-1 point 2: «открыть» / an Excel text and «изменить» wrap in their column (was nowrap) */
.reg td.link > .muted, .reg td.link > .cell--empty { white-space: nowrap; }   /* Show 35-2 point 2: «нет данных» on one line (was normal) */   /* slice 35 (D-500): «нет данных» wraps in its narrow column, the table keeps its width at 1024 */
.reg td.link > .xl-text { display: block; white-space: normal; overflow-wrap: break-word; }   /* Show 35-2 point 2: breaks between words, inside a word only when it alone is too long */   /* Show 35-1 point 2: an Excel text in «Запись встречи» / «Презентация» wraps in its column, the table stays in its window */
.reg th.col-score { width: 6.2rem; }
.reg th.col-sum { width: 4.6rem; }
.reg td.menu { padding-right: 0; }
/* slice 27 («Согласование встреч», D-318, D-319): the state stands as .status under the brand with the row's other marks;
   the row's one action sits before «⋯»; «Отклонить» opens .cell-pop with «Причина», without motion */
.reg td.brand .status { display: flex; margin-top: 3px; }
.reg td.brand .sub { overflow-wrap: anywhere; }      /* Show 2 point 2: a long «Цель встречи» with no space breaks inside the word */
.reg td.menu .row-act { display: inline-block; margin: 0 4px 0 0; vertical-align: middle; }
.reg td.menu > .btn--row { margin-right: 4px; vertical-align: middle; }
.reg td.menu > details.more { display: inline-block; vertical-align: middle; }
.reg td.menu .btn--row { white-space: normal; height: auto; min-height: 34px; line-height: 1.2; }   /* slice 27, Show 4 point 2: one line while there is room; its words wrap rather than push the table past its wrap */
@media (max-width: 1180px) {   /* Show 3 point 1: at 1024 px the row action wraps its words and «⋯» stands under it, so the register fits */
  .reg td.menu { white-space: normal; text-align: center; }
  .reg td.menu .btn--row { white-space: normal; height: auto; min-height: 34px; line-height: 1.2; padding: 6px 8px; max-width: 6.5rem; }
  .reg td.menu .row-act, .reg td.menu > .btn--row { margin: 0; }
  .reg td.menu > details.more { display: block; width: 34px; margin: 4px auto 0; }
  .reg td.code .btn--row { white-space: normal; height: auto; min-height: 34px; line-height: 1.2; padding: 6px 4px; max-width: 5rem; }   /* review 35-2 F2-1: «Код верный» wraps like the row action */
  .reg td.menu .btn--row { padding: 6px 4px; }   /* slice 38 (W-2): «Согласовать» is one word; 4 px a side keeps the table inside its wrap */
}
.cell-pop--reason { width: 300px; display: grid; gap: 8px; text-align: left; white-space: normal; }
.cell-pop--reason .pop__acts { display: flex; gap: 8px; }

/* «Лояльность» as a register: the brands down, the twelve actions across in the Excel's three groups, a date in each cell */
.loyreg { table-layout: fixed; min-width: 1260px; }
.loyreg col.c-brand { width: 15.5rem; }
.loyreg col.c-pct { width: 4.8rem; }
.loyreg thead th { vertical-align: bottom; }
.loyreg th.g { padding: 0 0 6px 10px; border-bottom: 0; border-left: 1px solid var(--line); font-size: var(--t-sm); font-weight: 620; color: var(--ink); text-align: left; white-space: normal; }
.loyreg thead tr + tr th { font-size: var(--t-xs); font-weight: var(--w-text); line-height: 1.25; white-space: normal; overflow-wrap: anywhere; hyphens: manual; padding-right: 8px; }
.loyreg th.gs, .loyreg td.gs { border-left: 1px solid var(--line); padding-left: 10px; }
.loyreg td { padding-right: 8px; font-size: var(--t-sm); }
.loyreg td:first-child { font-size: var(--text-body); }
.loyreg td.c { white-space: nowrap; }
.loyreg td.c .cell { width: calc(100% + 6px); margin: -5px -3px; padding: 4px 2px; cursor: pointer; }
.loyreg .cell .sub, .loyreg td.c .sub { display: block; margin-top: 0; font-size: var(--t-xs); color: var(--ink-3); }
.loyreg td.num { font-size: var(--t-md); padding-right: 6px; }
.loyreg th:first-child, .loyreg td:first-child { position: sticky; left: 0; z-index: 2; background: var(--canvas); }
.loyreg tbody tr:hover td:first-child { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 40%); }
/* slice 20: one header row of item names until the Excel's groups arrive (slice 24); a cell without its form yet is
   text, not a control — no hover, no pointer */
.loyreg thead th.it { font-size: var(--t-xs); font-weight: var(--w-text); line-height: 1.25; white-space: normal; overflow-wrap: normal; hyphens: manual; padding-right: 12px; }
.loyreg col.c-act { width: 10.5rem; }
.loyreg col.c-it { width: 6rem; }                  /* critique C1-1, C1-2: «00.00.00» and a gutter; every word of a name on its line */
.loyreg td.c { padding-right: 12px; }
/* critique C2-1: «Готово, %» and the row's action stay in view on the right while the twelve items scroll, as «Бренд»
   does on the left */
.loyreg .pct, .loyreg .act { position: sticky; right: 0; z-index: 2; background: var(--canvas); }
.loyreg:has(.act) .pct { right: 10.5rem; }
.loyreg .pct { border-left: 1px solid var(--line); }
.loyreg tbody tr:hover td.pct, .loyreg tbody tr:hover td.act { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 40%); }
.page--wide:has(.loyreg) { max-width: 1440px; }
.loyreg td.act { text-align: right; white-space: nowrap; }
.loyreg td.c span.cell { cursor: default; }
.loyreg td.c span.cell:hover { background: none; border-color: transparent; }
/* a brand opens to its contacts: a small mark before the name, the contacts as quieter rows under it */
.disc { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 4px 0 -4px; padding: 0; vertical-align: -3px; border: 0; border-radius: var(--r-xs); background: none; color: var(--ink-2); cursor: pointer; }
.disc::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
.disc[aria-expanded="true"]::before { transform: rotate(45deg); }
.disc:hover { background: var(--paper-deep); color: var(--ink); }
.loyreg tr.person td { border-top-color: transparent; padding-top: 4px; padding-bottom: 8px; color: var(--ink-2); }
.loyreg tr.person td:first-child { padding-left: 20px; font-size: var(--t-sm); color: var(--ink); }
.loyreg tr.person .sub { display: block; font-size: var(--t-xs); color: var(--ink-3); white-space: normal; }
.bday { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; font-size: var(--t-xs); color: var(--ink-3); }
.bday .cell { display: inline-block; width: auto; min-height: 0; margin: -3px -4px; padding: 2px 5px; font-size: var(--t-sm); color: var(--ink); }
.loyreg td.c .pop, .pop--cell { position: absolute; z-index: 12; left: 0; top: calc(100% - 2px); width: 340px; white-space: normal; font-size: var(--text-body); }
.soon { margin-top: var(--s-2); color: var(--ink-2); }

/* ---- «История изменений»: who, when, what it was, what it became — under its row, on the surface of a pop-over */
.pop--hist { width: min(460px, 90vw); }
.hist { margin: 0; padding: 0; list-style: none; max-height: 264px; overflow: hidden auto; }
.hist > li { padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.hist > li:first-child { border-top: 0; padding-top: 0; }
.hist__when { display: block; margin-bottom: 1px; font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hist b { font-weight: var(--w-medium); color: var(--ink); }
.hist del { color: var(--ink-3); }

/* «Планы»: people down, the months of the quarter across */
.plans th.num, .plans td.num { width: 8.5rem; }
.plans td.num .cell--empty { font-size: var(--t-sm); }
.plans td.num .cell { white-space: normal; overflow-wrap: normal; }   /* Show 35-1 point 1: «норматив не утверждён» wraps inside its month */
.table-wrap + .plans__h { margin-top: var(--s-6); }   /* Show 35-1 point 4, review 35-2 F2-2: only the second heading stands apart from the table before it */
.plans th .plans__copy { display: block; margin: 2px -12px 0 0; }
.plans tr.plans__sum > th { border-top: 1px solid var(--line); }   /* Show 2 point 2: the rule above a group's sum runs full width, screen and print */        /* slice 23: «Как в прошлом месяце» under its month, quiet */
#team tr.team__sum > th, #team tr.team__sum > td { border-top: 1px solid var(--line); }
#team tr.team__sum > th, #team tr.team__sum > td { border-bottom: 1px solid var(--line); }
#team tr.team__sum > th { white-space: nowrap; }   /* critique C1-2: the group's label on one line, its rule under it as under its figures */   /* slice 35 (D-499): a group's row under its people, as «Итого по группе» on «Планы» */
.plans th .plans__copy .btn { font-weight: var(--w-text); white-space: nowrap; }

@media (max-width: 1180px) {
  .kpi__row { grid-template-columns: 9rem 8rem minmax(0, 1fr); }
  .reg { font-size: var(--t-sm); }
  .reg thead th { font-size: var(--t-xs); }
  .reg th, .reg td { padding-right: 3px; }   /* review 35-2 F2-1: was 6px; with long Excel texts and «Согласовать» the 13 columns fit 1024 — 3px leaves room for Linux font metrics (check after fix 2) */
  .reg td.brand { min-width: 7rem; }        /* slice 27, Show 3 point 1 (was 8.5rem) */
  .reg td.when { white-space: normal; }     /* the time under the date */
  .reg td.brand .brand-link, .reg td .status { overflow-wrap: anywhere; white-space: normal; }
  .reg td.link > .xl-text { overflow-wrap: anywhere; }   /* Show 35-2 point 2: at 1024 a long Excel text may break inside a word, so the register fits */
  .reg td.link > .cell--empty { white-space: normal; }   /* the owner's «нет данных» wraps only when the column is that tight */   /* Show 35-1 point 2: a long brand name or mark breaks, so the real register fits at 1024 */
  .reg td.sum { font-size: var(--text-body); }
  .reg th.col-score { width: 4rem; }        /* slice 27, Show 3 point 1: room for the row action at 1024 px */
  .reg th.col-sum { width: 3.4rem; }
}
@media print {
  .tbl--edit .cell { display: block !important; width: auto; min-height: 0; margin: 0; padding: 0; border: 0; }
  .cell--empty, .reg .cell--empty, .disc, .cell-pop, .bday .cell--empty { display: none !important; }   /* slice 21: on «Реестр встреч» .tbl--edit .cell outweighed .cell--empty */
  .reg td.link .cell--empty.cell--show { display: inline !important; color: var(--ink-3); }   /* critique C1-1: «нет данных» prints for the owner too */
  .kpi__fig { font-size: 22pt; }
  .kpi__row--lead .share { display: none; }
  .loyreg th:first-child, .loyreg td:first-child { position: static; background: none; }
  .loyreg .pct, .loyreg .act { position: static; background: none; border-left: 0; }
  .loyreg { min-width: 0; width: 100%; }
  /* Show 1 point 1 (slice 20): twelve dates fit an A4 page only across it — the page prints landscape, the brand column
     gives up its screen width, the action column takes none, and no date or head runs into its neighbour */
  body:has(.loyreg) { page: wide-table; }
  .loyreg col.c-brand { width: 7.5rem; }
  .loyreg col.c-pct { width: 3.4rem; }
  .loyreg col.c-it { width: auto; }
  .loyreg col.c-act { width: 0; visibility: collapse; }
  .loyreg td.c { padding-right: 8px; font-size: 8pt; }
  .loyreg td.c .cell { width: auto; margin: 0; padding: 0; }
  .loyreg thead th.it { font-size: 6.5pt; padding-right: 8px; }
  .loyreg td:first-child, .loyreg th:first-child { font-size: 8.5pt; padding-right: 10px; overflow-wrap: anywhere; }   /* Show 2 point 1: a gutter on paper too */
}
@page wide-table { size: A4 landscape; }

@media print {   /* slice 23, Show 1 point 1: «Планы» — values under their headers, empty words not printed */
  .plans td.num .cell { display: block; width: 100%; text-align: right; }
  .plans td.num .cell--empty { color: var(--ink-3); }      /* slice 30, Show 1 point 5 (D-445): «не задан» prints as on screen (R-133) */
}

/* ---- slice 24 (row 61): «Лояльность» as a register — the mark of the Excel in the quiet tone (D-336), the cell form
   under its cell without motion, the birthday edited in its cell, the search of «Все мои бренды», «N из 12» under the
   percent (D-338). */
.loyreg td.c { position: relative; }
.loyreg td.c > a.cell { display: block; color: var(--ink); text-decoration: none; }
.loyreg td.c > a.cell--empty { color: var(--ink-3); }
.loyreg .cell--mark { color: var(--ink-3); }
.loyreg .cell--mark .mark { display: block; font-size: var(--t-xs); line-height: 1.25; white-space: normal; }
.loyreg td.c > .status { display: block; margin-top: 2px; font-size: var(--t-xs); white-space: normal; }
.loyreg td.pct .sub { display: block; font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; }
.loyreg td.c .pop--cell { text-align: left; }
.loyreg tr.person td.c { font-size: var(--t-xs); color: var(--ink-2); }
.bday__f { display: inline; margin: 0; }
.bday input.cell { width: 5.5em; font: inherit; font-size: var(--t-sm); color: var(--ink); background: none; border: 1px solid transparent; border-radius: var(--r-xs); }
.bday input.cell:hover { border-color: var(--line-strong); }
.bday input.cell:focus-visible { border-color: var(--accent); outline: none; }
.bday .err { font-size: var(--t-xs); }
.loy-find { display: flex; align-items: flex-end; gap: var(--s-3); margin-bottom: var(--s-4); }
.loy-find .field { margin: 0; min-width: 18rem; }
.loy-fix { display: inline; }
.loy-fix > summary { display: inline; cursor: pointer; color: var(--accent-text); text-decoration: underline; }
.loy-fix form { display: flex; align-items: flex-end; gap: var(--s-3); margin: var(--s-2) 0 var(--s-3); }
@media print {
  .loyreg tr.person, .loyreg tr.person[hidden] { display: table-row !important; }
  .loyreg tr.person--more { display: none !important; }
  .bday input.cell { border: 0; padding: 0; width: 3.5em; }
  .loy-find, .loy-fix, .pop--cell { display: none !important; }
  .loyreg th.gs, .loyreg td.gs { padding-left: 3px; }   /* the group's hairline keeps «Поздравление» whole in its column on A4 */
}

/* ---- slice 24, Show 1: the twelve actions and «Готово, %» side by side at 1440 (point 1); the header row stays under
   the frame while the table scrolls (point 2: the table scrolls in its own box, never taller than the window under the
   frame); the band's name stays with the brand column when the table scrolls sideways (point 8); the review list folds
   after five lines and stands apart from the table (point 6); a waiting cell prints its words (point 5). */
.loyreg col.c-brand { width: 14rem; }
.loyreg col.c-it { width: 5.4rem; }
.table-wrap:has(> .loyreg) { max-height: calc(100vh - var(--head-h) - 7rem); }   /* room for the page's foot padding: its top never goes under the frame */
.loyreg tr.tbl__grp th { position: static; }
.loyreg .grp__stay { position: sticky; left: 0; display: inline-block; }
#loy-review { margin-bottom: var(--s-5); }
.loy-more > summary { cursor: pointer; color: var(--accent-text); text-decoration: underline; margin: var(--s-2) 0; }
@media print {
  .table-wrap:has(> .loyreg) { max-height: none; }
  .loyreg td.c .status { display: block !important; }
  .loy-more:not([open]) > ul { display: block; }
}

@media print {   /* slice 24, Show 3 point 2: a waiting cell prints its date and «ждёт Clients», no spinner, no dash */
  .loyreg .cell[aria-busy="true"]::after { content: none; display: none; }
  .loyreg td.c .status:not([data-state])::before { content: none; }
}

/* Slice 28 (R-127, R-128; sheet: «Редактируемая таблица», «История изменений», «Короткая форма» as a list).
   «N из M» under a loyalty percent is a details' summary: it opens .pop.pop--list where it was clicked, without motion. */
details.nm { position: relative; display: block; }
details.nm > summary { list-style: none; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
details.nm > summary::-webkit-details-marker { display: none; }
details.nm > summary:hover { color: var(--accent-text); }
details.nm > .pop--list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 300px; text-align: left; white-space: normal; font-size: var(--t-sm); font-weight: var(--w-text); gap: var(--s-2); }
.pop--list ul { margin: 0; padding-left: 1.1em; display: grid; gap: 2px; }
.pop--list .pop__h { margin: 0; }
/* slice 30: «Продажи» on «Главная» — the plan bar under the figure, in its own column (not a grid cell of its own) */
.kpi__v .share { display: block; height: 8px; margin-top: var(--s-2); border-radius: 4px; }
/* slice 30: the quiet rows a little tighter, so the page stays one screen at 1366 × 768 with the sale-date sentence */
.kpi__row:not(.kpi__row--lead) { padding: var(--s-2) 0; }
.kpi__v .kpi__of { margin-left: var(--s-3); font-size: var(--t-md); font-weight: var(--w-text); letter-spacing: 0; color: var(--ink-2); }
.loyreg thead th.it .sub { display: block; margin-top: 2px; color: var(--ink-3); font-style: italic; }
.loyact { max-width: 980px; }
.loyact col.c-name { width: 40%; }
.loyact col.c-flag { width: 17%; }
.loyact th.flag, .loyact td.flag { white-space: normal; }
.loyact td.flag { position: relative; }
.loyact .flag-f { display: inline; margin: 0; }
.loyact tbody th[scope="row"] { font-weight: var(--w-text); text-align: left; }
.hist-d { position: relative; }
.hist-d > summary { cursor: pointer; color: var(--ink-2); }
.hist-d > .pop--hist { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 380px; max-height: 320px; overflow: auto; }
@media print {
  details.nm > .pop--list, .hist-d, .cell-pop { display: none !important; }
  details.nm > summary { text-decoration: none; }
}
.table-wrap:has(> .loyact) { overflow: visible; }          /* the table fits at 1024 px: its pops are never cut at the wrap's edge */
.loyreg td.pct:has(> details.nm[open]) { z-index: 30; }   /* the open list stands over the next rows' sticky «Готово, %» */
.table-wrap:has(> .loyact) .tbl thead th { position: sticky; top: var(--top-h, var(--head-h)); z-index: 4; }   /* critique C1-3: whole below the app's bar */
.panel-tbl td[data-col="loyalty"] a.sub { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }   /* Show 1 point 3: reads as the link it is */

/* Slice 29 (row 65): «Список на дату», «Изменения списка», поручения and «Идёт РК» lines — built from the sheet's
   Fields, Status and the quiet line under a name; no new component. */
.page--priority .head__acts { align-items: flex-end; }
.page--priority .dayf { margin: 0; display: flex; align-items: flex-end; gap: var(--s-2); }
.page--priority .dayf .input { width: 9em; }
.orders { list-style: none; margin: var(--s-1) 0 0; padding: 0; }
.orders li { margin-top: 2px; font-size: var(--t-sm); overflow-wrap: anywhere; }
.rkline { margin: var(--s-1) 0 0; font-size: var(--t-sm); overflow-wrap: anywhere; }
.rkline a { color: inherit; }
td .rkline__left, .rkline .who__why { color: var(--ink-2); }
#changes { margin-top: var(--s-5); }
.chg-list { list-style: none; margin: 0; padding: 0; }
.chg { padding: var(--s-1) 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); overflow-wrap: anywhere; }
td.codes { font-size: var(--t-sm); overflow-wrap: anywhere; min-width: 8em; }
.orders .status, .rkline .status { white-space: normal; }
.page--priority .tbl .rkline { max-width: 40ch; }
.rk-row td { padding-top: 0; border-top: 0; }
.rk-row .rkline { margin: 0; line-height: 20px; }
.rk-row .rkline .status { display: inline; }                       /* critique C2-2: one sentence, as on «Бренд» */
/* Slice 37 (R-149, R-150, D-511): the поручение line above the «Идёт РК» line of a «Лояльность» row; the «Идёт РК» line
   opens the dated required actions and those left as slice 28's «N из M» list (details.nm › .pop--list), where clicked. */
.rk-row .order { margin: 0; font-size: var(--t-sm); line-height: 20px; overflow-wrap: anywhere; }
.rk-row .order .status { display: inline; white-space: normal; }
.rkline details.nm.rk { display: inline-block; vertical-align: baseline; }
.rkline details.nm.rk > summary { display: inline; }
.rkline details.nm.rk > .pop--list { left: 0; right: auto; }
.loyreg tr.rk-row td:has(details.nm[open]) { z-index: 30; }
.rail .razbor__lines .yours--side a.rk .rkline__left { color: var(--ink-2); font-weight: 400; font-size: var(--t-sm); }   /* critique C2-1 */
.rail .razbor__lines .yours--side a.rk { color: inherit; text-decoration: none; }
.rail .razbor__lines .yours--side a.rk:hover b, .rail .razbor__lines .yours--side a.rk:focus-visible b { text-decoration: underline; }
.rail .razbor__lines .yours--side a.rk .status::before { content: none; }
.rail .razbor__lines .yours--side a.rk .status { display: inline; margin: 0; }
.page--priority .who__why, .page--priority .chg { overflow-wrap: anywhere; }   /* Show 1 point 2: long words wrap */
.yours--side .yours__on { margin: 0; font-size: var(--t-sm); color: var(--ink-2); overflow-wrap: anywhere; }

/* slice 30, critique C1-2: the two tables of «Планы» on one grid — fixed columns, so a cell never moves when a figure,
   «Основание» or «сотрудники: …» appears, and «Октябрь» stands at the same place in both */
#plans-wrap table.plans { table-layout: fixed; width: 100%; }
#plans-wrap .plans__c-name { width: 24%; }
#plans-wrap .plans__c-m { width: 13%; }
#plans-wrap .plans__c-menu { width: 11%; }
/* slice 30, Show 1 point 1: a long «Основание» wraps under its figure, a word with no space breaks inside, the table keeps its width */
#plans-wrap td .plans__basis, #plans-wrap td .sub { display: block; white-space: normal; overflow-wrap: anywhere; text-align: right; }
#plans-wrap td .cell + .plans__basis { margin-top: var(--s-2); }   /* Show 36-2 point 1: clear of the focused cell's box and outline */
#plans-wrap td .who__n { overflow-wrap: anywhere; }
/* slice 30, Show 1 point 3: the director's «Группа:» under «Продажи» in the label column, so the note keeps two lines */
.kpi__label .kpi__grp { display: block; margin-top: 2px; font-size: var(--t-sm); font-weight: var(--w-normal, 400); letter-spacing: 0; color: var(--ink-2); }
@media print { #plans-wrap table.plans { width: 100%; } #plans-wrap td .who__n { overflow-wrap: normal; } }
/* slice 30, critique C1-1: «Продажи» on «Главная» — the figure's column as wide as its figure («0 млн ₽» or «3,1 из 12,5 млн ₽»),
   never wider text over the note, and the note gets the room it needs to stay two lines */
#kpi-sales.kpi__row { grid-template-columns: 11rem max-content minmax(0, 1fr); }
@media (max-width: 1180px) { #kpi-sales.kpi__row { grid-template-columns: 9rem max-content minmax(0, 1fr); } }
/* slice 30, critique C2-1: in the fixed grid of «Планы» «Как в прошлом месяце» wraps inside its month column, right-aligned */
#plans-wrap .plans th .plans__copy { margin-right: 0; }
#plans-wrap .plans th .plans__copy .btn { white-space: normal; max-width: 100%; text-align: right; height: auto; }

/* Slice 31 (D-366): «+ Новый человек» inside a .pop — a details whose summary is the quiet small button; it opens
   «ФИО полностью» and «Роль» in place, without motion. Holders of a Clients account by date, one per line. */
.pop details.pop__new > summary { list-style: none; display: inline-flex; }
.pop details.pop__new > summary::-webkit-details-marker { display: none; }
.pop details.pop__new[open] > summary { margin-bottom: var(--s-2); }
.holder-l { display: block; }
/* Slice 31 Show 1 point 4: a long unbroken word in a name wraps inside its cell, never under the rail */
.tbl .who__n { overflow-wrap: anywhere; }
/* Slice 31 Critique C2-1: in the accounts table the action column may wrap its row button, so «Человек» keeps a holder's
   name and its period whole at 1024 px */
#accts td.act, #accts td.act .btn--row { white-space: normal; }

/* «Продажи»: the month, the year and «Условия по продаже» stand apart (CRM wrap-up, F70) */
.sales-detail + .sales-detail, #terms { margin-top: 48px; }
#terms h3 { margin-top: 16px; }

/* slice 34, Show 1 point 5 (TC-34-37): on the page «Записать действие» «Дата действия» sits beside «Этап» and «Результат»
   beside «Контакт», so the first screen at 1024×700 reaches «Контакт»; the drawer and narrow panes keep one column */
.drawer .pair--date, .drawer .pair--res { grid-template-columns: 1fr; gap: 0; }
@container (max-width: 540px) { .pair--date, .pair--res { grid-template-columns: 1fr; gap: 0; } }

/* slice 36 (journey seller-transfer-credit): «Продажи» moves focus to its heading on arrival; the heading is not a control, so no ring */
.sales-detail h1[tabindex="-1"]:focus { outline: none; }
/* slice 36 (R-148): «Авторство под вопросом» stands first on «Строки на проверку», apart from the groups by reason */
#author .table-wrap { margin-top: var(--s-4); }
#author { margin-bottom: var(--s-6); }
.tbl--review .cap { display: block; max-width: 16ch; overflow-wrap: break-word; }   /* slice 36, TC-36-41: a source's name, code or brand breaks only when one word alone is longer than its column; the table stays in its window */

/* Slice 37 — Условия по продаже (R-151, D-514): slice 28's «N из M» pop-over (details.nm › .pop.pop--list) opened from a
   sale's row; no new component. The link reads on one line with «· тип продажи не определён» beside it; while it is
   open the table's wrap shows it whole (the list has no sticky column to keep); printed open, it stands in the flow. */
details.nm.terms { display: inline-block; }
.table-wrap:has(details.nm.terms[open]) { overflow: visible; }
@media print {
  details.nm.terms[open] > .pop--list { display: grid !important; position: static; width: auto; padding: 0; border: 0; box-shadow: none; margin-top: var(--s-2); }
  details.nm.terms[open] { display: block; }
}
/* A brand name wraps in full in the sales list, never past its column (direction: «Let long brand names wrap in full»):
   a 200-character name with no space pushed the table to 3,800 px, and an open «Условия по продаже» with it (TC-37-40). */
#sales-list td, #apart .drill td { overflow-wrap: anywhere; }
#sales-list td.when, #sales-list td.code, #sales-list td.num, #apart .drill td.when, #apart .drill td.code, #apart .drill td.num { overflow-wrap: normal; }   /* a date or a sum never breaks inside a number (look, 1024 px) */
#sales-list td.when, #apart .drill td.when { white-space: nowrap; }
/* Slice 37 (TC-37-38, the stress test): a brand name of 200 characters without a space wraps in the page head of «Бренд»
   instead of pushing the page sideways — «Let long brand names wrap in full; never cut a brand name». */
.head > div:first-child { min-width: 0; }
.head h1 { overflow-wrap: anywhere; }
/* Slice 37 (R-150, D-511): «осталось обязательных» joins the loyalty note of «Главная»; the note's two lines sit at the
   figure's height, so the page stays one screen at 1366 × 768 (R-107) for a director too. */
#kpi-loyalty .kpi__note { line-height: 1.15; align-self: center; }
#kpi-loyalty.kpi__row:has(#kpi-left) { padding: var(--s-1) 0; }
/* Slice 37 (design check T-dots; D-544): a поручение's facts each in their own place — what, from whom, to whom, term,
   state — set apart by the gap, not strung together with middle dots. */
.order { display: flex; flex-wrap: wrap; column-gap: var(--s-3); row-gap: 0; align-items: baseline; }
.order .order__what { font-weight: 560; overflow-wrap: anywhere; min-width: 0; }
.orders li.order { margin-top: 2px; }
/* Slice 37 Show 1 point 5: the поручение and «Идёт РК» lines under a brand row stay in the visible part of the table:
   held at its left edge and as wide as the wrap, so a long line wraps where the user can read it. */
.loyreg tr.rk-row td > .order, .loyreg tr.rk-row td > .rkline { position: sticky; left: 0; max-width: calc(100vw - 2 * var(--s-6) - 2rem); }

/* slice 38 (critique C1-3): a list's heading takes the focus by script (R-157, journey seller-sales-month); it cannot be
   pressed, so no ring around it — the focus stays there for a screen reader */
h1[data-focus]:focus { outline: none; }
/* slice 38 (Show 1 point 5): «ноябрь 2026» beside a block's label never breaks */
.kpi__period { white-space: nowrap; }
/* slice 38 (review F2-1): the month's sentence and «За N квартал» on one line, the disclosure beside the sentence */
.scope-line { margin-top: var(--s-2); }
.scope-line > .scope { display: inline; margin-top: 0; }
.scope-line > .inline-more { margin-left: var(--s-2); }
/* slice 38 (Show 2 point 1): at 1024 the label column is too narrow for «ноябрь 2026» beside «Продажи»; it goes under the
   label, whole, and never runs under the figure */
@media (max-width: 1180px) { .kpi__row:not(.kpi__row--lead) .kpi__period { display: block; margin-left: 0; } }

/* Slice 39 (W-6): the «Идёт РК» line of «Приоритетные клиенты» on «Главная» is a link and looks like every link */
#priority a.rk { color: var(--accent-text); text-decoration-line: underline; }
/* Slice 39 (W-7): in the box the group row sticks at its top and the column names under it (loyalty.js sets --g-h);
   the heads stand over the body's sticky first and last cells */
.loyreg thead tr + tr th { top: var(--g-h, 0px); }
.loyreg thead th, .loyreg thead th:first-child, .loyreg thead th.pct { z-index: 3; }   /* Show 1 point 2: over `th:first-child`'s 2 */
.loyreg thead th[rowspan], .loyreg thead th[rowspan]:first-child, .loyreg thead th[rowspan].pct { z-index: 4; }
/* Slice 39 (W-8): in a register that scrolls in itself the cell's form floats where it fits, so the box never scrolls */
.loyreg td.c .pop[data-float], .pop--cell[data-float] { position: fixed; }
/* Slice 39 (C1-3): the receipt line under a register's title takes the Hint role, like «Данные Clients на …» */
.head__meta.receipt { font-size: var(--t-xs); line-height: 1.4; font-weight: 380; color: var(--ink-2); }
/* Slice 39 (Show 1 point 4): a long link from the Excel register breaks inside its cell, so the register keeps its frame at 1440 */
.reg td.link, .reg td.link .cell { white-space: normal; }
.reg td.link a { overflow-wrap: anywhere; }   /* a URL breaks anywhere; words never (Show 3 point 3) */
.reg td.link { max-width: 12rem; }
.reg td.code, .reg td.code .code { white-space: normal; overflow-wrap: normal; word-break: keep-all; }   /* Show 2 point 5: several codes wrap between codes, a code stays whole */
@media (max-width: 1180px) { .reg td.brand { overflow-wrap: anywhere; } }   /* a brand token with no space may break where the register is tight */
/* slice 39 Show 3 point 3: the Excel text breaks between words and after «_» (the `joins` filter), never inside a word, at 1440 */

/* Slice 41 Show 1: no empty grid row for an empty list of extra brands (point 2); a field gap under a lone action form on the row as a form (point 3) */
[data-more-list]:empty { display: none; }
.page--log > form.form__acts { margin-bottom: var(--s-4); }

/* Slice 41 Critique C2-1 (D-574): «Повестка» on its own line under the row, across the row's width; the row and its note read as one */
.reg tr.row-note td { padding-top: 0; border-top: 0; }
.reg tr.row-note .sub.agenda { max-width: var(--measure); overflow-wrap: anywhere; }

/* Slice 41 Show 2 point 1 (direction: the heads' tables never scroll sideways at 1024): below 1440 px a group's label
   wraps in «Итоги по сотрудникам», so its column no longer holds the table past its wrap (1024, 1280, 1366); at 1440 one line */
@media (max-width: 1400px) { #team tr.team__sum > th { white-space: normal; min-width: 8rem; } }

/* Slice 41 Show 3 points 1, 2: between the compact layout (≤ 1180) and 1400 the register and the top bar took their
   1440 spacing and ran past the window (1200–1399, 1366 the common laptop); here they take the compact spacing */
@media (min-width: 1181px) and (max-width: 1399px) {
  .bar { gap: var(--s-4); }
  .bar__nav { gap: var(--s-3); font-size: var(--t-sm); }
  .reg th, .reg td { padding-right: 3px; }   /* as ≤ 1180: room for the test-runner's Linux font metrics (check after fix 3) */
  .reg td.menu { white-space: normal; text-align: center; }
  .reg td.menu .btn--row { white-space: normal; height: auto; min-height: 34px; line-height: 1.2; padding: 6px 4px; max-width: 6.5rem; }
  .reg td.menu .row-act, .reg td.menu > .btn--row { margin: 0; }
  .reg td.menu > details.more { display: block; width: 34px; margin: 4px auto 0; }
  .reg td.when { white-space: normal; }
}
/* slice 42 (D-586, D-587): a group's summed row, «не загружено» and a seller's «нет данных» wrap in their cell, so the
   table stays inside its wrap at 1440 */
.panel-tbl td.num .muted, .panel-tbl td.num a.fig[data-unloaded], .panel-tbl tfoot tr[data-summed] td.num a.fig,
.panel-tbl tfoot tr[data-summed] td.num .sub { white-space: normal; }
.panel-tbl td.num a.fig[data-unloaded] { display: block; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.3; }   /* slice 42 (D-589): words, not a figure — the sub lines' type, so «не загружено» never widens the column */
/* slice 42, critique C1-3: «руководитель не назначен» on the name's left edge, as «нет записей» */
.panel-tbl td p.who__unplaced { margin-inline: 0; max-width: none; }
/* slice 42, critique C1-1: «N из M действий» goes under the percent, never over the note below */
#kpi-loyalty .kpi__v .kpi__of { display: block; white-space: normal; }
/* slice 42, critique C1-2: words wrap at spaces only; «руководителя» is hyphenated rather than run out of its cell */
.panel-tbl td .sub[data-words], .panel-tbl tfoot tr[data-summed] td.num .sub { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }

/* =========================================================== 28.11.2026 — Yarik's walk at Gate 2: five visual points, no slice.
   Styling only (and one line of placement in loyalty.js); no figure, link or rule of the pages changes. */

/* point 1 — «Главная»: «Лояльность» and «Продажи» stand on one grid — the label, the figure with its second line under it
   («N из M действий», «План не задан.»), the sentence — so both figures and both sentences start at the same place, and the
   director's «Группа: …» keeps one line under «Продажи». Below 1181 px the rows keep their own columns, as before. */
#kpi-loyalty .kpi__v .kpi__of, #kpi-sales .kpi__v .kpi__none { display: block; margin: 3px 0 0; font-size: var(--t-sm); line-height: 1.3; }
@media (min-width: 1181px) {
  @supports (grid-template-columns: subgrid) {
    .kpi { display: grid; grid-template-columns: 11rem max-content minmax(0, 1fr); column-gap: var(--gap); }
    .kpi:has(#kpi-sales-group) { grid-template-columns: minmax(11rem, max-content) max-content minmax(0, 1fr); }
    .kpi > .kpi__row, .kpi > #kpi-sales.kpi__row { grid-column: 1 / -1; }
    .kpi > .kpi__row:not(.kpi__row--lead), .kpi > #kpi-sales.kpi__row { grid-template-columns: subgrid; }
    .kpi__label .kpi__grp { white-space: nowrap; }
    #kpi-loyalty .kpi__v .kpi__of { white-space: nowrap; }
    #kpi-loyalty .kpi__note { align-self: baseline; line-height: inherit; }   /* on the percent's line, as the note of «Продажи» */
    #kpi-loyalty.kpi__row:has(#kpi-left) { padding: var(--s-2) 0; }           /* the same air as «Продажи» */
  }
}
/* the gap before «Как считается» travels with the words: a sentence that ends at the note's edge never widens the row */
#sales-basis { margin-left: 0; }
#sales-basis > summary { margin-left: var(--s-2); }

/* point 3 — a page head with a picker beside its buttons («Команда продаж», «Лояльность», «Приоритетные клиенты»): the
   buttons keep a button's height and stand on the picker's line, never stretched to the label above it */
.head__acts:has(> .field, > form .field) { align-items: flex-end; }
.head__acts:has(> .field, > form .field) > .btn { min-height: 40px; }

/* point 4 — «Лояльность» for a head: «Действия лояльности» is a plain button, and it and «Сотрудник» stand at the right
   of the page's title, as the buttons and «Период» on «Команда продаж»; under 1000 px they keep their own line */
@media (min-width: 1000px) {
  .head:has(> .head__acts > form[action="/loyalty"], > .head__acts > a[href="/loyalty/actions"]) { flex-wrap: nowrap; align-items: flex-start; }
}

/* point 5 — «Приоритетные клиенты»: «Показать» and «Выписка» as tall as «Список на дату» beside them */
.page--priority .dayf .btn { min-height: 40px; }

/* =========================================================== 28.11.2026 — Yarik's walk at Gate 2: «Команда продаж» in three
   parts, no slice. «Сотрудники» and «Группы» share the ten columns (a heading over the table, a heading row before the
   group rows); «Продажи вне продавцов» is a short table of its own under them: who, the period, from 1 January */
/* the three headings are one heading: the page's own h2 (as the rail's), var(--s-6) over it, var(--s-3) under it, and
   under each the same thing — a table's first line: the column names, or the group rows under the names' rule */
.panel-h, .panel-tbl .tbl__grp > th { font-size: var(--t-lg); font-weight: 660; letter-spacing: -0.015em; line-height: 1.2; color: var(--ink); }
.panel-h { margin: 0; padding: 0 0 var(--s-3) 10px; }
.panel-tbl .tbl__grp > th { padding-top: var(--s-6); padding-bottom: var(--s-3); text-align: left; }
.panel-tbl .panel-grp + tfoot tr:first-child td { border-top: 1px solid var(--line-strong); }   /* the rule under «Группы» is the rule under the column names */
.panel-out { margin-top: var(--s-6); }
.panel-out__note { max-width: var(--measure); margin-top: var(--s-3); padding-left: 10px; color: var(--ink-2); }
.out-tbl { width: auto; min-width: min(100%, 36rem); }
.out-tbl th:first-child, .out-tbl td:first-child { padding-left: 10px; }
.out-tbl th.num, .out-tbl td.num { padding-left: var(--s-6); white-space: nowrap; }
.out-tbl td .sub { color: var(--ink-2); }
.out-tbl tr.out-row--all td { border-top: 2px solid var(--line); }
.out-tbl tr.out-row--all td.num, .out-tbl tr.out-row--all .who__n { font-weight: var(--w-strong); }
@media (max-width: 1180px) { .panel-h, .panel-out__note, .out-tbl th:first-child, .out-tbl td:first-child { padding-left: 0; } }
/* a seller with no line: one line under «Подробнее», set as the holders' lines beside it */
.noline > p { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: var(--t-sm); }
.noline b { color: var(--ink); }

/* =========================================================== 28.11.2026 — Yarik's walk at Gate 2, later the same day, no slice.
   «Действия лояльности»: the page is its table's width and stands in the middle of the window, as «Лояльность» does */
@media screen { .page--loyact { width: 100%; max-width: calc(980px + 2 * var(--pad)); margin-inline: auto; } }
/* «Выписка» (the list of a day): its way back is a button of «Показать»'s size on the page it came from */
.page--print .head__acts > .btn { min-height: 40px; }

/* =========================================================== 28.11.2026 — Yarik's walk at Gate 2, the evening, no slice.
   «Команда продаж», the rail: «Без работы» and «Общие задачи» are closed until asked for; each heading keeps its count
   beside it and the mark of a fold at the right */
.rail-fold > summary { display: flex; align-items: baseline; gap: 0.3em; cursor: pointer; list-style: none; border-radius: var(--r-sm); }
.rail-fold > summary::-webkit-details-marker { display: none; }
.rail-fold > summary::after { content: ""; flex: none; align-self: center; margin-left: auto; margin-right: 4px; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
.rail-fold[open] > summary::after { transform: rotate(45deg); }
.rail-fold > summary > h2 { min-width: 0; }
.rail-fold > summary:hover > h2 { text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.rail-fold__n { flex: none; font-size: var(--t-lg); font-weight: 660; letter-spacing: -0.015em; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .rail-fold > summary::after { transition: none; } }

/* a cell a person may change shows it at rest: a hairline of the row rule's colour on the cell's own box; the pointer
   and the focus darken the same box, and the input that opens is the same box again, so nothing jumps. The box stops
   5 px outside its text (was 8): two cells side by side keep 4 px between them (2 px under 1180, where the columns
   stand closer), and an open cell never touches its neighbour's line. The text itself stays where it was. Screen only:
   on paper a cell is its text; a cell that is text without script (disabled) has no line */
@media screen {
  .tbl--edit td > .cell, .tbl--edit td > .flag-f > .cell { width: calc(100% + 10px); margin: -5px; padding: 4px; }
  .tbl--edit td > button.cell:not(:disabled):not(:hover):not(:focus-visible):not([aria-busy="true"]):not([aria-invalid="true"]):not([aria-expanded="true"]), .tbl--edit td > .flag-f > button.cell:not(:disabled):not(:hover):not(:focus-visible):not([aria-busy="true"]):not([aria-invalid="true"]):not([aria-expanded="true"]) { border-color: var(--line); }
  .loyreg td.c > a.cell:not(:hover):not(:focus-visible):not([aria-busy="true"]) { outline: 1px solid var(--line); outline-offset: -2px; }
}
@media screen and (max-width: 1180px) {
  .tbl--edit td > .cell, .tbl--edit td > .flag-f > .cell { width: calc(100% + 8px); margin: -5px -4px; padding: 4px 3px; }
  /* «Реестр встреч» under 1180: its thirteen columns stand 3 px apart, so its cells stay as they were — no line at rest */
  .reg td > .cell { width: calc(100% + 16px); margin: -5px -8px; padding: 4px 7px; }
  .reg td > button.cell:not(:disabled):not(:hover):not(:focus-visible):not([aria-busy="true"]):not([aria-invalid="true"]):not([aria-expanded="true"]) { border-color: transparent; }
}
/* «Планы»: how to enter a figure is said under the title, as on «Действия лояльности», where it is read before the first click */
#plans-how { margin-top: var(--s-1); }

/* =========================================================== 28.11.2026 — Yarik's walk at Gate 2, the night, no slice.
   «Реестр встреч»: a warning under a cell stands clear of the cell's line (the cell's box reaches 5 px under its text) */
@media screen { .tbl--edit td > .cell + .status { margin-top: 10px; } }
@media screen and (max-width: 1180px) { .reg td > .cell + .status { margin-top: 2px; } }   /* no line at rest there: as it was */
/* «Лояльность»: «Идёт РК …» stands in the brand's own cell, under the name — small, on the name's edge — and opens the
   same list. The rows of the table follow one another with nothing between them; the columns' rules run unbroken.
   The quiet tail («с 01.11 осталось N: …») is the list's own content, so on the page it is kept for a reader of the
   text only. A поручение keeps its line under the row */
.loyreg td:first-child > .rkline { margin: 3px 0 0; font-size: var(--t-xs); line-height: 1.35; overflow-wrap: anywhere; }
.loyreg td:first-child > .disc ~ .rkline { margin-left: 20px; }
.loyreg td:first-child > .rkline .status { display: inline; white-space: normal; font-size: var(--t-xs); font-weight: 500; }
.loyreg td:first-child > .rkline .rkline__tail { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print { .loyreg td:first-child > .rkline .rkline__tail { display: none; } }   /* read aloud on screen only; on paper its clipped box still ran across the columns */
.loyreg td:first-child:has(details.nm[open]) { z-index: 30; }

/* Yarik 29.11.2026: the column names of a long table stay under the app's bar while the page scrolls — each table's own,
   while the reader is in it. app.js marks the table's box `data-stick` when only the page scrolls it and measures the
   bar (--stick-top) and each row of the head (--row-top). Every other box keeps the head it had. */
@media screen {
  .table-wrap[data-stick] { overflow: visible; }
  .table-wrap[data-stick] > table > thead th { position: sticky; top: calc(var(--stick-top, var(--head-h)) + var(--row-top, 0px)); z-index: 4; }
  /* a collapsed table keeps a cell's border with the table, not with the stuck cell, so a stuck head lost its line:
     the cell draws the line itself, inside its lower edge, and its border there is let go — one line, at rest and stuck */
  .table-wrap[data-stick] > table > thead tr:last-child th { border-bottom-color: transparent; box-shadow: inset 0 -1px 0 var(--line-strong); }
  /* what the page scrolls to inside such a table — a row by its link, a cell by the Tab key — stops under the head */
  .table-wrap[data-stick] > table > tbody [id], .table-wrap[data-stick] > table > tbody :is(a, button, input, select, textarea, summary) { scroll-margin-top: calc(var(--stick-top, var(--head-h)) + var(--stick-head, 0px) + 8px); }
}

/* =========================================================== 29.11.2026 — Yarik's walk at Gate 2: six visual points, no slice. */
/* point 3 — «Реестр встреч»: a cell that already shows its value («оффлайн», «открыть») has its «изменить» under it. At
   rest that is no empty box under the words: its line and its word come when the row is in hand, as the word did before. */
@media screen {
  .tbl--edit td > :is(a, .xl-text) ~ button.cell { margin-top: 1px; }
  .tbl--edit td > :is(a, .xl-text) ~ button.cell:not(:disabled):not(:hover):not(:focus-visible):not([aria-busy="true"]):not([aria-invalid="true"]):not([aria-expanded="true"]) { border-color: transparent; }
  .tbl--edit tr:hover td > :is(a, .xl-text) ~ button.cell:not(:disabled):not(:hover):not(:focus-visible):not([aria-busy="true"]):not([aria-invalid="true"]):not([aria-expanded="true"]) { border-color: var(--line); }
}

/* point 6 — «Главная»: under «Баллы за встречи», «Лояльность» and «Продажи» stand side by side as two blocks of the sheet,
   a hairline between them (no cards: direction.md). Each reads top to bottom — its name, the figure, then one fact a
   line — where one long line ran across the page. Narrower than 1181 px the two blocks stand one under the other. */
@media screen {
  .page--home .kpi, .page--home .kpi:has(#kpi-sales-group) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0; }
  .page--home .kpi > .kpi__row--lead { grid-column: 1 / -1; }
  .page--home .kpi > #kpi-loyalty.kpi__row, .page--home .kpi > #kpi-sales.kpi__row {
    grid-column: auto; display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "label label" "fig note";
    column-gap: var(--s-5); row-gap: var(--s-1); align-items: start; align-content: start;
    padding: var(--s-3) 0; border-top: 1px solid var(--line); }
  .page--home .kpi > #kpi-loyalty.kpi__row { padding-right: var(--s-5); }
  .page--home .kpi > #kpi-sales.kpi__row { padding-left: var(--s-5); border-left: 1px solid var(--line); }
  .page--home .kpi > .kpi__row:not(.kpi__row--lead) > .kpi__label { grid-area: label; }
  .page--home .kpi > .kpi__row:not(.kpi__row--lead) > .kpi__v { grid-area: fig; }
  .page--home .kpi > .kpi__row:not(.kpi__row--lead) > .kpi__note { grid-area: note; align-self: start; font-size: var(--t-sm); line-height: 1.45; }   /* the secondary lines' type: the figure leads */
  /* the name's line: the period beside it, a director's «Группа: …» after them */
  .page--home .kpi > .kpi__row:not(.kpi__row--lead) .kpi__period { display: inline; margin-left: var(--s-2); }
  .page--home .kpi > .kpi__row > .kpi__label .kpi__grp { display: inline; margin: 0 0 0 var(--s-4); white-space: nowrap; }
  /* one fact a line */
  .page--home #kpi-loyalty > .kpi__note > #kpi-left,
  .page--home #sales-year > #fig-sales-y, .page--home #sales-year > .status, .page--home #sales-year > #sales-basis { display: block; width: fit-content; max-width: 100%; }
  .page--home #sales-year > .status { display: flex; }
  .page--home #sales-year > #sales-basis { margin-left: 0; }
  .page--home #sales-year > #sales-basis > summary { margin-left: 0; }
}
@media screen and (max-width: 1180px) {
  .page--home .kpi, .page--home .kpi:has(#kpi-sales-group) { grid-template-columns: minmax(0, 1fr); }
  .page--home .kpi > #kpi-loyalty.kpi__row { padding-right: 0; }
  .page--home .kpi > #kpi-sales.kpi__row { padding-left: 0; border-left: 0; }
}
/* point 1 — «Бренды без компании»: «Выбрать другую» is a button in its own outline, a gap from «Подтвердить» beside it */
.page--priority .tbl td.act > form + .btn { margin-left: var(--s-2); }

/* ---------- Yarik 29.11.2026, the walk's second wave of polish ---------- */
/* D-606: the words that explain a page stand above its body closed, under a name that says when to open them */
.about { margin-top: var(--s-2); max-width: var(--measure); }
.about > summary { display: inline-flex; align-items: center; gap: 7px; list-style: none; cursor: pointer; font-size: var(--t-sm); font-weight: 560; color: var(--accent-text); border-radius: var(--r-sm); }
.about > summary::-webkit-details-marker { display: none; }
.about > summary::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 1px 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
.about[open] > summary::before { transform: translateY(-2px) rotate(45deg); }
.about > summary:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.about__body { margin-top: var(--s-2); padding-left: var(--s-3); border-left: 2px solid var(--line); color: var(--ink-2); }
.about__body > * { margin: 0; }
.about__body > * + * { margin-top: var(--s-2); }
.about__body > .head__meta { display: block; }
.about__body ul { margin: 4px 0 0; padding-left: 1.2em; }
.section__h > .about { flex: 1 0 100%; max-width: none; margin-top: calc(-1 * var(--s-2)); }   /* under the section's name, at the sheet's left edge */
.section__h .about__body { max-width: var(--measure); }
.section__h .about__body p { color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .about > summary::before { transition: none; } }
@media print {
  .about > summary::before { content: none; }
  .about:not([open])::details-content { content-visibility: visible; display: block; }   /* on paper the words are in sight, as before */
}
/* «Команда продаж»: the same air under «Продажи вне продавцов» as above it */
.panel-out + .fold--more { margin-top: var(--s-6); }
/* «Главная»: the two counts of «Мои задачи» in colour — overdue in the system's red, today's in petrol; a zero stays quiet */
.page--home #tasks-link { text-decoration: none; }
.page--home #tasks-link .tl__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.page--home #tasks-link:hover .tl__name { text-decoration-thickness: 2px; }
.page--home #tasks-link .tl { display: inline-block; padding: 1px 8px; border-radius: var(--r-xs); background: var(--paper-deep); color: var(--ink-2); font-size: var(--t-sm); font-weight: 560; font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: 0.05em; }
.page--home #tasks-link .tl--late { background: var(--bad-soft); color: var(--bad); }
.page--home #tasks-link .tl--today { background: var(--accent-soft); color: var(--accent-text); }
.page--home #tasks-link .tl__dot { color: var(--ink-3); font-weight: 400; }
@media print { .page--home #tasks-link .tl { padding: 0; background: none; color: inherit; } }
/* «Главная», more air (Yarik 29.11.2026): the lines under the points bar and inside «Лояльность» and «Продажи» stand
   apart — the sentence, then the counts in the secondary type; in a block the figure on the left, a hairline, and one
   fact a line with space between the lines. A tall window (a 1080p screen) gets the full air; 1366 × 768 keeps one screen (R-156). */
@media screen {
  .page--home .kpi__row--lead .kpi__note { margin-top: var(--s-3); }
  .page--home .kpi__row--lead #kpi-counts { margin-top: 6px; font-size: var(--t-sm); }
  .page--home .kpi > #kpi-loyalty.kpi__row, .page--home .kpi > #kpi-loyalty.kpi__row:has(#kpi-left), .page--home .kpi > #kpi-sales.kpi__row { padding-block: var(--s-3); row-gap: var(--s-2); column-gap: var(--s-4); }   /* the two names on one line: «Лояльность» had 4 px less above it */
  .page--home .kpi > .kpi__row:not(.kpi__row--lead) > .kpi__note { padding-left: var(--s-4); border-left: 1px solid var(--line); line-height: 1.4; }
  .page--home #kpi-loyalty > .kpi__note > #kpi-left, .page--home #sales-year > * + * { margin-top: 5px; }
}
@media screen and (min-height: 860px) {
  .page--home .kpi__row--lead { padding-bottom: var(--s-5); }
  .page--home .kpi__row--lead .kpi__note { margin-top: var(--s-4); }
  .page--home .kpi__row--lead #kpi-counts { margin-top: var(--s-2); }
  .page--home .kpi > #kpi-loyalty.kpi__row, .page--home .kpi > #kpi-loyalty.kpi__row:has(#kpi-left), .page--home .kpi > #kpi-sales.kpi__row { padding-block: var(--s-5); row-gap: var(--s-3); }
  .page--home #kpi-loyalty > .kpi__note > #kpi-left, .page--home #sales-year > * + * { margin-top: var(--s-2); }
  .page--home .attn { margin-top: var(--s-6); }
}
@media screen and (max-height: 800px) {   /* a short window (1366 × 768): the same order, tighter, so the page stays one screen (R-156) */
  .page--home .kpi__row--lead .kpi__note { margin-top: var(--s-2); }
  .page--home .kpi__row--lead #kpi-counts { margin-top: var(--s-1); }
  .page--home .kpi > #kpi-loyalty.kpi__row, .page--home .kpi > #kpi-loyalty.kpi__row:has(#kpi-left), .page--home .kpi > #kpi-sales.kpi__row { padding-block: var(--s-2); row-gap: var(--s-1); }
  .page--home #kpi-loyalty > .kpi__note > #kpi-left, .page--home #sales-year > * + * { margin-top: 3px; }
}
/* «Команда продаж», two panes side by side (1400 px and wider): each pane scrolls in itself, so the list's scrollbar
   stands at the list's own right edge, beside the side pane — not at the window's edge, past the side pane's own
   (Yarik 29.11.2026). The app's bar stays above both; narrower, the side pane is under the list and the window scrolls. */
@media screen and (min-width: 1400px) {
  body:has(> .desk--panel) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  body:has(> .desk--panel) > .top { flex: none; }
  body > .desk--panel { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  body > .desk--panel > main.page { min-height: 0; overflow-y: auto; }
  body > .desk--panel > .rail { min-height: 0; }
  body > .desk--panel .rail__in { position: static; height: 100%; max-height: none; }
  /* a thing that stays at the pane's top is measured from under the pane's own top padding, so it is drawn back by it */
  body > .desk--panel > main.page .notice.is-pinned { top: calc(-1 * var(--s-6)); }
  body > .desk--panel > main.page .table-wrap[data-stick] > table > tbody [id],
  body > .desk--panel > main.page .table-wrap[data-stick] > table > tbody :is(a, button, input, select, textarea, summary) { scroll-margin-top: calc(var(--stick-head, 0px) + 8px); }
}

/* ---------- Yarik 29.11.2026, third wave (D-608, D-609) ---------- */
/* «Главная»: the points figure in the size of its plan — «0 из 36» reads as one figure */
.page--home .kpi__fig { font-size: var(--t-xl); letter-spacing: -0.02em; }
.page--home .kpi__fig .kpi__of { font-size: 1em; margin-left: 0.25em; }
/* «Продажи»: the group's line is a row of its own under the year's, in the facts' type */
.page--home #sales-year > #kpi-sales-group { display: block; width: fit-content; max-width: 100%; white-space: normal; color: inherit; }
.page--home #kpi-loyalty > .kpi__note > #kpi-left { margin-top: 0; }   /* the only fact of «Лояльность» now */
/* «Приоритетные клиенты»: the two sections that fix a brand's company, in one closed fold under the list */
.page--priority #map { margin-top: var(--s-6); }
.page--priority #map > .fold__body > section + section { margin-top: var(--s-6); }
/* «Лояльность» (D-610): the person's own sentence is on paper only, so the company's total starts the line on screen */
@media screen { .scope > .print-only + .muted { margin-left: 0; } }
@media print { .scope > .print-only { display: inline; } }

/* ---------- Yarik 29.11.2026, fourth wave (D-611, D-612) ---------- */
/* «Главная», «Стоит внимания»: «Убрать» beside a line's action; what was taken off is counted under the list, with «Вернуть» */
.page--home .attn .acts { gap: var(--s-2); }
.attn__off { margin-top: var(--s-3); padding-left: 10px; }
.attn__back { padding: 0; border: 0; background: none; font: inherit; font-weight: 560; color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; cursor: pointer; border-radius: var(--r-sm); }
.attn__back:hover { text-decoration-thickness: 2px; }
@media (max-width: 1180px) { .attn__off { padding-left: 0; } }

/* «Команда продаж», two panes wide: the side pane starts closed, a strip at the window's right edge that names what is
   in it, and slides out from the right when pressed; pressed again in the same place, it slides back. The pane keeps its
   own width while it moves, so its lines do not rewrap; the list takes the room that is left. */
.rail__toggle { display: none; }
@media screen and (min-width: 1400px) {
  html[data-rail="closed"] body > .desk--panel { grid-template-columns: minmax(0, 1fr) 44px; }
  html[data-rail-moved] body > .desk--panel { transition: grid-template-columns 260ms var(--ease); }
  html[data-rail] .desk--panel > .rail { position: relative; overflow: hidden; }
  html[data-rail] .desk--panel .rail__in > div { width: 359px; padding-top: var(--s-4); }
  html[data-rail] .desk--panel .rail__in { transition: opacity var(--dur-base) var(--ease) 60ms, visibility 0s; }
  html[data-rail="closed"] .desk--panel .rail__in { visibility: hidden; opacity: 0; overflow: hidden; transition: opacity var(--dur-fast) var(--ease), visibility 0s 260ms; }
  html[data-rail] .rail__toggle:not([hidden]) { position: absolute; z-index: 3; top: 10px; right: 10px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
    border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--canvas); color: var(--ink-2); cursor: pointer; outline-offset: -3px; }
  html[data-rail] .rail__toggle:hover { background: var(--paper-deep); color: var(--ink); }
  .rail__chev { width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }   /* › : press to fold the pane away */
  .rail__spine { display: none; }
  /* closed: the whole strip is the button — the chevron on top, the pane's contents named along it */
  html[data-rail="closed"] .rail__toggle:not([hidden]) { inset: 0; width: 100%; height: 100%; flex-direction: column; justify-content: flex-start; gap: var(--s-4); padding-top: 21px; border: 0; border-radius: 0; background: transparent; }
  html[data-rail="closed"] .rail__toggle:hover { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 45%); }
  html[data-rail="closed"] .rail__chev { margin: 0 0 0 3px; transform: rotate(135deg); }                       /* ‹ : press to slide it out */
  html[data-rail="closed"] .rail__spine { display: block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: var(--t-xs); font-weight: 560; letter-spacing: 0.03em; white-space: nowrap; color: var(--ink-2); }
  html[data-rail="closed"] .rail__toggle:hover .rail__spine { color: var(--ink); }
  /* closed, a head's own «Ваши задачи» stand above the table, as they do when the pane is under the list */
  html[data-rail="closed"] .desk--panel .yours-narrow { display: block; max-width: 40rem; margin-bottom: var(--s-6); }
  html[data-rail="closed"] .desk--panel #yours-block { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-rail-moved] body > .desk--panel, html[data-rail] .desk--panel .rail__in, html[data-rail="closed"] .desk--panel .rail__in { transition: none; }
}
/* «Команда продаж» with six figures a row (D-614): two panes wide there is room for the lines under «Баллы за встречи» and
   «Продажи» to stand a line each, so a row is lower */
@media screen and (min-width: 1400px) {
  .panel-tbl tbody td[data-col="points"] .sub:not([data-words]), .panel-tbl tbody td[data-col="rk_year"] .sub { max-width: none; white-space: nowrap; }
}

/* «Реестр встреч» (Yarik 29.11.2026, D-615): the three scores stand out as they do in the company's Excel, where their
   columns are filled light blue — here a wash of the system's petrol under the three headings and their cells */
@media screen {
  .reg tbody tr[data-row] > td:nth-child(n+9):nth-child(-n+11) { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 62%); }   /* the cells only: the headings stay plain */
  /* a cell's box started 5 px left of its column, over the edge of the wash: here it starts where the column does */
  .reg tbody tr[data-row] > td:nth-child(n+9):nth-child(-n+11) > .cell { margin-left: 0; width: calc(100% + 5px); }
  .reg tbody tr[data-row]:hover > td:nth-child(n+9):nth-child(-n+11) { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 88%); }
}

/* «Лояльность» (Yarik 29.11.2026, D-616): the three groups of the company's steps each stand in a quiet wash of their own —
   sky, mint, lilac, none of them a status colour — under the cells of their columns, the contacts' rows too; a hairline
   of the same hue under the group's name ties the name to its columns. The row in hand deepens each wash, as the name
   and «Готово, %» deepen. «Обсуждена СК/PFD», outside the groups, stays plain. */
@media screen {
  .loyreg { --g1: var(--wash-g1); --g2: var(--wash-g2); --g3: var(--wash-g3); }      /* the hues are tokens of ui/theme.css */
  .loyreg td.c[data-g="1"] { background: color-mix(in oklch, var(--canvas), var(--g1) 46%); }
  .loyreg td.c[data-g="2"] { background: color-mix(in oklch, var(--canvas), var(--g2) 46%); }
  .loyreg td.c[data-g="3"] { background: color-mix(in oklch, var(--canvas), var(--g3) 46%); }
  .loyreg tbody tr:hover td.c[data-g="1"] { background: color-mix(in oklch, var(--canvas), var(--g1) 88%); }
  .loyreg tbody tr:hover td.c[data-g="2"] { background: color-mix(in oklch, var(--canvas), var(--g2) 88%); }
  .loyreg tbody tr:hover td.c[data-g="3"] { background: color-mix(in oklch, var(--canvas), var(--g3) 88%); }
  .loyreg th.g[data-g="1"] { box-shadow: inset 0 -2px 0 color-mix(in oklch, var(--g1), var(--ink) 22%); }
  .loyreg th.g[data-g="2"] { box-shadow: inset 0 -2px 0 color-mix(in oklch, var(--g2), var(--ink) 22%); }
  .loyreg th.g[data-g="3"] { box-shadow: inset 0 -2px 0 color-mix(in oklch, var(--g3), var(--ink) 22%); }
}

/* Yarik 29.11.2026 (D-617): the days after «Срок прошёл:» read in the tag's own colour — one warning, not a tag and a
   plain figure under it. */
.due__meta > .status[data-state="bad"] + .nowrap,
.next__late > .status[data-state="bad"] + .nowrap { color: var(--bad); font-weight: 560; }

/* Yarik 29.11.2026 (D-620): an Excel row that found no brand or contact stands in the table — a note under its brand's
   name, or a row of the group «Из Excel» with its ticks under their steps; no notice over the table. */
.loyreg .xl-note { margin-top: var(--s-1); font-size: var(--t-sm); line-height: 1.35; }
.loyreg .xl-note .status { white-space: normal; }
.loyreg .xl-name { font-weight: 560; overflow-wrap: anywhere; }
.loyreg .xl-note .loy-fix form { flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0 var(--s-1); }
.loyreg .xl-note .loy-fix .field { flex: 1 1 100%; min-width: 0; }
.loyreg .xl-note .loy-fix .input, .loyreg .xl-note .loy-fix .sel, .loyreg .xl-note .loy-fix select { width: 100%; max-width: 100%; }
.loyreg tr.xl-row td.c > .cell { cursor: default; }

/* Yarik 29.11.2026 (D-621): the group «Без продавца» under the priority list — its note in the quiet voice after the name */
.tbl__grp .grp__note { margin-left: var(--s-3); font-size: var(--t-sm); font-weight: 400; color: var(--ink-2); }

/* Yarik 29.11.2026 (D-624): the level rules under «Приоритетные клиенты» — one quiet line, the numbers in the ink */
.tiers { margin-top: var(--s-2); font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.tiers b, .tiers .tiers__h { color: var(--ink); font-weight: 560; }
.tiers .tiers__dot { color: var(--ink-3); margin: 0 2px; }

/* ---------- sweep 2026-12, lane 1 ---------- */
/* A1 (K-1): «Закреплено» on «Главная» — a block of the sheet as «Лояльность» and «Продажи», across both their columns:
   the name, the figure, a hairline, then «Контакт за 60 дн.» and «Контакт за 30 дн.», one fact a line */
#kpi-brands .kpi__line { display: block; width: fit-content; }
#kpi-brands .kpi__line + .kpi__line { margin-top: 5px; }
@media screen {
  .page--home .kpi > #kpi-brands.kpi__row {
    grid-column: 1 / -1; display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "label label" "fig note";
    column-gap: var(--s-4); row-gap: var(--s-2); align-items: start; align-content: start; padding: var(--s-3) 0; border-top: 1px solid var(--line); }
}
/* A6 (K-5): «Открыть Clients» (`.bar__out`) stands in `.bar__user` before the name, as quiet as «Выйти».
   F7 (Yarik 3 Dec, 2a on A6/F5): the wordmark «MMG Продажи», the name and the role show at every width, and the
   sections keep their type size from before F5 (only the spacing between them closes up). The role stands beside the
   name in the hint size. Where that line does not fit, the person's corner takes two short lines: the name over the
   role, «Открыть Clients» over «Выйти» (a six-section bar below 1366 px, a bar with «Команда продаж» at ≤ 1180). Where
   even the full role does not fit there, its short form (`.bar__role-short`, the full one in the title): a six-section
   bar below 1200 px. Below 1100 px a six-section bar also takes a smaller wordmark and side margin (it needs them from 1072 px down;
   1024: 11 px to spare); from 1100 its wordmark stands on the page's edge as in every other bar */
.bar__role { font-size: var(--t-xs); }
.bar__role-short { display: none; }
@media (min-width: 1400px) and (max-width: 1535px) {
  .bar:has(.bar__nav > a:nth-child(6)) { gap: var(--s-4); }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__nav { gap: var(--s-3); }
}
@media (max-width: 1199px) {
  .bar:has(.bar__nav > a:nth-child(6)) .bar__role-full { display: none; }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__role-short { display: inline; }
}
@media (max-width: 1180px) {
  .bar__role { display: inline; }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__nav { gap: var(--s-2); }
}
@media (max-width: 1099px) {
  .bar:has(.bar__nav > a:nth-child(6)) { gap: var(--s-3); padding-inline: var(--s-3); }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__name { font-size: var(--t-sm); }
}
@media (min-width: 1181px) and (max-width: 1365px) {
  .bar:has(.bar__nav > a:nth-child(6)) .bar__user { display: grid; grid-template-areas: "who out" "who off"; column-gap: var(--s-4); row-gap: 1px; align-content: center; line-height: 1.25; }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__who { grid-area: who; display: grid; align-self: center; }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__role { margin-left: 0; }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__out { grid-area: out; }
  .bar:has(.bar__nav > a:nth-child(6)) .bar__user > a:last-child { grid-area: off; }
}
@media (max-width: 1180px) {
  .bar:has(.bar__nav > a[href="/panel"]) .bar__user { display: grid; grid-template-areas: "who out" "who off"; column-gap: var(--s-3); row-gap: 1px; align-content: center; line-height: 1.25; }
  .bar:has(.bar__nav > a[href="/panel"]) .bar__who { grid-area: who; display: grid; align-self: center; }
  .bar:has(.bar__nav > a[href="/panel"]) .bar__role { margin-left: 0; }
  .bar:has(.bar__nav > a[href="/panel"]) .bar__out { grid-area: out; }
  .bar:has(.bar__nav > a[href="/panel"]) .bar__user > a:last-child { grid-area: off; }
}
/* B8 (R-9, K-10): «перенесено с ДД.ММ» is the sheet's `.tag` in a row's source line and in «Шаг после»; its own line
   height keeps the source line as tall as a row without it (the tag's 20 px had made it 1 px taller) */
.tag[data-moved] { line-height: 1.3; }
/* ---- Sweep 2026-12 · lane 2 (loyalty) ---- */
/* A3: the campaign's start and end under the brand's name, lined up with the name as «Идёт РК до …» is */
.loyreg td:first-child > .rkdates { display: block; margin: 3px 0 0; font-size: var(--t-xs); line-height: 1.35; color: var(--ink-2); }
.loyreg td:first-child > .disc ~ .rkdates { margin-left: 20px; }
/* A4: «Действие засчитывается N дней» — one field, its button level with it, its history beside them */
.loydays { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-4); max-width: 980px; }
.loydays label { color: var(--ink); }
.loydays .loydays__in { width: 5.5rem; min-height: 32px; padding: 4px 10px; text-align: right; }
.loydays__hist { margin-left: var(--s-2); }
.loydays__hist > .pop--hist { right: auto; left: 0; }
.loydays__err { flex-basis: 100%; margin: 0; }
/* A4: in the list behind «N из M» the mark stays on the line of its date (.tbl--edit td .status would make it a block) */
.pop--list li .status.stale { display: inline; margin: 0; font-size: inherit; white-space: nowrap; }
/* B2 (K-8, R-6): a cell's proof mark under its date — «подтверждение», a link that opens the proof in a new tab (petrol
   text, as every link); «без подтверждения», quiet ink; either wraps inside the cell's column, never past it */
.loyreg td.c .proof { display: block; margin-top: 2px; font-size: var(--t-xs); line-height: 1.3; white-space: normal; overflow-wrap: normal; hyphens: manual; }
.loyreg td.c a.proof { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.loyreg td.c .proof--none { color: var(--ink-3); }
.loyreg td.c a.proof--none { color: var(--ink-3); text-decoration-color: var(--line-strong); }      /* the owner's: opens the proof form */
.loyreg td.c a.proof--none:hover { color: var(--accent-text); text-decoration-color: currentColor; }
/* F4: «не засчитано» under the date of a cell none of whose records counts — the words say it, so no «!» before them:
   one line in the cell's 6 rem column (walk 03.12: «!» alone on a line, or «не» apart from its word) */
.loyreg td.c .status.uncounted::before { content: none; }
.pop--cell textarea.input { min-height: calc(2 * 1.45em + 18px); }
form.pop--cell { row-gap: 10px; }   /* «Детали» at its two rows: the form fits under the bar (29.11 point 4) */
/* B2: «Подтверждение» in the cell's form — B1's line in the 340 px form: «Выбрать файл», «или», the link filling the rest
   of the line (the form stays short enough to open above the last row, F2-1); a chosen file's name takes the line and the
   link goes under it; «Что приложить» under them */
.proof-f .att__url.input { flex: 1 1 8rem; max-width: none; }
.proof-f .att__picked { max-width: 16ch; }
.proof-f__kept { margin: 0; font-size: var(--t-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.pop__later { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.pop__later a { white-space: nowrap; }
/* B2 (R-7): «Что приложить» on «Действия лояльности» — a field per action, «Сохранить» beside it while the row is in hand */
.loyact { max-width: 1180px; }
.loyact col.c-name { width: 28%; }
.loyact col.c-flag { width: 10%; }
.loyact col.c-hint { width: 38%; }
.hint-f { display: flex; align-items: center; gap: var(--s-2); margin: 0; }
.hint-f__in.input { flex: 1 1 auto; min-width: 0; min-height: 32px; padding: 4px 10px; font-size: var(--t-sm); }
.hint-f:not(:focus-within) .hint-f__save { visibility: hidden; }
.hint-c .err { display: block; margin-top: 6px; }
@media print { .hint-f__in.input { border: 0; padding: 0; background: none; min-height: 0; } .hint-f__save { display: none; } }
/* F6: the refusal summary's heading as the sheet draws it everywhere — inside a pop-over that opens in a section head
   («+ Контакт» under «Контакты бренда»), .section__h p made it grey and small */
.section__h .summary__h { color: var(--bad); font-size: inherit; }
/* Sweep B1 (lane 3, K-7, K-8): «Подтверждение» — the files and links of a row: a ruled list, the name a link in
   --accent-text, who and when quiet beside it; a taken-off one struck through in --ink-3; the form on one line —
   «Выбрать файл», the chosen name, «или», the link, «Приложить» — the refusal under it, the hint last */
.att { display: grid; gap: var(--s-2); min-width: 0; }
.att, .att :is(a, input, button) { scroll-margin-top: calc(var(--bar-h) + var(--fresh-h) + 72px); }   /* a #target never under the top bar */
.att__h { font-size: var(--t-sm); font-weight: 560; color: var(--ink); }
.att__none { font-size: var(--t-sm); color: var(--ink-3); }
.att__list { list-style: none; margin: 0; padding: 0; }
.att__i { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-3); min-height: 36px; padding: 4px 0; border-top: 1px solid var(--line); }
.att__body { min-width: 0; line-height: 1.45; }
.att__i:last-child { border-bottom: 1px solid var(--line); }
.att__n { color: var(--accent-text); overflow-wrap: anywhere; min-width: 0; }
span.att__n { color: var(--ink); }   /* F5: a text from the Excel register is not a link and does not look like one */
.att__meta { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.att__i--gone .att__n { color: var(--ink-3); }
.att__rm .btn { min-height: 28px; }
.att__add { display: grid; gap: var(--s-1); }
.att__line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.att__pick { position: relative; cursor: pointer; }
.att__pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.att__pick:has(input[aria-invalid="true"]) { border-color: var(--bad); border-width: 1.5px; }
.att__picked { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-sm); color: var(--ink-2); }
.att__picked:empty { display: none; }
.att__or { font-size: var(--t-sm); color: var(--ink-3); }
.att__url.input { flex: 1 1 220px; width: auto; min-width: 0; max-width: 440px; min-height: 32px; padding: 4px 10px; font-size: var(--t-sm); }
@media print { .att__add, .att__rm { display: none; } }

/* Sweep B3 (lane 3, K-8, R-8): «Презентация» and «Запись встречи» in «Реестр встреч». The owner's word in those cells is
   a link to the row's block (B1's component) drawn as the cell it replaced: a hairline at rest, under a value only while
   the row is in hand, none under 1180 as the register's other cells. The score cells of a meeting that needs a
   presentation read «нужна презентация», one status across the three. On the row's page the two blocks stand apart */
.reg td.link > a.cell { text-decoration: none; }
@media screen {
  .reg td.link > a.cell:not(:hover):not(:focus-visible) { border-color: var(--line); }
  .reg td.link > :is(a, .xl-text) ~ a.cell { margin-top: 1px; }
  .reg td.link > :is(a, .xl-text) ~ a.cell:not(:hover):not(:focus-visible) { border-color: transparent; }
  .reg tr:hover td.link > :is(a, .xl-text) ~ a.cell:not(:hover):not(:focus-visible) { border-color: var(--line); }
}
@media screen and (max-width: 1180px) { .reg td.link > a.cell:not(:hover):not(:focus-visible) { border-color: transparent; } }
.reg td.need-pres { text-align: center; }
.reg-atts { display: grid; gap: var(--s-5); margin-block: var(--s-5); }   /* in the page's column, as the forms above it */
.reg-atts:empty { display: none; }   /* F7: a reader's request with nothing attached — its line says «нет данных» */
/* the score wash (D-615) is set by column number; «нужна презентация» stands for the three, so the cells after it are
   «Итог встречи» and the menu again: at rest plain, in hand as any row */
@media screen {
  .reg tbody tr[data-row] > td.need-pres ~ td:nth-child(n+10) { background: none; }
  .reg tbody tr[data-row]:hover > td.need-pres ~ td:nth-child(n+10) { background: color-mix(in oklch, var(--canvas), var(--accent-soft) 40%); }
}
/* Sweep B9 (lane 3): under the seller's approved meeting while writing to Clients is off, a row note — «Запишите встречу
   в Clients» with «Открыть в Clients» for its brand; once the mirror brings a meeting of that day and brand, the meeting
   in words with «Это она». One line under the row, across the row; it wraps only when the window is narrow */
.reg tr.row-note--b9 td { padding-bottom: var(--s-2); }
.b9 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.b9__t { font-size: var(--t-sm); color: var(--ink); overflow-wrap: anywhere; }
.b9__m { font-size: var(--t-xs); color: var(--ink-3); }
.b9 .row-act { margin: 0; }

/* Sweep 2026-12, lane 4, item A8: K-6 where a form that writes to Clients stood — in the drawer and in a short form (.pop)
   the notice's button goes under its words, level with them, so the sentence keeps the narrow width and reads at once. */
[data-writing-off] .notice { flex-wrap: wrap; row-gap: var(--s-2); }
[data-writing-off] .notice__text { flex-basis: calc(100% - 2 * var(--s-3)); }
[data-writing-off] .notice .btn { align-self: auto; margin-left: calc(1ch + var(--s-3)); }
/* F2: the cell's form without script, a page of its own (the cell links here, no longer «Записать действие»): in the page's flow */
main.page > form.pop--cell { position: static; margin: var(--s-6) auto 0; }

/* Sweep 2026-12, lane 4, item F1: the «?» after «Данные Clients на …» stands one flex gap from the words, as the «!» before them. */
.fresh .colhelp__q { margin-left: 0; }

/* Sweep 2026-12, lane 4, item F2: a refused form's summary stands one form gap above the first field, not touching its label. */
.summary + .form { margin-top: var(--s-4); }

/* Sweep 2026-12, lane 4, item F11: «Кнопка, которая ждёт включения записи» (design/sheet.html). With writing to Clients off
   the form is whole and only its send button is held (disabled); one line right under the buttons' row says why — K-6 —
   and «Открыть Clients» goes on with the work in Clients. Quiet secondary type, the link as every link; no new colour. */
.held { margin: var(--s-2) 0 0; font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); }
.held__a { white-space: nowrap; font-weight: var(--w-medium); }
.pop > .held { margin-top: calc(var(--s-2) - var(--s-3)); }   /* in a .pop (grid, gap 12 px) the same 8 px from the button as in a form */
/* Sweep F12: under a register cell whose date would go to Clients the same line floats as the row's other pop-overs do
   (.cell-pop), right under the field (register.js sets its top), so opening the cell moves no row */
.tbl--edit td > .held { position: absolute; z-index: 10; left: 0; width: 300px; margin: 0; padding: 8px 10px; white-space: normal;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-float); }

/* Sweep 2026-12, sixth merge walk: the loyalty cell's form sets a 10 px row gap (not the pop's 12), so the held line under
   its button stood 6 px off; 8 px as in every other shape (F11). */
form.pop--cell > .held { margin-top: calc(var(--s-2) - 10px); }
