/* Дока Маркировка — единый файл стилей.
   Объединённый дизайн: узкое меню (A), плитка-вердикт (Б), мобильная раскладка (В).
   Все цвета — токены; тёмная тема переопределяет только токены. */

:root {
  --bg:#fafafa; --surface:#ffffff; --surface-2:#f4f4f5; --line:#e7e7ea; --line-strong:#d4d4d8;
  --fg:#18181b; --muted:#71717a; --accent:#3657e0; --accent-hover:#2a46bf; --accent-bg:#eef1fd; --on-accent:#ffffff;
  --ok:#15803d; --ok-bg:#e8f6ec; --warn:#a15c07; --warn-bg:#fdf4e1; --bad:#c81e1e; --bad-bg:#fdecec;
  --hero:#18181b; --on-hero:#f2f5fb; --on-hero-muted:#b9c7de; --focus:#5e88e9; --shadow:0 1px 2px rgba(16,24,40,.05); --overlay:rgb(10 20 30 / .4); --overlay-soft:rgb(10 20 30 / .35);
  --font-ui:"Onest",system-ui,-apple-system,"Segoe UI",sans-serif; --font-code:"IBM Plex Mono",ui-monospace,Consolas,monospace;
  --text-caption:11px; --text-meta:12px; --text-support:13px; --text-body:14px;
  --text-subheading:16px; --text-section:20px; --text-page:24px; --text-title:32px; --text-metric:26px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px;
  --control-sm:36px; --control-md:40px; --control-lg:44px;
  --radius:12px; --radius-sm:8px; --rail:60px;
  /* Legacy names used by older markup. */
  --ink:var(--fg); --teal:var(--accent); --paper:var(--bg); --white:var(--surface); --success:var(--ok); --danger:var(--bad); --tint:var(--accent-bg); --navy:var(--hero);
  color-scheme:light;
}
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) {
  --bg:#0e0f12; --surface:#16171b; --surface-2:#1c1d22; --line:#26272d; --line-strong:#36373f;
  --fg:#ececf1; --muted:#8b8b96; --accent:#8aa2ff; --accent-hover:#a8bbff; --accent-bg:#1d2340; --on-accent:#0e0f12;
  --ok:#6fdc96; --ok-bg:#12291b; --warn:#f2c463; --warn-bg:#33290f; --bad:#ff8f95; --bad-bg:#3a1717;
  --hero:#16171b; --on-hero:#ececf1; --on-hero-muted:#8b8b96; --focus:#8aa6ff; --shadow:none; color-scheme:dark;
} }
/* The logo: graphite parts become light on the dark theme. */
.logo-dark { display:none; }
.topbar-brand { display:none; }
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) .logo-light { display:none; } :root:not([data-theme="light"]) .logo-dark { display:inline-block; } }
:root[data-theme="dark"] .logo-light { display:none; }
:root[data-theme="dark"] .logo-dark { display:inline-block; }
:root[data-theme="dark"] {
  --bg:#0e0f12; --surface:#16171b; --surface-2:#1c1d22; --line:#26272d; --line-strong:#36373f;
  --fg:#ececf1; --muted:#8b8b96; --accent:#8aa2ff; --accent-hover:#a8bbff; --accent-bg:#1d2340; --on-accent:#0e0f12;
  --ok:#6fdc96; --ok-bg:#12291b; --warn:#f2c463; --warn-bg:#33290f; --bad:#ff8f95; --bad-bg:#3a1717;
  --hero:#16171b; --on-hero:#ececf1; --on-hero-muted:#8b8b96; --focus:#8aa6ff; --shadow:none; color-scheme:dark;
}

/* ---------- Base ---------- */
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { scrollbar-width:thin; scrollbar-color:var(--line-strong) var(--bg); }
body { min-width:0; margin:0; color:var(--fg); background:var(--bg); font:var(--text-body)/1.5 var(--font-ui); }
h1,h2,h3,h4 { margin:0; text-wrap:balance; overflow-wrap:break-word; }
h1 { font-size:clamp(var(--text-page),2.6vw,var(--text-title)); line-height:1.2; letter-spacing:-.025em; }
h2 { font-size:var(--text-section); line-height:1.3; letter-spacing:-.02em; }
h3 { font-size:var(--text-subheading); line-height:1.4; }
p { overflow-wrap:break-word; }
a { color:var(--accent); text-underline-offset:3px; }
code,kbd,pre,.mono { font-family:var(--font-code); }
::selection { background:var(--accent-bg); color:var(--fg); }
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
svg { flex-shrink:0; }
.visually-hidden { position:absolute; width:1px; height:1px; min-width:0; min-height:0; margin:-1px; padding:0; border:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------- Controls ---------- */
button,.button { display:inline-flex; align-items:center; justify-content:center; gap:var(--space-2); min-height:var(--control-md); padding:8px var(--space-4);
  border:1px solid transparent; border-radius:var(--radius-sm); background:var(--accent); color:var(--on-accent);
  font:600 var(--text-body)/1.3 var(--font-ui); cursor:pointer; text-decoration:none;
  transition:background-color .15s ease-out,border-color .15s ease-out,color .15s ease-out,opacity .15s ease-out; }
button:hover { background:var(--accent-hover); }
button:disabled,.button[aria-disabled="true"] { opacity:.55; cursor:not-allowed; }
button.secondary,.button.secondary,.secondary,.logout,.refresh-profile { background:var(--surface); color:var(--accent); border-color:var(--line-strong); }
button.secondary:hover,.button.secondary:hover,.logout:hover,.refresh-profile:hover { background:var(--accent-bg); }
button.danger,.button.danger { background:var(--bad); color:var(--on-accent); }
button.danger:hover,.button.danger:hover { background:var(--bad); filter:brightness(.92); }
button.small,.button.small { min-height:var(--control-sm); padding:4px var(--space-3); font-size:var(--text-meta); }
button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,textarea {
  width:100%; min-height:var(--control-md); padding:8px var(--space-3); border:1px solid var(--line-strong); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--fg); font:var(--text-body)/1.4 var(--font-ui); }
input[type="file"]:not(.visually-hidden) { width:100%; min-height:var(--control-md); padding:8px var(--space-3); border:1px dashed var(--line-strong); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--fg); font:var(--text-support) var(--font-ui); }
input,select,textarea { caret-color:var(--accent); }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover:not(:disabled):not([readonly]),select:hover:not(:disabled),textarea:hover:not(:disabled):not([readonly]) { border-color:var(--fg); }
input:not([type="checkbox"]):not([type="radio"]):disabled,input:not([type="checkbox"]):not([type="radio"])[readonly],select:disabled,textarea:disabled,textarea[readonly] { background:var(--surface-2); color:var(--muted); cursor:not-allowed; }
:is(input,select,textarea)[aria-invalid="true"] { border-color:var(--bad); }
/* A check box — a square with the accent fill and a white tick; a radio — a circle with the accent dot. */
input[type="checkbox"],input[type="radio"] {
  appearance:none; display:inline-grid; place-content:center; flex:0 0 18px; width:18px; height:18px; margin:0;
  border:1.5px solid var(--line-strong); border-radius:5px; background:var(--surface); color:var(--on-accent); cursor:pointer;
  transition:border-color .15s ease-out,background-color .15s ease-out; }
input[type="radio"] { border-radius:50%; color:var(--accent); }
input[type="checkbox"]::before {
  content:""; width:9px; height:5px; border:0 solid currentColor; border-width:0 0 2px 2px;
  transform:translateY(-1px) rotate(-45deg) scale(0); transform-origin:center; transition:transform .12s ease-out; }
input[type="radio"]::before { content:""; width:8px; height:8px; border-radius:50%; background:currentColor; transform:scale(0); transition:transform .12s ease-out; }
input[type="checkbox"]:hover:not(:disabled),input[type="radio"]:hover:not(:disabled) { border-color:var(--accent); }
input[type="checkbox"]:checked,input[type="checkbox"]:indeterminate { border-color:var(--accent); background:var(--accent); }
input[type="radio"]:checked { border-color:var(--accent); }
input[type="checkbox"]:checked::before { transform:translateY(-1px) rotate(-45deg) scale(1); }
input[type="radio"]:checked::before { transform:scale(1); }
input[type="checkbox"]:indeterminate::before { width:8px; height:0; border-width:0 0 2px; transform:none; }
@media (prefers-reduced-motion:reduce) { input[type="checkbox"],input[type="radio"],input[type="checkbox"]::before,input[type="radio"]::before { transition:none; } }
input[type="checkbox"]:disabled,input[type="radio"]:disabled { opacity:.5; cursor:not-allowed; }
label { display:block; margin:var(--space-4) 0 var(--space-1); font-size:var(--text-support); font-weight:600; }
summary { min-height:var(--control-sm); padding-block:var(--space-2); color:var(--accent); cursor:pointer; font-weight:600; }
kbd { padding:1px 6px; border:1px solid var(--line-strong); border-radius:5px; color:var(--muted); font-size:var(--text-caption); background:var(--surface); }

/* ---------- Shell: rail + topbar ---------- */
.workspace { display:grid; grid-template-columns:var(--rail) minmax(0,1fr); min-height:100vh; background:var(--bg); }
.workspace svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.rail { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; align-items:center; gap:4px; padding:12px 8px;
  border-right:1px solid var(--line); background:var(--surface); overflow-x:hidden; overflow-y:auto; }
.rail-brand { display:grid; place-items:center; width:32px; height:32px; margin-bottom:8px; }
.rail-brand img { width:32px; height:32px; }
.rail-brand .rail-brand-full { display:none; }
.rail-brand .rail-brand-full img { width:auto; height:32px; }
.rail-link .rail-short { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rail-link .rail-full { display:none; }
.rail-link { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; width:100%; min-height:36px; padding:4px 2px;
  border:0; border-radius:10px; background:transparent; color:var(--muted); text-decoration:none; font:500 10.5px/1.2 var(--font-ui); text-align:center; }
.rail-link:hover { background:var(--surface-2); color:var(--fg); }
.rail-link[aria-current="page"] { background:var(--accent-bg); color:var(--accent); }
.rail-theme { margin-top:auto; }
.workspace-body { min-width:0; display:flex; flex-direction:column; }
.topbar { position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:var(--space-3); min-height:60px; padding:10px var(--space-5);
  border-bottom:1px solid var(--line); background:var(--surface); }
.topbar-title { flex:0 0 auto; font-size:14px; font-weight:600; }
.command { flex:0 1 340px; max-width:380px; display:flex; align-items:center; gap:var(--space-2); min-height:var(--control-sm); padding:0 10px 0 var(--space-3);
  border:1px solid var(--line-strong); border-radius:10px; background:var(--surface-2); color:var(--muted); }
.command:focus-within { border-color:var(--accent); background:var(--surface); }
.command input[name="code"][type="text"] { flex:1 1 auto; min-width:0; min-height:34px; padding:0; border:0; border-radius:0; background:transparent; font:var(--text-support) var(--font-code); }
.command input:focus-visible { outline:none; }
.command kbd { font-size:10px; }
.topbar-right { display:flex; align-items:center; gap:var(--space-2); margin-left:auto; min-width:0; }
/* Every control of the topbar is one height on one line: search, ЛК ЧЗ, organization, phone, sign-out. */
.topbar .icon-button { flex:0 0 var(--control-lg); width:var(--control-lg); height:var(--control-lg); min-height:var(--control-lg); border-radius:var(--radius-sm); }
.org-chip { display:flex; align-items:center; gap:10px; min-width:0; height:var(--control-lg); padding:0 10px 0 5px; border:1px solid var(--line); border-radius:var(--radius-sm); color:var(--fg); text-decoration:none; }
.org-chip:hover { border-color:var(--line-strong); background:var(--surface-2); }
.org-avatar { display:grid; place-items:center; flex:0 0 auto; width:32px; height:32px; border-radius:8px; background:var(--accent); color:var(--on-accent); font-weight:700; font-size:13px; }
.org-text { min-width:0; display:grid; }
.org-text strong { max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:600; }
.org-text small { display:flex; align-items:center; gap:4px; color:var(--muted); font:11.5px var(--font-code); }
/* The unfolded menu leaves the top bar narrow: the organization is its letter, the name is in the tooltip. */
@media (min-width:701px) and (max-width:1100px) { :root[data-rail="wide"] .org-text { display:none; } :root[data-rail="wide"] .org-chip { padding-right:5px; } }
.inn-state svg { width:14px; height:14px; }
.inn-state.is-ok { color:var(--ok); } .inn-state.is-warn { color:var(--warn); }
.icon-button { flex:0 0 var(--control-md); width:var(--control-md); min-height:var(--control-md); padding:0; background:var(--surface); color:var(--muted); border-color:var(--line); }
.icon-button:hover { background:var(--accent-bg); color:var(--accent); }
.banner,.workspace-notice { margin:var(--space-4) 28px 0; padding:10px var(--space-3); border-radius:var(--radius-sm); font-size:var(--text-support); line-height:1.5; }
.banner-warn { background:var(--warn-bg); color:var(--warn); }
.banner-info { background:var(--accent-bg); color:var(--fg); }
.banner-bad { background:var(--bad-bg); color:var(--bad); }
.banner a { margin-left:6px; font-weight:600; color:inherit; }
.workspace-notice { background:var(--bad-bg); color:var(--bad); }
.workspace-notice:empty { display:none; }
/* Administration: a strip of its sections over its pages (the menu has no group of it). */
.admin-nav { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2) var(--space-4); margin:var(--space-4) 28px 0; padding:var(--space-2) var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); font-size:var(--text-support); }
.admin-nav a { color:var(--fg); text-decoration:none; }
.admin-nav-back { font-weight:600; }
.admin-nav-links { display:flex; flex-wrap:wrap; gap:var(--space-1); }
.admin-nav-links a { padding:var(--space-1) var(--space-2); border-radius:var(--radius-sm); color:var(--muted); }
.admin-nav-links a:hover { background:var(--surface-2); color:var(--fg); }
.admin-nav-links a[aria-current="page"] { background:var(--accent-bg); color:var(--accent); }
.workspace-main,.main.workspace-main { flex:1; width:100%; max-width:1320px; min-width:0; margin:0 auto; padding:var(--space-5) var(--space-5) calc(var(--space-5) + var(--floating-stack)); }
/* The right padding leaves room for the buttons of the support (support.js) in the corner. */
.workspace-footer { display:flex; justify-content:space-between; gap:var(--space-4); padding:var(--space-4) calc(var(--support-button) + 2 * var(--space-4)) var(--space-4) var(--space-5); color:var(--muted); font-size:11px; }
.workspace-main > .back,.workspace .footer,.workspace .eyebrow { display:none; }

/* ---------- Surfaces ---------- */
.sheet,.panel,.card { border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); }
.table-wrap,.docs-list-wrap { border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.docs-list-wrap { position:relative; overflow:hidden; }
.share-dialog,.upd-dialog,.cp-dialog { padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--fg); box-shadow:var(--shadow); }
:where(.share-dialog,.upd-dialog,.cp-dialog,.doc-card-dialog)::backdrop { background:var(--overlay); }
.upd-dialog > h2 { margin:0 0 var(--space-2); font-size:var(--text-subheading); }
.workspace-main > .sheet { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.description,.lead { max-width:72ch; margin:10px 0 0; color:var(--muted); font-size:var(--text-body); line-height:1.6; }
.check-note { margin:var(--space-2) 0 0; color:var(--muted); font-size:var(--text-meta); line-height:1.5; }
.note,.notice,.soon,.catalog-note { margin:var(--space-4) 0 0; padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--muted); font-size:var(--text-support); line-height:1.5; }
.notice:not(.error),.note:not(.error) { border-color:transparent; background:var(--ok-bg); color:var(--ok); }
.notice.error,.note.error { border-color:transparent; background:var(--bad-bg); color:var(--bad); }
.notice.warn { background:var(--warn-bg); color:var(--warn); }
.notice a { color:inherit; font-weight:600; }
.log-filter,.docs-filter { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--space-2) var(--space-3); padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.table,.docs-table,.doc-products { width:100%; border-collapse:collapse; }
:where(.table,.docs-table,.doc-products) th { color:var(--muted); font-size:var(--text-meta); font-weight:500; text-align:left; }
:where(.table,.docs-table,.doc-products) td { vertical-align:top; }
.state,.task-chip,.doc-status,.doc-chip,.ck-pill { display:inline-flex; align-items:center; padding:2px var(--space-2); border-radius:6px; background:var(--surface-2); color:var(--muted); font-size:var(--text-meta); font-weight:500; line-height:1.4; white-space:nowrap; }
:is(.state,.task-chip,.ck-pill).tone-ok,:is(.doc-status,.doc-chip)[data-tone="ok"] { background:var(--ok-bg); color:var(--ok); }
:is(.state,.task-chip,.ck-pill).tone-warn,:is(.doc-status,.doc-chip)[data-tone="warn"],.doc-status[data-tone="wait"] { background:var(--warn-bg); color:var(--warn); }
:is(.state,.task-chip,.ck-pill).tone-bad,:is(.doc-status,.doc-chip)[data-tone="bad"] { background:var(--bad-bg); color:var(--bad); }
:is(.state,.task-chip).tone-info,:is(.doc-status,.doc-chip)[data-tone="info"] { background:var(--accent-bg); color:var(--accent); }
.docs-empty,.log-empty,.ck-empty { padding:var(--space-5) var(--space-4); color:var(--muted); line-height:1.5; text-align:center; }
.empty-state { display:grid; justify-items:start; gap:6px; max-width:620px; margin:20px auto; padding:28px; border:1px dashed var(--line-strong); border-radius:var(--radius); background:var(--surface); }
.empty-state-mark { display:grid; place-items:center; width:34px; height:34px; margin-bottom:4px; border-radius:10px; background:var(--surface-2); color:var(--muted); font:500 18px var(--font-code); }
.empty-state h2 { font-size:18px; }
.empty-state p { max-width:58ch; margin:0; color:var(--muted); font-size:var(--text-support); }
.empty-state-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.link-button { min-height:var(--control-sm); padding:var(--space-1) 0; border:0; background:none; color:var(--accent); font-size:var(--text-support); font-weight:500; text-decoration:underline; cursor:pointer; }
.link-button:hover { background:none; }
.inline-link { margin-top:12px; }
.otp-input { max-width:180px; font-size:22px; letter-spacing:.3em; text-align:center; }

/* ---------- Administrators ---------- */
.me-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; }
.me-grid h3 { margin:0 0 10px; font-size:15px; }
.me-grid .state { margin:0 0 6px; }
.setup-steps { margin:0 0 12px; padding-left:20px; font-size:13px; line-height:1.6; }
.setup-steps li { margin-bottom:6px; }
.secret-key { padding:2px 6px; border-radius:6px; background:var(--surface-2); font:500 13px var(--font-code); letter-spacing:.06em; word-break:break-all; }
.row-actions { display:flex; flex-wrap:wrap; gap:6px; }
.row-form select { width:auto; min-width:130px; }
.table tr.is-off td { opacity:.55; }
.message { min-height:20px; margin:var(--space-3) 0 0; color:var(--accent); font-weight:600; }
.message,.profile-message,.reference-message,.docs-message { font-size:var(--text-support); line-height:1.45; }
.message.error,.profile-message.error,.reference-message.error,
:is(.message,.profile-message,.reference-message,.docs-message)[data-tone="bad"] { color:var(--bad); }
:is(.message,.profile-message,.reference-message,.docs-message)[data-tone="ok"] { color:var(--ok); }
:is(.message,.profile-message,.reference-message,.docs-message)[data-tone="warn"],
:is(.message,.profile-message,.reference-message,.docs-message)[data-tone="wait"] { color:var(--warn); }
.actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:16px; }

/* ---------- Home ---------- */
.workspace-heading { margin-bottom:24px; }
.workspace-heading p { margin:8px 0 0; color:var(--muted); }
.env-badge { display:inline-block; padding:2px 8px; border-radius:6px; background:var(--warn-bg); color:var(--warn); font:600 11px var(--font-code); letter-spacing:.04em; text-transform:uppercase; white-space:nowrap; }

