/* ОКК-завод — кабинет. Дизайн-система «Ночной пульт» (как на сайте okkzavod.ru):
   тёмная база, сигнальный оранжевый — только для спасения и главных действий, зелёный — спасено,
   янтарный — внимание, красный — просрочено. Onest для текста, IBM Plex Mono для цифр, таймкодов и меток.
   Анимации — только transform/opacity и уважают prefers-reduced-motion. */

@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('../fonts/onest-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: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('../fonts/onest-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, U+20BD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 400;
  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-display: swap; font-weight: 400;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212, U+20BD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 500;
  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-display: swap; font-weight: 500;
  src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212, U+20BD; }

:root {
  --bg: #0b0b0d; --bg-2: #0f0f12; --side: #0c0c0f;
  --surface: #141418; --surface-2: #1a1a1f; --surface-3: #222228; --hover: rgba(255,255,255,.035);
  --text: #f3f1ec; --text-2: #b8b6bd; --text-3: #8d8b94; --text-4: #66646d;
  --line: rgba(255,255,255,.075); --line-2: rgba(255,255,255,.14);
  --accent: #ff5b1f; --accent-hover: #ff7a47; --accent-ink: #160803; --accent-soft: rgba(255,91,31,.12);
  --accent-text: #ff8a57; --glow: rgba(255,91,31,.34);
  --ok: #43d193; --ok-soft: rgba(67,209,147,.11); --ok-text: #5fe0a6;
  --warn: #f2b13c; --warn-soft: rgba(242,177,60,.12); --warn-text: #f5c25e;
  --bad: #ff6b6b; --bad-soft: rgba(255,107,107,.11); --bad-text: #ff8a8a;
  --info: #8ab4ff; --info-soft: rgba(138,180,255,.11);
  --r: 16px; --r-sm: 11px; --r-xs: 7px;
  --shadow: 0 1px 0 rgba(255,255,255,.035) inset, 0 18px 40px -24px rgba(0,0,0,.7);
  --pop: 0 24px 70px -20px rgba(0,0,0,.75), 0 0 0 1px var(--line-2);
  --f: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side-w: 252px;
  color-scheme: dark;
}
[data-theme='light'] {
  --bg: #f4f3ef; --bg-2: #eceae5; --side: #f9f8f5;
  --surface: #ffffff; --surface-2: #f6f5f2; --surface-3: #eeece8; --hover: rgba(18,18,21,.035);
  --text: #121215; --text-2: #46454c; --text-3: #6b6a73; --text-4: #9a99a1;
  --line: rgba(18,18,21,.09); --line-2: rgba(18,18,21,.17);
  --accent-soft: rgba(255,91,31,.1); --accent-text: #c2410c; --glow: rgba(255,91,31,.25);
  --ok: #17915a; --ok-soft: rgba(23,145,90,.1); --ok-text: #137a4c;
  --warn: #b7791f; --warn-soft: rgba(183,121,31,.12); --warn-text: #8f5d05;
  --bad: #d63b3b; --bad-soft: rgba(214,59,59,.09); --bad-text: #b42323;
  --info: #3466d6; --info-soft: rgba(52,102,214,.09);
  --shadow: 0 1px 2px rgba(18,18,21,.04), 0 10px 30px -18px rgba(18,18,21,.18);
  --pop: 0 24px 60px -20px rgba(18,18,21,.3), 0 0 0 1px var(--line-2);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14.5px/1.5 var(--f); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; font-feature-settings: 'tnum' 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 560; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px 14px;
  background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 6px 18px -8px var(--glow); }
.brand-mark svg { width: 16px; height: 16px; stroke: var(--accent-ink); stroke-width: 2.8; }
.brand b { color: var(--accent-text); font-weight: 600; }
.co { position: relative; margin: 0 2px 10px; }
.co-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); background: var(--surface);
  border: 1px solid var(--line); text-align: left; cursor: default; }
