/* Речевая аналитика · интерфейс прототипа
   Палитра: вариант Marine Blue из palette-preview Ксении, чернила с бирюзовым оттенком оттуда же.
   Шрифты: Onest — интерфейс, Literata — заголовки страниц и разборов, JetBrains Mono — таймкоды и коды сигналов. */

:root {
  color-scheme: light;
  --bg: #f1f5f6;
  --rail: #e8eff1;
  --surface: #ffffff;
  --surface-2: #f4f8f9;
  --surface-3: #e7eef0;
  --border: #dce5e8;
  --border-strong: #c3d0d4;
  --hover: rgba(20, 35, 38, .05);

  --text: #142326;
  --text-2: #34474c;
  --text-3: #5d6e72;
  --text-4: #8d9da0;

  --accent: #067aa3;
  --accent-ink: #05678b;
  --accent-bright: #0787b5;
  --accent-soft: #e2f1f7;
  --accent-line: #a8d5e7;
  --on-accent: #ffffff;

  --good: #2f9e44; --good-ink: #237a34; --good-soft: #e5f3e8;
  --warn: #f59f00; --warn-ink: #8f5b00; --warn-soft: #fcf0d6;
  --bad:  #e03131; --bad-ink:  #b42323; --bad-soft:  #fbe6e6;

  --chat: #e9f1f3;
  --paper-shadow: 0 1px 0 rgba(20, 35, 38, .04), 0 18px 40px -22px rgba(20, 35, 38, .28);
  --shadow-1: 0 1px 2px rgba(20, 35, 38, .06), 0 1px 1px rgba(20, 35, 38, .03);
  --shadow-2: 0 12px 32px -14px rgba(20, 35, 38, .22), 0 2px 6px rgba(20, 35, 38, .05);

  --font-ui: "Onest", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Literata", "PT Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --sidebar-w: 256px;
  --r-lg: 14px;
  --r-md: 11px;
  --r-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1315;
    --rail: #0e181b;
    --surface: #122023;
    --surface-2: #17292d;
    --surface-3: #1e3439;
    --border: #22373b;
    --border-strong: #31494e;
    --hover: rgba(255, 255, 255, .05);
    --text: #e6eef0;
    --text-2: #b6c5c8;
    --text-3: #8a9b9e;
    --text-4: #62767a;
    --accent: #34afd9;
    --accent-ink: #72cdec;
    --accent-bright: #4cc0e8;
    --accent-soft: #0f3340;
    --accent-line: #1e5669;
    --on-accent: #04202a;
    --good: #4cc764; --good-ink: #86dc95; --good-soft: #133524;
    --warn: #f5b12e; --warn-ink: #f7c768; --warn-soft: #3a2c0c;
    --bad:  #f06464; --bad-ink:  #f59494; --bad-soft:  #3d1719;
    --chat: #0f1c1f;
    --paper-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .7);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 14px 34px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1315;
  --rail: #0e181b;
  --surface: #122023;
  --surface-2: #17292d;
  --surface-3: #1e3439;
  --border: #22373b;
  --border-strong: #31494e;
  --hover: rgba(255, 255, 255, .05);
  --text: #e6eef0;
  --text-2: #b6c5c8;
  --text-3: #8a9b9e;
  --text-4: #62767a;
  --accent: #34afd9;
  --accent-ink: #72cdec;
  --accent-bright: #4cc0e8;
  --accent-soft: #0f3340;
  --accent-line: #1e5669;
  --on-accent: #04202a;
  --good: #4cc764; --good-ink: #86dc95; --good-soft: #133524;
  --warn: #f5b12e; --warn-ink: #f7c768; --warn-soft: #3a2c0c;
  --bad:  #f06464; --bad-ink:  #f59494; --bad-soft:  #3d1719;
  --chat: #0f1c1f;
  --paper-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .7);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 14px 34px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 6px; }