/* ---------- Home: deviation control ---------- */
.monitor { margin-bottom:var(--space-5); padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.monitor-head { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:12px 24px; }
.monitor-head h2 { font-size:18px; }
.monitor-head p { max-width:68ch; margin:6px 0 0; color:var(--muted); font-size:var(--text-support); line-height:1.5; }
.monitor-actions { display:flex; align-items:center; gap:10px; }
.monitor-status { color:var(--muted); font-size:var(--text-meta); }
/* The tiles of the summary are horizontal blocks: the number on the left, the title and the note on the right; as many columns as fit (one in the narrow column of «Сегодня»). */
.monitor-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); grid-auto-rows:1fr; gap:var(--space-2); margin:var(--space-4) 0; }
.monitor-tile { display:grid; grid-template-columns:minmax(48px,max-content) minmax(0,1fr); grid-template-areas:"value title" "value note"; align-content:center; align-items:center; column-gap:var(--space-3); min-height:var(--control-lg); padding:var(--space-2) var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2); }
.monitor-tile span { grid-area:title; color:var(--fg); font-size:var(--text-support); font-weight:500; line-height:1.3; }
.monitor-tile strong { grid-area:value; font-size:var(--text-metric); font-weight:600; line-height:1; letter-spacing:-.02em; text-align:center; font-variant-numeric:tabular-nums; }
.monitor-tile small { grid-area:note; color:var(--muted); font-size:var(--text-meta); line-height:1.3; }
.monitor-tile small:empty { display:none; }
.monitor-tile[data-tone="bad"] strong { color:var(--bad); } .monitor-tile[data-tone="warn"] strong { color:var(--warn); } .monitor-tile[data-tone="ok"] strong { color:var(--ok); }
.monitor-action { color:var(--fg); font-weight:500; }
.monitor-examples { margin:6px 0 0; padding-left:16px; color:var(--muted); line-height:1.5; overflow-wrap:anywhere; }
.monitor-foot { margin:14px 0 0; font-size:12px; line-height:1.9; }
.monitor-errors { margin:var(--space-3) 0 0; color:var(--warn); font-size:var(--text-support); line-height:1.5; }
/* The deviations page: the list of risks and fixed deviations on the left, the card of the chosen one on the right. */
.dev-split { display:grid; grid-template-columns:minmax(260px,360px) minmax(0,1fr); align-items:start; gap:var(--space-4); margin-top:var(--space-4); }
.dev-list { display:grid; gap:var(--space-3); padding:var(--space-2); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.dev-group { display:grid; gap:2px; }
.dev-group + .dev-group { padding-top:var(--space-2); border-top:1px solid var(--line); }
.dev-group-title { margin:0; padding:var(--space-1) var(--space-3); color:var(--muted); font-size:var(--text-meta); font-weight:500; }
.dev-group-empty { margin:0; padding:var(--space-1) var(--space-3) var(--space-2); color:var(--muted); font-size:var(--text-support); }
.dev-item { display:grid; grid-template-columns:8px minmax(0,1fr) auto; align-items:center; gap:var(--space-3); width:100%; min-height:44px; padding:var(--space-2) var(--space-3); border:0; border-radius:var(--radius-sm); background:transparent; color:var(--fg); text-align:left; font:inherit; }
.dev-item:hover { background:var(--surface-2); }
.dev-item[aria-current="true"] { background:var(--accent-bg); }
.dev-dot { width:8px; height:8px; border-radius:50%; background:var(--fg); }
.dev-item.tone-bad .dev-dot { background:var(--bad); }
.dev-item.tone-check .dev-dot { background:var(--warn); }
.dev-item.tone-done .dev-dot { background:var(--ok); }
.dev-item.tone-done .dev-item-title, .dev-item.tone-done .dev-item-count { color:var(--muted); }
.dev-item-text { display:grid; min-width:0; }
.dev-item-title { font-size:var(--text-body); font-weight:500; line-height:1.3; }
.dev-item-sub { color:var(--muted); font-size:var(--text-meta); line-height:1.4; }
.dev-item-count { font-weight:600; font-variant-numeric:tabular-nums; }
.dev-item.tone-bad .dev-item-count { color:var(--bad); }
.dev-detail { display:grid; gap:var(--space-4); min-width:0; padding:var(--space-5); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.dev-detail[hidden] { display:none; }
.dev-detail-head { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:var(--space-3); }
.dev-detail-tools { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); }
.dev-detail-head-fixed { display:grid; grid-template-columns:minmax(0,1fr) auto; }
.dev-detail-head-fixed h2 { overflow-wrap:anywhere; }
.dev-violations-feedback { font-size:var(--text-support); }
.doc-card.dev-violations-dialog { left:auto; margin:0; height:100dvh; max-height:100dvh; max-width:100vw; padding:0; border:0; border-inline-start:1px solid var(--line); color:var(--fg); }
.dev-violations-dialog::backdrop { background:var(--overlay); }
.dev-violations-body > p { margin:0; }
.dev-violations-body > :not([hidden]) + :not([hidden]) { margin-top:var(--space-3); }
.upd-dialog.dev-violations-options { width:min(560px, calc(100vw - var(--space-5))); max-height:calc(100dvh - var(--space-5)); }
.dev-violations-options form { display:grid; gap:var(--space-4); }
.dev-violations-fields { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 216px), 1fr)); gap:var(--space-3); }
.dev-violations-filter { display:grid; gap:var(--space-1); min-width:0; margin:0; font-size:var(--text-support); }
.dev-violations-filter :is(input,select) { width:100%; min-width:0; }
.dev-violations-columns { column-gap:var(--space-4); row-gap:0; }
.dev-violations-columns label { display:flex; align-items:center; gap:var(--space-2); min-height:44px; margin:0; font-size:var(--text-support); cursor:pointer; }
.doc-products.dev-violations-table th { white-space:normal; overflow-wrap:anywhere; }
.dev-violations-scroll .dev-violations-table th { min-width:112px; }
.dev-violations-table td { overflow-wrap:anywhere; }
.dev-violations-table td small { display:block; }
.dev-violations-table .dev-violations-cell-label { display:none; }
@media (max-width:740px) {
  .dev-violations-scroll :is(table,tbody,tr) { display:block; }
  .dev-violations-scroll thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .dev-violations-scroll tbody tr { padding:var(--space-2) var(--space-3); }
  .dev-violations-scroll tbody tr + tr { border-top:1px solid var(--line); }
  .dev-violations-scroll .dev-violations-table td { display:grid; grid-template-columns:minmax(88px,1fr) minmax(0,2fr); gap:var(--space-2); padding:var(--space-1) 0; border:0; }
  .dev-violations-scroll .dev-violations-cell-label { display:block; color:var(--muted); }
}
/* The frame of a print form (print.js): out of sight, still laid out so the browser can print it. */
.print-frame { position:fixed; right:0; bottom:0; width:1px; height:1px; border:0; opacity:0; pointer-events:none; }
.dev-detail-title { display:grid; justify-items:start; gap:var(--space-1); min-width:0; }
.dev-detail-title h2 { margin:0; font-size:var(--text-section); line-height:1.3; }
.dev-detail-sub { color:var(--muted); font-size:var(--text-support); }
.dev-detail-text { margin:0; color:var(--muted); font-size:var(--text-support); line-height:1.5; }
.dev-todo { display:grid; gap:var(--space-1); }
.dev-todo h3 { margin:0; font-size:var(--text-body); }
.dev-todo p { margin:0; line-height:1.5; }
.dev-todo ol { display:grid; gap:var(--space-1); margin:0; padding-left:20px; }
.dev-more-list { display:grid; gap:var(--space-2); }
.dev-detail details { font-size:var(--text-support); }
.dev-detail summary { color:var(--accent); cursor:pointer; }
.dev-detail details .link-button { margin-top:var(--space-2); }
.dev-goods-status { margin:var(--space-2) 0 0; color:var(--muted); font-size:var(--text-meta); }
.dev-goods-status:empty { display:none; }
.dev-codes { max-height:240px; overflow:auto; margin-top:var(--space-1); color:var(--muted); font-size:var(--text-caption); line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.dev-codes:empty { display:none; }
@media (max-width:900px) { .dev-split { grid-template-columns:minmax(0,1fr); } .dev-detail { padding:var(--space-4); } }
.workspace-home-grid { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(240px,1fr); gap:20px; }
.workspace-start,.workspace-organization { padding:26px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); min-width:0; }
.workspace-organization { background:var(--accent-bg); border-color:transparent; }
.workspace-feature-icon,.workspace-org-icon { display:inline-grid; place-items:center; width:44px; height:44px; border-radius:10px; color:var(--accent); background:var(--accent-bg); }
.workspace-org-icon { background:var(--surface); }
.workspace-start h2 { margin:16px 0 8px; }
.workspace-start > p { margin:0; color:var(--muted); font-size:14px; }
.workspace-organization h2 { margin:0 0 18px; font-size:16px; }
.workspace-organization h3 { margin:16px 0 6px; font-size:var(--text-subheading); }
.workspace-organization p { margin:0; color:var(--muted); font-size:12px; }
.workspace-scan label { display:block; margin:0 0 var(--space-2); }
.workspace-scan-row { display:flex; gap:10px; align-items:stretch; }
.workspace-scan-row input { flex:1 1 auto; min-width:0; font:13px/1.5 var(--font-code) !important; }
.workspace-scan-row .primary { flex:0 0 auto; white-space:nowrap; }
.scan-submit { display:grid; place-items:center; flex:0 0 44px !important; width:44px; min-width:44px; min-height:44px; padding:0; }
.scan-submit svg { width:18px; height:18px; }
.workspace-text-link { display:inline-flex; align-items:center; gap:8px; margin-top:20px; font-size:13px; font-weight:500; text-decoration:none; }
.workspace-text-link:hover { text-decoration:underline; }
.workspace-text-link svg { width:16px; height:16px; }
.workspace-guide { margin-top:32px; }
.workspace-guide h2 { margin:0 0 16px; font-size:18px; }
.workspace-guide dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:0; }
.workspace-guide dl > div { padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.workspace-guide dt { font-size:14px; font-weight:600; }
.workspace-guide dd { margin:6px 0 0; color:var(--muted); font-size:13px; line-height:1.55; }
.workspace-future { display:flex; align-items:center; flex-wrap:wrap; gap:14px 26px; margin-top:28px; padding-top:20px; border-top:1px solid var(--line); color:var(--muted); }
.workspace-future h2 { font-size:13px; font-weight:500; }
.workspace-future > span { display:flex; gap:8px; align-items:center; font-size:13px; }
.workspace-future small { padding:1px 8px; border-radius:999px; background:var(--surface-2); font-size:11px; }

/* ---------- Mark check: reference layout (session list · passport · verdict tiles · path · tabs) ---------- */
.sheet-check { display:block; }
.check-layout { display:grid; grid-template-columns:260px minmax(0,1fr); align-items:start; gap:20px; }
.check-session { position:sticky; top:84px; max-height:calc(100vh - 110px); display:flex; flex-direction:column; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.check-session header { display:flex; align-items:baseline; justify-content:space-between; gap:8px; padding:12px 14px; border-bottom:1px solid var(--line); }
.check-session header small { color:var(--muted); font-size:11px; }
.session-list { margin:0; padding:0; list-style:none; overflow-y:auto; }
.session-item { display:grid; gap:3px; width:100%; min-height:0; padding:10px 14px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; color:var(--fg); text-align:left; font:400 13px/1.4 var(--font-ui); }
.session-item:hover { background:var(--surface-2); }
.session-item.is-active { background:var(--accent-bg); }
.session-item strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.session-item span { display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:11px; }
.session-item time { font-family:var(--font-code); }
.dot { display:inline-flex; align-items:center; gap:5px; font-style:normal; }
.dot::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.dot.tone-active { color:var(--ok); } .dot.tone-retired,.dot.tone-error { color:var(--bad); } .dot.tone-neutral { color:var(--warn); }
.session-empty { margin:0; padding:14px; color:var(--muted); font-size:12px; line-height:1.5; }
.check-main { min-width:0; display:grid; gap:16px; }
.check-scan { padding:14px 16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.check-scan .check-note { margin-top:8px; }
.check-result { display:grid; gap:14px; min-width:0; }
.check-head h2 { font-size:19px; font-weight:600; letter-spacing:-.01em; }
.check-head p { margin:4px 0 0; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.check-result[data-state="loading"] .check-head h2 { color:var(--muted); }
.verdict-row { display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:10px; }
.verdict-tile { min-width:0; display:grid; gap:4px; align-content:start; padding:14px 16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.verdict-tile > span { color:var(--muted); font-size:10.5px; letter-spacing:.07em; text-transform:uppercase; }
.verdict-tile strong { font-size:15px; font-weight:600; overflow-wrap:anywhere; }
.verdict-tile small { color:var(--muted); font-size:12px; line-height:1.45; }
.verdict-tile[data-tone="warn"] strong { color:var(--warn); } .verdict-tile[data-tone="bad"] strong { color:var(--bad); }
.verdict-status { border-color:transparent; background:var(--surface-2); }
.verdict-status strong { font-size:24px; line-height:1.15; letter-spacing:-.02em; }
.check-result[data-state="active"] .verdict-status { background:var(--ok-bg); }
.check-result[data-state="active"] .verdict-status strong { color:var(--ok); }
.check-result[data-state="retired"] .verdict-status,.check-result[data-state="error"] .verdict-status { background:var(--bad-bg); }
.check-result[data-state="retired"] .verdict-status strong,.check-result[data-state="error"] .verdict-status strong { color:var(--bad); }
.check-result[data-state="error"] .verdict-status small { color:var(--fg); }
.mark-path { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; margin:0; padding:0; list-style:none; }
.mark-path:empty { display:none; }
.mark-path li { display:grid; gap:2px; padding-top:7px; border-top:3px solid var(--line); font-size:12px; color:var(--muted); }
.mark-path li.is-done { border-top-color:var(--accent); color:var(--fg); }
.mark-path small { color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.check-tabs { display:flex; gap:2px; border-bottom:1px solid var(--line); overflow-x:auto; }
.check-tab { flex:0 0 auto; min-height:38px; margin:0; padding:8px 12px; border:0; border-bottom:2px solid transparent; border-radius:0; background:transparent; color:var(--muted); font:500 13px var(--font-ui); }
.check-tab:hover { background:transparent; color:var(--fg); }
.check-tab[aria-selected="true"] { border-bottom-color:var(--accent); color:var(--fg); }
.check-panel { min-width:0; }
.check-panel pre { max-height:430px; overflow:auto; margin:10px 0 0; padding:14px; border-radius:var(--radius-sm); background:var(--surface-2); color:var(--fg); font-size:12px; line-height:1.5; white-space:pre-wrap; }
.check-panel h3 { margin:20px 0 8px; font-size:15px; }
.timeline { margin:0; padding:0; list-style:none; }
.timeline li { display:grid; grid-template-columns:96px 18px minmax(0,1fr); gap:10px; }
.timeline li::before { content:""; grid-column:2; grid-row:1; justify-self:center; width:1px; background:var(--line); }
.timeline time { grid-column:1; grid-row:1; padding-top:2px; color:var(--muted); font:11.5px var(--font-code); text-align:right; }
.timeline li > div { grid-column:3; grid-row:1; position:relative; padding-bottom:16px; }
.timeline li > div::before { content:""; position:absolute; left:-23px; top:5px; width:9px; height:9px; border-radius:50%; border:2px solid var(--accent); background:var(--surface); }
.timeline li:first-child > div::before { background:var(--accent); }
.timeline strong { display:block; font-weight:500; }
.timeline small { display:block; color:var(--muted); font-size:12px; }
.timeline details { margin-top:4px; }
.timeline summary { font-size:12px; font-weight:500; }.data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:24px; }
.data-item { min-width:0; padding:12px 0; border-bottom:1px solid var(--line); }
.data-item span,.data-item strong { display:block; }
.data-item span { color:var(--muted); font-size:12px; }
.data-item strong { margin-top:3px; font-size:14px; font-weight:500; line-height:1.5; overflow-wrap:anywhere; }
.data-item.mono strong { font:13px/1.55 var(--font-code); }
.data-item .field-path { margin-top:3px; color:var(--muted); font:11px/1.4 var(--font-code); overflow-wrap:anywhere; }

/* ---------- Organization profile ---------- */
.profile-tabs { display:flex; gap:22px; overflow-x:auto; margin-top:24px; padding:0 26px; border:1px solid var(--line); border-radius:var(--radius) var(--radius) 0 0; background:var(--surface); }
.profile-tab-button { flex:0 0 auto; min-height:46px; margin:0; padding:12px 0 10px; border:0; border-bottom:2px solid transparent; border-radius:0; background:transparent; color:var(--muted); font:500 13px/1.4 var(--font-ui); white-space:nowrap; }
.profile-tab-button:hover { background:transparent; color:var(--fg); }
.profile-tab-button[aria-selected="true"] { border-bottom-color:var(--accent); color:var(--fg); }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:24px; margin-top:24px; }
.profile-grid.profile-tab-panel,.organization-section.profile-tab-panel { margin:0; padding:10px 26px 24px; border:1px solid var(--line); border-top:0; border-radius:0 0 var(--radius) var(--radius); background:var(--surface); }
.organization-section.profile-tab-panel { padding:var(--space-4) var(--space-5); }
.profile-item { min-width:0; padding:16px 0; border-bottom:1px solid var(--line); }
.profile-item span,.profile-item strong { display:block; }
.profile-item span { color:var(--muted); font-size:12px; }
.profile-item strong { margin-top:4px; font-size:15px; font-weight:500; overflow-wrap:anywhere; }
.session-ok { color:var(--ok); }
.organization-section h2 { font-size:18px; }
.organization-section > p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.organization-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-4); }
.organization-section-head > div { min-width:0; }
.organization-section-head h2 { margin:0; }
.organization-section-head p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.admin-sections { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:var(--space-2); margin-top:var(--space-4); }
.admin-section-link { display:grid; gap:var(--space-1); padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--fg); text-decoration:none; }
.admin-section-link:hover { border-color:var(--accent); }
.admin-section-link span { color:var(--muted); font-size:var(--text-meta); line-height:1.4; }
.group-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; margin-top:16px; }
.group-chip { display:flex; align-items:center; min-height:56px; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2); font-size:14px; font-weight:500; }
.refresh-profile { flex:0 0 auto; margin:0; }
.profile-message { min-height:18px; margin:var(--space-2) 0 0; color:var(--muted); }
.mod-list { display:grid; gap:10px; margin-top:16px; }
.mod-card { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(200px,.8fr); border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--surface); }
.mod-address,.mod-assignment { min-width:0; padding:14px 16px; }
.mod-assignment { border-left:1px solid var(--line); background:var(--accent-bg); }
.mod-card span,.mod-card strong { display:block; }
.mod-card span { color:var(--muted); font-size:12px; }
.mod-card strong { margin-top:4px; font-size:14px; font-weight:500; overflow-wrap:anywhere; }
.mod-groups { display:grid; gap:0; margin:6px 0 0; padding:0; list-style:none; }
.mod-groups li { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:38px; border-top:1px solid var(--line); }
.mod-groups li:first-child { border-top:0; }
.mod-groups li strong { margin:0; }
.mod-remove { flex:0 0 32px; width:32px; min-height:32px; padding:0; color:var(--bad); }
.mod-remove:hover { border-color:var(--bad); background:var(--bad-bg); }