.co-btn[aria-haspopup] { cursor: pointer; }
.co-btn[aria-haspopup]:hover { border-color: var(--line-2); }
.co-name { font-weight: 560; font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-sub { font: 400 11px/1.3 var(--f-mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.co-av { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font-weight: 600; font-size: 12px; color: var(--text-2); }
.co-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--pop); padding: 6px; z-index: 40; max-height: 60vh; overflow: auto; }
.co-menu button { width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.co-menu button:hover, .co-menu button[aria-current] { background: var(--hover); }
.nav { display: grid; gap: 2px; }
.nav a, .nav .nav-btn { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-weight: 480;
  transition: background .15s ease, color .15s ease; position: relative; }
.nav a:hover, .nav .nav-btn:hover { background: var(--hover); color: var(--text); }
.nav .nav-btn { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.nav a[aria-current='page'] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav a[aria-current='page'] .ico { color: var(--accent-text); }
.nav .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: inherit; }
a.me:hover { background: var(--hover); }
.me-name { font-size: 13.5px; font-weight: 520; line-height: 1.2; }
.me-role { font-size: 12px; color: var(--text-3); }
.side-tools { display: flex; gap: 4px; padding: 0 4px; }
.side-collapse { display: none; }
/* свёрнутое меню — только на компьютере; на телефоне меню и так выезжает по кнопке */
@media (min-width: 901px) {
  .side-collapse { display: inline-grid; }
  [data-side='mini'] { --side-w: 72px; }
  [data-side='mini'] .side { padding-inline: 10px; }
  [data-side='mini'] .brand { justify-content: center; padding-inline: 0; }
  [data-side='mini'] .brand > span:not(.brand-mark), [data-side='mini'] .co-btn > span:not(.co-av), [data-side='mini'] .co-btn > .ico,
  [data-side='mini'] .nav a > span:not(.badge), [data-side='mini'] .nav .nav-btn > span, [data-side='mini'] .me > div { display: none; }
  [data-side='mini'] .co { margin-inline: 0; }
  [data-side='mini'] .co-btn { justify-content: center; padding: 6px; }
  [data-side='mini'] .co-menu { right: auto; width: 240px; }
  [data-side='mini'] .nav a, [data-side='mini'] .nav .nav-btn { justify-content: center; padding: 10px 0; }
  [data-side='mini'] .nav .badge { position: absolute; top: 1px; right: 4px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
  [data-side='mini'] .nav-sep { margin-inline: 4px; }
  [data-side='mini'] .me { justify-content: center; padding: 8px 0; }
  [data-side='mini'] .side-tools { flex-direction: column; align-items: center; padding: 0; }
  [data-side='mini'] .side-tools form { margin-left: 0 !important; }
}
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--side); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 32px; min-height: 60px;
  background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top .crumbs { font-size: 13px; color: var(--text-3); display: flex; gap: 8px; align-items: center; min-width: 0; }
.top .crumbs a:hover { color: var(--text); }
.top .crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-3); cursor: pointer; min-width: 220px; font-size: 13.5px; }
.search-btn:hover { border-color: var(--line-2); color: var(--text-2); }
.search-btn kbd { margin-left: auto; }
kbd { font: 500 11px/1 var(--f-mono); padding: 4px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); border: 1px solid var(--line); }
.menu-btn { display: none; }
.page { width: 100%; max-width: 1380px; padding: 28px 32px 80px; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.55rem, 1.2rem + 1vw, 2rem); line-height: 1.12; letter-spacing: -0.03em; }
.page-head .lead { color: var(--text-2); margin-top: 6px; max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font: 500 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.eyebrow b { color: var(--accent-text); font-weight: 500; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 520; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .2s ease; text-decoration: none; }
.btn:hover { background: var(--surface-2); border-color: var(--text-4); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -12px var(--glow); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 10px 30px -10px var(--glow); }
.btn-white { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-white:hover { background: var(--text); opacity: .9; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); border-color: transparent; }
.btn-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok-text); }
.btn-ok:hover { background: var(--ok); color: #04130b; border-color: var(--ok); }
.btn-danger { color: var(--bad-text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .55; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.link { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.link:hover { color: var(--accent-hover); }
.link-quiet { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.link-quiet:hover { color: var(--accent-text); }
.muted-link { color: var(--text-3); }
.muted-link:hover { color: var(--text); }

.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 520; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--text-3); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color .15s ease, box-shadow .15s ease; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238d8b94' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.select option { background: var(--surface); color: var(--text); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input-sm, .select-sm { height: 34px; font-size: 13.5px; }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.role-help { display: grid; gap: 8px; margin: 10px 0 0; }
.role-help dt { font-weight: 560; }
.role-help dd { margin: 2px 0 0; color: var(--text-2); }
.form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .form-2 { grid-template-columns: minmax(0, 1fr); } }
.upload-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.upload-grid .input, .upload-grid .select { width: 100%; min-width: 0; }
@media (max-width: 760px) { .upload-grid { grid-template-columns: minmax(0, 1fr); } }
.err-box { background: var(--bad-soft); color: var(--bad-text); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 1px 0 0; }

/* ---------- поверхности ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 560; letter-spacing: -0.01em; display: flex; gap: 10px; align-items: center; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
/* на телефоне заголовок карточки не сжимается подписью: подпись и кнопка уходят на следующую строку */
@media (max-width: 640px) { .card-head { flex-wrap: wrap; row-gap: 6px; } .card-head h2, .card-head h3 { flex: 1 1 auto; min-width: 0; } .card-head > :not(h2):not(h3) { flex: 0 1 auto; } }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.section-title { font-size: 17px; font-weight: 560; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }
.section-title .sub { font-size: 13px; color: var(--text-3); font-weight: 400; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.split-r { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.stack > *, .grid > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 28px; }
.muted { color: var(--text-3); } .muted-2 { color: var(--text-2); } .small { font-size: 13px; } .xs { font-size: 12px; }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* ---------- метрики ---------- */
.kpi { padding: 18px 20px; display: grid; gap: 6px; position: relative; overflow: hidden; min-height: 132px; align-content: start; }
.kpi-label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.kpi-value { font-size: clamp(1.9rem, 1.5rem + 1.1vw, 2.5rem); font-weight: 520; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .5em; color: var(--text-3); font-weight: 450; letter-spacing: -0.01em; margin-left: 2px; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.kpi a.kpi-link { position: absolute; inset: 0; border-radius: inherit; }
.kpi a.kpi-link:hover, .kpi[data-kpi]:hover a.kpi-link { background: var(--hover); }
.kpi[data-kpi] { cursor: pointer; }
.kpi .ch-mini { position: relative; z-index: 1; }  /* подсказка мини-графика поверх подложки-ссылки; клик всё равно открывает окно */
.kpi-hero { background: radial-gradient(120% 140% at 0% 0%, rgba(255,91,31,.28), rgba(255,91,31,.06) 45%, transparent 70%), var(--surface);
  border-color: rgba(255,91,31,.38); box-shadow: 0 0 0 1px rgba(255,91,31,.08), 0 20px 50px -30px var(--glow); }
.kpi-hero .kpi-value { color: #fff; }
[data-theme='light'] .kpi-hero .kpi-value { color: var(--text); }
.kpi-good { background: radial-gradient(120% 140% at 0% 0%, rgba(67,209,147,.16), transparent 60%), var(--surface); }
.delta { font: 500 11.5px/1 var(--f-mono); padding: 4px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.delta.up { background: var(--ok-soft); color: var(--ok-text); }
.delta.down { background: var(--bad-soft); color: var(--bad-text); }

/* ---------- метки ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; max-width: 100%; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 520;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; line-height: 1; }
.chip::before { content: none; }
.chip-wrap { white-space: normal; line-height: 1.3; padding: 3px 10px; border-radius: 12px; overflow-wrap: anywhere; }  /* длинный адрес портала на телефоне (О12) */
.chip.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-soft); color: var(--ok-text); }
.chip-warn { background: var(--warn-soft); color: var(--warn-text); }
.chip-bad { background: var(--bad-soft); color: var(--bad-text); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-muted { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.tag { font: 500 11px/1 var(--f-mono); padding: 5px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; letter-spacing: .01em; }
.tag-accent { background: var(--accent-soft); color: var(--accent-text); }
.tag-ok { background: var(--ok-soft); color: var(--ok-text); }
.tag-bad { background: var(--bad-soft); color: var(--bad-text); }
.tag-warn { background: var(--warn-soft); color: var(--warn-text); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 600 11px/1 var(--f-mono);
  background: var(--surface-3); color: var(--text-2); }
.badge-hot { background: var(--accent); color: var(--accent-ink); }
.score { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 7px; border-radius: 8px; font: 600 13px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.score.ok { background: var(--ok-soft); color: var(--ok-text); }
.score.warn { background: var(--warn-soft); color: var(--warn-text); }
.score.bad { background: var(--bad-soft); color: var(--bad-text); }
.score.muted { background: var(--surface-3); color: var(--text-3); }
.prio { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.prio i { width: 3px; border-radius: 2px; background: var(--line-2); }
.prio i:nth-child(1) { height: 5px; } .prio i:nth-child(2) { height: 8px; } .prio i:nth-child(3) { height: 12px; }
.prio.p1 i { background: var(--accent); } .prio.p2 i:nth-child(-n+2) { background: var(--warn); } .prio.p3 i:nth-child(1) { background: var(--text-3); }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); letter-spacing: .02em; }
.av-sm { width: 24px; height: 24px; font-size: 10px; }
.av-lg { width: 52px; height: 52px; font-size: 17px; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font: 500 11px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 11px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover, .table tbody tr.is-hover:hover { background: var(--hover); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .t-title { font-weight: 520; color: var(--text); }
.only-m { display: none; }
.copy-text p { margin: 0 0 .7em; }
.copy-text p:last-child { margin-bottom: 0; }
/* таблица-карточки на телефоне: строка — карточка, ячейки с data-label — сеткой в две колонки с подписью,
   .stack-full — во всю ширину (название, «что важно») */
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody { display: block; }
  .table-stack tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px 16px;
    border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td, .table-stack tr:last-child td { display: block; padding: 0; border: 0; min-width: 0; }
  .table-stack .num { text-align: left; white-space: normal; }
  .table-stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px;
    font: 500 10.5px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
  .table-stack .stack-full { grid-column: 1 / -1; }
}
.table .t-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; line-height: 1.35; }
.table tfoot td { font-weight: 560; background: var(--surface-2); }
.table-compact td { padding: 9px 14px; }

/* ---------- вкладки и фильтры ---------- */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; color: var(--text-2);
  border: 0; background: none; cursor: pointer; white-space: nowrap; font-weight: 480; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a[aria-current='true'], .tabs button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25), inset 0 0 0 1px var(--line); font-weight: 520; }
.tabs .badge { height: 18px; min-width: 18px; font-size: 10.5px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .select, .filters .input { height: 34px; width: auto; font-size: 13.5px; background-color: var(--surface); }
.filters .input { min-width: 200px; }
.subnav { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a { padding: 10px 12px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 480; }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current='page'] { color: var(--text); border-color: var(--accent); }

/* ---------- списки ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.list > * { min-width: 0; }
.list-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); position: relative; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--hover); }
.list-item .stretch { position: absolute; inset: 0; }
.list-item .li-title { font-weight: 520; display: flex; gap: 8px; align-items: center; min-width: 0; }
.list-item .li-title span:not(.tag):not(.chip) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-title .tag, .list-item .li-title .chip { flex: none; }  /* метка не обрезается (О12) */
.list-item .li-title.li-wrap span:not(.tag):not(.chip) { white-space: normal; overflow: visible; }  /* совет целиком, не «…» */
.list-item .li-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.list-item .li-side { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.quote { color: var(--text-2); font-style: normal; }
.quote::before { content: '«'; } .quote::after { content: '»'; }
.q-block { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; color: var(--text-2); }

/* ---------- пустые состояния и баннеры ---------- */
.empty { padding: 40px 24px; text-align: center; color: var(--text-3); display: grid; gap: 10px; justify-items: center; }
.empty .ico { width: 30px; height: 30px; color: var(--text-4); }
.empty h3 { color: var(--text); font-size: 16px; }
.empty p { max-width: 46ch; font-size: 13.5px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.banner .ico { margin-top: 1px; }
.banner-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn-text); }
.banner-accent { background: var(--accent-soft); border-color: rgba(255,91,31,.25); color: var(--text); }
.banner-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok-text); }
.banner-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad-text); }
.banner b { color: var(--text); }
.demo-ribbon { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn-text); }

/* ---------- графики ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
.bars span { flex: 1; min-width: 4px; background: var(--surface-3); border-radius: 3px 3px 1px 1px; position: relative; }
.bars span i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 3px 3px 1px 1px; opacity: .85; }
.bars span.today { outline: 1px dashed var(--line-2); outline-offset: 2px; }
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--text-3); }
.meter.ok i { background: var(--ok); } .meter.warn i { background: var(--warn); } .meter.bad i { background: var(--bad); } .meter.accent i { background: var(--accent); }
.meter .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 2px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 13.5px; }
.ring { width: 64px; height: 64px; }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .8s var(--ease); }
.ring.ok .fg { stroke: var(--ok); } .ring.warn .fg { stroke: var(--warn); } .ring.bad .fg { stroke: var(--bad); }
.ring text { font: 600 18px var(--f-mono); fill: var(--text); dominant-baseline: central; text-anchor: middle; }
.ring-lg { width: 96px; height: 96px; }
.ring-lg text { font-size: 26px; }
.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 170px 1fr 70px; gap: 12px; align-items: center; font-size: 13.5px; }
.funnel-bar { height: 28px; border-radius: 8px; background: var(--accent-soft); position: relative; overflow: hidden; }
.funnel-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), #ff8a57); border-radius: 8px; }

/* ---------- спасение ---------- */
.case { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 0 16px; padding: 16px 20px 16px 0; border-bottom: 1px solid var(--line); position: relative; }
.case:last-child { border-bottom: 0; }
.case:hover { background: var(--hover); }
.case-rail { border-radius: 0 3px 3px 0; background: var(--line-2); }
.case.p1 .case-rail { background: var(--accent); box-shadow: 0 0 14px var(--glow); }
.case.p2 .case-rail { background: var(--warn); }
.case.overdue .case-rail { background: var(--bad); }
.case-title { font-weight: 560; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.case-reason { color: var(--text-2); font-size: 13.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.case-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.case-side { display: grid; justify-items: end; gap: 6px; align-content: start; position: relative; z-index: 1; }
.case .stretch { position: absolute; inset: 0; }
.due { font: 500 12px/1 var(--f-mono); padding: 5px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.due.late { background: var(--bad-soft); color: var(--bad-text); }
.due.soon { background: var(--warn-soft); color: var(--warn-text); }
.scenario { border-radius: var(--r); padding: 18px 20px; background: radial-gradient(130% 120% at 100% 0%, rgba(255,91,31,.16), transparent 60%), var(--surface);
  border: 1px solid rgba(255,91,31,.3); }
.scenario h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.scenario .say { font-size: 15px; line-height: 1.55; color: var(--text); margin-top: 10px; }
.scenario ol { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 6px; font-size: 14px; }
.scenario .close { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(255,91,31,.3); }
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.step::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); z-index: 1; }
.step-dot .ico { width: 12px; height: 12px; stroke-width: 2.4; }
.step.done .step-dot { background: var(--ok-soft); color: var(--ok-text); }
.step.now .step-dot { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.step.bad .step-dot { background: var(--bad-soft); color: var(--bad-text); }
.step-title { font-weight: 520; font-size: 13.5px; }
.step-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- разбор звонка ---------- */
.call-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.fact { background: var(--surface); padding: 12px 14px; }
.fact dt { font: 500 10.5px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.fact dd { margin: 6px 0 0; font-weight: 520; font-size: 14px; }
.player { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.player-row { display: flex; align-items: center; gap: 12px; }
.play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 8px 22px -10px var(--glow); }
.play:hover { background: var(--accent-hover); }
.play .ico { width: 18px; height: 18px; stroke-width: 2.2; }
.track { position: relative; flex: 1; height: 34px; cursor: pointer; display: flex; align-items: center; }
.track-line { position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--surface-3); }
.track-fill { position: absolute; left: 0; height: 4px; border-radius: 4px; background: var(--text); width: 0; }
.track-mark { position: absolute; top: 6px; width: 3px; height: 22px; border-radius: 2px; transform: translateX(-1px); opacity: .85; }
.track-mark.bad { background: var(--bad); } .track-mark.ok { background: var(--ok); } .track-mark.accent { background: var(--accent); }
.track-knob { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--text); transform: translateX(-6px); left: 0; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.time { font: 500 12.5px/1 var(--f-mono); color: var(--text-2); min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.speed { height: 30px; padding: 0 9px; border-radius: 8px; background: var(--surface-3); border: 0; font: 500 12px var(--f-mono); color: var(--text-2); cursor: pointer; }
.transcript { display: grid; gap: 2px; max-height: min(620px, calc(100vh - 330px)); overflow-y: auto; padding: 8px; scroll-behavior: smooth; }
.line { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background .15s ease; }
.line:hover { background: var(--hover); }
.line .tc { font: 500 11.5px/1.9 var(--f-mono); color: var(--text-4); }
.line .who { font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.line.manager .who { color: var(--accent-text); }
.line .txt { color: var(--text-2); line-height: 1.55; }
.line.client .txt { color: var(--text); }
.line.active { background: var(--accent-soft); }
.line.flag { box-shadow: inset 2px 0 0 var(--bad); }
.line.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 30% { background: rgba(255,91,31,.28); } 100% { background: transparent; } }
.crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.crit:last-child { border-bottom: 0; }
.crit-title { font-weight: 520; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.crit-score { font: 600 13px/1 var(--f-mono); white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.crit-score.ok { color: var(--ok-text); } .crit-score.warn { color: var(--warn-text); } .crit-score.bad { color: var(--bad-text); } .crit-score.muted { color: var(--text-3); }
.crit .meter { grid-column: 1 / -1; }
.crit-note { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.evidence { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; margin-top: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2); cursor: pointer; text-align: left; max-width: 100%; }
.evidence:hover { border-color: var(--accent); color: var(--text); }
.evidence .mono { color: var(--accent-text); font-size: 11.5px; }
.evidence.unverified { border-style: dashed; }
.mistake { padding: 14px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.mistake:last-child { border-bottom: 0; }
.better { background: var(--ok-soft); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 13.5px; }
.better b { color: var(--ok-text); font-weight: 560; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--f-mono); display: block; margin-bottom: 4px; }

/* ---------- диалоги, поиск, уведомления ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--pop); width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5,5,7,.6); backdrop-filter: blur(3px); }
.dlg-head { padding: 18px 20px 6px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dlg-head h2 { font-size: 18px; }
.dlg-body { padding: 10px 20px 4px; display: grid; gap: 14px; }
.dlg-foot { padding: 16px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.choice { display: grid; gap: 8px; }
.choice label { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.choice label:hover { border-color: var(--text-4); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice .c-title { font-weight: 520; }
.choice .c-sub { font-size: 12.5px; color: var(--text-3); }
/* «Другое — впишите свою нишу»: поле видно, только когда выбрано «Другое» */
.niche-other { display: none; }
.field:has(input[name="industry"][value="general"]:checked) .niche-other,
.form-row:has(select[name="industry"] option[value="general"]:checked) .niche-other { display: grid; }
.choice-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.cmdk { width: min(640px, calc(100vw - 32px)); margin-top: 12vh; }
.cmdk-input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 20px 0 52px; font-size: 16px; outline: none; }
.cmdk-wrap { position: relative; }
.cmdk-wrap .ico { position: absolute; left: 20px; top: 19px; color: var(--text-3); }
.cmdk-list { max-height: 50vh; overflow: auto; padding: 8px; }
.cmdk-item { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; align-items: center; }
.cmdk-item[aria-selected='true'], .cmdk-item:hover { background: var(--surface-2); }
.cmdk-type { font: 500 10.5px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.cmdk-title { font-weight: 520; }
.cmdk-sub { font-size: 12.5px; color: var(--text-3); }
.cmdk-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); display: flex; gap: 14px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--pop); font-size: 13.5px;
  animation: toast-in .35s var(--ease); }
.toast.ok .ico { color: var(--ok-text); } .toast.bad .ico { color: var(--bad-text); } .toast.warn .ico { color: var(--warn-text); }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.notif { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: start; }
.notif .ndot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; }
.notif.unread .ndot { background: var(--accent); }
.notif-body { white-space: pre-line; color: var(--text-2); font-size: 13.5px; margin-top: 3px; }

/* ---------- загрузка ---------- */
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 36px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; background: var(--surface);
  transition: border-color .2s ease, background .2s ease; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .ico { width: 30px; height: 30px; color: var(--accent-text); }
.files { display: grid; gap: 6px; margin-top: 12px; }
.file { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: pulse 1.2s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: min(400px, 100%); display: grid; gap: 22px; }
.auth-box h1 { font-size: 28px; letter-spacing: -0.03em; }
.auth-side { position: relative; overflow: hidden; background: #050506; display: grid; align-content: end; padding: 48px; color: #f3f1ec; }
.auth-side::before { content: ''; position: absolute; inset: 0; background:
  radial-gradient(60% 50% at 70% 30%, rgba(255,91,31,.35), transparent 70%),
  radial-gradient(50% 40% at 20% 80%, rgba(255,91,31,.18), transparent 70%); }
.auth-side .dunes { position: absolute; left: -10%; bottom: -5%; width: 120%; max-width: none; height: 55%; }
.auth-quote { position: relative; max-width: 520px; display: grid; gap: 16px; }
.auth-quote h2 { font-size: clamp(1.8rem, 1.2rem + 1.8vw, 2.7rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 520; }
.auth-quote h2 em { font-style: normal; color: #ff8a57; }
.auth-quote p { color: #a9a7ae; max-width: 44ch; }
.auth-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: #a9a7ae; max-width: 46ch; }
.auth-roles b { color: #e9e7ec; font-weight: 560; }
/* Л3: дюны — медленное «дыхание» слоёв и свет, бегущий по гребню; только transform и stroke, без перерисовки страницы */
.dunes .dune { transform-box: fill-box; transform-origin: 50% 100%; }
.dunes .dune-back { animation: dune-breathe 14s ease-in-out infinite alternate; }
.dunes .dune-front { animation: dune-breathe 18s ease-in-out -6s infinite alternate-reverse; }
.dunes .dune-glow { stroke-dasharray: 90 910; stroke-dashoffset: 1000; opacity: .9; animation: dune-glow 9s linear infinite; }
@keyframes dune-breathe { from { transform: translateX(-1.5%) scaleY(.97); } to { transform: translateX(1.5%) scaleY(1.04); } }
@keyframes dune-glow { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .dunes .dune, .dunes .dune-glow { animation: none; } .dunes .dune-glow { display: none; } }
.loop { display: flex; gap: 8px; flex-wrap: wrap; }
.loop span { font: 500 11.5px/1 var(--f-mono); padding: 7px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); color: #d8d6dc; }

@media (min-width: 1181px) { .sticky-col { position: sticky; top: 76px; } }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split-r { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--pop); }
  .side.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .top { padding: 10px 16px; }
  .search-btn { min-width: 0; }
  .search-btn .lbl, .search-btn kbd { display: none; }
  .page { padding: 20px 16px 96px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .call-head { grid-template-columns: auto 1fr; }
  .call-head > :last-child { grid-column: 1 / -1; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .tabbar { display: grid; }
  .funnel-row { grid-template-columns: 120px 1fr 56px; }
  .hide-m { display: none !important; }
  .only-m { display: inline !important; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; min-height: 112px; }
  .case { grid-template-columns: 4px minmax(0, 1fr); }
  .case-side { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; margin-top: 10px; }
  .list-item { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
  .list-item > :first-child:not(:only-child):not(div) { display: none; }  /* значок или аватар; строка с содержанием остаётся */
  .list-item[style] { grid-template-columns: minmax(0, 1fr) !important; }  /* строки со своей сеткой: всё в колонку */
}
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--side) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; font-size: 10.5px; color: var(--text-3); border-radius: 10px; position: relative; }
.tabbar a[aria-current='page'] { color: var(--text); }
.tabbar a[aria-current='page'] .ico { color: var(--accent-text); }
.tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); height: 16px; min-width: 16px; font-size: 9.5px; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 29; display: none; }
.scrim.on { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .side, .top, .tabbar, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #111; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .page { padding: 0; max-width: none; }
}

/* ---------- круговые диаграммы ---------- */
.donuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.donuts > .donut-card + .donut-card { border-left: 1px solid var(--line); }
.donut-card { padding: 18px 20px 20px; min-width: 0; }
.donut-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.donut-head h3 { font-size: 15px; margin: 0; }
.donut-body { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 14px; }  /* круги на одной высоте во всех карточках ряда */
.donut { width: 108px; height: 108px; }
.donut circle { fill: none; stroke-width: 5.2; }
.donut-track { stroke: var(--surface-3); }
.donut-seg { transition: stroke-width .2s var(--ease); }
.donut-seg:hover { stroke-width: 6.4; }
.donut-total { font: 600 8.5px var(--f-mono); fill: var(--text); text-anchor: middle; }
.donut-unit { font: 400 3.4px var(--f); fill: var(--text-3); text-anchor: middle; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.donut-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 34px; gap: 8px; align-items: center; }
.donut-legend li.zero > * { color: var(--text-3); } .donut-legend li.zero .lg-dot { opacity: .45; } /* без прозрачности текста: контраст 4.5:1 в обеих темах */
.donut-legend a, .donut-legend .lbl { color: var(--text-2); line-height: 1.25; overflow-wrap: break-word; }
.donut-legend a:hover { color: var(--text); }
.donut-legend b { font: 600 13px var(--f-mono); }
.donut-legend .pct { color: var(--text-3); font: 400 12px var(--f-mono); text-align: right; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut .t-accent, .lg-dot.t-accent { stroke: var(--accent); background: var(--accent); }
.donut .t-ok, .lg-dot.t-ok { stroke: var(--ok); background: var(--ok); }
.donut .t-warn, .lg-dot.t-warn { stroke: var(--warn); background: var(--warn); }
.donut .t-bad, .lg-dot.t-bad { stroke: var(--bad); background: var(--bad); }
.donut .t-info, .lg-dot.t-info { stroke: var(--info); background: var(--info); }
.donut .t-muted, .lg-dot.t-muted { stroke: var(--text-3); background: var(--text-3); }
.donut .t-faint, .lg-dot.t-faint { stroke: var(--text-4); background: var(--text-4); }
.donut .t-line, .lg-dot.t-line { stroke: var(--line-2); background: var(--line-2); }
.donut .t-ok-2, .lg-dot.t-ok-2 { stroke: color-mix(in srgb, var(--ok) 60%, var(--surface)); background: color-mix(in srgb, var(--ok) 60%, var(--surface)); }
.donut .t-ok-3, .lg-dot.t-ok-3 { stroke: color-mix(in srgb, var(--ok) 35%, var(--surface)); background: color-mix(in srgb, var(--ok) 35%, var(--surface)); }
.donut .t-warn-2, .lg-dot.t-warn-2 { stroke: color-mix(in srgb, var(--warn) 55%, var(--surface)); background: color-mix(in srgb, var(--warn) 55%, var(--surface)); }
.donut .t-bad-2, .lg-dot.t-bad-2 { stroke: color-mix(in srgb, var(--bad) 60%, var(--surface)); background: color-mix(in srgb, var(--bad) 60%, var(--surface)); }
.donut .t-bad-3, .lg-dot.t-bad-3 { stroke: color-mix(in srgb, var(--bad) 35%, var(--surface)); background: color-mix(in srgb, var(--bad) 35%, var(--surface)); }
.donuts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.donuts-4 .donut-body { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.donuts-4 .donut-legend { width: 100%; }
@media (max-width: 1180px) {
  .donuts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donuts-4 > .donut-card:nth-child(3) { border-left: 0; }
  .donuts-4 > .donut-card:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 1180px) {
  .donuts:not(.donuts-4) { grid-template-columns: minmax(0, 1fr); }
  .donuts:not(.donuts-4) > .donut-card + .donut-card { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .donuts-4 { grid-template-columns: minmax(0, 1fr); }
  .donuts-4 > .donut-card + .donut-card { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 420px) { .donut-body { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; } .donut { width: 96px; height: 96px; } }

/* ---------- сводка собственника ---------- */
.stack-s { display: grid; gap: 10px; }
.loss-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 34px 120px; gap: 12px; align-items: center;
  color: var(--text-2); font-size: 13.5px; padding: 4px 0; border-radius: var(--r-xs); }
.loss-row:hover { color: var(--text); }
.loss-row-3 { grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 40px; }  /* без колонки процента (О12) */
.loss-row .loss-label { line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.loss-row b { font: 600 13px var(--f-mono); text-align: right; }
.loss-row .muted { font: 400 12.5px var(--f-mono); text-align: right; }
.facts-list { display: grid; gap: 0; margin: 0; }
.facts-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.facts-list > div:last-child { border-bottom: 0; }
.facts-list dt { color: var(--text-2); font-size: 13.5px; }
.facts-list dd { margin: 0; font: 600 15px var(--f-mono); text-align: right; white-space: nowrap; }
.facts-text dd { font: 500 14px/1.4 var(--f); white-space: normal; text-align: right; max-width: 62%; }
.facts-list dd small { font: 400 12px var(--f); color: var(--text-3); margin-left: 6px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--text-2); }
.plain-list li { display: flex; gap: 8px; align-items: flex-start; }
.plain-list .ico-sm { color: var(--ok); flex: none; margin-top: 3px; }
@media (max-width: 560px) { .loss-row { grid-template-columns: minmax(0, 1fr) 30px 100px; } .loss-row .meter { display: none; }
  .loss-row-3 { grid-template-columns: minmax(0, 1fr) 40px; } }

/* ---------- карта потерь (публичные страницы) ---------- */
.pub { min-height: 100vh; }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line); }
.pub-main { width: min(1180px, 100%); margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 64px; }
.pub-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.pub-hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 560; }
.pub-hero h1 em { font-style: normal; color: var(--accent-text); }
.pub-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.pub-points li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; color: var(--text-2); }
.pub-points b { color: var(--text); font-weight: 560; }
.pub-points .n { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft);
  color: var(--accent-text); font: 600 13px var(--f-mono); }
.leak-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.leak-big { font: 600 clamp(1.9rem, 1.4rem + 1.6vw, 2.8rem)/1.05 var(--f); letter-spacing: -0.03em; }
.mistake { display: grid; gap: 10px; padding: 18px 20px; border-top: 1px solid var(--line); }
.mistake:first-child { border-top: 0; }
.say { border-left: 3px solid var(--ok); padding: 6px 12px; background: var(--ok-soft); border-radius: 0 8px 8px 0; color: var(--text); }
.heard { border-left: 3px solid var(--bad); padding: 6px 12px; background: var(--bad-soft); border-radius: 0 8px 8px 0; color: var(--text); }
.progress-big { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-big i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .6s var(--ease); }
@media (max-width: 900px) { .pub-hero, .leak-hero { grid-template-columns: minmax(0, 1fr); } }
@media print {
  .pub-top .actions, .no-print, .skip, .toasts { display: none !important; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f6f5f2; --text: #121215; --text-2: #46454c; --text-3: #6b6a73; --line: rgba(0,0,0,.12); }
  body { background: #fff; color: #111; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ---------- обучение: каталог, урок, тренировка ---------- */
.ln-reco { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255,91,31,.14), transparent 60%), var(--surface); }
.ln-reco .btn { height: auto; min-height: 38px; padding: 8px 16px; white-space: normal; text-align: left; max-width: 100%; }
.ln-toc [hidden] { display: none; }
.ln-course { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ln-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 500 11px/1 var(--f-mono);
  background: var(--surface-3); color: var(--text-3); }
.ln-n.done, .ln-toc a.done .ln-n { background: var(--ok-soft); color: var(--ok-text); }
.ln-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.ln-toc { position: sticky; top: 76px; display: grid; gap: 12px; padding: 18px; }
.ln-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ln-toc ol a { display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.35; color: var(--text-2); }
.ln-toc ol a:hover { background: var(--hover); }
.ln-toc ol a[aria-current] { background: var(--surface-3); color: var(--text); font-weight: 540; }
.ln-toc ol a small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.ln-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; max-width: 860px; }
.ln-blk .btn { white-space: normal; max-width: 100%; height: auto; min-height: 38px; padding-block: 8px; text-align: left; }
.ln-ladder { display: grid; gap: 6px; }
.ln-lvls { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-lvl { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13px; cursor: pointer; }
.ln-lvl input { accent-color: var(--accent); margin: 0; }
.ln-lvl:has(input:checked) { border-color: var(--accent); color: var(--text); }
.ln-lvl.locked { opacity: .5; cursor: default; }
.ln-up { color: var(--ok-text); font-weight: 540; font-size: 14px; }
.ln-streak { display: inline-flex; align-items: center; gap: 6px; }
.ln-head { padding: 2px 4px; }
.ln-head h2 { font-size: 24px; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; }
.ln-head p { color: var(--text-2); margin-top: 6px; max-width: 70ch; }
.ln-blk { display: grid; gap: 12px; padding: 20px; font-size: 15px; line-height: 1.55; }
.ln-blk p { margin: 0; }
.ln-k { font: 500 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.ln-blk h3 { font-size: 17px; line-height: 1.35; }
.ln-snip { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ln-snip:first-of-type { padding-top: 0; border-top: 0; }
.ln-snip audio, .snip-audio { width: 100%; max-width: 440px; height: 36px; display: block; }
.ln-dlg, .ln-chat { display: grid; gap: 8px; }
.ln-dlg > div, .ln-chat > div { max-width: 86%; padding: 9px 13px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px;
  line-height: 1.45; justify-self: start; overflow-wrap: anywhere; }
.ln-dlg small, .ln-chat small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 560; margin-bottom: 2px; }
.ln-dlg > div.mine, .ln-chat > div.mine { justify-self: end; background: var(--accent-soft); }
.ln-chat { max-height: 460px; overflow-y: auto; padding: 4px 2px; }
.ln-chat > div.wait { color: var(--text-3); }
.ln-ask { padding: 12px 14px; border-radius: var(--r-sm); border: 1px dashed var(--line-2); color: var(--text-2); font-size: 14px; }
.ln-opts { display: grid; gap: 8px; }
.ln-opt { text-align: left; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); font: inherit; line-height: 1.45; cursor: pointer; transition: border-color .12s ease; }
.ln-opt:hover:not(:disabled) { border-color: var(--accent); }
.ln-opt:disabled { cursor: default; }
.ln-opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.ln-opt.no { border-color: var(--bad); background: var(--bad-soft); }
.ln-why { padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px; }
.ln-rule { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ln-say { padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-soft); }
.ln-std { font-size: 13.5px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 12px; }
.ln-std summary, .ln-more summary { cursor: pointer; color: var(--text); font-weight: 540; font-size: 14px; }
.ln-std h4 { font-size: 13.5px; margin: 12px 0 0; color: var(--text); }
.ln-std dl { margin: 6px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
.ln-std dt { color: var(--text-3); text-align: right; white-space: nowrap; }
.lv-done, .ln-std dt.lv-done { color: var(--ok-text); } .lv-part, .ln-std dt.lv-part { color: var(--warn-text); }
.lv-miss, .ln-std dt.lv-miss { color: var(--bad-text); } .lv-na { color: var(--text-3); }
.ln-crit .lv { font-size: 13px; font-weight: 540; white-space: nowrap; }
.pp-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.pp-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.pp-row:last-child { border-bottom: 0; }
.pp-dot { font-size: 11px; line-height: 20px; }
.pp-val { text-align: right; white-space: nowrap; }
.ln-std dd { margin: 0; }
.ln-mine { display: grid; gap: 4px; }
.ln-mine .hbar { grid-template-columns: minmax(120px, 1.4fr) 2fr auto; }
.ln-fake { font-size: 13px; color: var(--text-3); }
.ln-box { display: grid; gap: 10px; }
.ln-err { margin: 0; color: var(--bad-text); font-size: 13.5px; }
.ln-err:empty { display: none; }
.ln-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ln-score b { font: 500 38px/1 var(--f-mono); letter-spacing: -.03em; }
.ln-crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ln-crit:last-child { border-bottom: 0; }
.ln-crit small { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; line-height: 1.45; }
.ln-crit .mono { white-space: nowrap; }
.ln-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.ln-link { border: 0; background: none; padding: 0; color: var(--text-3); font: inherit; font-size: 13.5px; cursor: pointer; text-decoration: underline; }
@media (max-width: 900px) { .ln-grid { grid-template-columns: minmax(0, 1fr); } .ln-toc { position: static; order: 2; } .ln-blk { padding: 16px; } }

/* ---------- обратная связь: «Пожелание или проблема», опрос ---------- */
/* в шапке — только значок, подпись — при наведении (title): кнопка одинаковая во всех кабинетах и не растягивает шапку */
.fb-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 0;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.fb-btn:hover { border-color: var(--line-2); color: var(--text); }
.fb-dlg { width: min(560px, calc(100vw - 32px)); }
.fb-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-tools .rec { border-color: var(--bad); color: var(--bad-text); background: var(--bad-soft); }
.fb-attach { display: grid; gap: 8px; }
.fb-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }
.fb-item img { max-height: 120px; max-width: calc(100% - 50px); border-radius: var(--r-xs); object-fit: contain; }
.fb-item audio { flex: 1; min-width: 0; height: 36px; }
.fb-item .icon-btn { margin-left: auto; }
.fb-more summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.fb-err { margin: 0; color: var(--bad-text); font-size: 13px; min-height: 0; }
.fb-err:empty { display: none; }
.fb-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.fb-scale label { display: grid; place-items: center; height: 38px; border-radius: 9px; border: 1px solid var(--line-2); cursor: pointer; font-weight: 520;
  font-variant-numeric: tabular-nums; transition: border-color .15s ease, background .15s ease; }
.fb-scale label:hover { border-color: var(--text-4); }
.fb-scale input { position: absolute; opacity: 0; pointer-events: none; }
.fb-scale label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.fb-scale label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-scale-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: -8px; }
.fb-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-examples .chip { height: auto; min-height: 24px; padding: 4px 10px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
  cursor: pointer; text-align: left; white-space: normal; }
.fb-examples .chip:hover { border-color: var(--line-2); color: var(--text); }
.fb-card { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.fb-card:last-child { border-bottom: 0; }
.fb-card:target { background: var(--accent-soft); }
.fb-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-3); }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-shot img { max-width: min(100%, 520px); max-height: 320px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.fb-reply { background: var(--ok-soft); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-reply b { display: block; font: 560 11.5px/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ok-text); margin-bottom: 4px; }
@media (max-width: 560px) { .fb-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); } .fb-card { padding: 14px 16px; } }