strong { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 20; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
.skip:focus { top: 12px; }

/* ---------- оболочка ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; padding-inline: clamp(16px, 3.4vw, 52px); padding-block: 30px 80px; outline: none; }
.page { max-width: 1200px; margin-inline: auto; display: grid; gap: 44px; }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 14px 16px;
  background: var(--rail);
  border-right: 1px solid var(--border);
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px; color: var(--text); text-decoration: none; min-width: 0; }
.brand__mark { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.brand__mark svg { width: 20px; height: 20px; }
.brand__text { display: grid; line-height: 1.2; min-width: 0; }
.brand__name { font-weight: 600; font-size: 14px; letter-spacing: -.005em; }
.brand__ws { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__quick { display: none; gap: 4px; }

.role-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.role-switch button {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 4px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; line-height: 1; color: var(--text-2);
  transition: background-color .12s, color .12s, box-shadow .12s;
}
.role-switch button:hover { color: var(--text); }
.role-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.nav { display: grid; gap: 2px; }
.nav__label { margin: 0 0 6px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.nav__link {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; column-gap: 10px;
  padding: 9px 10px; border-radius: 9px; color: var(--text-2); text-decoration: none;
  transition: background-color .12s, color .12s;
}
.nav__link .ico { margin-top: 1px; }
.nav__link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav__link[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.nav__link[aria-current="page"] .ico { color: var(--accent-ink); }
.nav__title { font-weight: 500; }
.nav__note { display: block; font-size: 11.5px; color: var(--text-3); line-height: 1.35; margin-top: 1px; }

.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.clock { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 10px 8px; }
.clock__place { font-size: 12px; color: var(--text-3); }
.clock__time { font-family: var(--font-mono); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.clock__tz { font-size: 11px; color: var(--text-3); margin-left: 4px; font-family: var(--font-ui); font-weight: 500; }
.side-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); text-decoration: none; cursor: pointer; font-size: 13px; text-align: left;
}
.side-btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-btn[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- шапка страницы ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 28px; }
.page-head__text { display: grid; gap: 8px; min-width: 0; max-width: 780px; }
.eyebrow { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.page-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.12; letter-spacing: -.012em; font-optical-sizing: auto; }
.page-sub { margin: 0; font-size: 14.5px; color: var(--text-2); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- кнопки, чипы, коды ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: border-color .12s, background-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover { border-color: var(--text-3); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--accent-ink); padding-inline: 6px; }
.btn--ghost:hover { background: var(--accent-soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px;
  border-radius: 999px; background: var(--surface-3); color: var(--text-2);
  font-size: 12.5px; font-weight: 500; line-height: 1.3;
}
.chip .ico { width: 14px; height: 14px; }
.chip--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.chip--accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip--nodata { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border-strong); border-radius: 6px; min-height: 22px; padding: 2px 7px; font-size: 12px; }
.chip--count { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.code {
  display: inline-block; padding: 3px 6px 2px; border-radius: 5px;
  background: var(--surface-3); color: var(--text);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; line-height: 1.2; letter-spacing: .02em;
}

/* таймкод автоматической расшифровки */
.tc {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px 2px 6px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; line-height: 1.45;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tc .ico { width: 11px; height: 11px; opacity: .85; }

/* ---------- уведомление, подсказки ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start; margin: 0;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px dashed var(--border-strong);
  color: var(--text-2); font-size: 13.5px; line-height: 1.55;
}
.notice > .ico { flex: none; margin-top: 2px; color: var(--accent-ink); }
.hint { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-3); max-width: 80ch; }
.caveat { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.caveat .ico { flex: none; width: 14px; height: 14px; margin-top: 3px; }

/* ---------- секции ---------- */
.section { display: grid; gap: 18px; min-width: 0; }
.section-head { display: grid; gap: 6px; }
.section-head--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.section-title { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-desc { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-3); max-width: 80ch; }
.subhead { margin: 0; font-size: 15px; font-weight: 600; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.panel { display: grid; gap: 12px; align-content: start; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.panel__head { display: flex; align-items: center; gap: 10px; }
.panel__head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel__head .chip--nodata { margin-left: auto; }
.panel p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.badge-ico { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }

/* ---------- список и деталь ---------- */
.chooser { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 20px; align-items: start; }
.chooser__index { position: sticky; top: 24px; display: grid; gap: 10px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.search { position: relative; display: flex; align-items: center; }
.search > .ico { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 86px 0 36px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font: 400 14px var(--font-ui);
}
.search input::placeholder { color: var(--text-4); }
.search input:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear {
  position: absolute; right: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 7px;
  background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.search__clear:hover { color: var(--text); }
.chooser__count { margin: 0; font-size: 12.5px; color: var(--text-3); }
.chooser__list { display: grid; gap: 6px; }
.item {
  display: grid; gap: 4px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .12s, background-color .12s;
}
.item:hover { border-color: var(--border-strong); }
.item[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.item[aria-selected="true"] .item__title { color: var(--accent-ink); }
.item__title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.item__teaser { font-size: 13px; line-height: 1.45; color: var(--text-2); }
.item__meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.item__meta .ico { width: 13px; height: 13px; }
.chooser__empty { margin: 0; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; color: var(--text-3); }
.chooser__detail { min-width: 0; }
.chooser__placeholder { display: grid; place-items: center; gap: 10px; min-height: 240px; padding: 32px; border-radius: var(--r-lg); border: 1px dashed var(--border-strong); color: var(--text-3); text-align: center; font-size: 13.5px; }

/* лист разбора */
.sheet {
  display: grid; gap: 24px; min-width: 0;
  padding: 28px clamp(18px, 2.6vw, 34px) 30px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  animation: sheet-in .18s ease-out;
}
@keyframes sheet-in { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.sheet__head { display: grid; gap: 8px; }
.sheet__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 23px; line-height: 1.24; letter-spacing: -.01em; font-optical-sizing: auto; }
.sheet__lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); max-width: 68ch; }
.sheet__head .chips { margin-top: 6px; }
.sheet__summary { margin: 0; font-size: 15px; line-height: 1.65; max-width: 72ch; }
.sheet__body { display: grid; gap: 12px; }
.sheet__body p { margin: 0; font-size: 14.5px; line-height: 1.65; max-width: 72ch; }

/* полоса оценки: 13 критериев короткой формы × 2 балла */
.score {
  display: grid; grid-template-columns: minmax(0, auto) minmax(180px, 1fr); align-items: center; gap: 8px 20px;
  padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2);
}
.score__label { display: grid; gap: 2px; }
.score__name { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.score__value { font-size: 15px; font-weight: 600; color: var(--text); }
.score__value em { font-style: normal; font-weight: 500; color: var(--text-3); }
.score__scale { display: grid; gap: 6px; }
.score__legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }
.seg13 { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 3px; }
.seg13 i { display: block; height: 10px; border-radius: 3px; background: var(--surface-3); }
.seg13[data-state="pending"] i { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.seg13 i[data-l="2"] { background: var(--accent); }
.seg13 i[data-l="1"] { background: linear-gradient(90deg, var(--accent) 50%, var(--surface-3) 50%); }
.seg13--sm i { height: 7px; border-radius: 2px; }

.meter { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter[data-state="pending"] { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

/* четыре блока разбора */
.blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.block { container-type: inline-size; display: grid; gap: 12px; align-content: start; padding: 16px 16px 16px; border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.block__head { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 13.5px; font-weight: 600; }
.block__badge { width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center; }
.block__badge .ico { width: 14px; height: 14px; }
.block--good .block__badge { background: var(--good-soft); color: var(--good-ink); }
.block--warn .block__badge { background: var(--warn-soft); color: var(--warn-ink); }
.block--next .block__badge { background: var(--accent-soft); color: var(--accent-ink); }
.block--plain .block__badge { background: var(--surface-3); color: var(--text-2); }
.moments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.moments li { display: grid; grid-template-columns: 1fr; gap: 6px; font-size: 14px; line-height: 1.55; }
.moments .tc { justify-self: start; }
@container (min-width: 380px) {
  .moments li { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: baseline; }
  .moments li.no-tc { grid-template-columns: 1fr; }
}

.profile { display: grid; gap: 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.profile__head { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.profile p { margin: 0; font-size: 14.5px; line-height: 1.6; max-width: 72ch; }

/* ключ — значение в примерах РОПа и комдира */
.kv { margin: 0; display: grid; border-top: 1px solid var(--border); }
.kv > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 6px 20px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.kv dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-top: 2px; }
.kv dd { margin: 0; font-size: 14.5px; line-height: 1.6; }

/* ---------- таблицы ---------- */
.table-card { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data caption { caption-side: top; text-align: left; padding: 12px 16px; font-size: 12.5px; color: var(--text-3); border-bottom: 1px solid var(--border); }
.data th, .data td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.data thead th { background: var(--surface-2); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; vertical-align: bottom; }
.data thead th.group { text-align: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.data thead th.blk { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; color: var(--text-2); text-align: center; padding-inline: 8px; }
.data tbody tr:last-child > * { border-bottom: 0; }
.data tbody th[scope="row"] { font-weight: 600; color: var(--text); white-space: nowrap; }
.data td.formula-cell { color: var(--text-2); max-width: 520px; line-height: 1.55; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { display: flex; gap: 14px; align-items: center; padding: 14px 0; }
.empty__icon { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty__text { display: grid; gap: 2px; }
.empty__text strong { font-size: 14px; color: var(--text); }
.empty__text span { font-size: 13px; color: var(--text-3); }

/* ---------- цифры ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: grid; gap: 10px; align-content: start; padding: 16px 18px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat__label { margin: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.stat__value { margin: 0; font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--text); }
.stat__value.is-empty { color: var(--text-4); font-weight: 500; }
.stat__value small { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.stat__note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }

/* ---------- сигналы ---------- */
.signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.signal { display: grid; gap: 14px; align-content: start; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.signal__head { display: flex; align-items: center; gap: 10px; }
.signal__head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.codes { margin: 0; display: grid; gap: 9px; }
.codes > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.codes dt { display: flex; flex-wrap: wrap; gap: 4px; }
.codes dd { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.signal__note { margin: 0; font-size: 12.5px; color: var(--text-3); }
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.sources__label { margin-right: 2px; }
.sources .chip { min-height: 22px; padding: 2px 8px; font-size: 11.5px; }

/* ---------- чистота воронки ---------- */
.checks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.checks li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.checks li:last-child { border-bottom: 0; }
.checks__codes { display: flex; flex-wrap: wrap; gap: 4px; }
.checks__text { font-size: 13.5px; line-height: 1.55; color: var(--text-2); }

/* ---------- формулы трёх цифр ---------- */
.formulas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.formula { display: grid; gap: 14px; align-content: start; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.formula h3 { margin: 0; font-size: 15px; font-weight: 600; }
.frac { display: grid; font-size: 13.5px; line-height: 1.5; }
.frac__num { padding-bottom: 9px; color: var(--text); }
.frac__den { padding-top: 9px; border-top: 1.5px solid var(--text); color: var(--text-2); }
.formula__note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }

/* ---------- правила отбора (упорядоченный список) ---------- */
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: rule; }
.rules li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 13px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 1.55; }
.rules li::before { counter-increment: rule; content: counter(rule); font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1; color: var(--accent-ink); }

/* ---------- сообщение комдиру ---------- */
.message { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; max-width: 660px; padding: 20px; border-radius: 18px; background: var(--chat); border: 1px solid var(--border); }
.message__avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.message__avatar svg { width: 22px; height: 22px; }
.message__meta { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.message__meta strong { font-size: 13.5px; color: var(--text); }
.bubble { margin-top: 6px; padding: 13px 16px; border-radius: 4px 16px 16px 16px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 14.5px; line-height: 1.6; }
.charcount { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.charcount .meter { flex: 0 1 140px; height: 4px; }

/* ---------- выноски ---------- */
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-lg); background: var(--accent-soft); }
.callout > .badge-ico { background: var(--surface); color: var(--accent-ink); }
.callout__body { display: grid; gap: 8px; min-width: 0; font-size: 14px; line-height: 1.55; }
.callout__body p { margin: 0; }
.callout__body ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.callout--link { align-items: center; justify-content: space-between; flex-wrap: wrap; }

.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.reasons li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.reasons li .chip--nodata { min-height: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px; }

/* ---------- отчёт как документ ---------- */
.report { display: grid; gap: 30px; padding: clamp(20px, 3vw, 34px); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.report .section-title { font-size: 17px; }
.report .panel { background: var(--surface-2); border-color: transparent; }
.report .table-card { border-color: var(--border); }

.doc { max-width: 900px; width: 100%; justify-self: center; display: grid; gap: 30px; padding: clamp(22px, 5vw, 58px); border-radius: 4px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--paper-shadow); }
.doc__head { display: grid; gap: 10px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.doc__kicker { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.doc__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3vw, 30px); line-height: 1.15; letter-spacing: -.01em; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--text-3); }
.doc h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.3; }
.doc .formulas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc .formula { background: var(--surface-2); border-color: transparent; }
.doc p { margin: 0; line-height: 1.65; }
.comment { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; align-items: start; }
.comment__avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-weight: 600; }
.comment__body { display: grid; gap: 6px; }
.comment__empty { color: var(--text-3); font-style: italic; font-family: var(--font-display); }

/* ---------- профиль ---------- */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.role-card { display: grid; gap: 14px; align-content: start; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.role-card[data-current="true"] { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.role-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-card h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.role-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.role-card li { display: flex; align-items: center; gap: 8px; }
.role-card li .ico { color: var(--text-3); }
.role-card .btn { justify-self: start; }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .formulas { grid-template-columns: 1fr; }
  .signal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 959px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; overflow: visible; gap: 12px;
    padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .sidebar__quick { display: flex; }
  .side-foot { display: none; }
  .nav { display: flex; gap: 6px; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav__label { display: none; }
  .nav__link { flex: none; display: flex; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
  .nav__link[aria-current="page"] { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: none; }
  .nav__note { display: none; }
  .role-switch { max-width: 420px; }
  .main { padding-block: 22px 64px; }
  .page { gap: 36px; }
  .chooser { grid-template-columns: 1fr; }
  .chooser__index { position: static; }
  .chooser__list { grid-auto-flow: column; grid-auto-columns: minmax(250px, 78%); overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .item { scroll-snap-align: start; }
  .roles { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .stats, .stats--2, .split, .blocks, .doc .formulas { grid-template-columns: 1fr; }
  .score { grid-template-columns: 1fr; }
  .kv > div { grid-template-columns: 1fr; gap: 4px; }
  .checks li { grid-template-columns: 1fr auto; }
  .checks__codes { grid-column: 1 / -1; }
  .codes > div { grid-template-columns: 1fr; gap: 4px; }
  .sheet { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .skip, .page-head__actions { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .doc { box-shadow: none; border: 0; padding: 0; max-width: none; }
}

/* ---------- иконки: SVG-маски, цвет наследуется от текста ---------- */
.ico { display: inline-block; flex: none; width: 16px; height: 16px; background-color: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E"); }
.ico-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.ico-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E"); }
.ico-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.2M12 16.2v.1'/%3E%3C/svg%3E"); }
.ico-calendar { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.ico-promise { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6h10M10 12h10M10 18h10'/%3E%3Cpath d='M3.5 6l1.6 1.6L8 4.7M3.5 12l1.6 1.6L8 10.7M3.5 18l1.6 1.6L8 16.7'/%3E%3C/svg%3E"); }
.ico-wave { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10v4M8 6.5v11M12 9v6M16 4v16M20 10v4'/%3E%3C/svg%3E"); }
.ico-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.2 2'/%3E%3C/svg%3E"); }
.ico-eye-off { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.1c.5-.1.9-.1 1.4-.1 5 0 8.5 4.5 9.5 7-.4 1-1.2 2.3-2.4 3.4M6.6 6.6C4.5 8 3.1 10 2.5 12c1 2.5 4.5 7 9.5 7 1.8 0 3.4-.6 4.8-1.4'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E"); }
.ico-link-off { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 17H7A5 5 0 0 1 7 7h2M15 7h2a5 5 0 0 1 2 9.6M8.5 12H12M3 3l18 18'/%3E%3C/svg%3E"); }
.ico-info { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.2M12 7.8v.1'/%3E%3C/svg%3E"); }
.ico-inbox { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13.5 5.6 5.7A2.4 2.4 0 0 1 7.9 4h8.2a2.4 2.4 0 0 1 2.3 1.7L21 13.5V18a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpath d='M3 13.5h5l1.6 2.5h4.8l1.6-2.5h5'/%3E%3C/svg%3E"); }
.ico-grid { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3C/svg%3E"); }
.ico-message { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H9.5L5 20.5V17'/%3E%3Cpath d='M4 6v9a2 2 0 0 0 1 1.7'/%3E%3C/svg%3E"); }
.ico-chart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16M7 16.5v-5M12 16.5v-10M17 16.5v-7'/%3E%3C/svg%3E"); }
.ico-doc { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E"); }
.ico-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 20.5c1.2-3.6 4.2-5.5 7.5-5.5s6.3 1.9 7.5 5.5'/%3E%3C/svg%3E"); }
.ico-sun { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4'/%3E%3C/svg%3E"); }
.ico-moon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5z'/%3E%3C/svg%3E"); }
.ico-monitor { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12.5' rx='2'/%3E%3Cpath d='M8.5 20.5h7M12 16.5v4'/%3E%3C/svg%3E"); }
.ico-flag { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4M5 4h11.5l-2 4 2 4H5'/%3E%3C/svg%3E"); }
.ico-arrow-right { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.ico-pause { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6.5' y='5' width='3.8' height='14' rx='1'/%3E%3Crect x='13.7' y='5' width='3.8' height='14' rx='1'/%3E%3C/svg%3E"); }
.ico-funnel { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 5h17l-6.5 7.5V19l-4 2v-8.5z'/%3E%3C/svg%3E"); }
.ico-task { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M8.5 12.2l2.5 2.5 4.6-5.2'/%3E%3C/svg%3E"); }
.ico-lines { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 10.5h16M4 15h11M4 19.5h7'/%3E%3C/svg%3E"); }
.ico-target { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Ccircle cx='12' cy='12' r='.8'/%3E%3C/svg%3E"); }
.ico-layers { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 21 8.5l-9 5-9-5z'/%3E%3Cpath d='M3 13l9 5 9-5'/%3E%3C/svg%3E"); }
.ico-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 19.5c.9-3 3.4-4.5 6.5-4.5s5.6 1.5 6.5 4.5'/%3E%3Cpath d='M16 4.6a3.5 3.5 0 0 1 0 6.8M18.6 15.2c1.4.7 2.4 2.1 2.9 4.3'/%3E%3C/svg%3E"); }
.ico-close-circle { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.2 9.2l5.6 5.6M14.8 9.2l-5.6 5.6'/%3E%3C/svg%3E"); }

/* тело примера: таймкод слева, если хватает ширины */
.sheet__body { container-type: inline-size; }

/* =================== живые данные =================== */
:root {
  --heat-1: #e3f2f8; --heat-ink-1: #142326;
  --heat-2: #bfe1ef; --heat-ink-2: #142326;
  --heat-3: #8ccbe3; --heat-ink-3: #142326;
  --heat-4: #3fa6cf; --heat-ink-4: #0b1d21;
  --heat-5: #0a7aa6; --heat-ink-5: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --heat-1: #14323c; --heat-ink-1: #e6eef0;
    --heat-2: #185467; --heat-ink-2: #e6eef0;
    --heat-3: #1b6a85; --heat-ink-3: #f2f7f8;
    --heat-4: #2e9dc4; --heat-ink-4: #04202a;
    --heat-5: #6fcbea; --heat-ink-5: #04202a;
  }
}
:root[data-theme="dark"] {
  --heat-1: #14323c; --heat-ink-1: #e6eef0;
  --heat-2: #185467; --heat-ink-2: #e6eef0;
  --heat-3: #1b6a85; --heat-ink-3: #f2f7f8;
  --heat-4: #2e9dc4; --heat-ink-4: #04202a;
  --heat-5: #6fcbea; --heat-ink-5: #04202a;
}

/* переключатель дня и недели */
.periods { display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: -20px; }
.periods__label { flex: none; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.periods__list { display: flex; gap: 6px; min-width: 0; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.periods__list::-webkit-scrollbar { display: none; }
.period {
  flex: none; height: 32px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background-color .12s, color .12s, border-color .12s;
}
.period:hover { border-color: var(--border-strong); color: var(--text); }
.period[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.period small { font-size: 11.5px; font-weight: 500; opacity: .7; margin-left: 4px; }
.period-panel { display: grid; gap: 44px; min-width: 0; }

/* выпадающий фильтр */
.select { position: relative; }
.select select {
  -webkit-appearance: none; appearance: none; width: 100%; height: 40px; padding: 0 36px 0 12px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text);
  font: 500 14px var(--font-ui);
}
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 1.8px solid var(--text-3); border-bottom: 1.8px solid var(--text-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-soft); }

/* длинный список: прокрутка внутри колонки */
.chooser--long .chooser__list { max-height: min(68vh, 760px); overflow-y: auto; padding: 2px 6px 2px 2px; margin: -2px -6px -2px -2px; scrollbar-width: thin; }

/* 13 делений балла: заливка по уровню, штриховка — не оценивается по речи */
.seg13 i { background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--surface-3) var(--p, 0%)); }
.seg13 i[data-na] { background: repeating-linear-gradient(135deg, var(--border-strong) 0 1.5px, transparent 1.5px 4px); }

/* семь блоков чек-листа в разборе */
.blockbar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; grid-column: 1 / -1; }
.blockbar li { display: grid; gap: 3px; justify-items: center; padding: 7px 4px 6px; border-radius: 6px; font-size: 11px; line-height: 1.2; text-align: center; min-width: 0; }
.blockbar b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.blockbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* тепловые ячейки: одна шкала, 5 ступеней по 20 процентов */
.data td.heat { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; padding: 10px 6px; border: 2px solid var(--surface); vertical-align: middle; }
.heat.h0, .blockbar .h0 { color: var(--text-4); font-weight: 500; background: transparent; }
.h1 { background: var(--heat-1); color: var(--heat-ink-1); }
.h2 { background: var(--heat-2); color: var(--heat-ink-2); }
.h3 { background: var(--heat-3); color: var(--heat-ink-3); }
.h4 { background: var(--heat-4); color: var(--heat-ink-4); }
.h5 { background: var(--heat-5); color: var(--heat-ink-5); }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.heat-legend__scale { display: flex; gap: 2px; }
.heat-legend__scale span { min-width: 46px; height: 20px; padding: 0 6px; border-radius: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.data .rowgroup { background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: normal; min-width: 140px; }
.data td.more { color: var(--text-3); font-size: 12.5px; }
.data .weak { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 12.5px; line-height: 1.4; color: var(--text-2); min-width: 220px; max-width: 320px; }
.data .weak q { display: block; color: var(--text-3); margin-top: 2px; }

/* таймкоды, даты, метки */
.tc--date { background: var(--surface-3); color: var(--text-2); }
.tc--date.is-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-3); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-3); font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
q { quotes: "«" "»"; }
.moments q, .advice q { color: var(--text-2); }
.advice { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.advice b { font-weight: 600; color: var(--text); }
.block__foot { margin: 0; font-size: 12px; color: var(--text-3); }
.muted { color: var(--text-3); }
.item__score { margin-left: auto; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.item[aria-selected="true"] .item__score { background: var(--surface); }
.chip--good { background: var(--good-soft); color: var(--good-ink); }
.chip--warn { background: var(--warn-soft); color: var(--warn-ink); }

/* профиль клиента */
.pgrid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.pgrid > div { display: grid; gap: 2px; align-content: start; min-width: 0; }
.pgrid dt { font-size: 12px; color: var(--text-3); }
.pgrid dd { margin: 0; font-size: 14px; line-height: 1.45; }
.pgrid dd.is-empty { color: var(--text-4); }
.pgrid q { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.obs { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.obs li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.obs .ico { flex: none; margin-top: 2px; color: var(--warn-ink); }

/* изменение к прошлому периоду */
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta .ico { width: 14px; height: 14px; }
.delta--good { color: var(--good-ink); }
.delta--bad { color: var(--bad-ink); }
.delta--flat { color: var(--text-3); font-weight: 500; }
.data td .big { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.data td .sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* зоны роста */
.zones { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.zones li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 160px) 58px; gap: 16px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.zones__title { font-size: 14px; line-height: 1.45; }
.zones__title small { display: block; font-size: 12px; color: var(--text-3); }
.zones__bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.zones__bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.zones__val { text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* формулы с числами */
.formula__value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.formula__big { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.formula__big.is-empty { color: var(--text-4); font-size: 20px; font-weight: 500; }
.formula__of { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* списки клиентов и сделок */
.clients { list-style: none; margin: 0; padding: 0; display: grid; }
.clients li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.clients li:last-child { border-bottom: 0; }
.clients__who { font-weight: 600; }
.clients__what { grid-column: 1 / -1; color: var(--text-2); line-height: 1.5; }
.clients__what q { color: var(--text-3); }
.go { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.go:hover { text-decoration: underline; }
.go .ico { width: 14px; height: 14px; }
.deals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.deals li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 13px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.deals__who { font-weight: 600; font-size: 14px; }
.deals__why { grid-column: 1 / -1; font-size: 13.5px; color: var(--text-2); }
.exemplars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.exemplars li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; }
.exemplars__score { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.exemplars__why { color: var(--text-2); line-height: 1.5; }
.exemplars__why b { color: var(--text); font-weight: 600; }

@media (max-width: 959px) {
  .periods { margin-top: -14px; }
  .chooser--long .chooser__list { max-height: none; overflow-y: visible; margin: 0; padding: 0 0 4px; }
}
@media (max-width: 720px) {
  .pgrid { grid-template-columns: 1fr; }
  .blockbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .zones li { grid-template-columns: 1fr 58px; }
  .zones__bar { grid-column: 1 / -1; grid-row: 2; }
  .exemplars li { grid-template-columns: 56px minmax(0, 1fr); }
  .exemplars li .go { grid-column: 2; }
}
.ico-trend-up { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 17l6-6 4 4 6-7'/%3E%3Cpath d='M14 8h6v6'/%3E%3C/svg%3E"); }
.ico-trend-down { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7l6 6 4-4 6 7'/%3E%3Cpath d='M14 16h6v-6'/%3E%3C/svg%3E"); }
