/* Licensing_RG — стили приложения: тема «тёплый» (выбор пользователя 01.10, прототип — design/prototype).
   Токены темы — переменные CSS в :root; компоненты — ниже. Встроенных стилей и скриптов нет (строгий CSP). */

/* ---------- Шрифты: свои файлы (OFL 1.1), без внешних CDN ---------- */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/golos-text-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/golos-text-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../fonts/golos-text-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(../fonts/unbounded-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(../fonts/unbounded-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(../fonts/unbounded-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(../fonts/unbounded-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

/* Знаков нет в веб-версиях шрифтов: узбекского ʻ (oʻ, gʻ) — в Golos Text (он — из TTF той же версии рисунком кавычки ‘),
   стрелки → — в подмножествах Golos Text и IBM Plex Mono. Дополнительные файлы — tools/docs/web-fonts-extra.py; объявлены
   последними — для своих знаков браузер берёт их первыми; ступени веса Golos Text — под переменный шрифт, чтобы и вес 650
   находил свой файл. */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 449; font-display: swap;
  src: url(../fonts/golos-text-extra-400.woff2) format("woff2"); unicode-range: U+02BB, U+2192; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 450 549; font-display: swap;
  src: url(../fonts/golos-text-extra-500.woff2) format("woff2"); unicode-range: U+02BB, U+2192; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 550 649; font-display: swap;
  src: url(../fonts/golos-text-extra-600.woff2) format("woff2"); unicode-range: U+02BB, U+2192; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 650 900; font-display: swap;
  src: url(../fonts/golos-text-extra-700.woff2) format("woff2"); unicode-range: U+02BB, U+2192; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/ibm-plex-mono-extra-400.woff2) format("woff2"); unicode-range: U+2192; }

/* ---------- Токены темы «тёплый» ---------- */
:root {
  color-scheme: light;
  --font-body: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-brand: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --bg: #F5EFE8;
  --surface: #FFFFFF;
  --surface-2: #FBF7F3;
  --surface-3: #F3EBE3;
  --border: #E8DDD2;
  --border-strong: #D6C6B7;
  --text: #2E2520;
  --text-soft: #5A4B42;
  --text-muted: #6E5E54;
  --text-faint: #A08F84;
  --accent: #E2643B;
  --accent-strong: #B9482A;
  --accent-tint: #FCEBE3;
  --on-accent: #FFFFFF;
  --accent-2: #F2A93B;
  --ok: #3F7D4F;
  --ok-tint: #E8F2E6;
  --warn: #8C5A12;
  --warn-tint: #FDF0D8;
  --warn-line: #F2A93B;
  --danger: #B3372F;
  --danger-tint: #FBE6E2;
  --info: #6A5BA8;
  --info-tint: #EFECF8;
  --side: #45382F;
  --side-text: #D9CBBF;
  --side-active-bg: rgba(226, 100, 59, .22);
  --side-active: #FFD9C7;
  --side-border: #3A2F27;
  --shadow-s: 0 1px 2px rgba(70, 50, 35, .06), 0 2px 8px rgba(70, 50, 35, .05);
  --shadow-m: 0 2px 6px rgba(70, 50, 35, .07), 0 14px 34px rgba(70, 50, 35, .10);
  --radius: 6px;
  --radius-s: 4px;
  --head-transform: uppercase;
  --head-spacing: .06em;
  --chart-1: #E2643B;
  --chart-2: #F2C58E;
}

/* В Unbounded нет казахских и узбекских букв Ә Ғ Қ Ң Ө Ұ Ү Һ Ҳ — браузер брал бы их из другого шрифта посреди слова.
   На этих языках заголовки — Golos Text целиком (так же в PDF: src/Lrg.Portal/Reports/fonts/README.md); название
   бренда — латиницей, остаётся в Unbounded (--font-brand). */
html:lang(kk-Cyrl), html:lang(uz-Cyrl) { --font-display: "Golos Text", system-ui, sans-serif; }

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font-body);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Каркас приложения ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; background: var(--side); color: var(--side-text);
  border-right: 1px solid var(--side-border);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--text); }