/* ---------- общий график (О10): partials/chart.html, static/js/chart.js ---------- */
:root { --chart-1: #f5551b; }  /* серия в тёмной теме: оранжевый в полосе светлоты для тёмного фона (проверено dataviz) */
[data-theme='light'] { --chart-1: #ff5b1f; }
.ch { position: relative; padding-left: 40px; }
.ch-plot { position: relative; outline-offset: 4px; }
.ch-area { position: absolute; inset: 0; }
.ch-area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ch-line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  animation: ch-fade .6s ease both; }
.ch-fill { fill: var(--chart-1); opacity: .1; animation: ch-fade .9s ease both; }
.ch-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.ch-tick span { position: absolute; right: calc(100% + 8px); top: -8px; font: 400 11px/16px var(--f-mono); color: var(--text-3);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-norm { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--text-4); }
.ch-norm span { position: absolute; right: 0; top: 2px; font-size: 11px; color: var(--text-3); background: var(--surface); padding: 0 4px; }
.ch-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--chart-1);
  box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.ch-end { animation: ch-fade .4s .8s ease both; }
.ch-bar { position: absolute; bottom: 0; transform: translateX(-50%); max-width: 24px; background: var(--chart-1);
  border-radius: 4px 4px 0 0; transform-origin: bottom; animation: ch-grow .7s var(--ease) both; }