/* ---------- Reference catalogs (admin) ---------- */
.reference-summary { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-top:24px; padding:16px 18px; border-radius:var(--radius); background:var(--accent-bg); }
.reference-summary strong { font-size:26px; letter-spacing:-.02em; }
.reference-summary span { max-width:52ch; color:var(--muted); font-size:13px; }
.reference-search { margin:20px 0 12px; }
.catalog-list { display:grid; gap:10px; }
details.catalog { border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.catalog > summary { display:block; padding:14px 16px; color:var(--fg); list-style:none; }
.catalog > summary::-webkit-details-marker { display:none; }
.catalog > summary strong,.catalog > summary small { display:block; }
.catalog > summary strong { font-size:15px; }
.catalog > summary small { margin-top:3px; color:var(--muted); font-size:12px; font-weight:400; }
.catalog-count { float:right; color:var(--accent); font:12px var(--font-code); }
.catalog-body { border-top:1px solid var(--line); }
.catalog-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.catalog-item { min-width:0; padding:10px 16px; border-bottom:1px solid var(--line); }
.catalog-item code,.catalog-item small,.catalog-item span { display:block; }
.catalog-item code { color:var(--accent); font-size:12px; overflow-wrap:anywhere; }
.catalog-item small { margin-top:2px; color:var(--muted); font:11px var(--font-code); }
.catalog-item span { margin-top:3px; font-size:13px; }
.catalog-actions { display:flex; gap:10px; margin-top:8px; }
.catalog-actions button { min-height:28px; padding:2px 8px; background:transparent; color:var(--accent); border-color:var(--line); font-size:12px; }
.catalog-actions button:last-child { color:var(--bad); }
.catalog-empty { margin:0; padding:22px; color:var(--muted); text-align:center; }
.reference-add { margin-top:22px; padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.reference-add h2 { font-size:var(--text-subheading); }
.reference-add p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.reference-add-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
.reference-add button { margin-top:16px; }
.reference-message { min-height:20px; margin:var(--space-2) 0 0; color:var(--ok); font-weight:600; }
.reference-import { margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
.reference-import p { color:var(--muted); font-size:13px; }

/* ---------- Access ---------- */
.access-main { display:grid; align-content:start; gap:var(--space-5); }
.access-main .workspace-heading { margin:0; }
.access-heading { display:flex; align-items:start; justify-content:space-between; gap:var(--space-4); }
.access-heading > div { min-width:0; overflow-wrap:anywhere; }
.access-heading > .button { flex-shrink:0; }
.access-summary { display:flex; align-items:center; justify-content:space-between; gap:var(--space-5); padding:var(--space-4) var(--space-5); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.access-verdict { display:flex; align-items:center; gap:var(--space-3); min-width:0; }
.access-status-icon { display:grid; place-items:center; flex:0 0 36px; height:36px; border-radius:50%; }
.access-verdict.tone-ok .access-status-icon { background:var(--ok-bg); color:var(--ok); }
.access-verdict.tone-warn .access-status-icon { background:var(--warn-bg); color:var(--warn); }
.access-verdict.tone-bad .access-status-icon { background:var(--bad-bg); color:var(--bad); }
.access-status-icon svg,.access-privacy svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.access-verdict strong { display:block; font-size:var(--text-subheading); font-weight:600; }
.access-verdict p { margin:var(--space-1) 0 0; color:var(--muted); font-size:var(--text-support); overflow-wrap:anywhere; }
.access-facts { display:flex; flex-shrink:0; flex-wrap:wrap; gap:var(--space-5); margin:0; }
.access-fact { display:grid; gap:var(--space-1); min-width:0; }
.access-fact dt { color:var(--muted); font-size:var(--text-meta); }
.access-fact dd { margin:0; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.access-main .access-section { display:grid; align-content:start; gap:var(--space-4); margin:0; padding:var(--space-5); min-width:0; }
.access-main .access-section h2 { margin:0; font-size:var(--text-section); }
.access-main .description { margin:0; font-size:var(--text-support); overflow-wrap:anywhere; }
.access-columns { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:var(--space-5); }
.access-columns .button { justify-self:start; white-space:normal; text-align:center; }
.license-check { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:var(--space-4) var(--space-5); }
.license-check > div { display:grid; gap:var(--space-2); }
.license-check > small,.license-check > .access-progress { grid-column:1 / -1; }
.license-check button { white-space:nowrap; }
.access-progress { margin:0; color:var(--muted); font-size:var(--text-support); }
.access-history .table-wrap { border:0; border-radius:0; }
.access-history .table { min-width:480px; margin:0; width:100%; }
.access-history th:first-child,.access-history td:first-child { padding-left:0; white-space:nowrap; font-variant-numeric:tabular-nums; }
.access-history th:last-child,.access-history td:last-child { padding-right:0; text-align:right; white-space:nowrap; }
.access-history td { overflow-wrap:anywhere; }
.access-privacy { color:var(--muted); font-size:var(--text-support); }
.access-privacy summary { display:flex; align-items:center; gap:var(--space-2); width:fit-content; cursor:pointer; list-style:none; min-height:var(--control-lg); }
.access-privacy summary::after { content:""; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(-45deg); margin-left:var(--space-1); }
.access-privacy[open] summary::after { transform:rotate(45deg); }
.access-privacy > div { display:grid; gap:var(--space-3); padding-top:var(--space-3); }
@media (max-width:860px) {
  .access-summary { align-items:start; flex-direction:column; }
  .access-facts { padding-left:calc(36px + var(--space-3)); }
  .access-columns { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:520px) {
  .access-heading { flex-direction:column; }
  .access-main .access-section,.access-summary { padding:var(--space-4); }
  .access-facts { padding-left:0; }
  .license-check { grid-template-columns:minmax(0,1fr); }
  .license-check > button { width:100%; }
  .access-heading > .button { min-height:var(--control-lg); }
}
.access-section { margin-top:28px; }
.access-section h2 { display:flex; align-items:center; gap:10px; margin-bottom:12px; font-size:18px; }
.pill { padding:2px 8px; border-radius:6px; font:500 11px var(--font-code); letter-spacing:0; }
.pill-warn { background:var(--warn-bg); color:var(--warn); }
.table-wrap { overflow-x:auto; }
.table { font-size:var(--text-support); }
.table th,.table td { padding:var(--space-2) var(--space-3); border-top:1px solid var(--line); }
.table thead th { border-top:0; }
.table .num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.table tr.is-current td { background:var(--accent-bg); }
.access-request { padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 var(--space-4); }
.event-list { margin:0; padding:0; list-style:none; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.event-list li { display:flex; gap:16px; padding:10px 14px; border-top:1px solid var(--line); font-size:13px; }
.event-list li:first-child { border-top:0; }
.event-list time { flex:0 0 auto; color:var(--muted); font:12px var(--font-code); }

/* ---------- Seats (concurrent sign-ins) ---------- */
.seat-list { display:grid; gap:0; margin:0 0 16px; padding:0; list-style:none; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.seat { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-top:1px solid var(--line); }
.seat:first-child { border-top:0; }
.seat.is-mine { background:var(--accent-bg); }
.seat-text { min-width:0; display:grid; gap:2px; }
.seat-text strong { font-weight:500; overflow-wrap:anywhere; }
.seat-text small { color:var(--muted); font-size:12px; }
.seat form { flex:0 0 auto; }
/* ---------- Admin: organizations and access ---------- */
.admin-head { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:12px 24px; margin-bottom:18px; }
.segmented { display:inline-flex; gap:2px; padding:3px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.segmented a { padding:6px 14px; border-radius:7px; color:var(--muted); font-size:13px; font-weight:500; text-decoration:none; }
.segmented a[aria-current="page"] { background:var(--accent-bg); color:var(--accent); }
.kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.kpi { display:grid; gap:2px; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--fg); text-decoration:none; }
.kpi:hover,.kpi.is-active { border-color:var(--accent); }
.kpi span { color:var(--muted); font-size:12px; }
.kpi b { font-size:22px; font-weight:600; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.kpi.tone-warn b { color:var(--warn); } .kpi.tone-bad b { color:var(--bad); } .kpi.tone-ok b { color:var(--ok); } .kpi.tone-info b { color:var(--accent); }
.orgs-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; align-items:start; }
.orgs-layout.has-card { grid-template-columns:minmax(0,1fr) 340px; }
.orgs-list { display:grid; gap:12px; min-width:0; }
.orgs-filter { display:flex; flex-wrap:wrap; gap:8px; }
.orgs-filter input { flex:1 1 220px; width:auto !important; }
.orgs-filter select { flex:0 0 180px; width:auto; }
.table td.empty { padding:var(--space-5); color:var(--muted); text-align:center; }
.table small { color:var(--muted); font-size:11.5px; }
.table .mono { font-size:var(--text-meta); }
.table a { font-weight:500; }
.state.tone-muted { background:var(--surface-2); color:var(--muted); }
.pill-info { background:var(--accent-bg); color:var(--accent); }
.muted { color:var(--muted); }
.grant { padding:14px 16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.form-grid.four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.form-grid .span-2 { grid-column:span 2; }
.input-pair { display:flex; gap:6px; }
.input-pair input { flex:1 1 auto; min-width:0; }
.input-pair select { flex:0 0 84px; }
.grant + .orgs-filter, .new-codes + .grant { margin-top:14px; }
.orgs-filter + .table-wrap { margin-top:12px; }
.new-codes { margin-bottom:14px; padding:16px 18px; border:1px solid var(--accent); border-radius:var(--radius); background:var(--accent-bg); }
.new-codes h2 { margin-bottom:10px; font-size:16px; }
.new-codes textarea { width:100%; resize:vertical; font-size:14px; letter-spacing:.04em; background:var(--surface); }

/* ---------- Activation code on the access page ---------- */
.access-code { padding:20px 22px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.code-form { display:flex; flex-wrap:wrap; gap:8px; max-width:560px; }
.code-form input { flex:1 1 260px; width:auto; text-transform:uppercase; letter-spacing:.06em; }
.code-form input::placeholder { text-transform:none; letter-spacing:.06em; }
.org-card { position:sticky; top:84px; display:grid; gap:14px; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.org-card header { position:relative; padding-right:28px; }
.org-card h2 { font-size:var(--text-subheading); }
.org-card header p { margin:2px 0 0; color:var(--muted); font-size:12px; }
.org-card .close { position:absolute; top:-4px; right:0; color:var(--muted); font-size:22px; text-decoration:none; }
.org-card h3 { margin-top:4px; font-size:14px; }
.org-facts { display:grid; grid-template-columns:auto 1fr; gap:6px 12px; margin:0; font-size:13px; }
.org-facts dt { color:var(--muted); }
.org-facts dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.card-form { display:grid; gap:0; padding-top:12px; border-top:1px solid var(--line); }
.card-form h3 { margin:0 0 8px; }
.card-form.inline { grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; }
.card-form.inline label { margin-top:0; }
.extend-buttons { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.extend-buttons button { padding:8px 6px; }
.danger-zone summary { color:var(--bad); font-size:13px; }
.event-list.compact li { flex-direction:column; gap:2px; padding:8px 12px; }

/* ---------- Admin ---------- */
.admin-public { max-width:760px; margin:0 auto; padding:48px 20px; }
.admin-public .sheet { padding:32px; }
.admin-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 24px; border-bottom:1px solid var(--line); background:var(--surface); }
.admin-header .brand { display:flex; align-items:center; gap:10px; color:var(--fg); font-weight:600; text-decoration:none; }
.panel-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; margin-top:24px; }
.card { display:flex; flex-direction:column; align-items:flex-start; gap:8px; min-height:180px; padding:20px; color:var(--fg); text-decoration:none; }
a.card:hover { border-color:var(--accent); }
.card strong { margin-top:auto; font-size:20px; letter-spacing:-.02em; }
.card > span { color:var(--muted); font-size:13px; line-height:1.5; }
.card .tag { padding:2px 8px; border-radius:6px; background:var(--accent-bg); color:var(--accent); font:500 11px var(--font-code); }
.groups { margin-top:20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.group { display:flex; gap:12px; align-items:flex-start; margin:0; padding:14px 16px; border-bottom:1px solid var(--line); font-weight:400; cursor:pointer; }
.group:last-child { border-bottom:0; }
.group strong,.group span { display:block; }
.group span span { margin-top:2px; color:var(--muted); font-size:12px; }
.groups + button,form > button[type="submit"] { margin-top:18px; }

/* ---------- Journal (admin) ---------- */
.log-main { display:grid; gap:16px; }
.log-head { display:flex; flex-wrap:wrap; gap:12px 24px; align-items:flex-end; justify-content:space-between; }
.log-head p { margin:6px 0 0; color:var(--muted); max-width:70ch; font-size:14px; }
.log-counts { display:flex; gap:8px; flex-wrap:wrap; }
.log-counts span { padding:6px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); font-size:13px; }
.log-counts b.e { color:var(--bad); } .log-counts b.w { color:var(--warn); }
.log-filter label { display:grid; gap:var(--space-1); margin:0; font-size:var(--text-meta); }
.log-filter input[type="search"] { min-width:260px; }
.log-filter a { align-self:center; font-size:13px; font-weight:600; }
.log-list { border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.log-row { border-top:1px solid var(--line); }
.log-row:first-child { border-top:0; }
.log-row summary { display:grid; grid-template-columns:76px 82px minmax(140px,220px) minmax(0,1fr); gap:12px; align-items:baseline; padding:10px 14px; color:var(--fg); font-weight:400; font-size:13px; list-style:none; }
.log-row summary::-webkit-details-marker { display:none; }
.log-row summary:hover { background:var(--surface-2); }
.log-time,.log-rid,.log-event { font:12px var(--font-code); }
.log-time,.log-rid { color:var(--muted); }
.log-rid { margin-left:6px; }
.log-level { justify-self:start; padding:2px 8px; border-radius:6px; background:var(--accent-bg); color:var(--accent); font:600 11px var(--font-code); }
.log-level.error { background:var(--bad-bg); color:var(--bad); }
.log-level.warning { background:var(--warn-bg); color:var(--warn); }
.log-text { min-width:0; overflow-wrap:anywhere; }
.log-row pre { margin:0; padding:12px 14px 16px; border-top:1px dashed var(--line); background:var(--surface-2); font-size:12px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.log-note { color:var(--muted); font-size:12px; }

/* ---------- Sign-in page ---------- */
.auth-page { width:min(1080px,calc(100% - 32px)); min-height:100vh; margin:auto; display:grid; align-content:center; padding:32px 0; }
/* Two columns only for the sign-in sheet (it has .intro); the pages of a link and of the certificate are one column. */
.auth-page .sheet:has(> .intro) { display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); overflow:hidden; }
/* The dark column: the logo on top, what the page is for, the demo at the bottom. */
.intro { display:grid; grid-template-rows:auto 1fr auto; align-content:space-between; gap:var(--space-5); padding:32px; background:var(--hero); color:var(--on-hero); }
.intro-brand { display:flex; align-items:center; gap:var(--space-3); line-height:0; }
.intro-brand img { width:auto; height:32px; }
.intro-text { display:grid; align-content:center; gap:var(--space-3); }
.intro h1 { font-size:clamp(26px,2.6vw,30px); line-height:1.15; letter-spacing:-.03em; }
.intro-text p { max-width:36ch; margin:0; color:var(--on-hero-muted); font-size:14px; line-height:1.55; }
.demo-entry { display:grid; justify-items:start; gap:var(--space-3); }
.demo-entry p { max-width:36ch; margin:0; color:var(--on-hero-muted); font-size:13px; line-height:1.5; }
.demo-entry strong { color:var(--on-hero); font-weight:600; }
.demo-entry button { background:transparent; color:var(--on-hero); border:1px solid color-mix(in srgb, var(--on-hero) 40%, transparent); }
.demo-entry button:hover { background:color-mix(in srgb, var(--on-hero) 10%, transparent); }
.demo-samples { margin-top:12px; padding:12px 16px; border:1px dashed var(--line-strong); border-radius:var(--radius); background:var(--surface); }
.demo-samples h2 { margin:0 0 10px; color:var(--muted); font-size:12px; font-weight:500; letter-spacing:.06em; text-transform:uppercase; }
.demo-sample-list { display:flex; flex-wrap:wrap; gap:8px; }
.form { display:grid; align-content:start; gap:var(--space-3); padding:32px; min-width:0; }
.form h2 { font-size:var(--text-section); }
/* «Как войти?» with the link to the instruction of the sign-in on the right. */
.auth-title { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:var(--space-1) var(--space-3); }
.auth-title h2 { margin:0; }
.auth-guide { font-size:var(--text-support); }
/* The way to sign in: a segmented control (its explanation is the title of each tab). */
.method-switch { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-1); padding:var(--space-1); border-radius:var(--radius-sm); background:var(--surface-2); }
.method { min-height:var(--control-sm); padding:0 var(--space-2); border:0; border-radius:6px; background:transparent; color:var(--muted); font:500 var(--text-body)/1.2 var(--font-ui); }
.method:hover { background:transparent; color:var(--fg); }
.method[aria-selected="true"] { background:var(--surface); color:var(--fg); box-shadow:var(--shadow); }
.auth-panel { display:grid; gap:var(--space-2); min-width:0; }
.auth-panel > input + label { margin-top:var(--space-2); }
.auth-panel h3 { font-size:var(--text-subheading); }
.auth-panel > p { max-width:56ch; margin:0; color:var(--muted); font-size:var(--text-body); }
.auth-readiness { border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); overflow:hidden; }
.auth-readiness-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); padding:var(--space-2) var(--space-3); border-bottom:1px solid var(--line); }
.auth-readiness-head strong,.auth-readiness-head span { display:block; }
.auth-readiness-head strong { font-size:var(--text-support); font-weight:500; }
.auth-readiness-head span { margin-top:2px; color:var(--muted); font-size:var(--text-meta); }
.auth-readiness[data-state="ok"] { border-color:transparent; }
.auth-readiness[data-state="ok"] .auth-readiness-head { background:var(--ok-bg); }
.auth-readiness[data-state="ok"] .auth-readiness-head strong { display:flex; align-items:center; gap:var(--space-2); color:var(--ok); }
.auth-readiness[data-state="ok"] .auth-readiness-head strong::before { content:"✓"; display:inline-grid; place-items:center; flex:none; width:16px; height:16px; border-radius:50%; background:var(--ok); color:var(--ok-bg); font-size:10px; font-weight:700; }
.auth-readiness[data-state="ok"] #readiness-details { color:var(--ok); }
.auth-readiness[data-state="bad"] .auth-readiness-head { background:var(--bad-bg); }
/* A ready workplace is one line; «подробнее» (data-open) shows what was checked. */
.auth-readiness[data-state="ok"]:not([data-open]) .auth-readiness-head { border-bottom:0; }
.auth-readiness[data-state="ok"]:not([data-open]) .auth-readiness-head span,.auth-readiness[data-state="ok"]:not([data-open]) .auth-readiness-list { display:none; }
.auth-readiness-list { margin:0; padding:0; list-style:none; }
.auth-readiness-list li { display:grid; grid-template-columns:22px minmax(0,1fr); gap:10px; align-items:start; padding:10px 14px; border-top:1px solid var(--surface-2); }
.auth-readiness-list li:first-child { border-top:0; }
.auth-readiness-list strong,.auth-readiness-list span { display:block; }
.auth-readiness-list strong { font-size:13px; }
.auth-readiness-list li div span { margin-top:1px; color:var(--muted); font-size:12px; }
.readiness-mark { display:grid !important; place-items:center; width:20px; height:20px; border:2px solid var(--line-strong); border-radius:50%; color:var(--on-accent); font-size:11px; font-weight:700; }
.auth-readiness-list li[data-state="wait"] .readiness-mark { border-top-color:var(--accent); animation:doka-spin .8s linear infinite; }
.auth-readiness-list li[data-state="ok"] .readiness-mark { border-color:var(--ok); background:var(--ok); }
.auth-readiness-list li[data-state="ok"] .readiness-mark::before { content:"✓"; }
.auth-readiness-list li[data-state="bad"] .readiness-mark { border-color:var(--bad); background:var(--bad); }
.auth-readiness-list li[data-state="bad"] .readiness-mark::before { content:"!"; }
.auth-readiness-list li[data-state="idle"] { opacity:.62; }
.certificate { display:flex; gap:var(--space-3); align-items:center; min-height:60px; padding:var(--space-3) var(--space-4); border:1px dashed var(--line-strong); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--muted); font-size:13px; }
.certificate-mark { color:var(--accent); font:18px var(--font-code); }
.org-list { display:grid; gap:var(--space-2); margin-top:var(--space-3); }
.certificate-option { display:grid; grid-template-columns:20px minmax(0,1fr) auto; align-items:center; gap:var(--space-3); justify-content:stretch; width:100%; min-height:0; padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--fg); text-align:left; font-weight:400; }
.certificate-option:hover { background:var(--surface-2); }
.certificate-option.selected { border-color:var(--accent); background:var(--accent-bg); }
.certificate-radio { width:16px; height:16px; border:1px solid var(--accent); border-radius:50%; }
.certificate-option.selected .certificate-radio { border:5px solid var(--accent); }
.certificate-option > span { min-width:0; }
.certificate-option strong,.certificate-option small { display:block; }
.certificate-option strong { font-size:14px; line-height:1.35; }
.certificate-option small { margin-top:2px; color:var(--muted); font-size:12px; }
/* The certificates of this computer: a frame of five rows whatever their number (the form keeps its height), the rest
   scrolls inside it; a search above, the count and the order under it. */
.certificate-picker { display:grid; gap:var(--space-2); }
.certificate-search { width:100%; }
.certificate-list { display:grid; grid-auto-rows:max-content; align-content:start; height:calc(5 * 55px + 2px); overflow:auto; border:1px solid var(--line); border-radius:var(--radius-sm); scrollbar-width:thin; }
.certificate-list .certificate-option { min-height:55px; padding:var(--space-2) var(--space-3); border:0; border-bottom:1px solid var(--line); border-radius:0; }
/* A short label beside a name: the certificate, a sent draft («Отправлен»). */
.certificate-badge, .cr-draft-badge { display:inline-flex; padding:1px 6px; border-radius:4px; background:var(--accent-bg); color:var(--accent); font-size:11px; font-weight:600; white-space:nowrap; }
.certificate-end { display:grid; justify-items:end; gap:2px; }
.certificate-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:var(--space-1) var(--space-3); color:var(--muted); font-size:var(--text-meta); }
.certificate-list .certificate-option:last-child { border-bottom:0; }
.certificate-list .certificate-option strong,.certificate-list .certificate-option small:not(.certificate-expiry) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.certificate-option .certificate-expiry { margin:0; font:12px var(--font-code); white-space:nowrap; font-variant-numeric:tabular-nums; }
.certificate-option .certificate-expiry.is-soon { color:var(--warn); }
/* A phone: the owner wraps in full, the mark and the expiry go under the organization. */
@media (max-width:520px) {
  .certificate-list .certificate-option { grid-template-columns:20px minmax(0,1fr); row-gap:2px; }
  .certificate-list .certificate-option strong { white-space:normal; }
  .certificate-option .certificate-end { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); grid-column:2; }
}
.org-step { padding-top:var(--space-3); border-top:1px solid var(--line); }
.org-step h4 { font-size:16px; }
.org-step-note { margin:4px 0 6px; color:var(--muted); font-size:13px; }
.org-manual { margin-top:12px; font-size:13px; }
/* Under the certificates: the help on the left, the sign-in on the right. */
.auth-foot { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-3); padding-top:var(--space-3); border-top:1px solid var(--line); }
.auth-foot .actions { margin-top:0; }
.help { flex:1 1 200px; font-size:13px; }
.help p { margin:8px 0 0; color:var(--muted); font-size:12px; }
/* Under the form of the sign-in: the browser that works with УКЭП out of the box. */
.browser-tip { margin:var(--space-3) 0 0; padding-top:var(--space-3); border-top:1px solid var(--line); color:var(--muted); font-size:12px; line-height:1.5; }
.footer { margin:18px 0 0; color:var(--muted); font-size:11px; }

/* ---------- Motion ---------- */
@keyframes doka-rise { from { transform:translateY(4px); opacity:.6; } to { transform:none; opacity:1; } }
.home-main .workspace-home-grid,.check-result:not([hidden]) { animation:doka-rise .25s cubic-bezier(.16,1,.3,1); }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; } }

/* ---------- Responsive ---------- */
@media (max-width:1100px) {
  .check-layout { grid-template-columns:220px minmax(0,1fr); }
  .orgs-layout.has-card { grid-template-columns:1fr; }
  .org-card { position:static; }
  .kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .form-grid.four { grid-template-columns:1fr 1fr; }
  .topbar-title { display:none; }
}
@media (max-width:860px) {
  .check-layout { grid-template-columns:1fr; }
  .check-session { order:2; position:static; max-height:none; }
  .verdict-row { grid-template-columns:1fr 1fr; }
  .verdict-status { grid-column:1 / -1; }
  .workspace-home-grid,.workspace-guide dl { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:1fr; }
  .auth-page .sheet:has(> .intro) { grid-template-columns:1fr; }
  .intro { gap:var(--space-4); padding:var(--space-5); }
  .intro-text p { display:none; }
  .form { padding:var(--space-5); }
}
/* Mode В: the rail becomes a bottom tab bar for phones and data collection terminals. */
@media (max-width:700px) {
  .me-grid { grid-template-columns:1fr; }
  .seat { flex-direction:column; align-items:stretch; }
  .monitor { padding:var(--space-4); }
  .kpis { grid-template-columns:1fr 1fr; }
  .form-grid.four,.card-form.inline { grid-template-columns:1fr; }
  .form-grid .span-2 { grid-column:auto; }
  .admin-head { align-items:flex-start; }
  .verdict-row { grid-template-columns:1fr; }
  .mark-path { grid-template-columns:repeat(5,minmax(64px,1fr)); overflow-x:auto; padding-bottom:4px; }
  .timeline li { grid-template-columns:64px 14px minmax(0,1fr); }
  .timeline li > div::before { left:-19px; }
  .workspace { grid-template-columns:1fr; padding-bottom:calc(68px + env(safe-area-inset-bottom,0px)); }
  .rail { position:fixed; inset:auto 0 0 0; z-index:10; top:auto; height:auto; flex-direction:row; justify-content:space-around; gap:0; padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px)); border-right:0; border-top:1px solid var(--line); }
  .rail-brand,.rail-theme,.rail-toggle { display:none; }
  .topbar-brand { display:block; line-height:0; }
  .topbar-brand img { width:28px; height:28px; }
  .rail-link { width:auto; flex:1; min-height:52px; max-width:84px; font-size:10.5px; }
  .rail-link .rail-badge { right:calc(50% - 22px); }
  .topbar { flex-wrap:wrap; gap:10px; padding:10px 16px; }
  .command { order:3; flex-basis:100%; max-width:none; }
  .command kbd { display:none; }
  .org-text strong { max-width:calc(100vw - 170px); }
  .workspace-main,.main.workspace-main { padding:var(--space-4) var(--space-4) calc(var(--space-4) + var(--floating-stack)); }
  .banner,.workspace-notice,.admin-nav { margin:12px 16px 0; }
  .workspace-footer { padding:16px; flex-wrap:wrap; }
  .data-grid,.profile-grid,.catalog-items,.reference-add-grid,.mod-card { grid-template-columns:1fr; }
  .mod-assignment { border-left:0; border-top:1px solid var(--line); }
  .workspace-scan-row { flex-wrap:wrap; }
  .workspace-scan-row .primary { width:100%; }
  .workspace-scan-row .scan-submit { width:44px; }
  .workspace-start,.workspace-organization { padding:var(--space-4); }
  .form { padding:var(--space-4); }
  .log-row summary { grid-template-columns:1fr 1fr; }
  .log-text { grid-column:1/-1; }
  .log-filter input[type="search"] { min-width:0; }
  .reference-summary { display:block; }
}

/* Documents ГИС МТ */
.workspace-future > a { display:flex; gap:8px; align-items:center; font-size:13px; color:var(--accent); text-decoration:none; }
.workspace-future > a:hover { text-decoration:underline; }
.docs-page h1 { font-size:var(--text-page); letter-spacing:-.02em; }
.docs-head p { margin-top:6px; color:var(--muted); max-width:70ch; }
.docs-filter { margin:var(--space-4) 0 var(--space-2); }
.docs-field { display:grid; gap:var(--space-1); color:var(--muted); font-size:var(--text-meta); }
.docs-field input:not([type="checkbox"]):not([type="radio"]),.docs-field select,.docs-field textarea { min-height:var(--control-sm); }
.docs-field select { max-width:260px; }
.docs-number input { width:240px; font-family:var(--font-code); font-size:13px; }
/* «Входящие / Исходящие»: a segmented control as high as the other controls of the row — a grey track, the chosen
   option on a white plate. */