.side-brand { color: #fff; }
.side-brand .wordmark { font: 600 15px/1.1 var(--font-brand); letter-spacing: .01em; }
.side-brand .wordmark small { display: block; font: 500 11px/1.2 var(--font-body); color: var(--side-text); letter-spacing: 0; margin-top: 3px; }
.side-section { margin: 14px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.side-section { color: #B6A293; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--side-text); font-weight: 500; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
  position: relative; line-height: 1.25;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item:hover { background: #50423A; color: #fff; }
.nav-item[aria-current="page"] { background: var(--side-active-bg); color: var(--side-active); font-weight: 600; }
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .count { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent-2); color: #2A1D05; }
.side-org {
  margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: var(--radius-s);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.side-org { background: #514339; border-color: #5D4E43; color: #fff; }
.side-org .org-name { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.side-org .org-sub { font-size: 12px; color: var(--text-muted); }
.side-org .org-sub { color: #D9CBBF; }

.main { display: flex; flex-direction: column; min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.top h1 { font-size: 21px; font-weight: 650; text-transform: var(--head-transform); letter-spacing: var(--head-spacing); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(360px, 34vw);
  padding: 9px 12px; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--text); }
.search input::placeholder { color: var(--text-faint); }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-s);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); cursor: pointer;
}
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); border: 2px solid var(--surface); }
.user { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--accent-tint); color: var(--accent-strong); font-weight: 650; font-size: 13.5px;
}
.avatar.a2 { background: var(--warn-tint); color: var(--warn); }
.avatar.a3 { background: var(--info-tint); color: var(--info); }
.avatar.a4 { background: var(--ok-tint); color: var(--ok); }
.user-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.user-role { font-size: 12px; color: var(--text-muted); }

.content { padding: 26px 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); }
.page-head .head-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
/* Выбор в шапке страницы (период, отбор) — по содержимому, в строку с кнопкой */
.page-head .head-actions .input { width: auto; }
.badge-partner {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-strong); font-weight: 600; font-size: 13px;
}