.ch-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); pointer-events: none; }
.ch-tip { position: absolute; top: 4px; transform: translateX(-50%); display: grid; gap: 2px; padding: 8px 10px;
  border-radius: 10px; background: var(--surface-2); box-shadow: var(--pop); font-size: 12px; color: var(--text-2);
  white-space: nowrap; pointer-events: none; z-index: 5; }
.ch-tip.low { top: auto; bottom: 4px; }
.ch [hidden] { display: none; }
.ch-tip b { font: 600 15px/1.2 var(--f); color: var(--text); }
.ch-tip [data-d]:empty { display: none; }
.ch-x { position: relative; height: 18px; margin-top: 6px; }
.ch-x span { position: absolute; transform: translateX(-50%); font: 400 11px/16px var(--f-mono); color: var(--text-3); white-space: nowrap; }
.ch-table { margin-top: 6px; font-size: 12px; }
.ch-table summary { cursor: pointer; color: var(--text-3); width: max-content; }
.ch-table table { margin-top: 8px; }
/* в плитке показателя: без осей, подсказка над графиком (плитка обрезает всё, что выходит за неё) */
.ch-mini { padding-left: 0; }
.ch-mini .ch-plot { outline-offset: 2px; }
.ch-mini .ch-tip, .ch-mini .ch-tip.low { top: auto; bottom: calc(100% + 6px); white-space: normal; width: max-content; max-width: 100%; }
.ch-mini .ch-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.ch-mini .ch-bar { max-width: 16px; border-radius: 3px 3px 0 0; }
.ch-mini .ch-line { stroke-width: 1.75; }
@keyframes ch-fade { from { opacity: 0; } }
@keyframes ch-grow { from { transform: translateX(-50%) scaleY(0); } }
/* сортировка по заголовку (В10): кнопка выглядит как заголовок, стрелка — направление */
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-sort::after { content: '↕'; font-size: 10px; opacity: .35; }
th[aria-sort='ascending'] .th-sort::after { content: '↑'; opacity: .9; }
th[aria-sort='descending'] .th-sort::after { content: '↓'; opacity: .9; }
th .th-sort:hover { color: var(--text); }
/* петля спасения в отчёте (В12): строка — ссылка на список */
a.funnel-link { color: inherit; text-decoration: none; border-radius: 8px; padding: 2px 4px; margin: 0 -4px; }
a.funnel-link:hover { background: var(--hover); }
a.funnel-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- главная партнёра (П2) ---------- */
.pc-count { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 10px 12px;
  border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
.pc-count:hover { background: var(--hover); }
.pc-count b { font-size: 22px; line-height: 1.1; }
.pc-count span:last-child { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); }
.dot:not(.chip) { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-bad { background: var(--bad); }
.feed-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.feed-row:first-child { border-top: 0; padding-top: 0; }
.feed-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.feed-money .ico, .feed-paid .ico { color: var(--ok-text); } .feed-money, .feed-paid { background: var(--ok-soft); }
.track-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.track-steps li { padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 2px; min-width: 0; }
.track-steps li span { font-size: 12px; color: var(--text-2); }
.track-steps li.done { background: var(--surface-2); }
.track-steps li.now { box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (max-width: 900px) { [data-stack-m] { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 560px) { .track-steps { grid-template-columns: minmax(0, 1fr); } }
.pc-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .pc-count { padding: 8px 10px; } .pc-count b { font-size: 18px; } }

/* ---------- мастер подключения клиента партнёром (П3) ---------- */
.wz-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wz-steps li { padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 2px; min-width: 0; }
.wz-steps li span { font-size: 12px; color: var(--text-2); }
.wz-steps li.done { background: var(--ok-soft); box-shadow: inset 0 0 0 1px transparent; }
.wz-steps li.done span { color: var(--ok-text); }
.wz-steps li.now { box-shadow: inset 0 0 0 1.5px var(--accent); }
.wz-how { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
@media (max-width: 560px) { .wz-steps { grid-template-columns: minmax(0, 1fr); } }

/* П5: обучение партнёра — список уроков на странице «Обучение», тест */
.pl-lessons { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 2px; }
.pl-lessons a { display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.35; color: var(--text-2); }
.pl-lessons a:hover { background: var(--hover); }
.pl-lessons a small { display: block; color: var(--text-3); font-size: 12px; }
.pl-lessons a.done .ln-n { background: var(--ok-soft); color: var(--ok-text); }
.ex-q { border: 1px solid var(--line); margin: 0; min-width: 0; }
.ex-q legend { padding: 0 4px; }
.ex-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  margin-top: 6px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.ex-opt:hover { border-color: var(--accent); }
.ex-opt input { margin-top: 3px; flex: none; accent-color: var(--accent); }
.ex-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, var(--surface-3)); }

/* Снимки «как получить ключ CRM» (partials/crm_howto.html) */
.crm-howto-done summary { cursor: pointer; font-size: 13px; color: var(--accent-text); width: max-content; max-width: 100%; }
.crm-howto-done[open] { display: grid; gap: 8px; }
.crm-howto-done[open] summary { margin-bottom: 2px; }
/* снимки шагов CRM — в широком окне, по одному на всю ширину: на них должен читаться текст интерфейса */
dialog.crm-guide { width: min(1240px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
.crm-guide-body { padding: 6px 20px 4px; display: grid; gap: 22px; }
.crm-guide figure { margin: 0; display: grid; gap: 8px; min-width: 0; }
.crm-guide figcaption { font-size: 14.5px; line-height: 1.45; color: var(--text); }
.crm-guide img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); box-shadow: 0 0 0 1px var(--line-2); }
@media (max-width: 560px) {
  .crm-guide-body { padding: 4px 12px; } .crm-guide .dlg-head { padding: 14px 12px 4px; }
  /* на телефоне снимок шире экрана — листается вбок, текст интерфейса читается без увеличения */
  .crm-guide figure > a { display: block; overflow-x: auto; overscroll-behavior-x: contain; border-radius: var(--r-sm); }
  .crm-guide img { width: 860px; max-width: none; }
}

/* С4: команда ОКК в кабинете клиента — постоянная плашка сверху */
.staff-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 28px;
  background: var(--accent-soft, var(--hover)); color: var(--text); font-size: 13.5px; border-bottom: 1px solid var(--line); }