.docs-direction { display:inline-flex; flex:none; gap:2px; box-sizing:border-box; height:var(--control-sm); padding:2px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.docs-direction label { position:relative; display:flex; margin:0; }
.docs-direction input { position:absolute; opacity:0; pointer-events:none; }
.docs-direction span { display:flex; align-items:center; padding:0 var(--space-3); border-radius:7px; color:var(--muted); font-size:var(--text-support); font-weight:500; cursor:pointer; white-space:nowrap; }
.docs-direction span:hover { color:var(--fg); }
.docs-direction input:checked + span { background:var(--surface); color:var(--fg); box-shadow:var(--shadow); font-weight:600; }
.docs-direction input:focus-visible + span { outline:2px solid var(--focus); outline-offset:-2px; }
/* The toolbar of «Документы»: direction, search, period and more filters in one row; the status chips; the active choice. */
.docs-toolbar { display:grid; margin:var(--space-4) 0 var(--space-2); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.docs-bar { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); padding:var(--space-3); }
.docs-search { position:relative; display:flex; align-items:center; flex:1 1 260px; min-width:0; margin:0; }
.docs-search svg { position:absolute; left:var(--space-3); top:50%; width:16px; height:16px; transform:translateY(-50%); fill:none; stroke:var(--muted); stroke-width:1.8; stroke-linecap:round; pointer-events:none; }
.docs-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { height:var(--control-sm); min-height:0; padding-block:0; padding-left:36px; }
.docs-bar-button { min-height:var(--control-sm); padding:4px var(--space-3); font-size:var(--text-support); font-weight:500; }
.docs-bar-button svg { width:16px; height:16px; }
.docs-bar-button[aria-expanded="true"] { border-color:var(--accent); background:var(--accent-bg); }
.docs-more-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-2) var(--space-3); padding:0 var(--space-3) var(--space-3); }
.docs-more-filters .docs-field select { max-width:none; }
.docs-statuses { display:flex; flex-wrap:wrap; gap:var(--space-2); padding:var(--space-3); border-top:1px solid var(--line); }
.docs-status-chip { min-height:30px; padding:0 var(--space-3); border-color:var(--line); border-radius:999px; background:var(--surface); color:var(--fg); font-size:var(--text-support); font-weight:500; gap:6px; }
.docs-status-chip:hover { background:var(--surface-2); }
.docs-status-chip b { color:var(--muted); font-weight:500; font-variant-numeric:tabular-nums; }
.docs-status-chip b:empty { display:none; }
.docs-status-chip[data-tone="bad"] b { color:var(--bad); }
.docs-status-chip[aria-pressed="true"],.docs-status-chip[aria-pressed="true"]:hover { border-color:var(--accent); background:var(--accent-bg); color:var(--accent); }
.docs-status-chip[aria-pressed="true"] b { color:var(--accent); }
.docs-active { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); padding:var(--space-2) var(--space-3); border-top:1px solid var(--line); color:var(--muted); font-size:var(--text-meta); }
.docs-token { display:inline-flex; align-items:center; gap:2px; padding:2px 2px 2px var(--space-2); border-radius:6px; background:var(--surface-2); color:var(--fg); }
.docs-token-clear { min-height:22px; padding:0 6px; border:0; background:none; color:var(--muted); font-size:14px; font-weight:400; }
.docs-token-clear:hover { background:var(--line); color:var(--fg); }
.docs-active .link-button { font-size:var(--text-meta); }
.docs-message { min-height:20px; margin:var(--space-1) 0; color:var(--muted); }
.docs-group-errors { margin:0 0 10px; padding:10px 14px 10px 30px; border-radius:var(--radius-sm); background:var(--warn-bg); color:var(--fg); font-size:13px; }
.docs-table { font-size:var(--text-body); }
.docs-table th { padding:var(--space-2) var(--space-3); border-bottom:1px solid var(--line); background:var(--surface-2); }
.docs-table td { padding:var(--space-3); border-bottom:1px solid var(--line); }
.doc-row { cursor:pointer; }
.doc-row:hover,.doc-row:focus-visible { background:var(--tint); outline:none; }
/* The edge of a row: an error, or a document waiting for a signature or the acceptance. */
.doc-row-bad > td:first-child { box-shadow:inset 3px 0 0 var(--bad); }
.doc-row-wait > td:first-child { box-shadow:inset 3px 0 0 var(--warn); }
.doc-date { white-space:nowrap; font-variant-numeric:tabular-nums; color:var(--muted); }
.doc-date small { display:block; font-size:12px; }
.doc-main strong { display:block; font-weight:600; }
.doc-main small,.doc-party small { display:block; margin-top:2px; color:var(--muted); font-size:12px; }
.doc-main .doc-row-error { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px var(--space-3); margin-top:6px; color:var(--bad); }
.doc-row-error .link-button { font-size:12px; }
.doc-group { color:var(--muted); font-size:13px; }
.doc-actions { text-align:right; white-space:nowrap; }
.docs-more { display:flex; justify-content:center; }
.docs-more button { margin:12px; }
.doc-backdrop { position:fixed; inset:0; z-index:40; background:var(--overlay-soft); }
.doc-card { position:fixed; top:0; right:0; bottom:0; z-index:41; width:min(760px, 100vw); display:flex; flex-direction:column; background:var(--surface); border-left:1px solid var(--line); box-shadow:var(--shadow); outline:none; }
.doc-card[hidden],.doc-backdrop[hidden] { display:none; }
.doc-card-dialog { left:auto; margin:0; height:100dvh; max-height:100dvh; max-width:100vw; padding:0; border:0; border-left:1px solid var(--line); color:var(--fg); }
.doc-card-footer { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); padding:var(--space-4); padding-bottom:max(var(--space-4),env(safe-area-inset-bottom)); border-top:1px solid var(--line); }
body.doc-open { overflow:hidden; }
.doc-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:var(--space-3); padding:var(--space-4); border-bottom:1px solid var(--line); }
.doc-card-head > div { min-width:0; }
.doc-card-head h2 { font-size:20px; letter-spacing:-.01em; overflow-wrap:anywhere; }
.doc-card-kicker { color:var(--muted); font-size:12px; }
.doc-card-head .icon-button { font-size:22px; line-height:1; }
.doc-card-body { flex:1; overflow:auto; padding:var(--space-4) var(--space-4) var(--space-5); }
.doc-card-status { display:flex; gap:10px; align-items:center; color:var(--muted); font-size:13px; }
.doc-pending { display:grid; justify-items:start; gap:var(--space-2); padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2); }
.doc-pending p { margin:0; color:var(--muted); font-size:var(--text-support); }
.doc-errors { margin:14px 0 4px; padding:12px 14px; border-radius:var(--radius-sm); background:var(--bad-bg); }
.doc-errors h3 { font-size:14px; color:var(--bad); }
.doc-errors ul { margin:6px 0 0; padding-left:18px; font-size:14px; }
.doc-errors li + li { margin-top:6px; }
.doc-meta { margin-top:6px; }
.doc-sub { display:block; color:var(--muted); font-size:12px; font-weight:400; }
.doc-id { display:flex; flex-wrap:wrap; gap:4px 10px; align-items:baseline; }
.doc-id code,.doc-code code { font:13px/1.5 var(--font-code); overflow-wrap:anywhere; }
.doc-code { display:inline-flex; flex-wrap:wrap; gap:2px 8px; align-items:baseline; }
.doc-code .link-button { font-size:12px; }
.doc-section { margin-top:18px; }
.doc-section h3 { margin-bottom:6px; font-size:15px; }
.doc-section > .notice { margin:0 0 var(--space-2); }
.doc-object-fields { display:grid; gap:2px; margin-top:4px; font-size:14px; }
.doc-object-fields small { color:var(--muted); }
.doc-table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius-sm); }
.doc-table-wrap > button { margin:10px; }
.doc-products { font-size:var(--text-support); }
.doc-products th { padding:var(--space-2); background:var(--surface-2); white-space:nowrap; }
.doc-products td { padding:var(--space-2); border-top:1px solid var(--line); }
.doc-products .doc-product-note { min-width:240px; max-width:360px; white-space:normal; overflow-wrap:anywhere; }
.doc-products tfoot :is(th,td) { border-top:1px solid var(--line-strong); background:var(--surface-2); color:var(--fg); font-weight:600; font-variant-numeric:tabular-nums; }
.doc-plain-list { margin:0; padding-left:22px; font-size:13px; }
.doc-raw { margin-top:18px; font-size:13px; }
.doc-raw pre { max-height:360px; overflow:auto; padding:10px; border-radius:var(--radius-sm); background:var(--surface-2); font:12px/1.5 var(--font-code); }
.doc-loading,.doc-muted { color:var(--muted); }
.doc-error { color:var(--bad); }
@media (max-width:760px) {
  .docs-filter { padding:12px; }
  .docs-field,.docs-number input,.docs-field select { width:100%; max-width:none; }
  .docs-date { width:calc(50% - 6px); }
  .docs-filter > button { width:100%; }
  .docs-search { flex-basis:100%; }
  .docs-more-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .docs-statuses { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
  .docs-status-chip { flex:none; }
  .docs-table thead { display:none; }
  .docs-table tr { display:grid; grid-template-columns:1fr auto; gap:2px 10px; padding:12px 14px; border-bottom:1px solid var(--line); }
  .docs-table td { padding:0; border:0; }
  .doc-date { grid-column:1; font-size:12px; }
  .doc-date small { display:inline; margin-left:6px; }
  .doc-status-cell { grid-column:2; grid-row:1; }
  .doc-main,.doc-party,.doc-group,.doc-actions { grid-column:1 / -1; }
  .doc-actions { text-align:left; margin-top:var(--space-1); }
  .doc-row-bad > td:first-child,.doc-row-wait > td:first-child { box-shadow:none; }
  .docs-table tr.doc-row-bad { box-shadow:inset 3px 0 0 var(--bad); }
  .docs-table tr.doc-row-wait { box-shadow:inset 3px 0 0 var(--warn); }
  .doc-card { width:100vw; border-left:0; }
  .doc-card-body { padding:12px 16px 24px; }
}.doc-card-tools { display:flex; gap:6px; }
.doc-card-tools svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.doc-card-tools [aria-pressed="true"] { color:var(--accent); border-color:var(--accent); }
.doc-card.doc-card-wide { width:min(1400px, 100vw); }
.doc-card-wide .doc-meta { grid-template-columns:repeat(3,minmax(0,1fr)); }
.doc-search { display:flex; align-items:center; gap:10px; padding:10px 20px; border-bottom:1px solid var(--line); background:var(--surface-2); }
.doc-search input { flex:1; min-width:0; min-height:36px; padding:6px 12px; border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--fg); font:14px var(--font-ui); }
.doc-search small { color:var(--muted); font-size:12px; white-space:nowrap; }
.doc-search[hidden] { display:none; }
.doc-id-row { display:grid; gap:2px; margin:12px 0 4px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2); }
.doc-id-row > span:first-child { color:var(--muted); font-size:12px; }
.doc-id-row .doc-id code { font-size:14px; }
.doc-actions { margin:12px 0 4px; }
.doc-edo-status { margin-bottom:8px; font-size:13px; color:var(--muted); }
.doc-action-row { display:flex; flex-wrap:wrap; gap:8px; }
.doc-soon { color:var(--muted); border-style:dashed; }
.doc-soon-tag { margin-left:6px; padding:0 6px; border-radius:999px; background:var(--surface-2); font-size:11px; font-weight:400; }
.doc-action-message { min-height:0; margin-top:8px; font-size:13px; }
.doc-action-message:empty { display:none; }
.doc-action-message[data-tone="ok"] { color:var(--ok); }
.doc-action-message[data-tone="bad"] { color:var(--bad); }
.doc-action-message[data-tone="wait"] { color:var(--muted); }
.doc-hit { background:var(--warn-bg); border-radius:4px; }
.doc-table-wrap > button[hidden] { display:none; }
@media (max-width:760px) { .doc-card-wide .doc-meta { grid-template-columns:1fr; } .doc-search { padding:8px 16px; } }.doc-block-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin-bottom:8px; }
.doc-block-head h3 { margin:0; }
.doc-block-head .doc-search { flex:1 1 260px; padding:0; border:0; background:none; }/* Left menu: badge and the wide mode */
.rail-badge { position:absolute; top:3px; right:8px; min-width:17px; height:17px; padding:0 5px; border-radius:999px; background:var(--warn); color:var(--white); font:600 10.5px/17px var(--font-ui); text-align:center; }
.rail-toggle { margin-top:auto; }
.rail-toggle + .rail-theme { margin-top:0; }
@media (min-width:701px) {
  :root[data-rail="wide"] { --rail:232px; }
  :root[data-rail="wide"] .rail { align-items:stretch; padding:12px 8px; }
  :root[data-rail="wide"] .rail-brand { justify-items:start; width:auto; margin-left:6px; }
  :root[data-rail="wide"] .rail-brand .rail-brand-mark { display:none; }
  :root[data-rail="wide"] .rail-brand .rail-brand-full { display:block; }
  :root[data-rail="wide"] .rail-link { flex-direction:row; justify-content:flex-start; gap:12px; min-height:36px; padding:0 12px; font-size:14px; text-align:left; }
  :root[data-rail="wide"] .rail-link .rail-short { display:none; }
  :root[data-rail="wide"] .rail-link .rail-full { display:inline; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  :root[data-rail="wide"] .rail-badge { position:static; margin-left:auto; }
  :root[data-rail="wide"] .rail-toggle svg { transform:scaleX(-1); }
}.docs-tabs { display:flex; gap:4px; margin:16px 0 0; border-bottom:1px solid var(--line); }
.docs-tabs button { position:relative; min-height:40px; padding:8px 14px; border:0; border-bottom:2px solid transparent; border-radius:0; background:none; color:var(--muted); font:500 14px var(--font-ui); cursor:pointer; }
.docs-tabs button:hover { color:var(--fg); background:none; }
.docs-tabs button[aria-selected="true"] { color:var(--accent); border-bottom-color:var(--accent); }
.docs-tab-count { display:inline-block; min-width:20px; margin-left:4px; padding:0 6px; border-radius:999px; background:var(--warn); color:var(--white); font-size:11.5px; line-height:19px; text-align:center; }
.docs-tab-count[hidden] { display:none; }
.docs-sign-note { margin:14px 2px 0; color:var(--muted); font-size:13px; }
.doc-source { display:block; margin-top:4px; color:var(--muted); font-size:11.5px; }/* Collapsed menu on a computer: icons only, the titles appear in the wide mode (and as tooltips). */
@media (min-width:701px) { :root:not([data-rail="wide"]) .rail-link .rail-short { display:none; } }

/* Menu groups: a thin divider in the collapsed menu, a caption in the wide one. On the phone the bottom bar keeps
   «Сегодня», «Приёмка», «Проверка» and «Ещё»; «Ещё» opens every section as a sheet. */
.rail-group { flex-shrink:0; width:60%; height:1px; margin:4px 0; background:var(--line); }
.rail-group .rail-full { display:none; }
.rail-more { display:none; }
.rail-link { flex-shrink:0; }
@media (min-width:701px) {
  :root[data-rail="wide"] .rail-group { width:auto; height:auto; margin:8px 12px 0; background:none; }
  :root[data-rail="wide"] .rail-group .rail-full { display:block; font-size:11px; font-weight:500; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
}
@media (max-width:700px) {
  .rail-group,.rail .rail-link:not(.rail-mobile) { display:none; }
  .rail-more { display:flex; }
  :root.rail-open .rail { inset:auto 0 0 0; max-height:82vh; flex-direction:column; flex-wrap:nowrap; justify-content:flex-start; align-items:stretch; overflow-y:auto; border-radius:18px 18px 0 0; box-shadow:0 -12px 40px rgb(10 20 30 / .25); padding:14px 12px calc(12px + env(safe-area-inset-bottom,0px)); }
  :root.rail-open .rail .rail-link { display:flex; flex-direction:row; justify-content:flex-start; gap:12px; max-width:none; min-height:44px; padding:0 12px; font-size:15px; }
  :root.rail-open .rail .rail-link .rail-short { display:none; }
  :root.rail-open .rail .rail-link .rail-full { display:inline; }
  :root.rail-open .rail .rail-badge { position:static; margin-left:auto; }
  :root.rail-open .rail-group { display:block; width:auto; height:auto; margin:10px 12px 2px; background:none; }
  :root.rail-open .rail-group .rail-full { display:block; font-size:11px; font-weight:500; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
  :root.rail-open .rail-more { order:-1; }
  :root.rail-open .rail-theme { display:flex; }
  :root.rail-open body::after { content:""; position:fixed; inset:0; z-index:9; background:var(--overlay-soft); }
}

/* «Подождите»: spinner over a list that is being refreshed; stale rows stay visible but dimmed. */
.is-busy { min-height:150px; }
.is-busy > :not(.busy-indicator) { opacity:.35; pointer-events:none; transition:opacity .2s; }
.busy-indicator { position:absolute; top:48px; left:50%; z-index:3; display:flex; align-items:center; gap:10px; padding:10px 18px; border:1px solid var(--line); border-radius:999px; background:var(--surface); box-shadow:var(--shadow); color:var(--fg); font-size:14px; white-space:nowrap; transform:translateX(-50%); }
.busy-block { display:flex; align-items:center; gap:10px; padding:18px 2px; color:var(--muted); font-size:14px; }
.busy-spinner { flex:0 0 auto; width:18px; height:18px; border:2px solid var(--line-strong); border-top-color:var(--accent); border-radius:50%; animation:doka-spin .8s linear infinite; }
@keyframes doka-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .busy-spinner { animation-duration:2.4s; } }
/* Deviation control: four tiles; on the home page every tile leads to its details */
.monitor-tile-link { color:inherit; text-decoration:none; transition:border-color .15s, box-shadow .15s, transform .15s; }
.monitor-tile-link:hover { border-color:var(--accent); box-shadow:var(--shadow); transform:translateY(-1px); }
.monitor-tile-link:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.monitor-compact .monitor-tiles { margin-bottom:0; }
.monitor-busy .monitor-status::before { content:""; display:inline-block; width:12px; height:12px; margin-right:8px; vertical-align:-1px; border:2px solid var(--line-strong); border-top-color:var(--accent); border-radius:50%; animation:doka-spin .8s linear infinite; }
.monitor-busy .monitor-tile strong { animation:doka-pulse 1.4s ease-in-out infinite; }
@keyframes doka-pulse { 50% { opacity:.45; } }
@media (prefers-reduced-motion:reduce) { .monitor-busy .monitor-tile strong { animation:none; } }
/* Goods with their codes */
.doc-toggle-col { width:64px; white-space:nowrap; }
.doc-toggle { min-height:26px; padding:2px 10px 2px 8px; border:1px solid var(--line-strong); border-radius:999px; background:var(--surface); color:var(--fg); font:500 12px var(--font-ui); cursor:pointer; }
.doc-toggle::before { content:"▸"; display:inline-block; margin-right:5px; color:var(--muted); transition:transform .15s; }
.doc-toggle[aria-expanded="true"] { border-color:var(--accent); color:var(--accent); }
.doc-toggle[aria-expanded="true"]::before { transform:rotate(90deg); color:var(--accent); }
.doc-codes-row > td { padding:4px 10px 12px 64px; background:var(--surface-2); }
.doc-codes-row[hidden] { display:none; }
.doc-code-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:4px 16px; }
.doc-code-item { padding:3px 6px; border-radius:6px; }
.doc-code-item code { font-size:12px; }
.doc-code-item small.tone-bad { display:block; color:var(--bad); font-size:var(--text-meta); }
@media (max-width:760px) { .doc-codes-row > td { padding-left:10px; } .doc-code-list { grid-template-columns:1fr; } }
/* Codes of a line: one per row */
.doc-code-list { grid-template-columns:1fr; gap:2px; }
/* Delivery check by scanning */
.doc-check { margin:14px 0 6px; padding:14px 16px; border:1px solid var(--accent); border-radius:var(--radius); background:var(--accent-bg); }
.doc-check-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.doc-check-head h3 { margin:0; font-size:16px; }
.doc-check > .doc-muted { margin:6px 0 10px; font-size:13px; }
.doc-check-input { width:100%; min-height:44px; padding:8px 14px; border:2px solid var(--accent); border-radius:var(--radius-sm); background:var(--surface); color:var(--fg); font:15px var(--font-code); }
.doc-check-feedback { min-height:20px; margin:8px 2px; font-size:14px; font-weight:500; }
.doc-check-feedback[data-tone="ok"] { color:var(--ok); }
.doc-check-feedback[data-tone="bad"] { color:var(--bad); }
.doc-check-feedback[data-tone="wait"] { color:var(--warn); }
.doc-check-progress { height:8px; border-radius:999px; background:var(--surface); overflow:hidden; }
.doc-check-progress span { display:block; width:100%; height:100%; background:var(--accent); transform:scaleX(0); transform-origin:left center; transition:transform .2s cubic-bezier(.23,1,.32,1); }
.doc-check-progress[data-done="true"] span { background:var(--ok); }
.doc-check-counters { display:flex; flex-wrap:wrap; gap:6px 16px; margin:10px 0; font-size:13px; }
.doc-check-ok { color:var(--ok); font-weight:600; }
.doc-check-missing { color:var(--muted); }
.doc-check-extra { color:var(--bad); font-weight:600; }
.doc-check-line-ok td { color:var(--ok); }
.doc-check-extra-list { margin-top:10px; font-size:13px; }
.doc-check-start { margin-left:auto; }
/* A line of ОСУ: its GTIN after the name, the units received typed or counted by the scanner. */
.doc-check-osu { color:var(--muted); font:12px var(--font-code); }
.doc-check-qty { width:80px; min-height:var(--control-sm); margin-right:var(--space-1); font-variant-numeric:tabular-nums; }
/* ---------- Mark check: A + C on a computer, D on a phone ---------- */
.ck-layout { display:grid; grid-template-columns:340px minmax(0,1fr); gap:20px; align-items:start; }
.ck-session { position:sticky; top:16px; display:flex; flex-direction:column; max-height:calc(100vh - 120px); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.ck-scan { display:grid; gap:var(--space-2); padding:var(--space-4); border-bottom:1px solid var(--line); }
.ck-scan label { margin:0; font-size:13px; font-weight:600; }
.ck-scan-row { display:flex; align-items:center; width:100%; gap:var(--space-2); }
.ck-scan-row input { flex:1; min-width:0; min-height:44px; border:2px solid var(--accent); font:14px var(--font-code) !important; }
.ck-scan-row .scan-submit { flex:0 0 44px; width:44px; min-height:44px; padding:0; }
.ck-scan-row input::placeholder { font-family:var(--font-ui); font-size:var(--text-support); }
.ck-scan-row .scan-submit svg { width:20px; height:20px; }
.ck-counters { display:flex; flex-wrap:wrap; gap:6px; }
.ck-counters[hidden],.ck-pill[hidden] { display:none; }
.ck-list { flex:1; margin:0; padding:4px 0; list-style:none; overflow:auto; }
.ck-item { display:flex; align-items:center; gap:10px; width:100%; min-height:52px; padding:8px 16px; border:0; border-left:3px solid transparent; border-radius:0; background:none; color:var(--fg); text-align:left; cursor:pointer; }
.ck-item:hover { background:var(--surface-2); }
.ck-item.is-active { background:var(--accent-bg); border-left-color:var(--accent); }
.ck-item-text { flex:1; min-width:0; display:grid; }
.ck-item-text strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:500; }
.ck-item-text small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; color:var(--muted); }
.ck-item-text small.tone-bad { color:var(--bad); } .ck-item-text small.tone-warn { color:var(--warn); }
.ck-item time { color:var(--muted); font-size:12px; }
.ck-dot { flex:0 0 10px; width:10px; height:10px; border-radius:50%; background:var(--line-strong); }
.ck-dot.tone-ok { background:var(--ok); } .ck-dot.tone-warn { background:var(--warn); } .ck-dot.tone-bad { background:var(--bad); }
.ck-empty { margin:0; font-size:var(--text-support); }
.ck-session-actions { padding:10px 16px; border-top:1px solid var(--line); }
.ck-session .demo-samples { padding:12px 16px; border-bottom:1px solid var(--line); }
.ck-placeholder { display:grid; gap:6px; place-content:center; min-height:320px; padding:24px; border:1px dashed var(--line-strong); border-radius:var(--radius); color:var(--muted); text-align:center; }
.ck-placeholder strong { color:var(--fg); font-size:18px; }
.ck-placeholder[hidden],.ck-result[hidden] { display:none; }
.ck-result { min-width:0; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.ck-head { display:flex; gap:18px; align-items:center; padding:18px 22px; border-bottom:1px solid var(--line); }
.ck-badge { display:grid; place-items:center; flex:0 0 60px; width:60px; height:60px; border-radius:14px; background:var(--surface-2); color:var(--muted); }
.ck-badge svg { width:28px; height:28px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.ck-result[data-tone="ok"] .ck-badge { background:var(--ok-bg); color:var(--ok); }
.ck-result[data-tone="warn"] .ck-badge { background:var(--warn-bg); color:var(--warn); }
.ck-result[data-tone="bad"] .ck-badge { background:var(--bad-bg); color:var(--bad); }
.ck-head-text { flex:1; min-width:0; display:grid; gap:4px; }
.ck-head-line { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; }
.ck-status { padding:3px 10px; border-radius:999px; background:var(--surface-2); font-size:13px; font-weight:600; }
.ck-result[data-tone="ok"] .ck-status { background:var(--ok-bg); color:var(--ok); }
.ck-result[data-tone="warn"] .ck-status { background:var(--warn-bg); color:var(--warn); }
.ck-result[data-tone="bad"] .ck-status { background:var(--bad-bg); color:var(--bad); }
.ck-kind { color:var(--muted); font-size:13px; }
.ck-head h1 { margin:0; font-size:21px; font-weight:600; letter-spacing:-.01em; overflow-wrap:anywhere; }
.ck-code { display:flex; flex-wrap:wrap; gap:4px 14px; margin:0; color:var(--muted); font-size:13px; }
.ck-code code { font:13px var(--font-code); overflow-wrap:anywhere; }
.ck-alert { margin:0; padding:12px 22px; border-bottom:1px solid var(--line); font-size:14px; font-weight:500; }
.ck-alert[hidden] { display:none; }
.ck-alert[data-tone="bad"] { background:var(--bad-bg); color:var(--bad); }
.ck-alert[data-tone="warn"] { background:var(--warn-bg); color:var(--warn); }
/* Under the alert of a code out of turnover: «Вернуть в оборот» and when it is needed. */
.ck-return { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2) var(--space-3); padding:var(--space-3) 22px; border-bottom:1px solid var(--line); }
.ck-return small { flex:1 1 280px; color:var(--muted); font-size:var(--text-meta); }
.ck-facts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:0; border-bottom:1px solid var(--line); }
.ck-fact { padding:12px 22px; border-right:1px solid var(--line); min-width:0; }
.ck-fact:last-child { border-right:0; }
.ck-fact dt { color:var(--muted); font-size:12px; }
.ck-fact dd { margin:3px 0 0; font-size:15px; font-weight:600; overflow-wrap:anywhere; }
.ck-fact dd small { display:block; color:var(--muted); font-size:12px; font-weight:400; }
.ck-fact[data-tone="bad"] dd { color:var(--bad); } .ck-fact[data-tone="warn"] dd { color:var(--warn); }
.ck-lifecycle-wrap { padding:16px 22px; border-bottom:1px solid var(--line); }
.ck-lifecycle-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.ck-lifecycle-head h2 { font-size:14px; }
.ck-lifecycle-head span { color:var(--muted); font-size:12px; }
.ck-lifecycle { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin:0; padding:0; list-style:none; }
.ck-lifecycle li { position:relative; display:grid; justify-items:center; gap:4px; min-width:0; padding:0 6px; text-align:center; }
.ck-lifecycle li::before { content:""; position:absolute; top:10px; right:50%; width:100%; height:2px; background:var(--line); transform:translateX(-10px); }
.ck-lifecycle li:first-child::before { display:none; }
.ck-lifecycle-mark { position:relative; z-index:1; display:grid; place-items:center; width:22px; height:22px; border:2px solid var(--line-strong); border-radius:50%; background:var(--surface); color:var(--on-accent); font-size:11px; font-weight:700; }
.ck-lifecycle li[data-state="done"]::before,.ck-lifecycle li[data-state="active"]::before { background:var(--ok); }
.ck-lifecycle li[data-state="done"] .ck-lifecycle-mark { border-color:var(--ok); background:var(--ok); }
.ck-lifecycle li[data-state="active"] .ck-lifecycle-mark { border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-bg); }
.ck-lifecycle strong { font-size:12px; font-weight:600; }
.ck-lifecycle small { color:var(--muted); font-size:10.5px; line-height:1.25; }
.ck-lifecycle li[data-state="future"] { color:var(--muted); }
.ck-tab-select { display:none; }
.ck-tabs { display:flex; gap:2px; padding:0 14px; border-bottom:1px solid var(--line); overflow-x:auto; }
.ck-tabs button { flex:0 0 auto; min-height:44px; padding:0 12px; border:0; border-bottom:2px solid transparent; border-radius:0; background:none; color:var(--muted); font:500 14px var(--font-ui); cursor:pointer; }
.ck-tabs button:hover { color:var(--fg); background:none; }
.ck-tabs button[aria-selected="true"] { color:var(--accent); border-bottom-color:var(--accent); }
.ck-tabs button.is-empty:not([aria-selected="true"]) { color:var(--line-strong); }
.ck-panel { padding:6px 22px 18px; }
.ck-panel[hidden] { display:none; }
.ck-table-wrap { overflow-x:auto; }
.ck-table { width:100%; border-collapse:collapse; font-size:14px; }
.ck-table th { padding:10px 10px 8px 0; text-align:left; color:var(--muted); font-size:12px; font-weight:500; border-bottom:1px solid var(--line); }
.ck-table td { padding:11px 10px 11px 0; border-bottom:1px solid var(--surface-2); vertical-align:top; }
.ck-when span,.ck-when small { display:block; } .ck-when small { color:var(--muted); font-size:12px; }
.ck-op { font-weight:600; }
.ck-mono { font:13px var(--font-code); overflow-wrap:anywhere; }
.ck-table .tone-bad { color:var(--bad); }
.ck-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:28px; margin:0; }
.ck-grid .ck-fact { padding:10px 0; border-right:0; border-bottom:1px solid var(--surface-2); }
.ck-grid .ck-fact dd { font-size:14px; font-weight:500; }
.ck-sub { display:block; color:var(--muted); font-size:12px; font-weight:400; }
.ck-empty-panel { margin:14px 0 4px; color:var(--muted); }
.ck-next { display:none; }
@media (max-width:1100px) { .ck-facts { grid-template-columns:repeat(2,minmax(0,1fr)); } .ck-fact:nth-child(2) { border-right:0; } .ck-fact:nth-child(-n+2) { border-bottom:1px solid var(--line); } }
/* Phone / ТСД (reference D): one column, a big colored verdict, pill tabs, the scan button at the bottom. */
@media (max-width:700px) {
  .ck-layout { grid-template-columns:1fr; gap:14px; }
  .ck-session { position:static; max-height:none; order:2; }
  .ck-result,.ck-placeholder { order:1; }
  .ck-list { max-height:260px; }
  .ck-head { flex-direction:column; align-items:flex-start; gap:8px; padding:22px 18px 18px; border:0; }
  .ck-result[data-tone="ok"] .ck-head { background:var(--ok); color:#fff; }
  .ck-result[data-tone="warn"] .ck-head { background:var(--warn); color:#fff; }
  .ck-result[data-tone="bad"] .ck-head { background:var(--bad); color:#fff; }
  .ck-result[data-tone] .ck-head .ck-status { background:rgba(255,255,255,.2); color:#fff; font-size:22px; padding:0; background:none; }
  .ck-result[data-tone] .ck-head .ck-kind,.ck-result[data-tone] .ck-head .ck-code { color:rgba(255,255,255,.85); }
  .ck-badge { display:none; }
  .ck-head h1 { font-size:var(--text-subheading); }
  .ck-facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:12px; border:0; background:var(--bg); }
  .ck-fact,.ck-fact:nth-child(-n+2) { padding:10px 12px; border:1px solid var(--line) !important; border-radius:12px; background:var(--surface); }
  .ck-lifecycle-wrap { padding:14px 12px; }
  .ck-lifecycle { display:flex; overflow-x:auto; padding:4px 0 6px; scroll-snap-type:x proximity; }
  .ck-lifecycle li { flex:0 0 112px; scroll-snap-align:start; }
  .ck-tab-select { display:grid; gap:4px; margin:12px 12px 6px; color:var(--muted); font-size:12px; }
  .ck-tab-select span { font-weight:600; }
  .ck-tabs { display:none; }
  .ck-tabs button { min-height:36px; padding:0 14px; border:1px solid var(--line); border-radius:999px; background:var(--surface); }
  .ck-tabs button[aria-selected="true"] { border-color:var(--fg); background:var(--fg); color:var(--surface); }
  .ck-panel { padding:4px 12px 14px; }
  .ck-grid { grid-template-columns:1fr; }
  .ck-next { display:block; position:fixed; left:12px; right:12px; bottom:calc(76px + env(safe-area-inset-bottom,0px)); z-index:9; min-height:52px; border-radius:12px; font-size:16px; box-shadow:var(--shadow); }
  .sheet-check { padding-bottom:70px; }
}@media (max-width:700px) {
  .ck-table thead { display:none; }
  .ck-table, .ck-table tbody { display:block; }
  .ck-table tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 10px; margin-bottom:8px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
  .ck-table td { padding:0; border:0; }
  .ck-table td:first-child { grid-column:2; grid-row:1; text-align:right; color:var(--muted); font-size:13px; }
  .ck-table td:nth-child(2) { grid-column:1; grid-row:1; font-weight:600; }
  .ck-table td:nth-child(n+3) { grid-column:1 / -1; color:var(--muted); font-size:13px; }
}
.ck-item-meta { display:grid; justify-items:end; gap:2px; }
.ck-item-meta time { color:var(--muted); font-size:12px; }
.ck-device { padding:0 6px; border-radius:999px; background:var(--surface-2); color:var(--muted); font-size:10.5px; white-space:nowrap; }

/* «Войти на телефоне» */
.share-dialog { width:min(420px, calc(100vw - 32px)); }
.share-close-row { display:flex; justify-content:space-between; align-items:center; }
.share-close-row h2 { margin:0; font-size:18px; }
.share-hint,.share-note { color:var(--muted); font-size:13px; }
.share-note:empty { display:none; }
.share-qr { display:grid; place-items:center; width:240px; height:240px; margin:8px auto; padding:8px; border-radius:12px; background:#fff; }
.share-qr svg { width:100%; height:100%; }
.share-qr.is-expired { opacity:.15; }
/* The certificate page: one column of instructions; the fingerprint and the file names wrap anywhere. */
.cert-page { display:grid; gap:var(--space-3); width:100%; max-width:720px; margin:0 auto; padding:var(--space-5); }
.cert-page p,.cert-page ol { margin:0; }
.cert-page code { overflow-wrap:anywhere; }
.cert-page ol { padding-left:var(--space-5); }
.cert-page h2 { margin-top:var(--space-3); }
.cert-qr { padding:var(--space-3) var(--space-4); border:1px solid var(--line); border-radius:var(--radius); }
.cert-qr p { margin:0; color:var(--muted); font-size:var(--text-meta); }
.share-timer { margin:4px 0 10px; text-align:center; font-weight:600; }
.share-link-row { display:flex; gap:8px; margin-bottom:8px; }
.share-link-row input { flex:1; min-width:0; font:12px var(--font-code); }
.link-result { max-width:480px; margin:40px auto; padding:24px; }
/* Camera and photo next to the scan fields */
.scan-buttons { display:inline-flex; align-items:center; gap:4px; flex:0 0 auto; position:relative; }
.scan-button { display:grid; place-items:center; width:40px; min-height:40px; padding:0; border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--muted); cursor:pointer; }
.scan-button:hover { color:var(--accent); border-color:var(--accent); background:var(--surface); }
.scan-button svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.scan-buttons.is-compact .scan-button { width:30px; min-height:30px; border:0; background:transparent; }
.scan-note { position:absolute; top:100%; right:0; z-index:5; width:max-content; max-width:260px; margin-top:4px; padding:6px 10px; border-radius:8px; background:var(--fg); color:var(--surface); font-size:12px; }
.scan-note:empty { display:none; }
.scan-layer { position:fixed; inset:0; z-index:60; display:grid; place-items:center; background:rgb(0 0 0 / .85); }
.scan-box { position:relative; display:grid; gap:var(--space-3); width:min(560px, 100vw); padding:var(--space-3); outline:none; }
/* The view of the camera (or the photo) and the square the mark is aimed into: exactly this square is read. */
.scan-view { position:relative; width:100%; max-height:70vh; aspect-ratio:4 / 3; overflow:hidden; border-radius:14px; background:#000; }
.scan-view video,.scan-photo { width:100%; height:100%; object-fit:cover; }
.scan-photo { object-fit:contain; }
.scan-frame { position:absolute; top:50%; left:50%; height:62%; aspect-ratio:1; transform:translate(-50%, -50%); border:4px solid var(--bad); border-radius:12px;
  box-shadow:0 0 0 9999px rgb(0 0 0 / .4); pointer-events:none; transition:border-color .12s, background-color .12s; }
.scan-frame[data-state="outside"] { border-color:var(--warn); border-style:dashed; }
.scan-frame[data-state="ok"] { border-color:var(--ok); background:rgb(0 0 0 / .15); }
.scan-frame svg { display:none; position:absolute; top:50%; left:50%; width:48px; height:48px; margin:-24px 0 0 -24px; fill:none; stroke:var(--ok); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.scan-frame[data-state="ok"] svg { display:block; }
.scan-box.is-photo .scan-frame,.scan-frame[data-state="none"] { display:none; }
.scan-box.camera-unavailable .scan-view { display:none; }
.scan-box.camera-unavailable { width:min(460px, calc(100vw - 24px)); padding:var(--space-5); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); }
.scan-box.camera-unavailable .scan-text { color:var(--fg); line-height:1.5; }
.scan-text { margin:0; color:#fff; text-align:center; font-size:15px; }
.scan-actions { display:flex; flex-wrap:wrap; gap:var(--space-2); justify-content:center; }
.scan-actions [aria-pressed="true"] { border-color:var(--accent); color:var(--accent); }
@media (prefers-reduced-motion:reduce) { .scan-frame { transition:none; } }
@media (max-width:700px) { .scan-view { aspect-ratio:1; } }
.ck-scan-row .scan-buttons { order:3; }
.workspace-scan-row .scan-buttons .scan-button,.cr-scan-row .scan-button,.ck-scan-row .scan-button { min-height:44px; width:44px; }
@media (max-width:700px) { .scan-button { width:46px; min-height:46px; } }
/* «Остатки»: the fields of the filters share the width of the block; the search is the widest. */
.st-filter > .docs-field { flex:1 1 180px; min-width:0; }
.st-filter > .docs-number { flex-grow:2; }
.st-filter .docs-field :is(input, select) { width:100%; max-width:none; }
.st-qty { font-weight:600; }
.tone-bad-row td { background:var(--bad-bg); }
.doc-products td.tone-bad { color:var(--bad); font-weight:600; }
/* Stock: the warehouse of ГИС МТ — the balance now, the operations of the period, the documents behind a number */
.st-num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.st-wh-scroll { overflow-x:auto; }
.st-wh-table { border-collapse:separate; border-spacing:0; }
.st-wh-table thead { position:sticky; top:0; z-index:2; }
.st-wh-table tfoot { position:sticky; bottom:0; z-index:2; }
.st-wh-table thead th { min-width:88px; text-align:center; vertical-align:bottom; white-space:normal; border-bottom:1px solid var(--line); }
.st-wh-table tbody th { border-top:1px solid var(--line); }
.st-wh-table tfoot :is(th,td) { padding:var(--space-2); border-top:1px solid var(--line-strong); background:var(--surface-2); font-weight:600; }
.st-wh-table :is(.st-band,.st-start) { border-left:1px solid var(--line-strong); }
.st-wh-table .st-name { position:sticky; left:0; z-index:1; min-width:min(320px, 55vw); text-align:left; white-space:normal; font-weight:400; background:var(--surface); }
.st-wh-table :is(thead,tfoot) .st-name { background:var(--surface-2); font-weight:600; }
.st-wh-table tbody .st-name small { display:block; color:var(--muted); font-family:var(--font-code); }
.st-ops-list { max-height:60vh; overflow:auto; margin-bottom:var(--space-3); }
.st-unknown { display:grid; gap:var(--space-2); margin-top:var(--space-5); }
.st-unknown h3 { margin:0; font-size:var(--text-subheading); }
.st-unknown .cr-hint { margin:0; }
.st-open-codes { min-width:78px; }
.st-hit-note { display:block; color:var(--muted); font-size:var(--text-meta); }
/* The side card of a product: the summary (the values shared by all its codes) and the list of codes. */
.st-card :is(.doc-card-body,.st-card-content) { display:grid; grid-auto-rows:max-content; gap:var(--space-3); }
.st-card :is(.doc-card-body,.st-card-content) > .cr-hint { margin:0; }
/* The facts fill each row whole (no empty grey cells): a flexible row of cells, the wide ones on a row of their own. */
.st-card-summary { display:flex; flex-wrap:wrap; gap:1px; margin:0; background:var(--line); border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; }
.st-card-summary > div { flex:1 1 150px; min-width:0; padding:var(--space-2) var(--space-3); background:var(--surface); }
.st-card-summary > .st-card-wide { flex-basis:100%; }
.st-card-summary dt { color:var(--muted); font-size:var(--text-meta); }
.st-card-summary dd { margin:var(--space-1) 0 0; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.st-code-list { display:grid; margin:0; padding:0; list-style:none; border:1px solid var(--line); border-radius:var(--radius-sm); }
.st-code-item { display:grid; gap:var(--space-1); min-width:0; padding:var(--space-2) var(--space-3); border-top:1px solid var(--line); }
.st-code-item:first-child { border-top:0; }
.st-code-item.doc-hit { border-radius:0; }
.st-code-item .doc-code { display:flex; justify-content:space-between; gap:var(--space-1) var(--space-3); min-width:0; }
.st-code-item .doc-code code { min-width:0; }
.st-code-meta { display:flex; flex-wrap:wrap; gap:var(--space-1) var(--space-4); margin:0; color:var(--muted); font-size:var(--text-meta); }
.st-code-meta > div { display:flex; gap:var(--space-1); min-width:0; }
.st-code-meta dt::after { content:":"; }
.st-code-meta dd { margin:0; color:var(--fg); overflow-wrap:anywhere; }
.st-code-meta .tone-bad dd { color:var(--bad); }
.st-doc small { display:block; color:var(--muted); }

/* Creation of documents */
.cr-step { margin:var(--space-4) 0; padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.cr-step h2 { display:flex; align-items:center; gap:var(--space-2); margin:0 0 var(--space-3); font-size:var(--text-subheading); }
.cr-num { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:var(--accent); color:var(--on-accent); font-size:13px; font-weight:600; }
.cr-upd-note,.cr-hint { color:var(--muted); font-size:13px; }
/* «Создать документ»: the group as buttons, the type as tiles and a window with the whole catalog, then the document in
   blocks with «Готовность» beside it (create.js). */
.create-page .docs-head { margin-bottom:var(--space-4); }
.cr-pick-section { display:grid; gap:var(--space-2); margin-bottom:var(--space-4); }
.cr-label { margin:0; color:var(--fg); font-size:var(--text-support); font-weight:500; }
.cr-drafts[hidden] { display:none; }
.cr-draft-list { display:grid; gap:var(--space-2); margin:0; padding:0; list-style:none; }
.cr-draft { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2) var(--space-4); padding:var(--space-2) var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.cr-draft-text { display:grid; gap:2px; min-width:0; }
.cr-draft-text strong { font-weight:500; }
.cr-draft-text small { color:var(--muted); font-size:var(--text-meta); }
.cr-draft-actions { display:flex; align-items:center; gap:var(--space-3); }
.cr-group-list { display:grid; gap:var(--space-2); }
.cr-group-row { display:flex; flex-wrap:wrap; gap:var(--space-2); }
.cr-group-btn { min-height:var(--control-lg); padding:0 var(--space-4); border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--fg); font:500 var(--text-body) var(--font-ui); }
.cr-group-btn:hover { border-color:var(--accent); background:var(--surface); }
.cr-group-btn[aria-pressed="true"] { border:2px solid var(--accent); background:var(--accent-bg); color:var(--accent); }
.cr-group-more { border-style:dashed; color:var(--accent); }
.cr-group-search { max-width:320px; }
.cr-group-single { margin:0; padding:var(--space-3) var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.cr-quick { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-3); }
.cr-quick > .doc-error,.cr-quick > .docs-empty,.cr-quick > .busy-block { grid-column:1 / -1; margin:0; }
.cr-quick-tile { display:grid; grid-template-columns:24px minmax(0,1fr); align-items:center; gap:var(--space-3); min-height:60px; padding:var(--space-2) var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--fg); text-align:left; font:inherit; }
.cr-quick-tile:hover { border-color:var(--accent); background:var(--accent-bg); }
.cr-quick-tile[aria-pressed="true"] { border:2px solid var(--accent); background:var(--accent-bg); }
.cr-quick-tile[aria-pressed="true"] strong { color:var(--accent); }
.cr-quick-tile svg { width:22px; height:22px; fill:none; stroke:var(--accent); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.cr-quick-text { display:grid; gap:2px; min-width:0; }
.cr-quick-text strong { font-weight:500; line-height:1.3; }
.cr-quick-text small { color:var(--muted); font-size:var(--text-meta); line-height:1.3; }
.cr-quick-more { border-style:dashed; }
.cr-picker { width:min(860px, calc(100vw - 32px)); max-height:calc(100vh - 48px); padding:var(--space-5); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--fg); box-shadow:var(--shadow); }
.cr-picker[open] { display:flex; flex-direction:column; gap:var(--space-3); }
.cr-picker::backdrop { background:var(--overlay); }
.cr-picker-head { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-3); }
.cr-picker-head h2 { margin:0; font-size:var(--text-section); }
.cr-picker-head span { color:var(--muted); font-size:var(--text-support); }
.cr-type-search { width:100%; }
.cr-cats { display:flex; flex-wrap:wrap; gap:var(--space-2); }
.cr-cat[aria-pressed="true"],.cr-codes-toolbar .cr-cat.is-active { background:var(--accent-bg); border-color:var(--accent); color:var(--accent); }
.cr-cat.is-ok { color:var(--ok); } .cr-cat.is-bad { color:var(--bad); }
.cr-types { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:max-content; align-content:start; gap:var(--space-1) var(--space-5); min-height:0; overflow:auto; }
.cr-types > .doc-error,.cr-types > .docs-empty,.cr-cat-title { grid-column:1 / -1; }
.cr-cat-title { margin:var(--space-2) 0 0; color:var(--muted); font-size:var(--text-meta); font-weight:500; }
.cr-type { display:grid; justify-content:stretch; justify-items:start; align-content:start; gap:2px; width:100%; min-height:0; padding:var(--space-2) var(--space-3); border:0; border-radius:var(--radius-sm); background:transparent; color:var(--fg); text-align:left; font:inherit; }
.cr-type:hover { background:var(--surface-2); }
.cr-type[aria-checked="true"] { background:var(--accent-bg); color:var(--accent); }
.cr-type strong { font-weight:500; }
.cr-type small { color:var(--muted); font-size:var(--text-meta); line-height:1.4; font-weight:400; }
.cr-picker .cr-upd-note { margin:0; padding-top:var(--space-3); border-top:1px solid var(--line); }
.cr-work { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,300px); align-items:start; gap:var(--space-4); }
.cr-work[hidden] { display:none; }
.cr-main,.cr-doc-form { display:grid; gap:var(--space-4); min-width:0; }
.cr-doc-head { display:grid; gap:var(--space-1); }
.cr-doc-head h2 { margin:0; font-size:var(--text-section); }
.cr-doc-head .cr-hint { margin:0; }
.cr-block { display:grid; gap:var(--space-3); min-width:0; margin:0; padding:var(--space-4) var(--space-5); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.cr-block[hidden] { display:none; }
.cr-block > legend { float:left; width:100%; padding:0; font-size:var(--text-subheading); font-weight:600; }
.cr-block h3 { margin:0; font-size:var(--text-subheading); }
.cr-block .cr-form { margin:0; }
.cr-block-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:var(--space-2) var(--space-4); }
.cr-codes-tools { display:flex; flex-wrap:wrap; gap:var(--space-4); }
.cr-codes-tools[hidden],.cr-code-filters[hidden] { display:none; }
.cr-codes-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); min-width:0; }
.cr-code-filters { display:flex; flex-wrap:wrap; gap:var(--space-2); min-width:0; max-width:100%; }
.cr-mod-filter { flex:0 1 260px; min-width:0; max-width:100%; }
.cr-mod-filter > .docs-field { margin:0; }
.cr-codes-toolbar > .cr-hint { flex-basis:100%; margin:0; }
.cr-codes-toolbar select.cr-cat { padding-inline-end:var(--space-5); text-overflow:ellipsis; }
@media (max-width:700px) { .cr-codes-toolbar .cr-cat { min-height:var(--control-lg); } }
.cr-scan-note:empty { display:none; }
.cr-codes-table tr.cr-code-bad > td { background:var(--bad-bg); }
.cr-codes-table[data-mode="gtin"] .ck-mono { white-space:nowrap; overflow-wrap:normal; }
.cr-codes-table .cr-product-name { min-width:160px; max-width:320px; }
.cr-codes-table .cr-product-group { min-width:128px; }
.cr-codes-table tr.cr-code-note > td { padding-top:0; background:var(--bad-bg); font-size:var(--text-meta); }
.cr-codes-table tr.cr-code-bad:has(+ .cr-code-note) > td { border-bottom:0; }
/* The receipt of a line (its own primary document) under the code. */
.cr-code-receipt { display:block; color:var(--muted); font:var(--text-meta) var(--font-ui); }
.cr-code-remove { width:32px; min-height:32px; flex-basis:32px; font-size:18px; }
.cr-ready { position:sticky; top:84px; display:grid; gap:var(--space-3); padding:var(--space-5); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.cr-ready h2 { margin:0; font-size:var(--text-subheading); }
.cr-ready-list { display:grid; gap:var(--space-2); margin:0; padding:0; list-style:none; font-size:var(--text-support); }
.cr-ready-list li { display:grid; grid-template-columns:20px minmax(0,1fr); gap:var(--space-2); align-items:start; }
.cr-ready-mark { font-weight:600; text-align:center; }
.is-done .cr-ready-mark { color:var(--ok); } .is-todo .cr-ready-mark { color:var(--warn); }
.cr-ready .cr-errors:empty,.cr-ready .cr-result:empty { display:none; }
.cr-ready .cr-result { margin:0; }
.cr-ready-note { color:var(--muted); font-size:var(--text-meta); }
@media (max-width:1100px) { .cr-quick { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) {
  .cr-work { grid-template-columns:minmax(0,1fr); }
  .cr-ready { position:static; }
  .cr-types { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:520px) { .cr-quick { grid-template-columns:minmax(0,1fr); } .cr-picker { padding:var(--space-4); } }
/* УПД: the yearly limit of outgoing documents through the API of ЭДО Лайт — all, sent, left */
.upd-limit { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 18px; margin:0 0 16px; padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); font-size:14px; }
.upd-limit-title { font-weight:600; }
.upd-limit strong { font-size:16px; font-variant-numeric:tabular-nums; }
.upd-limit small { flex-basis:100%; color:var(--muted); }
.upd-limit[data-tone="warn"] { border-color:var(--warn); }
.upd-limit[data-tone="warn"] small { color:var(--warn); font-weight:600; }
.cr-form { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:var(--space-3) var(--space-4); margin:var(--space-2) 0 var(--space-4); }
/* The fields of a form are spaced by its gaps, not by the margin of a label. */
.cr-form > .docs-field { margin:0; }
.cr-mod-setting { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--space-3); min-width:0; }
.cr-mod-setting > .cr-field { flex:1 1 360px; min-width:0; margin:0; }
.cr-mod-mode { flex:0 1 260px; min-width:0; margin:0; }
.cr-field { align-content:start; }
.cr-field[hidden] { display:none; }
.cr-field.is-required > span:first-child:not(.cr-field-head)::after,.cr-field.is-required .cr-field-name::after { content:" *"; color:var(--bad); }
/* The name of a field with its explanation behind «?» (.field-help), and «+» inside the field: a window with the values. */
.cr-field-head { position:relative; display:flex; align-items:center; gap:var(--space-1); min-width:0; }
.cr-field-head .field-help { position:static; }
.cr-input { position:relative; display:block; min-width:0; }
.cr-input > input { width:100%; padding-right:calc(var(--control-sm) + var(--space-1)); }
.cr-choice-button { position:absolute; top:var(--space-1); right:var(--space-1); bottom:var(--space-1); width:auto; min-height:0; aspect-ratio:1; border-radius:var(--radius-sm); font-size:18px; line-height:1; }
.cr-field.is-off .cr-choice-button { display:none; }
.cr-choice { width:min(560px, calc(100vw - 32px)); }
.cr-choice > :not(.cr-choice-list) { flex-shrink:0; }
.cr-choice-list { display:grid; grid-template-columns:minmax(0,1fr); grid-auto-rows:max-content; align-content:start; gap:var(--space-1); min-height:0; padding:var(--space-1); overflow:auto; }
.cr-field-hint { color:var(--muted); font-size:var(--text-meta); }
.cr-field-error { color:var(--bad); font-size:var(--text-meta); }
.cr-field-error:empty { display:none; }
.cr-field.has-error select,.cr-field.has-error input { border-color:var(--bad); }
.cr-scan-row { display:flex; gap:8px; align-items:center; }
.cr-scan-row .cr-scan-input { flex:1; }
.cr-scan-row input { min-width:0; min-height:44px; font:13px var(--font-code); }
.cr-scan-input .cr-choice-button { color:var(--accent); }
.cr-choice-button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.cr-scan-note { min-height:18px; color:var(--muted); font-size:13px; }
.cr-scan-note[data-tone="warn"] { color:var(--warn); }
.cr-scan-note[data-tone="bad"] { color:var(--bad); font-weight:600; }
/* A mark scanned again: its row in the document flashes (no motion with reduced motion). */
.cr-codes-table tr.is-repeat > td { animation:cr-repeat 1.6s ease-out; }
@keyframes cr-repeat { 0%,40% { background:var(--warn-bg); } 100% { background:transparent; } }
@media (prefers-reduced-motion:reduce) { .cr-codes-table tr.is-repeat > td { animation:none; background:var(--warn-bg); } }
.cr-cell { width:120px; min-height:var(--control-sm); padding:var(--space-1) var(--space-2); }
@media (max-width:768px) { .cr-cell { min-height:var(--control-lg); } }
#cr-codes tr.has-error td { background:var(--bad-bg); }
.cr-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:14px; }
.access-actions { flex-wrap:nowrap; }
.access-actions form { display:flex; margin:0; }
.access-actions :is(button,.button) { min-height:var(--control-md); margin:0; white-space:nowrap; }
.cr-errors { color:var(--bad); font-size:13px; }
.cr-json { max-height:420px; overflow:auto; padding:12px; border-radius:var(--radius-sm); background:var(--surface-2); font:12.5px/1.5 var(--font-code); }
.cr-result { min-height:20px; font-weight:500; }
.docs-head + .cr-result:empty { display:none; }
.cr-result[data-tone="ok"] { color:var(--ok); } .cr-result[data-tone="bad"] { color:var(--bad); } .cr-result[data-tone="wait"] { color:var(--muted); } .cr-result[data-tone="warn"] { color:var(--warn); }
/* УПД (XML) */
.upd-parties { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--space-3); }
.upd-parties fieldset { display:grid; align-content:start; gap:var(--space-1); margin:0; padding:var(--space-2) var(--space-3) var(--space-3); border:1px solid var(--line); border-radius:var(--radius); }
.upd-parties legend { padding:0 6px; font-weight:600; }
/* A line of goods — a card: the number, the name read whole, the group and «Убрать»; the fields with their labels;
   the strip of «Состав» with the button that opens it. */