/* ---------- Карточки и элементы ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-s); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.card-head h3 { font-size: 16.5px; font-weight: 650; text-transform: var(--head-transform); letter-spacing: var(--head-spacing); }
.card-head h3 { font-size: 14px; }
.card-head .more { margin-left: auto; font-size: 13.5px; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  padding: 9px 16px; border-radius: var(--radius-s); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; line-height: 1.2;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-warn { background: var(--warn-line); border-color: var(--warn-line); color: #2A1D05; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent-strong); padding-left: 10px; padding-right: 10px; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-tint); color: var(--ok); }
.b-warn { background: var(--warn-tint); color: var(--warn); }
.b-danger { background: var(--danger-tint); color: var(--danger); }
.b-info { background: var(--info-tint); color: var(--info); }
.b-neutral { background: var(--surface-3); color: var(--text-soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-soft); font-size: 13px; font-weight: 500;
}
button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.input {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-s); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input::placeholder { color: var(--text-faint); }

/* ---------- Кабинет ---------- */
.grid-cab { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.kpi-value small { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.kpi-note { font-size: 12.5px; color: var(--text-muted); }
.kpi-note.warn { color: var(--warn); font-weight: 600; }
.meter { display: block; width: 100%; height: 6px; margin-top: 6px; }
.meter .track { fill: var(--surface-3); }
.meter .fill { fill: var(--accent); }
.meter .fill.warn { fill: var(--warn-line); }

.alert {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius);
  background: var(--warn-tint); border: 1px solid color-mix(in srgb, var(--warn-line) 55%, transparent);
}
.alert .alert-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--warn-line); color: #2A1D05; flex: none; }
.alert-title { font-weight: 650; }
.alert-text { color: var(--text-soft); font-size: 14px; }
.alert .btn { margin-left: auto; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding: 12px 18px; line-height: 1.3; vertical-align: bottom;
  border-bottom: 1px solid var(--border);
}
.table th { text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.nowrap { white-space: nowrap; }
.icon-btn.sm { width: 34px; height: 34px; }
.link-btn { padding: 2px 0; font-size: 12.5px; background: none; border: 0; color: var(--accent-strong); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--text-muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions.start { justify-content: flex-start; }

.build { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.build-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius); background: var(--accent-tint); color: var(--accent-strong); flex: none; }
.build-icon svg.i { width: 28px; height: 28px; }
.build-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.build-title { font-weight: 650; font-size: 16px; }
.build-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.build-sha { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.events { list-style: none; margin: 0; padding: 8px 22px 18px; }
.events li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.events li:last-child { border-bottom: 0; }
.ev-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.ev-text { font-size: 14px; line-height: 1.4; }
.ev-time { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.team { display: flex; flex-direction: column; gap: 12px; padding: 14px 22px 20px; }
.member { display: flex; align-items: center; gap: 12px; }
.member .m-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.member .m-role { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Магазин ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab {
  padding: 10px 14px; border: 0; background: none; color: var(--text-muted); font-weight: 600; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.grid-shop { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.plan.popular { border: 2px solid var(--accent); }
.plan-flag { position: absolute; top: -12px; left: 20px; padding: 3px 11px; border-radius: 999px; background: var(--accent-strong); color: var(--on-accent); font-size: 12px; font-weight: 650; }
.plan-name { font: 600 18px/1.2 var(--font-display); }
.plan-name { font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 15px; }
.plan-price { font-size: 36px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.plan-per { font-size: 13px; color: var(--text-muted); }
.plan-next { font-size: 13.5px; color: var(--text-soft); padding: 8px 10px; border-radius: var(--radius-s); background: var(--surface-2); }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg.i { color: var(--accent); margin-top: 1px; }
.plan-buy { margin-top: auto; display: flex; gap: 10px; align-items: center; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-s); overflow: hidden; }
.stepper button { width: 34px; height: 38px; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--text-soft); }
.stepper output { min-width: 34px; text-align: center; font-weight: 650; }
.addons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.addon { display: flex; gap: 14px; align-items: center; padding: 18px 20px; }
.addon-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-s); background: var(--surface-3); color: var(--accent-strong); flex: none; }
.addon-title { font-weight: 650; }
.addon-price { font-weight: 650; color: var(--accent-strong); }
.addon .btn { margin-left: auto; }
.cart { position: sticky; top: 84px; }
.cart-lines { list-style: none; margin: 0; padding: 4px 22px; }
.cart-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.cart-lines li .price { font-weight: 600; white-space: nowrap; }
.cart-sum { padding: 6px 22px 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cart-sum .row { display: flex; justify-content: space-between; gap: 12px; }
/* «Купить» с сайта продукта (этап 8, шаг 1): подтверждение — узкой карточкой, строки и итог — как в корзине */
.buy-card { max-width: 640px; }
.buy-card .cart-lines, .buy-card .cart-sum, .buy-card .cart-total { padding-left: 0; padding-right: 0; }
.cart-sum .discount { color: var(--ok); font-weight: 600; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 22px 4px; font-size: 15px; font-weight: 600; }
.cart-total strong { font-size: 26px; letter-spacing: -.01em; }
.cart-uzs { padding: 0 22px 16px; font-size: 12.5px; color: var(--text-muted); }
.pay-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 22px 16px; }
.pay {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--text);
}
.pay[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-strong); }
.pay .radio { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.pay[aria-pressed="true"] .radio { border: 4px solid var(--accent); }
.cart-foot { padding: 0 22px 20px; display: flex; flex-direction: column; gap: 10px; }
.note { font-size: 12.5px; color: var(--text-muted); display: flex; gap: 6px; align-items: flex-start; }
.note.warn { color: var(--warn); font-weight: 600; }

/* ---------- Счёт ---------- */
.grid-inv { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.paper { padding: 34px 38px; }
.paper-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 2px solid var(--text); }
.paper-title { font: 600 22px/1.25 var(--font-display); }
.paper-title { font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 22px 0; }
.party-label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 6px; }
.party-name { font-weight: 650; }
.party-line { font-size: 14px; color: var(--text-soft); }
.stub { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 6px; background: var(--warn-tint); color: var(--warn); font-size: 12.5px; font-weight: 600; }
.paper .table th, .paper .table td { padding-left: 0; padding-right: 12px; }
.paper .table th:last-child, .paper .table td:last-child { padding-right: 0; }
.totals { margin-left: auto; width: min(360px, 100%); display: flex; flex-direction: column; gap: 6px; padding-top: 16px; font-size: 14px; }
.totals .row { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; font-size: 18px; font-weight: 700; }
.paper-foot { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.inv-list { list-style: none; margin: 0; padding: 6px 22px 16px; }
.inv-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.inv-list li:last-child { border-bottom: 0; }
.inv-list .mono { white-space: nowrap; }
.inv-list .sum { grid-column: 2; grid-row: 1; font-weight: 600; white-space: nowrap; }
.inv-list .badge { grid-column: 1 / -1; justify-self: start; }

/* ---------- Админка ---------- */
.kpi-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi-card { padding: 18px 20px; }
.kpi-card .kpi-value { font-size: 26px; }
.trend { font-size: 12.5px; font-weight: 600; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--danger); }
.grid-adm { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
.chart { display: block; width: 100%; height: 210px; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .bar { fill: var(--chart-2); }
.chart .bar.hi { fill: var(--chart-1); }
.chart .lbl { fill: var(--text-muted); font: 500 11.5px var(--font-body); }
.chart .val { fill: var(--text-soft); font: 600 11.5px var(--font-body); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.toolbar .search { margin-left: auto; width: min(320px, 100%); }
.toolbar select.input { width: auto; min-width: 150px; padding-top: 8px; padding-bottom: 8px; }
.pay-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }
.pay-tag .sq { width: 10px; height: 10px; border-radius: 3px; background: var(--border-strong); }
.pay-tag.payme .sq { background: #33CCCC; }
.pay-tag.click .sq { background: #0B7DE5; }
.pay-tag.uzum .sq { background: #7B3FE4; }
.pay-tag.invoice .sq { background: var(--accent-2); }
.queue { list-style: none; margin: 0; padding: 6px 22px 16px; }
.queue li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.queue li:last-child { border-bottom: 0; }
.queue .q-main { font-weight: 600; font-size: 14px; }
.queue .q-sub { font-size: 12.5px; color: var(--text-muted); }
.queue .btn { margin-left: auto; }
/* Готовность к запуску: столбцы во всех карточках на одной линии — у отметки и ссылки ширина своя, не по содержимому */
.table.launch { table-layout: fixed; }
.table.launch td:first-child { width: 150px; }
.table.launch td:last-child { width: 110px; text-align: right; }
@media (max-width: 720px) {
  .table.launch { table-layout: auto; }
  .table.launch td:first-child, .table.launch td:last-child { width: auto; }
}

/* ---------- Вход ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 20px;
  background:
    radial-gradient(900px 500px at 15% 10%, var(--accent-tint), transparent 60%),
    radial-gradient(700px 420px at 90% 90%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 60%),
    var(--bg);
}
.login-row { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.login-card { width: min(420px, 100%); padding: 34px 32px 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-m); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .wordmark { font: 600 17px/1.1 var(--font-brand); }
.login-card h2 { font-size: 24px; font-weight: 700; }
.login-card .sub { color: var(--text-muted); margin: 6px 0 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.lock-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); font-size: 12.5px; color: var(--text-muted); }
.code { display: flex; gap: 8px; justify-content: space-between; }
.code span {
  display: grid; place-items: center; width: 48px; height: 56px; border-radius: var(--radius-s); border: 1px solid var(--border-strong);
  font: 600 22px var(--font-mono); background: var(--surface);
}
.code span.on { border: 2px solid var(--accent); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-soft); }
.check .box { width: 18px; height: 18px; border-radius: 5px; background: var(--accent-strong); display: grid; place-items: center; color: var(--on-accent); }
.lang-mini { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }

/* ---------- Логотип ---------- */
.lockup { display: flex; align-items: center; gap: 14px; }
.lockup .name { font: 600 22px/1.05 var(--font-brand); letter-spacing: .01em; white-space: nowrap; }
.lockup .name small { display: block; font: 500 12.5px/1.2 "Golos Text", sans-serif; letter-spacing: .02em; opacity: .75; margin-top: 4px; }
.mark-40 { width: 40px; height: 40px; }
.mark-56 { width: 56px; height: 56px; }
/* Знак «Вершина»: цвета — через переменные, они наследуются в содержимое <use> (селекторы по месту туда не проходят) */
:root { --lg-ink: #2E2520; --lg-teal: #E2643B; --lg-amber: #F2A93B; }
.side { --lg-ink: #FFFFFF; }
.lg-amber { fill: var(--lg-amber); }
.lg-stroke-teal { fill: none; stroke: var(--lg-teal); }
.lg-stroke-ink { fill: none; stroke: var(--lg-ink); }

/* ---------- Ширины ---------- */
@media (max-width: 1280px) {
  .grid-cab, .grid-shop, .grid-inv { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .side { padding: 16px 10px; align-items: center; }
  .side-brand .wordmark, .nav-item span, .side-section, .side-org div, .nav-item .count { display: none; }
  .side-brand { padding: 4px 0 14px; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item[aria-current="page"]::before { left: -10px; }
  .side-org { padding: 8px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .kpi-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-adm, .addons, }
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30;
    flex-direction: row; justify-content: space-around; padding: 6px 4px; border-right: 0; border-top: 1px solid var(--side-border);
  }
  .side-brand, .side-org, .side-section, .side .nav-hide-m { display: none; }
  .nav-item { width: auto; padding: 10px; }
  .nav-item[aria-current="page"]::before { display: none; }
  .top { top: 0; position: static; padding: 12px 16px; flex-wrap: wrap; }
  .search { order: 5; width: 100%; margin-left: 0; }
  .user-meta { display: none; }
  .content { padding: 18px 16px 90px; }
  .page-head h2 { font-size: 22px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--border); }
  .alert { flex-wrap: wrap; }
  .alert .btn { margin-left: 0; width: 100%; }
  .parties { grid-template-columns: minmax(0, 1fr); }
  .paper { padding: 22px 18px; }
  .kpi-cards,   .code span { width: 42px; height: 50px; }
  .login-card { padding: 26px 20px 22px; }
}


/* Валюта и НДС (01.10): выбор валюты в верхней панели, цены с НДС, настройка ставки в админке */
.cur-select select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding: 9px 34px 9px 12px; border-radius: var(--radius-s); border: 1px solid var(--border); background-color: var(--surface);
  color: var(--text); font-weight: 600; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6B70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.cur-select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.plan-net { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.plan-price { white-space: nowrap; }
.inv-cur { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 0; font-size: 13.5px; }
.cart-uzs { line-height: 1.4; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; padding: 16px 22px; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.vat-input { max-width: 140px; font-weight: 650; }
.table.rates td { padding: 8px 0; }
.table.rates td:first-child { padding-left: 0; }
.table.rates td:last-child { padding-right: 0; }
.table.rates td + td { padding-left: 14px; }
.settings-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 0 22px 20px; }
@media (max-width: 1080px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
/* Прайс в сумах: поля цен по ширине суммы; дата, основание и «Утвердить» — в строку, на узком экране — столбиком */
.price-input { width: 150px; text-align: right; }
.section.price-approve { flex-direction: row; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.price-approve .grow { flex: 1 1 260px; }
.price-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* Отчёты: месяц, «Показать» и «Выгрузить CSV» — в строку */
.section.toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.toolbar .input { width: auto; }
.cur-fixed { cursor: default; }
/* Согласие с условиями покупки при оформлении; страницы правил — текстом с отступами */
.terms-check { align-items: flex-start; font-size: 13.5px; color: var(--text); }
.terms-check input { margin-top: 2px; flex: none; }
.terms-links { margin-top: -4px; display: block; line-height: 1.6; }
.legal { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.legal p { margin: 0; line-height: 1.55; }
@media (max-width: 720px) { .cur-select { order: 4; } }
.plan-price.long { font-size: 25px; letter-spacing: -.01em; }
/* Код валюты ISO рядом с ценой уровня — мельче числа */
.plan-price .cur { font-size: .5em; font-weight: 600; letter-spacing: 0; color: var(--text-muted); }

/* ---------- Компоненты приложения (этап 1) ---------- */
.login-col { display: flex; flex-direction: column; gap: 16px; align-items: center; width: min(440px, 100%); }
.login-card { width: 100%; }
.login-card.wide { width: min(560px, calc(100vw - 40px)); }
.login-col:has(.login-card.wide) { width: min(560px, 100%); }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-card .links { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.lang-mini strong { font-weight: 600; color: var(--text-soft); }
.lang-mini a, .lang-mini strong { padding: 2px 4px; }

.top-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn.wide { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; font-weight: 600; font-size: 13.5px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); box-shadow: var(--shadow-m);
}
.menu-list a, .menu-list button {
  display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; font-size: 14px;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-3); text-decoration: none; }
.menu-list a[aria-current="true"] { font-weight: 650; color: var(--accent-strong); }
.menu-list .sep { height: 1px; margin: 6px 4px; background: var(--border); padding: 0; }
.user-btn { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 2px; border-radius: var(--radius-s); }

.flash { padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 18px; font-weight: 500; }
.flash.ok { background: var(--ok-tint); color: var(--ok); }
.flash.warn { background: var(--warn-tint); color: var(--warn); }
.flash.danger { background: var(--danger-tint); color: var(--danger); }
.flash p { margin: 0 0 6px; }
.bullets { margin: 0 0 12px; padding-left: 20px; font-size: 14px; color: var(--text-soft); }
.bullets li + li { margin-top: 4px; }
.flash .bullets { margin: 0; color: inherit; }
.form-error { padding: 10px 12px; border-radius: var(--radius-s); background: var(--danger-tint); color: var(--danger); font-size: 14px; }
.form-error ul { margin: 0; padding-left: 18px; }
.field-error { color: var(--danger); font-size: 13px; }
.hint { color: var(--text-muted); font-size: 13px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1 1 200px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E5E54' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-strong); margin: 0; }
.input.code-input { font: 600 22px var(--font-mono); letter-spacing: .3em; text-align: center; }

.qr { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr svg { width: 184px; height: 184px; background: #fff; padding: 8px; border-radius: var(--radius-s); border: 1px solid var(--border); }
.secret { font-family: var(--font-mono); font-size: 14px; word-break: break-all; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-s); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-family: var(--font-mono); font-size: 15px;
  padding: 14px 18px; background: var(--surface-2); border-radius: var(--radius-s); list-style: none; margin: 0; }

.section { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.section + .section { border-top: 1px solid var(--border); }
.section h3 { font-size: 14px; font-weight: 650; text-transform: var(--head-transform); letter-spacing: var(--head-spacing); }
.section p { margin: 0; color: var(--text-soft); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rows li:last-child { border-bottom: 0; }
.rows .grow { flex: 1 1 220px; min-width: 0; }
/* Список и раздел карточки одним элементом: у раздела — свои поля, у строк — свои отступы (без них строки упирались в края) */
.rows.section { padding: 8px 22px; gap: 0; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.empty { color: var(--text-muted); padding: 8px 0; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.side-org { color: inherit; }
a.side-org:hover { text-decoration: none; filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { border-color: var(--danger); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 600; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .top-tools { gap: 8px; }
  .codes { grid-template-columns: minmax(0, 1fr); }
  .menu-list { right: -8px; }
}
.side-org-menu { margin-top: auto; }
.side-org-menu > summary { list-style: none; cursor: pointer; }
.side-org-menu > summary::-webkit-details-marker { display: none; }
.side-org-menu .side-org { margin-top: 0; }
.menu-list.up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
/* Узкая панель (только значки): меню организации шире её — открывается справа от панели, поверх страницы. position:
   fixed — чтобы его не обрезала прокрутка панели (BUG-005); сама панель — над содержимым страницы */
@media (min-width: 721px) and (max-width: 1080px) {
  .side { z-index: 20; }
  .side-org-menu .menu-list.up { position: fixed; left: 84px; right: auto; top: auto; bottom: 12px; min-width: 240px; max-width: calc(100vw - 100px); }
}
@media (max-width: 720px) { .side-org-menu { display: none; } }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.input.input-sm { padding: 6px 30px 6px 10px; font-size: 13.5px; width: auto; }
.user-meta { display: flex; flex-direction: column; text-align: left; }
.section.form-stack { max-width: none; }
.section.form-stack > * { max-width: 520px; }

/* Страницы входа и регистрации: карточка помещается в экран ноутбука (768 px) и стоит по центру; переход
   «вход ↔ регистрация» — сразу под заголовком, а не внизу карточки */
.login-wrap { min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
.login-card { padding: 28px 28px 24px; gap: 14px; }
.login-card h2 { font-size: 22px; }
.login-card .sub { margin-top: 4px; font-size: 14.5px; }
.login-card form { gap: 12px; }
.login-card .field { gap: 5px; }
.login-card .input { padding: 10px 12px; }
.login-card .btn-lg { padding: 11px 18px; }
.login-card .hint { font-size: 12.5px; }
.login-brand .mark-40 { width: 34px; height: 34px; }
.auth-switch {
  margin: 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-soft);
}
.auth-switch a { font-weight: 650; }
.login-card .lock-note { margin: 0; }
.login-col { gap: 12px; }
@media (max-width: 720px) { .login-card { padding: 22px 18px 18px; } }
.login-card { gap: 12px; }
.login-card .lock-note { padding: 0; background: none; font-size: 12px; line-height: 1.35; align-items: center; justify-content: center; text-align: center; }
.login-card .or { margin: -2px 0; }
.login-card { padding: 24px 28px 20px; }
.login-col { gap: 8px; }
.auth-switch { padding: 8px 12px; }

/* Магазин (этап 3): вкладки — ссылки, количество — поле внутри «степпера», варианты продления и перехода */
a.tab { display: inline-block; text-decoration: none; }
a.tab:hover { text-decoration: none; color: var(--text); }
.tab[aria-current="page"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.stepper input.qty { width: 64px; height: 38px; border: 0; background: transparent; text-align: center; font: inherit; font-weight: 650; color: var(--text); }
.grid-shop > div > .addons:first-child { margin-top: 0; grid-template-columns: minmax(0, 1fr); }
.addon .badge { flex: none; white-space: nowrap; }
.addon .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.addon-buy { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.addon.is-soon { opacity: .78; }
.renew-options { display: flex; flex-wrap: wrap; gap: 10px; }
.cart-lines li.cart-remove { border-bottom: 1px dashed var(--border); padding: 0 0 8px; justify-content: flex-end; }
.cart .section .flash { margin: 0 0 8px; }
.cart-foot form { display: flex; justify-content: center; }
@media (max-width: 720px) {
  .addon { flex-wrap: wrap; }
  .addon-buy { margin-left: 0; }
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.totals-pad { padding: 16px 22px 20px; }
.kv.stacked { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.kv.stacked dd { margin-bottom: 8px; }
.role-list { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
/* Пробная сборка рядом с пробной лицензией: файлы комплекта — имя, SHA-256, размер, скачать */
.section.form-stack > .trial-build { max-width: 760px; }
.trial-build { border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.trial-build h4 { margin: 0; font-size: 15px; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.file-list .file-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-list .hash { overflow-wrap: anywhere; }
.more-block > summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; font-size: 14px; }
.queue-item { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.queue-item:last-child { padding-bottom: 0; border-bottom: 0; }
.queue-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.more-block[open] > summary { margin-bottom: 8px; }
.code-block {
  margin: 0; padding: 12px 14px; max-height: 360px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-s); font: 12px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
@media (max-width: 720px) { .file-list li { flex-wrap: wrap; } }
/* Сертификат лицензии (PDF) — ссылкой под номером лицензии */
.cert-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12.5px; color: var(--accent-strong); text-decoration: none; }
.cert-link:hover { text-decoration: underline; }
/* Поддержка (этап 6): переписка обращения — сообщения заказчика, ответы поддержки (тоном акцента), внутренние заметки
   агентов (штрихом, тоном предупреждения); текст — как написан, с переводами строк */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg-agent { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.msg-note { background: var(--warn-tint); border-style: dashed; border-color: var(--warn-line); }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-who { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.msg-author { font-weight: 650; font-size: 14px; line-height: 1.25; }
.msg-meta { font-size: 12.5px; color: var(--text-muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.msg-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; }
.msg-files li { display: inline-flex; align-items: center; gap: 8px; }
.msg-files a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
textarea.input { font: inherit; resize: vertical; min-height: 120px; line-height: 1.5; }
.card-gap { margin-bottom: 22px; }
/* База знаний (этап 6): разделы — плиткой, статья — читаемой колонкой; разметка статьи — только свои теги (HelpMarkdown) */
.help-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.help-list li { gap: 10px; }
.help-list li svg.i { color: var(--accent); flex: none; }
.help-body { max-width: 760px; line-height: 1.6; }
.help-body h3 { margin: 10px 0 0; font-size: 17px; text-transform: none; letter-spacing: 0; }
.help-body h4 { margin: 6px 0 0; font-size: 15px; }
.help-body ul, .help-body ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.help-body pre { margin: 0; padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface-2); overflow-x: auto; }
.help-body code { font-family: var(--font-mono); font-size: .92em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.help-body pre code { background: none; padding: 0; }
.help-body blockquote { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent); color: var(--text-soft); }
@media (max-width: 1080px) { .help-sections { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Юридические документы (этап 8, шаг 2): страница для чтения ---------- */
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 18px 24px; max-width: 920px; margin: 0 auto; }
.doc-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.doc-wrap { max-width: 920px; margin: 0 auto; padding: 0 24px 32px; }
.legal-doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 28px 36px; line-height: 1.6; color: var(--text); }
.legal-doc h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; }
.legal-doc h2 { font-size: 18px; margin: 28px 0 10px; scroll-margin-top: 12px; }
.legal-doc h3 { font-size: 15.5px; margin: 20px 0 8px; }
.legal-doc p { margin: 0 0 10px; }
.legal-doc p.clause b { font-weight: 600; color: var(--text-soft); }
.legal-doc ul { margin: 0 0 10px; padding-left: 22px; }
.legal-doc li { margin: 0 0 4px; }
.legal-doc .table-wrap { overflow-x: auto; margin: 0 0 14px; }
.legal-doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal-doc th, .legal-doc td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.legal-doc th { background: var(--surface-2); font-weight: 600; }
.legal-doc code { font-family: var(--font-mono); font-size: .92em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.legal-doc .flash { margin-bottom: 16px; }
.legal-doc .legal-edition { margin-top: 22px; }
.doc-foot { max-width: 920px; margin: 0 auto; padding: 8px 24px 36px; }
.doc-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.doc-foot a { color: var(--text-muted); }
@media (max-width: 640px) {
  .doc-top, .doc-wrap, .doc-foot { padding-left: 16px; padding-right: 16px; }
  .legal-doc { padding: 20px 18px; }
  .legal-doc h1 { font-size: 22px; }
}