.staff-bar form { margin-left: auto; }
.staff-bar b { font-weight: 600; }
@media (max-width: 560px) { .staff-bar { padding: 8px 16px; } .staff-bar form { margin-left: 0; } }
.co-search { width: 100%; margin-bottom: 6px; }

/* С5: обратная связь в почтовом виде — лента слева, обращение справа */
.mail { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-list { display: grid; max-height: calc(100dvh - 140px); overflow: auto; position: sticky; top: 76px; }
.mail-item { display: grid; gap: 3px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.mail-item:last-child { border-bottom: 0; }
.mail-item:hover { background: var(--hover); }
.mail-item[aria-current] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mail-top { display: flex; justify-content: space-between; gap: 8px; min-width: 0; color: var(--text); }
.mail-age { flex: none; font-size: 12px; color: var(--text-3); }
.mail-who { font-size: 12px; color: var(--text-3); }
.mail-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.mail-st { display: flex; gap: 6px; align-items: center; margin-top: 2px; color: var(--text-3); }
.mail-view { padding: 20px 22px; display: grid; gap: 14px; min-width: 0; }
.mail-back { display: none; }
.mail-history { border-top: 1px solid var(--line); padding-top: 10px; }
.mail-steps { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); display: grid; gap: 2px; }
@media (max-width: 900px) {
  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail-list { position: static; max-height: none; }
  .mail-picked .mail-list { display: none; }
  .mail:not(.mail-picked) .mail-view { display: none; }
  .mail-back { display: inline-flex; align-items: center; gap: 6px; }
}
.sv-score { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--hover); font: 600 17px/1 var(--f-mono); color: var(--text); }
.sv-score.bad { background: var(--bad-soft, var(--hover)); color: var(--bad-text); }
.sv-score.ok { background: var(--ok-soft); color: var(--ok-text); }