.upd-items-tools { display:flex; flex-wrap:wrap; align-items:end; gap:var(--space-2) var(--space-4); margin-bottom:var(--space-2); }
.upd-items-tools .upd-check { min-height:var(--control-sm); margin:0; }
.upd-inline-field { display:inline-flex; align-items:center; gap:var(--space-2); margin:0; color:var(--muted); font-size:var(--text-support); font-weight:400; }
.upd-inline-field select { width:auto; min-height:var(--control-sm); }
.upd-arm-prices { display:flex; flex-wrap:wrap; align-items:end; gap:var(--space-2); }
.upd-items-status { display:flex; flex-wrap:wrap; align-items:baseline; gap:var(--space-1) var(--space-3); margin:0 0 var(--space-2); }
.upd-items-status:not(:has(.upd-items-note:not(:empty), #upd-problems-open:not([hidden]))) { display:none; }
.upd-items-note { margin:0; }
.upd-items-note:empty { display:none; }
.upd-problems-table td:first-child { font-family:var(--font-code); font-size:var(--text-meta); overflow-wrap:anywhere; }
.upd-lines { container-type:inline-size; }
#upd-lines-body { display:grid; gap:var(--space-2); }
.upd-line { display:grid; gap:var(--space-2); padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); cursor:pointer; }
.upd-line:hover { border-color:var(--line-strong); }
.upd-line-head { display:flex; align-items:flex-start; gap:var(--space-2); }
.upd-line-num { min-width:16px; padding-top:var(--space-1); color:var(--muted); font-size:var(--text-support); font-variant-numeric:tabular-nums; }
/* The name reads as the title of the card; its frame shows on hover and focus, where it is edited. */
.upd-line-name { flex:1; min-width:0; padding-top:var(--space-1); font-weight:500; overflow-wrap:anywhere; }
.upd-line-name.is-empty { color:var(--muted); font-weight:400; }
.upd-line-group { align-self:center; padding:2px var(--space-2); border-radius:999px; background:var(--accent-bg); font-size:var(--text-meta); white-space:nowrap; }
.upd-line-group.is-alcohol { background:var(--warn-bg); }
.upd-line-fields { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:var(--space-2); margin:0 0 0 var(--space-5); }
.upd-line-fields dd { margin:0; }
.upd-value { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.upd-cell { display:grid; gap:var(--space-1); min-width:0; margin:0; }
.upd-cell-label { color:var(--muted); font-size:var(--text-meta); }
.upd-sum { text-align:right; font-weight:500; font-variant-numeric:tabular-nums; }
.upd-sum-cell .upd-cell-label { text-align:right; }
.upd-line-foot { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-1) var(--space-2); margin-left:var(--space-5); padding-top:var(--space-2); border-top:1px solid var(--line); font-size:var(--text-support); }
.upd-line-icon { display:inline-flex; color:var(--muted); }
.upd-line-icon svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.upd-line-state { padding:2px var(--space-2); border-radius:999px; background:var(--surface-2); color:var(--muted); font-size:var(--text-meta); }
.upd-line-state.is-warn { background:var(--warn-bg); color:var(--warn); }
.upd-composition-toggle { display:inline-flex; align-items:center; gap:var(--space-1); margin-left:auto; font-size:var(--text-support); text-decoration:none; }
.upd-composition-toggle:hover { text-decoration:underline; }
.upd-composition-toggle svg { width:16px; height:16px; }
.upd-line.has-error { border-color:var(--bad); background:var(--bad-bg); }
/* «Состав» of a line in the side card (doc-card): the summary of the check, its bar, the filter, the marks with check
   boxes and the actions on the chosen ones at the foot. */
.upd-comp-card .doc-card-body { display:grid; grid-auto-rows:max-content; gap:var(--space-3); padding-bottom:0; }
.upd-comp-chips,.upd-comp-tools { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-1) var(--space-2); }
.upd-comp-tools > .upd-comp-check { margin-left:auto; }
/* The goods of the line in the card: the name, then the unit, the quantity, the price and the VAT in one row. */
.upd-comp-goods { display:grid; gap:var(--space-3); padding-bottom:var(--space-3); border-bottom:1px solid var(--line); }
.upd-comp-goods .docs-field { margin:0; }
.upd-comp-name { field-sizing:content; min-height:var(--control-md); resize:vertical; font-family:var(--font-ui); }
.upd-comp-numbers { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-2); }
.upd-comp-total { margin:0; text-align:right; color:var(--muted); }
.upd-comp-sum { color:var(--fg); font-weight:500; font-variant-numeric:tabular-nums; }
@media (max-width: 480px) { .upd-comp-numbers { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.st-card-summary.upd-comp-summary > div { flex-basis:120px; }
.upd-comp-message { margin:0; }
.upd-comp-message:empty { display:none; }
.upd-comp-summary dd[data-tone="ok"] { color:var(--ok); }
.upd-comp-summary dd[data-tone="bad"] { color:var(--bad); }
.upd-comp-stamp { margin:0; }
.upd-comp-bar { display:flex; height:6px; margin-top:calc(-1 * var(--space-1)); border-radius:3px; overflow:hidden; background:var(--surface-2); }
.upd-comp-bar span { flex:1 1 0; background:var(--line-strong); }
.upd-comp-bar .is-ok { background:var(--ok); } .upd-comp-bar .is-warn { background:var(--warn); } .upd-comp-bar .is-bad { background:var(--bad); }
.upd-comp-all { margin:0; }
.st-code-item.upd-comp-code { grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:var(--space-2); }
.upd-comp-code code { font:12.5px/1.5 var(--font-code); overflow-wrap:anywhere; }
.upd-comp-actions { position:sticky; bottom:0; z-index:1; display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); padding:var(--space-3) 0; border-top:1px solid var(--line); background:var(--surface); }
.upd-comp-count { flex:1; color:var(--muted); font-size:var(--text-support); }
.upd-comp-card .upd-sub { margin:var(--space-2) 0 0; }
.upd-comp-card .cr-form,.upd-comp-card .upd-add-fields { margin:0; }
/* A narrow list (a phone, a narrow window): the fields two in a row. */
@container (max-width:520px) {
  .upd-line-fields { grid-template-columns:repeat(2,minmax(0,1fr)); margin-left:0; }
  .upd-line-foot { margin-left:0; }
  .upd-sum { text-align:left; }
  .upd-sum-cell .upd-cell-label { text-align:left; }
}
/* УПД, form of 19.10.2026: sections on the left (.cr-main), «Итого» and «Готовность» on the right (.cr-ready). */
.upd-main > .cr-step { min-width:0; margin:0; }
/* The fields of the form are spaced by the gaps of their grids, not by the margin of a label. */
.upd-main .docs-field { margin:0; }
.upd-step-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2); margin-bottom:var(--space-3); }
.upd-step-head h2 { margin:0; }
.upd-step-actions,.upd-step-foot { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2) var(--space-4); }
.upd-step-foot { justify-content:space-between; margin-top:var(--space-3); }
.upd-step-foot .upd-check { margin:0; }
.cr-form.upd-doc-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2fr); }
.upd-doc-row select { width:100%; }
/* The product groups of the document under «Итого»: from the lines, not chosen by hand. */
.upd-group-list { display:flex; flex-wrap:wrap; gap:var(--space-1); margin:0; padding:0; list-style:none; }
.upd-group-list li { padding:2px var(--space-2); border-radius:999px; background:var(--accent-bg); font-size:var(--text-support); }
.upd-group-list li.is-alcohol { background:var(--warn-bg); }
.upd-total { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:var(--space-1) var(--space-3); margin:0; font-size:var(--text-body); }
.upd-total dt { color:var(--muted); }
.upd-total dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; }
.upd-total .is-total { color:var(--fg); font-weight:600; }
.upd-side-actions { display:grid; gap:var(--space-2); }
.upd-side-actions .link-button { justify-self:start; }
.upd-side .upd-limit { margin:0; padding:var(--space-2) var(--space-3); font-size:var(--text-support); }
/* Грузоотправитель and грузополучатель: a choice as a row of buttons (radio inputs). */
.upd-cargo { display:grid; gap:var(--space-3); margin-top:var(--space-4); }
.upd-cargo-item { display:grid; gap:var(--space-2); align-content:start; min-width:0; }
.upd-segment { display:grid; gap:var(--space-1); min-width:0; margin:0; padding:0; border:0; }
.upd-segment legend { margin-bottom:var(--space-1); padding:0; color:var(--muted); font-size:var(--text-meta); font-weight:500; }
.upd-segment-row { display:flex; flex-wrap:wrap; width:fit-content; max-width:100%; border:1px solid var(--line-strong); border-radius:var(--radius-sm); overflow:hidden; }
.upd-segment-row label { position:relative; }
.upd-segment-row input { position:absolute; inset:0; margin:0; opacity:0; cursor:pointer; }
.upd-segment-row span { display:flex; align-items:center; min-height:var(--control-sm); padding:0 var(--space-3); border-left:1px solid var(--line); font-size:var(--text-support); }
.upd-segment-row label:first-child span { border-left:0; }
.upd-segment-row input:checked + span { background:var(--accent-bg); color:var(--accent); font-weight:600; }
.upd-segment-row input:focus-visible + span { outline:2px solid var(--focus); outline-offset:-2px; }
/* The seller and the signer: one line from the sign-in, the fields under «Изменить». */
.upd-own { align-self:start; padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-2); }
.upd-signer { margin-top:var(--space-4); }
.upd-own > summary { display:flex; align-items:flex-start; justify-content:space-between; gap:var(--space-3); cursor:pointer; list-style:none; }
.upd-own > summary::-webkit-details-marker { display:none; }
.upd-own[open] > summary { margin-bottom:var(--space-3); }
.upd-own-head { display:grid; gap:2px; min-width:0; }
.upd-own-title { font-weight:600; }
.upd-own-line { color:var(--muted); font-size:var(--text-support); overflow-wrap:anywhere; }
.upd-own-edit { color:var(--accent); font-size:var(--text-support); font-weight:500; white-space:nowrap; }
/* The ИНН and the name of a party: the parties of the directory found as they are typed, under the field. */
.upd-cp-field { position:relative; min-width:0; }
.upd-cp-results { position:absolute; top:100%; left:0; right:0; z-index:5; display:grid; gap:2px; max-height:280px; overflow:auto; padding:var(--space-1); border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); box-shadow:var(--shadow); }
.upd-cp-results[hidden] { display:none; }
.upd-cp-option { display:grid; justify-items:start; gap:2px; min-height:var(--control-md); padding:var(--space-2); border:0; border-radius:var(--radius-sm); background:transparent; color:var(--fg); font:var(--text-body) var(--font-ui); text-align:left; }
.upd-cp-option:hover,.upd-cp-option.is-active { background:var(--accent-bg); color:var(--fg); }
.upd-cp-option small { color:var(--muted); font-size:var(--text-meta); }
.upd-cp-empty { margin:0; padding:var(--space-2); color:var(--muted); font-size:var(--text-support); }
/* A line of goods: the empty optional details as «+ Поле» buttons. */
.upd-add-fields { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-3); }
.upd-add-field { min-height:var(--control-sm); padding:0 var(--space-3); border:1px dashed var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--accent); font:500 var(--text-support) var(--font-ui); }
.upd-add-field:hover { border-color:var(--accent); background:var(--accent-bg); color:var(--accent); }
/* УПД: toolbar, groups, ЕГАИС, stock dialog; checked marks */
.docs-head:has(.upd-toolbar) { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-3); }
.upd-toolbar { display:flex; flex-wrap:wrap; align-items:stretch; gap:var(--space-2); }
.upd-toolbar > :is(.button,button) { flex:none; min-height:var(--control-md); margin:0; }
@media (max-width:700px) { .upd-toolbar { width:100%; } .upd-toolbar > :is(.button,button) { flex:1 1 160px; } }
.upd-load { cursor:pointer; }
.upd-groups { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); grid-auto-flow:row; gap:var(--space-1) var(--space-4); margin:0 0 var(--space-3); padding:var(--space-2) var(--space-3); border:1px solid var(--line); border-radius:var(--radius); }
.upd-groups legend { padding:0 var(--space-1); font-size:var(--text-support); font-weight:600; }
.upd-groups .upd-check { width:100%; min-height:var(--control-md); margin:0; padding:var(--space-2); border-radius:var(--radius-sm); cursor:pointer; }
.upd-groups .upd-check:hover { background:var(--surface-2); }
.upd-groups .cr-field-hint { grid-column:1 / -1; }
.upd-egais { border-color:var(--warn); background:var(--warn-bg); }
.upd-egais .cr-num { width:auto; padding:0 8px; }
/* The places (one field a side: the КПП of an organization or the ФИАС ID of an ИП) on one line, the waybill on the next. */
.cr-form.upd-egais-grid { grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end; }
.upd-egais-grid [data-field="egais.ttnNumber"] { grid-column:1; }
.upd-more-section > summary { display:flex; align-items:center; gap:10px; font-size:var(--text-subheading); font-weight:600; color:var(--fg); }
.upd-dialog { width:min(860px, calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow:auto; }
.upd-dialog h3 { margin:0 0 10px; }
.upd-stock-list { max-height:50vh; overflow:auto; }
.upd-stock-list .cr-cell { width:70px; }
.doc-products td.tone-ok { color:var(--ok); font-weight:500; }
.st-mod { font-size:13px; color:var(--muted); }
/* Receipts of processing, codes of a document, ЭДО id, places of activity, preliminary check of УПД */
.doc-receipt { margin:10px 0; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.doc-receipt > summary { cursor:pointer; font-weight:600; }
.doc-receipt > summary[data-tone="ok"] { color:var(--ok); } .doc-receipt > summary[data-tone="bad"] { color:var(--bad); }
.doc-receipt-steps { margin:8px 0 0; padding-left:20px; display:grid; gap:6px; }
.doc-receipt-steps li strong { display:block; font-weight:500; }
.doc-receipt-steps li.tone-bad strong { color:var(--bad); } .doc-receipt-steps li.tone-ok strong { color:var(--ok); }
.doc-receipt-error { margin:4px 0 0; color:var(--bad); font-size:13px; }
.profile-edo small { display:block; color:var(--muted); font-size:12px; }
.profile-edo-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:4px; }
.field-help { position:relative; display:inline-flex !important; align-items:center; gap:3px; width:max-content; max-width:100%; outline:none; }
.field-help-mark { display:inline-grid; place-items:center; width:16px; height:16px; border:1px solid var(--line-strong); border-radius:50%; color:var(--muted); font-size:11px; font-weight:600; line-height:1; cursor:help; }
.field-help:focus-visible .field-help-mark { outline:2px solid var(--focus); outline-offset:1px; }
.field-tooltip { position:absolute; left:0; top:calc(100% + 8px); z-index:20; width:min(240px,calc(100vw - 64px)); padding:9px 11px; border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--fg); color:var(--on-accent) !important; box-shadow:var(--shadow); font-size:12px !important; line-height:1.45; opacity:0; visibility:hidden; pointer-events:none; transform:translateY(-3px); transition:opacity .15s ease-out,transform .15s ease-out,visibility .15s; }
/* Only «?» opens the explanation: the pointer on the mark, or the keyboard on the name of the field. */
.field-help-mark:hover ~ .field-tooltip,.field-help:focus-visible .field-tooltip { opacity:1; visibility:visible; transform:translateY(0); }
.mod-tools { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:8px 0 12px; }
.mod-card-tools { display:flex; flex-wrap:wrap; gap:var(--space-2) var(--space-3); margin-top:var(--space-2); }
.mod-egais { margin:6px 0 0; font-size:13px; } .mod-egais.tone-bad { color:var(--bad); } .mod-egais.tone-ok { color:var(--ok); }
.upd-validation { margin:12px 0; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.upd-validation-list { margin:4px 0 0; padding-left:20px; font-size:13px; }
.cr-cell.cr-cell-wide { width:180px; }
/* Errors with «что делать»: one block per code, who fixes it, steps, the letter for the supplier */
.err-list { display:grid; gap:10px; margin-top:8px; }
.err-item { display:grid; gap:6px; padding:12px 14px; border:1px solid var(--bad); border-radius:var(--radius-sm); background:var(--surface); }
.err-item.err-theirs { border-color:var(--warn); } .err-item.err-system { border-color:var(--muted); }
.err-head { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px 12px; align-items:baseline; }
.err-head strong { font-size:15px; }
.err-code { font:500 12px var(--font-mono, monospace); color:var(--muted); }
.err-text { margin:0; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.err-fixer { margin:0; font-size:13px; font-weight:600; }
.err-steps { margin:0; padding-left:20px; display:grid; gap:3px; font-size:var(--text-body); }
.err-actions { display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px 14px; }
.err-codes summary { cursor:pointer; color:var(--accent); font-size:13px; }
.err-letter { width:100%; font:13px var(--font-ui); padding:8px; border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--fg); }
/* Card of a document: the counterparty and the sum first, the chips of the state, the technical id at the bottom */
.doc-hero { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-start; gap:10px 20px; margin-bottom:10px; }
.doc-hero-who { display:grid; gap:2px; min-width:0; }
.doc-hero-role { font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.doc-hero-who strong { font-size:19px; letter-spacing:-.01em; line-height:1.25; }
.doc-hero-who small { color:var(--muted); font-size:13px; }
.doc-hero-sum { text-align:right; display:grid; gap:2px; }
.doc-hero-sum b { font-size:24px; letter-spacing:-.02em; font-variant-numeric:tabular-nums; white-space:nowrap; }
.doc-hero-sum small { color:var(--muted); font-size:var(--text-meta); }
.doc-raw .doc-id-row { margin:8px 0; }
/* «Сегодня»: things to do with deadlines, the state of Честный знак, quick actions */
.today-head { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:10px 16px; margin-bottom:14px; }
.today-head h1 { margin:0; font-size:var(--text-page); letter-spacing:-.02em; }
.today-head p { margin:var(--space-1) 0 0; color:var(--muted); font-size:var(--text-support); }
.health-chip { display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border:1px solid var(--line); border-radius:999px; background:var(--surface); font-size:13px; white-space:nowrap; }
.health-chip i { width:8px; height:8px; border-radius:50%; background:var(--muted); }
.health-chip[data-state="ok"] i { background:var(--ok); }
.health-chip[data-state="degraded"] i { background:var(--warn); }
.health-chip[data-state="down"] { border-color:var(--bad); color:var(--bad); } .health-chip[data-state="down"] i { background:var(--bad); }
.today-tasks { list-style:none; margin:0 0 18px; padding:0; display:grid; gap:8px; }
.today-empty { color:var(--muted); padding:14px 0; }
/* Without a key: «Ещё N дел — откроются после подключения» under the first tasks. */
.today-more { padding:0 var(--space-4); color:var(--muted); }
.today-task { display:grid; grid-template-columns:40px minmax(0,1fr) auto; gap:14px; align-items:center; padding:12px 16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.today-icon { width:40px; height:40px; border-radius:11px; display:grid; place-items:center; background:var(--surface-2); color:var(--muted); }
.today-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.today-task.tone-bad .today-icon { background:var(--bad-bg); color:var(--bad); }
.today-task.tone-warn .today-icon { background:var(--warn-bg); color:var(--warn); }
.today-task.tone-ok .today-icon { background:var(--ok-bg); color:var(--ok); }
.today-task.tone-info .today-icon { background:var(--accent-bg); color:var(--accent); }
.today-body { display:grid; gap:2px; min-width:0; }
.today-body strong { font-size:15px; font-weight:600; }
.today-body small { color:var(--muted); font-size:13px; }
.today-due { color:var(--bad); font-weight:600; }
.today-task.tone-warn .today-due { color:var(--warn); }
.today-task .button { inline-size:144px; text-decoration:none; white-space:nowrap; }
/* «Быстро» and «Сводка» side by side, of one height; the state of the day and its tasks below them. */
.today-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.3fr); gap:var(--space-4); align-items:stretch; margin-bottom:var(--space-5); }
.today-quick,.today-stock { display:grid; align-content:start; gap:var(--space-3); padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.home-main { container-type:inline-size; }
.today-work { display:grid; gap:var(--space-4); align-items:start; }
.today-work > section { min-width:0; }
.today-stock-head,.today-stock-totals div { display:flex; justify-content:space-between; flex-wrap:wrap; align-items:baseline; gap:var(--space-1) var(--space-2); }
.today-stock-head h2 { margin:0; font-size:var(--text-subheading); }
.today-stock-head a,.today-stock-status,.today-stock-totals dt { font-size:var(--text-support); }
.today-stock-totals { display:grid; gap:var(--space-2); margin:0; }
.today-stock-totals dt,.today-stock-status { color:var(--muted); }
.today-stock-totals dd { margin:0; font-weight:600; font-variant-numeric:tabular-nums; }
.today-stock .docs-tabs { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,3fr); margin:0; }
.today-stock .docs-tabs button { padding-inline:var(--space-2); font-size:var(--text-support); white-space:normal; }
.today-stock .table { width:100%; border-collapse:collapse; text-align:left; }
.today-stock .table :is(th,td) { padding-inline:var(--space-1); }
.today-stock .table th:first-child { overflow-wrap:anywhere; }
.today-stock .table tbody th { font-weight:400; }
.today-stock-status { margin:0; }
@container (min-width:760px) {
  .today-work { grid-template-columns:minmax(0,1fr) minmax(300px,.55fr); }
}
@media (pointer:coarse) {
  .today-stock .docs-tabs button { min-height:var(--control-lg); }
}
.today-grid .monitor-head h2 { margin:0; font-size:var(--text-subheading); }
.today-links { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px; }
.today-links a,.today-links button { display:flex; align-items:flex-start; gap:10px; min-height:0; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--fg); text-decoration:none; text-align:left; font:500 14px var(--font-ui); justify-content:flex-start; }
.today-links a:hover,.today-links button:hover { border-color:var(--accent); background:var(--accent-bg); }
.today-links svg { width:18px; height:18px; flex-shrink:0; margin-top:2px; fill:none; stroke:currentColor; stroke-width:1.7; color:var(--accent); }
.today-links small { display:block; color:var(--muted); font-size:12px; font-weight:400; }
.today-grid .monitor { display:grid; grid-template-columns:minmax(0,1fr); align-content:start; gap:var(--space-3); margin:0; }
.today-grid .monitor-tiles { margin:0; }
/* «Сводка» of the home page: the title and «Обновить» on one line (a long status is cut, the button stays in place),
   the progress of the data for the tasks of the day under them across the whole block. */