/* М6: итог, записанный в CRM, — на странице звонка */
.crm-note .note-text { white-space: pre-wrap; font-family: inherit; margin: 8px 0 0; color: var(--text-2, inherit); }

/* Знакомство с кабинетом (Р6, static/js/tour.js): подсветка блока и подсказка рядом; на телефоне — внизу экрана */
.tour-ring { position: fixed; z-index: 90; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(8, 8, 10, .55); transition: top .25s, left .25s, width .25s, height .25s; }
.tour-pop { position: fixed; z-index: 91; width: min(360px, calc(100vw - 24px)); background: var(--surface); color: var(--text);
  border-radius: var(--r, 14px); box-shadow: var(--pop); padding: 16px 18px; display: grid; gap: 8px; }
.tour-pop h2 { font-size: 17px; margin: 0; }
.tour-pop p { margin: 0; color: var(--text-2); font-size: 14px; }
.tour-step { font-size: 12px; color: var(--text-3); }
.tour-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
@media (max-width: 640px) { .tour-pop { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; } }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }

/* [М] Страница звонка на телефоне: «Коротко», затем «Что сделать с клиентом сейчас» — выше расшифровки */
@media (max-width: 1180px) {
  .call-split > .stack { display: contents; }
  .call-split .call-summary { order: -2; }
  .call-split .scenario, .call-split .client-msg { order: -1; }
}