.today-grid .monitor-head { flex-wrap:wrap; align-items:center; gap:var(--space-3); }
.today-grid .monitor-head > div:first-child { flex:0 0 auto; }
.today-grid .monitor-actions { flex:1 1 0; justify-content:flex-end; min-width:0; }
.today-grid .monitor-status { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.today-grid .monitor-actions button { flex-shrink:0; }
.monitor-progress { display:grid; flex:1 0 100%; gap:var(--space-1); }
.monitor-progress progress { width:100%; height:6px; border:0; border-radius:999px; background:var(--surface-2); color:var(--accent); accent-color:var(--accent); overflow:hidden; appearance:none; }
.monitor-progress progress::-webkit-progress-bar { background:var(--surface-2); border-radius:999px; }
.monitor-progress progress::-webkit-progress-value { background:var(--accent); border-radius:999px; transition:width .16s; }
.monitor-progress progress::-moz-progress-bar { background:var(--accent); border-radius:999px; }
.monitor-progress[data-state="ok"] progress::-webkit-progress-value { background:var(--ok); }
.monitor-progress[data-state="ok"] progress::-moz-progress-bar { background:var(--ok); }
.monitor-progress[data-state="warn"] progress::-webkit-progress-value { background:var(--warn); }
.monitor-progress[data-state="warn"] progress::-moz-progress-bar { background:var(--warn); }
.monitor-progress span { color:var(--muted); font-size:var(--text-meta); }
@media (prefers-reduced-motion:reduce) { .monitor-progress progress::-webkit-progress-value { transition:none; } }
/* Two columns: both blocks share the rows of the grid, so the quick actions and the tiles of «Сводка» stand on the same
   lines (two rows of two). */
@media (min-width:861px) {
  .today-grid { grid-template-rows:auto 1fr; row-gap:var(--space-3); }
  .today-grid > .today-quick,.today-grid > .monitor { grid-row:span 2; grid-template-rows:subgrid; row-gap:var(--space-3); }
  .today-grid .today-links,.today-grid .monitor-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:1fr; align-content:stretch; }
}
@media (max-width:860px) { .today-grid { grid-template-columns:minmax(0,1fr); } }
@media (max-width:560px) { .today-task { grid-template-columns:36px minmax(0,1fr); } .today-task .button { grid-column:2; justify-self:start; } .today-icon { width:36px; height:36px; } }
/* Catalog of documents: categories and search */
.cr-cat { min-height:var(--control-sm); padding:var(--space-1) var(--space-3); border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--fg); font:500 var(--text-support) var(--font-ui); }
.cr-cat:hover { background:var(--accent-bg); }
.cr-cat[aria-selected="true"] { background:var(--accent-bg); border-color:var(--accent); color:var(--accent); }
.ex-dates { display:flex; min-width:0; gap:var(--space-2); } .ex-dates input { flex:1; min-width:0; }
.ex-multi { display:flex; flex-wrap:wrap; gap:4px 14px; max-height:180px; overflow:auto; padding:4px 0; }
/* Сервисы ГИС МТ */
/* Integrations: the plan of the connections by stages; none works yet. */
.integration-intro { display:grid; gap:var(--space-1); margin-bottom:var(--space-4); padding:var(--space-3) var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--accent-bg); }
.integration-intro p { max-width:70ch; margin:0; color:var(--muted); }
.integration-stage { display:grid; gap:var(--space-2); margin-bottom:var(--space-4); }
.integration-stage h2 { margin:0; font-size:var(--text-subheading); }
.integration-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:var(--space-3); margin:0; padding:0; list-style:none; }
.integration-item { display:grid; align-content:start; gap:var(--space-1); min-width:0; padding:var(--space-3) var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.integration-item-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:var(--space-1) var(--space-3); }
.integration-item h3 { margin:0; font-size:var(--text-body, 14px); font-weight:600; }
.integration-item p { margin:0; color:var(--muted); font-size:var(--text-support); }
.integration-item .integration-data { color:var(--fg); }
.integration-status { color:var(--muted); font-size:var(--text-meta); }
.integration-brand { display:inline-flex; align-items:center; gap:var(--space-2); min-width:0; vertical-align:middle; }
.integration-logo { flex-shrink:0; object-fit:contain; }
.pagination-toolbar { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:var(--space-2); margin-block:var(--space-3); }
.pagination-page { display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-2); min-width:0; max-width:100%; margin:0; width:auto; }
form.pagination-toolbar > button { margin:0; }
.pagination-toolbar .pagination-page { flex-wrap:nowrap; white-space:nowrap; flex:0 0 auto; }
.pagination-toolbar .pagination-page input[type="number"] { flex:0 0 64px; width:64px; min-width:64px; max-width:64px; }
.pagination-page select { max-width:100%; }
/* RetailCRM orders and inline order card. */
.retailcrm-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-2); min-width:0; }
.retailcrm-toolbar > .docs-field { align-self:flex-end; }
.retailcrm-filters { margin-bottom:var(--space-4); }
.retailcrm-extra-filters,.retailcrm-filter-actions,.retailcrm-filters > p,.retailcrm-filters > .cr-actions { flex-basis:100%; }
.retailcrm-extra-filters[open] > summary { margin-bottom:var(--space-2); }
.retailcrm-filter-actions > label { margin-inline-end:auto; }
.retailcrm-load-progress { flex-basis:100%; display:grid; gap:var(--space-1); color:var(--muted); font-size:var(--text-meta); }
.retailcrm-load-progress progress { width:100%; accent-color:var(--accent); }
.retailcrm-workspace { display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); align-items:start; gap:var(--space-3); }
.retailcrm-panel { min-width:0; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.retailcrm-panel-head { padding:var(--space-3) var(--space-4); border-bottom:1px solid var(--line); }
.retailcrm-panel-head h2,.retailcrm-panel .doc-card-head h2 { margin:0; font-size:var(--text-subheading); }
.retailcrm-panel-head .profile-message { margin:var(--space-1) 0 0; }
.retailcrm-orders { list-style:none; margin:0; padding:0; }
.retailcrm-orders li + li { border-top:1px solid var(--line); }
button.retailcrm-order-pick { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:var(--space-1) var(--space-2); width:100%; border:0; border-radius:0; padding:var(--space-2) var(--space-4); background:var(--surface); text-align:left; color:var(--fg); }
button.retailcrm-order-pick:hover:not(:disabled) { background:var(--surface-2); }
button.retailcrm-order-pick[aria-pressed="true"] { background:var(--accent-bg); box-shadow:inset 2px 0 var(--accent); }
.retailcrm-order-pick > :is(.retailcrm-order-meta,.retailcrm-order-result) { grid-column:1/-1; }
.retailcrm-order-pick > strong,.retailcrm-order-meta,.retailcrm-mark { overflow-wrap:anywhere; }
.retailcrm-order-result { display:flex; flex-wrap:wrap; gap:var(--space-1); }
.retailcrm-order-result .doc-chip { white-space:normal; }
.retailcrm-orders-more { padding:var(--space-3) var(--space-4); }
.retailcrm-card-body { display:grid; gap:var(--space-3); padding:var(--space-3) var(--space-4); }
:is(.retailcrm-filters,.retailcrm-card-body) > :is(.profile-message,.cr-actions):empty { display:none; }
@media (min-width:701px) {
 #retailcrm-order { position:sticky; top:84px; display:flex; flex-direction:column; max-height:calc(100dvh - 84px - var(--space-4)); }
 #retailcrm-order > .doc-card-head { flex:none; }
 .retailcrm-card-body { overflow:auto; }
}
.retailcrm-card-body h3,.retailcrm-card-body .profile-message { margin:0; }
.retailcrm-item,.retailcrm-mark { display:grid; gap:var(--space-1) var(--space-2); padding-block:var(--space-2); }
.retailcrm-item { border-top:1px solid var(--line); }
.retailcrm-mark { grid-template-columns:minmax(0,1fr) auto; align-items:start; }
.retailcrm-mark > .retailcrm-owner { grid-column:1/-1; }
.retailcrm-owner { display:grid; gap:var(--space-1); min-width:0; overflow-wrap:anywhere; font-weight:400; }
.retailcrm-owner strong { font-size:var(--text-support); font-weight:600; }
.retailcrm-owner small { color:var(--muted); font-size:var(--text-meta); font-weight:400; }
@media (max-width:700px) {
 .pagination-toolbar > span { display:none; }
 .pagination-toolbar .pagination-page input[type="number"] { flex-basis:56px; width:56px; min-width:56px; max-width:56px; }
 .retailcrm-workspace { grid-template-columns:minmax(0,1fr); }
 .retailcrm-filter-actions > button { width:100%; }
 .retailcrm-mark { grid-template-columns:minmax(0,1fr); justify-items:start; }
}
@media (max-width:360px) { .pagination-toolbar .pagination-page > span { display:none; } }

.integration-note { margin:0; color:var(--muted); font-size:var(--text-support); }
.integration-status[data-tone="ok"] { color:var(--ok); font-weight:600; }
/* Дока АРМ: the connection is a small card whose settings open on a click (details), the check of the sold marks a card
   of the section «Дока АРМ». */
.arm-connect,.arm-sold,.integration-card { padding:var(--space-3) var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.arm-connect h2,.arm-sold h2,.integration-card h2 { margin:0; font-size:var(--text-subheading); }
.arm-summary { display:grid; gap:var(--space-1); margin:calc(-1 * var(--space-3)) calc(-1 * var(--space-4)); padding:var(--space-3) var(--space-4); border-radius:var(--radius); color:var(--fg); font-weight:400; cursor:pointer; list-style:none; }
.arm-summary h2 { color:var(--fg); }
.arm-summary::-webkit-details-marker { display:none; }
.arm-summary:hover { background:var(--surface-2); }
.arm-summary:focus-visible { outline:2px solid var(--focus); outline-offset:-2px; }
.arm-summary h2::after { content:"›"; display:inline-block; margin-left:var(--space-2); color:var(--muted); transition:transform .15s ease-out; }
.arm-connect[open] > .arm-summary h2::after { transform:rotate(90deg); }
.arm-connect[open] > .arm-summary { margin-bottom:0; }
.arm-body { display:grid; gap:var(--space-3); padding-top:var(--space-3); }
.arm-open { justify-self:start; font-weight:500; }
@media (prefers-reduced-motion:reduce) { .arm-summary h2::after { transition:none; } }
.arm-form { margin-bottom:0; }
.arm-form .arm-path { grid-column:1 / -1; }
.arm-form .arm-path input { font-family:var(--font-code); }
/* A path and «Выбрать…» (a window of Windows on the main computer) in one row: Дока АРМ, the backup copies. */
.path-row { display:flex; flex-wrap:wrap; gap:var(--space-2); align-items:center; }
.path-row input { flex:1 1 12rem; min-width:0; }
.path-row button { flex:none; }
.arm-connect .cr-actions,.integration-card .cr-actions { margin-top:0; align-items:center; }
.arm-connect .profile-message,.integration-card .profile-message { margin:0; }
.arm-connect .profile-message:empty,.integration-card .profile-message:empty { display:none; }
.integration-card { display:grid; gap:var(--space-2); }
.integration-card .integration-note { margin:0; }
.arm-sold { display:grid; gap:var(--space-3); }
.arm-sold[hidden] { display:none; }
.arm-sold .docs-filter,.arm-sold .integration-note,.arm-sold .profile-message { margin:0; }
/* The dates sit right in the card: no second frame around them. */
.arm-sold .docs-filter { padding:0; border:0; background:none; }
.arm-sold .profile-message:empty { display:none; }
.arm-sold-result:empty { display:none; }
.arm-sold-result { display:grid; gap:var(--space-2); }
.arm-sold-result .cr-actions { margin:0; }
.arm-sold-code { font-size:var(--text-meta); word-break:break-all; }
.arm-sold-what { flex:0 1 220px; font-weight:500; }
.arm-sold-detail { display:block; color:var(--muted); font-size:var(--text-meta); font-weight:400; }
.tl-layout { display:grid; grid-template-columns:240px 1fr; gap:18px; align-items:start; }
.tl-nav { display:grid; gap:4px; position:sticky; top:12px; }
.tl-nav-item { justify-content:flex-start; min-height:36px; padding:6px 12px; background:transparent; color:var(--fg); border:1px solid transparent; text-align:left; font-weight:500; font-size:var(--text-support); }
.tl-nav-item:hover { background:var(--accent-bg); }
.tl-nav-item[aria-current="true"] { background:var(--accent-bg); border-color:var(--accent); color:var(--accent); }
.tl-main { min-width:0; padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.tl-main h2 { margin:0 0 4px; font-size:18px; }
.tl-tree { margin:6px 0; padding-left:18px; list-style:disc; }
.tl-tree li { margin:3px 0; }
@media (max-width: 760px) { .tl-layout { grid-template-columns:1fr; } .tl-nav { position:static; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); } }
/* The unfolded menu takes 172 px more: the same switch while the content is as narrow. */
@media (min-width: 761px) and (max-width: 932px) { :root[data-rail="wide"] .tl-layout { grid-template-columns:1fr; } :root[data-rail="wide"] .tl-nav { position:static; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); } }
.group-connect {margin:20px 0 8px; padding-top:16px; border-top:1px solid var(--line); }
.group-connect h3 { margin:0 0 6px; font-size:15px; }
.group-connect p { max-width:760px; }
.group-connect .button { text-decoration:none; }
.group-available { margin-top:14px; }
.group-available > summary { cursor:pointer; color:var(--accent); font-size:13px; font-weight:500; margin-bottom:10px; }
.group-chip.is-off { min-height:40px; color:var(--muted); background:var(--surface); font-weight:400; }
.upd-parties fieldset[hidden],[data-shipment][hidden] { display:none; }
.upd-parties .cr-form { row-gap:var(--space-2); margin:0; grid-template-columns:repeat(2,minmax(0,1fr)); }
.upd-more { margin:6px 0; }
.upd-more > summary { cursor:pointer; color:var(--accent); font-size:13px; font-weight:500; padding:4px 0; }
.upd-address-mode { display:flex; flex-wrap:wrap; gap:var(--space-3); margin:0; font-size:13px; }
.upd-address-mode label,.upd-check { display:inline-flex; align-items:center; gap:var(--space-2); font-size:var(--text-support); }
.upd-check { margin:0 0 var(--space-3); }
.cr-form .upd-wide { grid-column:1 / -1; }
.upd-sub { margin:14px 0 6px; font-size:14px; font-weight:600; }
.upd-repeat-row { display:flex; flex-wrap:wrap; align-items:end; gap:8px 12px; margin:0 0 8px; }
.upd-repeat-row .docs-field { flex:1 1 160px; }
.upd-repeat-row .link-button { margin-bottom:var(--space-2); }
.docs-field textarea { font:var(--text-support) var(--font-code); resize:vertical; }

/* Search and commands (Ctrl K) */
.topbar-search { flex:0 1 380px; display:flex; align-items:center; gap:var(--space-2); min-width:0; height:var(--control-lg); min-height:var(--control-lg); padding:0 var(--space-2) 0 var(--space-3);
  border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--muted); font:13px var(--font-ui); text-align:left; cursor:text; }
.topbar-search:hover { background:var(--surface); border-color:var(--accent); color:var(--fg); }
.topbar-search span { flex:1 1 auto; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.topbar-search svg { flex:0 0 auto; width:16px; height:16px; }
.topbar-search kbd { display:none; }
.palette { width:min(620px, calc(100vw - 32px)); max-height:min(560px, calc(100vh - 80px)); margin:10vh auto auto; padding:0; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--fg); box-shadow:var(--shadow); }
.palette::backdrop { background:var(--overlay); }
.palette-form { display:flex; flex-direction:column; max-height:inherit; }
.palette-input { min-height:52px; padding:14px 18px; border:0; border-bottom:1px solid var(--line); border-radius:var(--radius) var(--radius) 0 0; font-size:15px; }
.palette-input:focus-visible { outline:none; }
.palette-list { flex:1 1 auto; margin:0; padding:6px; overflow:auto; list-style:none; }
.palette-list li { display:flex; flex-direction:column; gap:1px; padding:8px 12px; border-radius:var(--radius-sm); cursor:pointer; }
.palette-list li small { color:var(--muted); font-size:12px; }
.palette-list li[aria-selected="true"] { background:var(--accent-bg); }
.palette-list li[aria-selected="true"] strong { color:var(--accent); }
.palette-list li.palette-empty { color:var(--muted); cursor:default; }
.palette-note:empty { display:none; }
.palette-note { margin:0; padding:8px 18px; border-top:1px solid var(--line); font-size:13px; }
.palette-help { margin:0; padding:8px 18px; border-top:1px solid var(--line); color:var(--muted); font-size:11.5px; }
@media (max-width:760px) {
  .topbar-search { flex:1 1 auto; }
  .topbar-search kbd { display:none; }
  .palette { margin-top:16px; }
  .palette-help { display:none; }
}
/* Acceptance of an УПД (buyer title) */
.doc-accept { display:grid; gap:10px; margin:0 0 16px; padding:14px 16px; border:1px solid var(--accent); border-radius:var(--radius); background:var(--accent-bg); }
.doc-accept h3 { margin:0; font-size:15px; }
.doc-accept p { margin:0; }
.doc-accept-who { font-weight:600; }
.doc-accept-proof { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); overflow:hidden; }
.doc-accept-proof div { min-width:0; padding:10px 12px; border-top:1px solid var(--line); border-left:1px solid var(--line); }
.doc-accept-proof div:nth-child(-n+2) { border-top:0; }
.doc-accept-proof div:nth-child(odd) { border-left:0; }
.doc-accept-proof dt { color:var(--muted); font-size:11px; }
.doc-accept-proof dd { margin:2px 0 0; font-size:13px; font-weight:600; overflow-wrap:anywhere; }
.doc-accept-check { color:var(--muted); }
.doc-accept-check[data-tone="ok"] { color:var(--ok); font-weight:600; }
.doc-accept-check[data-tone="warn"] { color:var(--warn, var(--bad)); font-weight:600; }
.doc-accept-bar { display:flex; flex-wrap:wrap; gap:8px; }
.doc-accept-bar .primary { min-width:140px; }
.doc-accept-form { display:grid; gap:10px; padding:12px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); }
.doc-accept-form fieldset { display:grid; gap:6px; margin:0; padding:0; border:0; }
.doc-accept-form legend { margin-bottom:4px; font-weight:600; }
.doc-accept-form label { display:flex; align-items:flex-start; gap:8px; }
.doc-accept-form .docs-field { display:grid; gap:4px; }
.doc-accept-form button { justify-self:start; }
/* What the chosen result does in Честный знак and what to do next. */
.doc-accept-guide { display:grid; gap:var(--space-1); padding:var(--space-2) var(--space-3); border-radius:var(--radius-sm); background:var(--warn-bg); font-size:var(--text-support); }
.doc-accept-guide p,.doc-accept-guide ol { margin:0; }
.doc-accept-guide ol { display:grid; gap:var(--space-1); padding-left:var(--space-5); }
.doc-accept-done { color:var(--ok); font-weight:600; }
@media (max-width:760px) {
  /* On a phone the decision stays under the thumb while the marks are scanned. */
  .doc-accept-bar { position:sticky; bottom:0; z-index:2; margin:0 -16px -14px; padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:var(--surface); border-top:1px solid var(--line); }
  .doc-accept-bar button { flex:1 1 140px; min-height:48px; }
  .doc-accept-proof { grid-template-columns:1fr; }
  .doc-accept-proof div,.doc-accept-proof div:nth-child(-n+2) { border-top:1px solid var(--line); border-left:0; }
  .doc-accept-proof div:first-child { border-top:0; }
}
/* Deviations: steps «Что делать» */
/* Messages inside the catalog grid of «Создать документ» take the whole width */
/* «Выбрать из документов» in cancellations */
.cr-pick { display:block; margin-top:4px; }
.cr-pick-list { display:grid; grid-template-columns:minmax(0,1fr); grid-auto-rows:max-content; align-content:start; gap:var(--space-1); max-height:280px; overflow:auto; margin-top:var(--space-2); padding:var(--space-2); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); }
.cr-pick-item { display:grid; grid-template-columns:minmax(0,1fr); justify-items:start; align-content:start; gap:var(--space-1); min-width:0; min-height:var(--control-lg); padding:var(--space-2) var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--fg); text-align:left; font:13px/1.4 var(--font-ui); white-space:normal; overflow-wrap:anywhere; }
.cr-pick-item:hover { background:var(--accent-bg); border-color:var(--accent); }
.cr-pick-item small { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
/* A place of activity in «Создать документ»: the chosen group connected to it or not (a mark and words, not the color alone). */
.cr-pick-item small.tone-ok { color:var(--ok); } .cr-pick-item small.tone-bad { color:var(--bad); }
/* КПП of an individual entrepreneur: the field is blocked (party-fields.js) */
.cr-field.is-off input:disabled, .docs-field.is-off input:disabled { background:var(--surface-2); color:var(--muted); cursor:not-allowed; }
/* Directory of counterparties (Организация → Контрагенты, choice in УПД and documents) */
.cp-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 12px; }
.cp-toolbar input { flex:1 1 240px; min-height:var(--control-md); }
.cp-dialog { width:min(860px, calc(100vw - 32px)); max-height:calc(100vh - 48px); overflow:auto; }
.cp-dialog h3 { margin:0 0 10px; }
.cp-actions { white-space:nowrap; }
.cp-name { min-width:230px; }
.cp-name small { display:block; margin-top:3px; color:var(--muted); }
.cp-inn,.cp-kpp { min-width:104px; white-space:nowrap; }
.cp-address { min-width:260px; }
/* Инвентаризация */
.inv-work { display:grid; gap:var(--space-2); margin-top:var(--space-3); }
.inv-work .doc-check-feedback,.inv-work .doc-check-counters { margin:0; }
.inv-work .doc-check-feedback:empty { position:absolute; min-height:0; }
/* The row of the scan: the field, the camera, «Загрузить TXT» and «Звук» — one line, one height (44 px). */
.inv-scan { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2) var(--space-3); }
.inv-scan .doc-check-input { flex:1 1 320px; height:var(--control-lg); min-height:0; }
.inv-scan .scan-button { width:var(--control-lg); min-height:var(--control-lg); }
.inv-import { flex:0 0 auto; min-height:var(--control-lg); margin:0; cursor:pointer; }
.inv-scan .upd-check { min-height:var(--control-lg); margin:0; }
.inv-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; }
.inv-group-writeoffs { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.inv-group-writeoffs[hidden] { display:none; }
/* The personal cabinet of Честный знак next to the organization in the top bar: the mark of Честный знак only */
.lk-chip { display:flex; align-items:center; justify-content:center; flex:0 0 var(--control-lg); width:var(--control-lg); height:var(--control-lg); padding:0; border:1px solid var(--line); border-radius:var(--radius-sm); text-decoration:none; }
.lk-chip:hover { border-color:var(--line-strong); background:var(--surface-2); }
.lk-chip img { display:block; width:32px; height:32px; }
/* «Инструкция»: the section of the page on the site, the same size as the chip of the cabinet. */
.help-chip { text-decoration:none; }
.help-chip svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

/* Инвентаризация: «Новая инвентаризация» above, the list as a table under it («Весь остаток» pinned first). */
.inv-new-card { display:grid; margin:var(--space-4) 0; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.inv-new-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2) var(--space-3); padding:var(--space-3) var(--space-4); border-bottom:1px solid var(--line); }
.inv-new-head h2 { font-size:var(--text-subheading); }
.inv-new { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)) auto; align-items:end; gap:var(--space-2) var(--space-3); padding:var(--space-4); }
.inv-new .inv-wide { grid-column:span 2; }
.inv-new .docs-field { margin:0; }
.inv-new .docs-field select,.inv-new .docs-field input { width:100%; max-width:none; }
.inv-new-card > .cr-hint { margin:0; padding:0 var(--space-4) var(--space-4); }
.inv-table th:last-child,.inv-row-actions { text-align:right; }
.inv-row-title strong { display:block; font-weight:600; }
.inv-row-title small,.inv-row-place,.inv-row-when { color:var(--muted); font-size:var(--text-meta); }
.inv-row-progress,.inv-row-when { font-variant-numeric:tabular-nums; white-space:nowrap; }
.inv-row-place { overflow-wrap:anywhere; }
.inv-row-actions { white-space:nowrap; }
.inv-row-actions .link-button { margin-left:var(--space-3); }
.inv-row.is-stock > td { background:var(--accent-bg); }
.inv-row.is-stock > td:first-child { box-shadow:inset 3px 0 0 var(--accent); }
@media (max-width:1024px) { .inv-new { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) {
  .inv-new { grid-template-columns:minmax(0,1fr); }
  .inv-new .inv-wide { grid-column:auto; }
}
@media (max-width:760px) {
  .inv-table tr { grid-template-columns:minmax(0,1fr) auto; }
  .inv-row-title,.inv-row-place,.inv-row-progress,.inv-row-when { grid-column:1; }
  .inv-row-actions { grid-column:1 / -1; text-align:left; }
  .inv-row.is-stock > td,.inv-row.is-stock > td:first-child { background:none; box-shadow:none; }
  .inv-table tr.is-stock { background:var(--accent-bg); box-shadow:inset 3px 0 0 var(--accent); }
}
.inv-back { margin:0 0 4px; }
.inv-head-actions { display:flex; flex-wrap:wrap; gap:8px; }
.inv-work .cr-cell { width:90px; }
.org-settings { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:760px; align-items:start; }
/* Организация → Настройки → Обновления */
.update-box { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); display:grid; gap:10px; max-width:720px; }
.update-box h3 { margin:0; font-size:15px; }
.update-box p { margin:0; }
#update-status[data-tone="ok"] { color:var(--ok); }
#update-status[data-tone="wait"] { color:var(--warn); }
#update-status[data-tone="bad"] { color:var(--bad); }
.update-notes { margin:0; padding-left:20px; }
.backup-form { margin:0; grid-template-columns:repeat(2,minmax(0,1fr)); }
/* «СУЗ — заказ кодов» (a demo): the way of a code, the orders, the labels. */
.suz-demo strong { display:flex; align-items:center; gap:var(--space-2); }
.suz-steps { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:var(--space-2); margin:0 0 var(--space-4); padding:0; list-style:none; }
.suz-steps li { display:flex; align-items:center; gap:var(--space-2); padding:var(--space-2) var(--space-3); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); font-size:var(--text-support); }
.suz-steps b { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; background:var(--accent-bg); color:var(--accent); font-size:12px; }
.suz-actions { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-1) var(--space-3); }
.suz-label-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:var(--space-2); margin:var(--space-3) 0; }
.suz-label { display:grid; grid-template-columns:64px minmax(0,1fr); align-items:center; gap:var(--space-2); margin:0; padding:var(--space-2); border:1px dashed var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); }
.suz-label svg { width:64px; height:64px; shape-rendering:crispEdges; }
.suz-label svg path { fill:var(--fg); stroke:none; }
.suz-label figcaption { display:grid; gap:2px; min-width:0; font-size:var(--text-meta); overflow-wrap:anywhere; }
.rail-tag { display:none; margin-left:auto; padding:0 6px; border-radius:6px; background:var(--warn-bg); color:var(--warn); font:600 10.5px/17px var(--font-ui); }
:root[data-rail="wide"] .rail-tag { display:inline-block; }
.backup-box .cr-actions,.backup-box .profile-message,.token-box .profile-message { margin:0; }
.backup-box .profile-message:empty,.token-box .profile-message:empty { display:none; }
.token-box input { font-family:var(--font-code); }
/* «Уведомления Windows»: a switch per event, saved at once. */
.notify-options { display:grid; gap:var(--space-2); margin:0; padding:0; border:0; }
.notify-options .upd-check { margin:0; }
/* The offer to update (update-offer.js): a card in the corner of every page of the main computer */
/* To the beginning / to the end of a long page (workspace.js): bottom right, above the buttons of the support. */
.scroll-jump { position:fixed; right:var(--space-4); bottom:calc(var(--space-4) + var(--support-stack)); z-index:8; display:grid; gap:var(--space-2); }
.scroll-jump[hidden],.doc-open .scroll-jump,.rail-open .scroll-jump { display:none; }
.scroll-jump-button { box-shadow:var(--shadow); }
.scroll-jump-button:disabled { opacity:.4; }
.scroll-jump-button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
/* Техподдержка (support.js): one button in the corner of every page; the card with the phone and the chats opens to
   its left. */
/* --floating-stack: the column of the floating buttons (the support and «в начало / в конец»); the end of the page keeps
   this room, so nothing stays under them. */
:root { --support-button:48px; --support-stack:calc(var(--support-button) + var(--space-2)); --support-bottom:var(--space-4);
  --floating-stack:calc(var(--support-stack) + 2 * (var(--control-lg) + var(--space-2))); }
.support { position:fixed; right:var(--space-4); bottom:var(--support-bottom); z-index:9; display:flex; align-items:flex-end; gap:var(--space-2); }
.doc-open .support,.rail-open .support { display:none; }
.support-button { flex:none; width:var(--support-button); height:var(--support-button); min-height:0; padding:0; border-radius:50%; box-shadow:0 0 0 4px var(--accent-bg); }
.support-button svg { width:24px; height:24px; }
.support-card { display:grid; gap:var(--space-3); width:min(320px, calc(100vw - var(--support-button) - 2 * var(--space-4) - var(--space-2))); max-height:calc(100vh - var(--support-bottom) - var(--space-4)); overflow:auto;
  padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--fg); box-shadow:var(--shadow); }
.support-card h2 { font-size:var(--text-subheading); }
.support-phone,.support-chats,.support-logs { display:grid; gap:var(--space-2); }
.support-chats { grid-template-columns:repeat(2,minmax(0,1fr)); }
.support-chats > .support-label { grid-column:1 / -1; }
.support-phone-row { display:flex; align-items:center; gap:var(--space-2); }
.support-copy { flex:none; width:44px; min-height:44px; }
.support-chats,.support-logs { padding-top:var(--space-3); border-top:1px solid var(--line); }
.support-logs textarea { min-height:0; resize:vertical; }
.support-log-actions { display:grid; gap:var(--space-2); }
.support-status { margin:0; color:var(--muted); font-size:var(--text-support); }
.support-status:empty { display:none; }
.support-status[data-tone="ok"] { color:var(--ok); }
.support-status[data-tone="bad"] { color:var(--bad); }
.support-label { color:var(--muted); font-size:var(--text-meta); }
.support-number { color:var(--fg); font-size:var(--text-section); font-weight:600; font-variant-numeric:tabular-nums; text-decoration:none; letter-spacing:.01em; }
.support-number:hover { color:var(--accent); }
.support-card .link-button { justify-self:start; font-size:var(--text-support); }
.support-hours { display:grid; grid-template-columns:auto minmax(0,1fr); gap:var(--space-1) var(--space-3); margin:0; font-size:var(--text-support); }
.support-hours dt { color:var(--muted); }
.support-hours dd { margin:0; }
.support-link { justify-content:flex-start; min-width:0; padding:var(--space-2); white-space:normal; }
.support-link svg,.support-copy svg { flex:none; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
/* A phone scrolls by the finger: «в начало / в конец» would only cover the right edge of the content (buttons of the
   cards), so only the support stays in the corner. */
@media (max-width:700px) {
  :root { --support-bottom:calc(76px + env(safe-area-inset-bottom,0px)); --floating-stack:var(--support-stack); }
  .support { right:var(--space-3); }
  .support-card { position:absolute; right:0; bottom:calc(var(--support-button) + var(--space-2)); width:min(320px, calc(100vw - 2 * var(--space-3))); max-height:calc(100dvh - var(--support-bottom) - var(--support-button) - 2 * var(--space-3)); }
  .scroll-jump { display:none; }
  body:has(.ck-next) .support { bottom:calc(140px + env(safe-area-inset-bottom,0px)); }
}
/* The modal windows of create.js: a write-off from «Отклонения» is being filled with marks; the document is sent. */
.wait-dialog { width:min(440px, calc(100vw - 32px)); padding:var(--space-5); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--fg); box-shadow:var(--shadow); }
.wait-dialog::backdrop { background:var(--overlay); }
.wait-dialog-head { display:flex; align-items:center; gap:var(--space-3); font-size:var(--text-subheading); }
.wait-dialog-text { margin:var(--space-3) 0 0; color:var(--muted); font-size:var(--text-support); }
.wait-dialog-bar { display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-4); }
.wait-dialog-bar > .button { flex:1 1 auto; justify-content:center; text-align:center; }
.update-offer { position:fixed; right:16px; bottom:16px; z-index:60; display:grid; gap:8px; width:min(380px, calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto; padding:16px; border:1px solid var(--accent); border-radius:12px; background:var(--surface); color:var(--fg); box-shadow:0 12px 32px rgba(0,0,0,.18); }
.update-offer p { margin:0; }
.update-offer-current, .update-offer small { color:var(--muted); }
.update-offer-title { font-weight:600; }
.update-offer-notes { margin:0; padding-left:18px; display:grid; gap:4px; font-size:14px; }
.update-offer-bar { display:flex; flex-wrap:wrap; gap:8px; }
.update-offer-message:empty { display:none; }
/* The update installed: a green check beside the title, the card framed in the color of success. */
.update-offer[data-state="done"] { border-color:var(--ok); }
.update-offer-head { display:flex; align-items:center; gap:var(--space-3); }
/* The green check of success: the update installed, the document sent (.wait-dialog). */
.update-offer-check, .wait-dialog-check { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:50%; background:var(--ok-bg); color:var(--ok); }
.update-offer-check svg, .wait-dialog-check svg { width:20px; height:20px; }
@media (max-width:760px) { .update-offer { right:8px; left:8px; bottom:8px; width:auto; } }

@media (max-width:700px) {
  button:not(.link-button),.button:not(.link-button),input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select:not([multiple]),textarea,.icon-button { min-height:var(--control-lg); }
  .link-button,summary,.upd-groups .upd-check { min-height:var(--control-lg); }
  .icon-button { flex-basis:var(--control-lg); width:var(--control-lg); }
  .cr-form,.cr-form.upd-doc-row,.cr-form.upd-egais-grid,.upd-parties .cr-form,.org-settings,.integration-list,.backup-form { grid-template-columns:minmax(0,1fr); }
  .organization-section-head { flex-direction:column; }
  .refresh-profile { width:100%; }
  .access-actions { flex-wrap:wrap; }
  .access-actions > * { flex:1 1 100%; }
  .access-actions > form > button { width:100%; }
  .docs-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.docs-field select:not([multiple]),.docs-field textarea { min-height:var(--control-lg); }
  #monitor-tasks .task-chip { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
}
