/* ============================================================================
   Kruto AI — оформление каркаса, этап 1.
   Слой поверх стилей в app.html: подключается последним и переопределяет их,
   поэтому старая разметка и весь JS работают без изменений.
   Здесь только оболочка — сайдбар, шапка, выбор клиента, базовые элементы.
   Внутренности разделов (контент, идеи, аналитика, аудит) идут этапами дальше.
   ========================================================================= */

/* токены — в :root app.html: он один на весь хаб */

body {
  /* стили оболочки на месте — показываем страницу (скрыта в <head> app.html) */
  opacity: 1;
  animation: none;
  font-family: var(--font);
  background: var(--page-grad), var(--page);
  background-attachment: fixed;   /* градиент стоит на месте, страница едет поверх */
}

/* ─────────────────────────── боковая панель ──────────────────────────────── */
/* Светлая, в цвет страницы (25.09, по образцу Яндекс Метрики): тёмная полоса
   спорила с содержимым за внимание. Открытый раздел — белая скруглённая
   плашка, как карточки на странице. */
.side {
  width: var(--side-w);
  background: transparent;        /* сквозь панель виден градиент страницы */
  color: var(--ink-2);
  border-right: 1px solid var(--border);
  padding: 22px 14px 16px;
  gap: 2px;
  z-index: 30;
  transition: width .18s ease, padding .18s ease;
  overflow-x: hidden;
}

.side .brand { padding: 0 11px 16px; gap: 9px; }
/* знак — капля с глазами (--logo-mark в app.html), без плашки и тени */
.side .brand .logo { width: 34px; height: 34px; background: var(--logo-mark) center / contain no-repeat; }
.side .brand b { color: var(--ink); font-size: 16px; letter-spacing: -.3px; }
.side .brand > div { min-width: 0; }
.side .brand small {
  display: block; margin-top: 2px; font-size: 8px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* выбранный клиент — первым звеном пути в шапке (13.10.2026): имя и стрелка, клик раскрывает список под ним */
.client-switch {
  position: relative; display: flex; align-items: center; gap: 7px; cursor: pointer; flex: none;
  margin: 0 -2px 0 -8px; padding: 5px 8px; border-radius: 9px; border: 1px solid transparent;
}
.topbar .client-switch .client-ava, .topbar .client-switch #brandHandle { display: none; }
.topbar .client-switch .client-txt { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
/* имя клиента — чуть крупнее пути за ним (13.10.2026), стрелка — маленькая и тонкая; на узком экране имя сжимается
   с многоточием — иначе длинное («FINCOM …») выталкивало кнопки шапки за край телефона */
.topbar .client-switch { flex: 0 1 auto; min-width: 0; }
.topbar .client-switch .client-txt b { font-size: 14px; color: var(--ink); max-width: 240px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .client-switch .client-fresh { margin: 0; }
.topbar .client-switch::after { width: 4.5px; height: 4.5px; margin: -3px 0 0; border-right-width: 1.3px;
  border-bottom-width: 1.3px; border-color: var(--muted); }
.topbar .client-switch[aria-expanded="true"]::after { margin-top: 2px; }
.topbar .client-switch:hover, .topbar .client-switch[aria-expanded="true"] { background: rgba(255, 255, 255, .7); }
.topbar .client-menu { right: auto; width: 270px; }
/* путь «/ Стратегия / Досье» — вплотную к имени клиента: зазор шапки (12 px) здесь лишний; −10, а не −12: у имени
   свои −2 px справа, и путь наезжал на него */
.topbar .client-switch + .crumbs { margin-left: -10px; }
.client-ava {
  width: 31px; height: 31px; flex: none; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent-ink); display: grid; place-content: center; font-size: 11.5px; font-weight: 800;
}
.client-txt { min-width: 0; flex: 1; }
.client-txt b {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-txt small {
  display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* стрелка — рамкой, а не символом «⌄»: в Inter он читался как буква «v» */
.client-switch::after {
  content: ""; width: 7px; height: 7px; flex: none; margin: -4px 5px 0 0;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s;
}
.client-switch[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 4px; }
.client-switch:hover, .client-switch[aria-expanded="true"] { border-color: rgba(var(--accent-rgb), .3); }
.client-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.client-switch.single { cursor: default; }
.client-switch.single::after { content: none; }
.client-switch.single:hover { border-color: transparent; background: none; }

/* список клиентов — белая плашка, строки как карточка выбора */
.client-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 16px 40px rgba(20, 25, 45, .16); max-height: 60vh; overflow-y: auto;
}
.cm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px; border: 0; border-radius: var(--r-md); background: transparent;
  color: var(--ink); cursor: pointer;
}
.cm-item:hover, .cm-item:focus-visible { background: var(--sunken); outline: none; }
.cm-item.on { background: var(--accent-soft); }
.cm-item .client-ava { width: 27px; height: 27px; border-radius: 8px; font-size: 11px; }
.cm-item .ic { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }

.side .nav-btn {
  color: var(--ink-2); border-radius: 12px; padding: 10px 11px; gap: 11px;
  font: 600 13.5px var(--font); white-space: nowrap;
}
.side .nav-btn:hover { background: rgba(20, 25, 45, .045); color: var(--ink); }
.side .nav-btn[aria-current="true"] {
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 25, 45, .1);
}
.side .nav-btn[aria-current="true"] .ic { color: var(--accent); opacity: 1; }
.side .nav-btn .cnt { background: var(--surface); color: var(--ink-2); }
.side .nav-btn[aria-current="true"] .cnt { background: var(--accent-soft); color: var(--accent-ink); }
.side .nav-btn .cnt.hot { background: var(--serious-soft); color: var(--serious-text); }
.nav-sep { background: var(--border); margin: 10px 11px; }

/* профиль и «Свернуть» внизу панели */
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.side .side-fold { color: var(--muted); }
.side-foot.as-btn {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 0; padding: 12px 11px 0;
  border-top: 1px solid var(--border); color: var(--ink-2); white-space: nowrap;
}
.who-ava {
  width: 31px; height: 31px; flex: none; border-radius: 50%; background: #e8d4ff;
  color: #624298; display: grid; place-content: center; font-size: 11.5px; font-weight: 800;
}
.side-foot.as-btn b { color: var(--ink); font-size: 12.5px; font-weight: 700; }
.side-foot.as-btn span#whoRole { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.side-foot.as-btn:hover b { color: var(--accent-ink); }

/* свёрнутая панель — полоса иконок; подписи — в подсказках (title) */
@media (min-width: 861px) {
  /* полоса иконок уже (13.10.2026): карточки клиента в панели больше нет — она в пути сверху */
  body.nav-collapsed:not(.nav-top) .side { width: 64px; padding: 22px 8px 16px; }
  body.nav-collapsed:not(.nav-top) .side .brand { padding: 0 9px 16px; }
  body.nav-collapsed:not(.nav-top) .side .brand > div,
  body.nav-collapsed:not(.nav-top) .side .nav-btn > span, body.nav-collapsed:not(.nav-top) .side .nav-btn .nav-hid,
  body.nav-collapsed:not(.nav-top) .side .nav-btn .cnt, body.nav-collapsed:not(.nav-top) .who-txt { display: none; }
  body.nav-collapsed:not(.nav-top) .side .nav-btn { justify-content: center; padding: 11px 0; }
  body.nav-collapsed:not(.nav-top) .side-foot.as-btn { justify-content: center; padding: 12px 0 0; }
  body.nav-collapsed .side-fold .ic { transform: scaleX(-1); }
  /* знак — выше и левее (13.10.2026, просьба владельца): по высоте — вровень с путём в шапке, по ширине — над значками
     разделов. Сдвиг рисованием, а не отступами: разделы под ним остаются на месте */
  body:not(.nav-top) .side .brand { transform: translate(-3px, -6px); }
}

/* ───────────────────────────── рабочая область ─────────────────────────── */
.main { padding: 0 30px 80px; }

/* Шапка тянется во всю ширину области, поэтому выходит за поля отрицательным
   отступом — так не пришлось заворачивать все разделы в общий контейнер. */
.topbar {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  height: 66px; margin: 0 -30px 14px; padding: 0 30px;
  /* полупрозрачная (07.10.2026): сквозь шапку виден градиент страницы, как в макете; размытие
     держит читаемость, когда под неё уезжает содержимое */
  background: rgba(255, 255, 255, .35); backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(23, 25, 35, .06);
}
/* меню слева: от панели до содержимого — 12 px, а не 30 (07.10.2026, просьба владельца) */
body:not(.nav-top) .main { padding-left: 12px; }
body:not(.nav-top) .topbar { margin-left: -12px; padding-left: 12px; }
.crumbs {
  min-width: 0; font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crumbs b { color: var(--ink-2); font-weight: 700; }
.crumbs span::before { content: " / "; color: #c9ccd6; }
/* у раздела без группы (профиль) второй части пути нет — и разделителя тоже */
.crumbs span:empty::before { content: none; }
/* «Стратегия» (13.10.2026, 74-space.js): «свернуть заголовок» — значком за путём; на других разделах его нет */
.crumb-acts { display: flex; align-items: center; gap: 4px; flex: none; margin-left: 6px; }
body:not(:has(#sec-space:not([hidden]))) .crumb-acts { display: none; }
.crumb-ic { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); }
.crumb-ic:hover { border-color: var(--border); background: rgba(255, 255, 255, .7); color: var(--ink); }
/* место под полосу прокрутки — всегда: в документе она есть, в обзоре часто нет, и ряд слоёв не «дышит» при переходе */
html:has(#sec-space:not([hidden])) { scrollbar-gutter: stable; }
.crumb-ic .ic { width: 16px; height: 16px; }
.crumb-ic.sp-sfold .ic { width: 15px; height: 15px; transform: rotate(90deg); transition: transform .15s; }
body.sec-min .crumb-ic.sp-sfold .ic { transform: rotate(-90deg); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex: none; }
.topbar .nav-new {
  margin: 0; padding: 0 16px; height: 38px; flex: none; white-space: nowrap;
  border-radius: 12px; font: 700 12.5px var(--font);
  background: var(--accent); box-shadow: 0 6px 16px rgba(91, 92, 240, .22);
}
.topbar .nav-new:hover { background: var(--accent-ink); }
.nav-burger {
  display: none; width: 38px; height: 38px; flex: none; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--ink-2); cursor: pointer;
}
.nav-burger:hover { color: var(--ink); border-color: var(--accent); }
.nav-backdrop { display: none; }

/* заголовок раздела и вкладки */
.sec-bar { margin: 0 0 16px; }
/* шапка раздела компактнее (26.09): крупный заголовок с пустотой над и под
   ним съедал первый экран — до фильтров и цифр приходилось листать */
.sec-title { font-size: 22px; font-weight: 750; letter-spacing: -.5px; }
/* у раздела из одной вкладки строки вкладок нет — нет и линии под заголовком */
.sec-bar:has(.sec-tabs:empty) { margin-bottom: 12px; }
.sec-bar:has(.sec-tabs:empty) .sec-top { margin-bottom: 0; }
.sec-tabs { gap: 0 18px; }
.sec-tabs button { font-size: 13.5px; font-weight: 650; }

/* ───────────────────────── базовые элементы ────────────────────────────── */
.btn { border-radius: 12px; font-weight: 700; }
.btn-primary { background: var(--accent); box-shadow: 0 6px 16px rgba(91, 92, 240, .22); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { border-color: var(--border); }
.btn-ghost:hover { border-color: #cfd1da; background: #fafafa; color: var(--ink); }
.chip { border-radius: 999px; font-weight: 650; }
.panel, .card, .tm-card { border-radius: 16px; box-shadow: var(--shadow-2); border-color: var(--border); }
textarea, input[type="text"], input[type="number"], input[type="password"], select {
  border-radius: 10px; border-color: var(--border);
}
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
table th {
  font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  background: #fafafa;
}

/* ─────────────────────────── узкие экраны ──────────────────────────────── */
@media (max-width: 860px) {
  /* Панель уезжает за край и выдвигается кнопкой: девять групп в строку на
     телефоне занимали пол-экрана до начала работы. */
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px; height: 100vh;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    padding: 20px 14px 16px; transform: translateX(-100%);
    transition: transform .2s ease; overflow-y: auto;
    /* выезжает поверх страницы — своя непрозрачная подложка с тем же градиентом */
    background: var(--page-grad), var(--page);
  }
  body.nav-open .side { transform: none; box-shadow: 0 18px 60px rgba(10, 12, 20, .45); }
  body.nav-collapsed .side { display: flex; }
  .side .brand span, .side .brand small { display: block; }
  .side .nav-btn { width: 100%; }
  .side-foot { margin: auto 0 0; padding: 12px 8px 0; }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 20;
    background: rgba(12, 14, 22, .45); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .nav-burger { display: inline-flex; }
  .main { padding: 0 14px 70px; }
  .topbar { height: 58px; margin: 0 -14px 16px; padding: 0 14px; }
  .sec-title { font-size: 22px; letter-spacing: -.4px; }
  .topbar .nav-new { padding: 0 12px; }
  .side-fold { display: none !important; }
}
/* на телефоне кнопка с подписью съедала путь «клиент / раздел / вкладка»:
   остаётся значок, подпись — в aria-label */
@media (max-width: 520px) {
  .topbar .nav-new { width: 38px; padding: 0; gap: 0; font-size: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
  .nav-backdrop { transition: none; }
}


/* ─────────────── пояснение раздела: подсказка вместо абзаца ─────────────── */
/* Заголовок раздела уже стоит в строке раздела, а пояснение нужно не каждый раз:
   прячем абзац и отдаём его текст подсказке у знака «?». */
body.grouped .main > section .sec-sub,
body.grouped .main > section .anx-top p { display: none; }

.sec-info {
  width: 20px; height: 20px; flex: none; position: relative;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface);
  color: var(--muted); font: 700 11.5px var(--font); cursor: help; padding: 0;
}
.sec-info:hover, .sec-info:focus-visible { color: var(--accent-ink); border-color: var(--accent); }
/* До наведения подсказки нет вовсе: спрятанная прозрачностью, она всё равно
   торчала за правый край и толкала страницу вбок на телефоне. */
.sec-info::after {
  content: attr(data-tip); display: none; position: absolute; left: -8px; top: calc(100% + 8px);
  width: max-content; max-width: min(52ch, 78vw); padding: 10px 12px; border-radius: 10px;
  background: #1a1e2c; color: #fff; font: 500 12.5px/1.5 var(--font);
  text-align: left; box-shadow: 0 10px 30px rgba(20, 22, 31, .22);
  pointer-events: none; z-index: 40;
}
.sec-info:hover::after, .sec-info:focus-visible::after { display: block; }
/* то же у заголовка блока (10.10, правка 36): пояснение под заголовком карточки — не абзацем, а здесь.
   Подсказка встаёт под заголовком от его левого края и не шире блока; по касанию тоже открывается */
.hint-h { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.hint-h > h2, .hint-h > h3 { margin: 0; }
.hint-h > .sec-info { position: static; }
.hint-h > .sec-info::after { left: 0; max-width: min(52ch, 100%); }
.hint-h > .sec-info:focus::after { display: block; }

/* ─────────────── строка управления графиком ─────────────── */
/* Была прижата к правому краю и переносилась так, что «потолок» оставался на
   строке один. Отдаём ей отдельную строку целиком и выравниваем по левому краю. */
.anx-wide .card > .frow:first-of-type { row-gap: 12px; }
.anx-wide .card > .frow:first-of-type > .sp { display: none; }
.anx-wide .card > .frow:first-of-type > .ctl {
  flex: 1 0 100%; justify-content: flex-start; align-items: flex-end; gap: 10px 14px;
}
/* разрыв строки в разметке больше не нужен: с подписями над контролами все шесть
   органов помещаются в один ряд, «срез» — второй; на узком экране переносятся сами */
.anx-wide .ctl-break { display: none; }
/* подпись над контролом и у графика: «источник» над сегментом, «период» над списком */
.anx-wide .frow .pair { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.anx-wide .frow .pair > label { order: -1; }
.anx-wide .fn-filters { gap: 8px; align-items: flex-end; }
.anx-wide .fn-filters .hint { align-self: center; }
/* все органы графика одного роста: сегменты, выбор показателей, списки и
   «сбросить срез» — 30 px; кегль значений в полях — из общего правила полей ниже */
.anx-wide .seg { padding: 2px; border-radius: 10px; }
.anx-wide .seg button { height: 24px; padding: 0 10px; font-size: 12.5px; font-weight: 600; }  /* + рамка и поля дорожки = 30 */
.anx-wide .fn-pick-btn, .anx-wide .card .frow select, .anx-wide .card .frow input[type="date"],
.anx-wide .card .frow button.ghost.mini {
  height: 30px; padding-top: 0; padding-bottom: 0; line-height: 28px;
}
.anx-wide .card .frow button.ghost.mini { font-size: 12.5px; font-weight: 600; }
/* та же стрелка у выбора показателей, что у всех select (они — в общем правиле
   в конце файла); фон белый в любом состоянии */
.anx-wide .fn-pick-btn {
  appearance: none; -webkit-appearance: none; padding-left: 9px; padding-right: 26px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a919e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
}
.anx-wide .card .frow select:disabled, .anx-wide .fn-pick-btn:disabled {
  background-color: var(--surface); color: var(--muted); opacity: 1;
}
.anx-wide .fn-pick-btn::after { content: none; }


/* ============================================================================
   Этап 2. Контент: в работе · канбан · календарь · опубликовано
   ========================================================================= */

/* ─────────────────── таблица материалов ────────────────────────────────── */
.scen-wrap { border-radius: 14px; }
.scen-thead {
  position: sticky; top: 0; z-index: 2; background: var(--sunken);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.scen-item { border-bottom: 1px solid var(--hairline); transition: background .12s; }
.scen-item:last-child { border-bottom: 0; }
.scen-item:hover { background: var(--sunken); }
.scen-title { font-weight: 600; color: var(--ink); }
.scen-empty { color: var(--muted); padding: 34px 16px; text-align: center; }

/* ─────────────────── канбан ────────────────────────────────────────────── */
.kn-colhead { padding: 4px 8px 10px; }
.kn-coltitle {
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.kn-count {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.kn-card { border-radius: 12px; box-shadow: var(--shadow-1); border-color: var(--hairline); }
.kn-card:hover { border-color: var(--accent); box-shadow: var(--shadow-2); }
.kn-card-title { font-weight: 600; color: var(--ink); }
.kn-card-foot { color: var(--muted); }

/* ─────────────────── календарь ─────────────────────────────────────────── */
/* Контент-план — широкая таблица: пусть прокручивается внутри своей карточки,
   а не тащит за собой страницу. */
#planTable { overflow-x: auto; }

/* ─────────────────── опубликовано: цифры и фильтры ─────────────────────── */
.hqx .stats { gap: 14px; }
.hqx .stat {
  border-radius: 14px; box-shadow: var(--shadow-1); padding: 14px 18px; min-width: 150px;
}
.hqx .stat b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hqx .stat span { color: var(--muted); font-size: 12.5px; }

/* ─────────────────── узкие экраны ──────────────────────────────────────── */
@media (max-width: 760px) {
  .hqx .stat { flex: 1 1 calc(50% - 7px); min-width: 0; }
  .hqx .stat b { font-size: 22px; }
}

/* ─────────── переключатель представлений: список · канбан · календарь ──── */
/* На экране три разных выбора подряд, и они должны читаться по-разному:
   вкладки раздела — подчёркиванием, режим и тип — сегментами, фильтры — чипами. */
#workViews {
  display: inline-flex; gap: 2px; padding: 3px; background: var(--sunken);
  border: 1px solid var(--border); border-radius: 12px;
}
#workViews .chip {
  border: 0; background: transparent; border-radius: 10px; height: 28px;
  color: var(--ink-2); font-size: 12.5px;
}
#workViews .chip[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
}

/* дорожка сегментов должна отличаться от выбранного сегмента: на белом фоне
   разница в два процента яркости не читается вовсе */
#workViews { background: var(--page); }


/* ============================================================================
   Этап 3. Идеи: генератор · список · заметки с TG · хуки
   ========================================================================= */

/* ─────────────────── генератор идей ────────────────────────────────────── */
#ideaGen.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-1); padding: 18px 20px;
}
.ig-head { border-bottom: 1px solid var(--hairline); padding-bottom: 14px; margin-bottom: 16px; }
.ig-title { font-weight: 650; color: var(--ink); gap: 9px; }
.ig-title svg { color: var(--accent); }
.ig-draft {
  background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 600;
}
.ig-modes {
  display: inline-flex; gap: 2px; padding: 3px; background: var(--page);
  border: 1px solid var(--border); border-radius: 12px;
}
.ig-mode {
  border: 0; background: transparent; border-radius: 10px; height: 28px; padding: 0 12px;
  color: var(--ink-2); font-size: 12.5px; font-family: inherit; cursor: pointer;
}
.ig-mode.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.ig-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.ig-fld input, .ig-fld textarea, .ig-fld select {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--ink); font-family: inherit; font-size: 13.5px; padding: 8px 11px;
}
.ig-fld input:focus, .ig-fld textarea:focus { border-color: var(--accent); outline: none; }
.ig-tree { background: var(--sunken); border: 1px solid var(--hairline); border-radius: 12px; }
.ig-out {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-1);
}
.ig-actions { gap: 8px; }

/* ─────────────────── хуки ──────────────────────────────────────────────── */
.hk-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-1); padding: 12px 14px; margin-bottom: 14px;
}
.hk-groups { gap: 6px; }
.hk-groups .chip, .hk-brand .chip { height: 28px; font-size: 12.5px; padding: 0 11px; }
.hk-legend { color: var(--muted); font-size: 12.5px; }
.hk-grid { gap: 12px; }
.hk-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-1); padding: 14px 16px 14px 18px; position: relative;
  transition: box-shadow .14s, border-color .14s;
}
.hk-card:hover { box-shadow: var(--shadow-2); border-color: var(--accent); }
/* пригодность хука видна полосой, а не только оттенком рамки: цветом одним
   смысл передавать нельзя — его не видно ни в чёрно-белой печати, ни глазу,
   который к оттенкам невнимателен */
.hk-card::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--border);
}
.hk-card.fit-good::before { background: var(--good); }
.hk-card.fit-neutral::before { background: var(--muted); }
.hk-card.fit-risk::before { background: var(--serious); }
.hk-h { font-weight: 650; color: var(--ink); }
.hk-tpl { color: var(--ink-2); }
.hk-tags { color: var(--muted); font-size: 12.5px; }
.hk-why { color: var(--muted); font-size: 12.5px; }

/* блок генерации внизу — такая же карточка, а не россыпь полей */
.hk-gen {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-1); padding: 16px 18px; margin-top: 16px;
}
.hk-gen h4 { margin: 0 0 12px; font-size: 14.5px; color: var(--ink); }
.hk-gen h4 small { color: var(--muted); font-weight: 400; }
.hk-gen-row { gap: 8px; }
.hk-gen-row input, .hk-gen-row select {
  height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-size: 13.5px; padding: 0 11px;
}
.hk-gen-row input:focus { border-color: var(--accent); outline: none; }
.hk-gen-row .btn { height: 38px; border-radius: 10px; }
#hkText {
  border: 1px solid var(--border); border-radius: 10px; background: var(--sunken);
  color: var(--ink-2); font-family: inherit; font-size: 13.5px; padding: 10px 12px;
}
.hk-custom { margin-top: 12px; }

/* ─────────────────── узкие экраны ──────────────────────────────────────── */
@media (max-width: 760px) {
  .ig-head { flex-wrap: wrap; gap: 10px; }
  .ig-modes { width: 100%; }
  .ig-mode { flex: 1 1 0; }
  .hk-gen-row { flex-wrap: wrap; }
  .hk-gen-row input { flex: 1 1 100%; }
  .hk-gen-row select, .hk-gen-row .btn { flex: 1 1 calc(50% - 4px); }
}


/* ============================================================================
   Этап 4. Аналитика и воронка
   ========================================================================= */

/* ─────────────────── шапка и управление ───────────────────────────────── */
.anx-top { align-items: center; margin-bottom: 14px; }
/* в общем меню заголовок и абзац скрыты, кнопка отчёта — в строке фильтров: пустую шапку убираем */
body.grouped .main > section .anx-top { display: none; }
.anx-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-1); padding: 10px 12px 12px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end;
}
/* Подпись фильтра — над контролом, слева, мелко: рядом с кнопками она съедала
   ширину строки. Одно начертание для панели аналитики и для органов графика. */
.anx-seg .lbl, .anx-wide .frow .pair > label, .anx-wide .fn-filters > label {
  font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); line-height: 1.2; padding: 0; margin: 0; align-self: flex-start;
}
.anx-seg {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: transparent; border: 0; border-radius: 0; padding: 0;
}
/* дорожка сегментов: кнопки внутри — выбор одного из вариантов */
.anx-track {
  display: inline-flex; gap: 6px; background: var(--sunken); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.anx-track > button {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; height: 27px; padding: 0 10px; font-size: 12.5px; font-family: inherit;
}
.anx-track > button:hover { border-color: var(--accent); color: var(--accent-ink); }
.anx-track > button.on, .anx-track > button[aria-pressed="true"] {
  background: var(--accent-soft); color: var(--accent-ink); border-color: transparent;
}
.anx-toggle { color: var(--ink-2); font-size: 12.5px; gap: 6px; }
/* панель равняет по низу: переключатель той же высоты, что дорожка кнопок (35px), — середины на одной линии */
.anx-bar .anx-toggle { min-height: 35px; box-sizing: border-box; }

/* ─────────────────── карточки метрик ──────────────────────────────────── */
.kpi-row { gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-1); padding: 14px 16px;
}
.kpi .k-lbl {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.kpi .k-val {
  font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.kpi .k-sub { color: var(--muted); font-size: 12.5px; }

/* ─────────────────── панели разрезов ──────────────────────────────────── */
.anx .pane, .anx-grid .pane {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-1); padding: 16px 18px;
}
.pane-h { align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pane-h h3 { font-size: 14.5px; font-weight: 650; color: var(--ink); margin: 0; }
.pane-h .h-note { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.p-foot { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }
.anx .card, .anx-wide .card { border-radius: 14px; box-shadow: var(--shadow-1); }

/* таблицы разрезов: прокрутка внутри панели, а не растянутая страница */
.anx .pane > table, .anx-grid .pane > table { max-width: 100%; }
.anx .pane { overflow-x: auto; }

/* ─────────────────── воронка ──────────────────────────────────────────── */
/* «Откуда цифры»: заметка замера и порядок счёта свёрнуты под лентой — раньше
   это были два абзаца мелкого текста, которые читали один раз */
#sec-hqfunnel .fun-how { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
#sec-hqfunnel .fun-how summary { cursor: pointer; color: var(--ink-2); font-weight: 600; width: max-content; }
#sec-hqfunnel .fun-how summary:hover { color: var(--accent-ink); }
#sec-hqfunnel .fun-how .fun-note { margin: 8px 0 0; line-height: 1.5; }
#sec-hqfunnel .fun-how ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; }
#sec-hqfunnel .hint { color: var(--muted); font-size: 12.5px; }
.fn-foot { color: var(--muted); font-size: 12.5px; }
.fn-how summary { color: var(--ink-2); font-size: 12.5px; cursor: pointer; }

/* ─────────────────── узкие экраны ─────────────────────────────────────── */
@media (max-width: 760px) {
  .anx-bar { gap: 12px; }
  .anx-seg { flex: 1 1 100%; }
  .anx-track { flex-wrap: wrap; }
  .kpi-row { gap: 10px; }
  .kpi { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 12px 13px; }
  .kpi .k-val { font-size: 22px; }
  .anx-grid { grid-template-columns: 1fr; }
}

/* ─────────────────── карточки метрик: спокойные, как в прототипе ───────── */
.kpi.g1, .kpi.g2, .kpi.g3, .kpi.g4, .kpi.g5 {
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  box-shadow: var(--shadow-1);
}
.kpi::after { background: none; }
.kpi .k-lbl { color: var(--muted); font-weight: 600; }
.kpi .k-sub { color: var(--muted); opacity: 1; }
/* цвет метрики остаётся в линии динамики: карточки различимы, но не кричат */
.kpi .k-spark { opacity: .85; }
.kpi.g1 .k-spark path { stroke: #3b4fd8; }
.kpi.g2 .k-spark path { stroke: #6c3fe0; }
.kpi.g3 .k-spark path { stroke: #0e8f80; }
.kpi.g4 .k-spark path { stroke: #1b7fa8; }
.kpi.g5 .k-spark path { stroke: #c1476f; }

/* линия динамики не должна наезжать на плашку сравнения: даём ей свою полосу */
.kpi { padding-bottom: 54px; }
.kpi .k-spark { height: 38px; opacity: .7; }


/* ============================================================================
   Этап 5. Аудит: досье · конкуренты · референсы · приёмы · рубрики · стратегия
   ========================================================================= */

/* ─────────────────── широкие таблицы прокручиваются сами ───────────────── */
/* Горизонтальная прокрутка страницы — это сломанная вёрстка. Широкой таблице
   место в своей рамке с собственной прокруткой. */
#compTable, #rubList, #fmtLeadList, #refsTable, #refsAcc,
#planTable { overflow-x: auto; }
/* на будущее: любая обёртка с широкой таблицей ведёт себя так же */
.hqx div:has(> table.t) { overflow-x: auto; }

/* ─────────────────── карточки и таблицы разделов ───────────────────────── */
.hqx .card {
  border-radius: 14px; box-shadow: var(--shadow-1); border: 1px solid var(--border);
}
.hqx .card > h2, .hqx .card > .frow > h2 {
  font-size: 15px; font-weight: 650; color: var(--ink); margin: 0 0 4px;
}
.hqx .grp-head {
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  font-weight: 650; margin: 22px 0 8px;
}
.hqx .hint { color: var(--muted); font-size: 12.5px; }
.hqx table.t thead th {
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; background: var(--sunken);
}
.hqx table.t tbody tr:hover { background: var(--sunken); }
.hqx table.t td.num, .hqx table.t th.num { font-variant-numeric: tabular-nums; }

/* ─────────────────── поля и кнопки в строках управления ────────────────── */
.hqx .frow { gap: 8px; align-items: center; flex-wrap: wrap; }
.hqx .frow input[type="search"], .hqx .frow input[type="text"], .hqx .frow select {
  height: 32px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); padding: 0 10px;
}
.hqx .frow input[type="search"], .hqx .frow input[type="text"] { font-size: 13.5px; }
.hqx .frow input:focus, .hqx .frow select:hover { border-color: var(--accent); outline: none; }
.hqx .frow button { border-radius: 10px; }
.hqx .frow button.ghost {
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
}
.hqx .frow button.ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ─────────────────── узкие экраны ──────────────────────────────────────── */
@media (max-width: 760px) {
  .hqx .frow input[type="search"], .hqx .frow input[type="text"] { flex: 1 1 100%; }
  /* подпись в одну строку: в половине ширины «выброс: любой» переносилась
     внутри поля в 32 px и обрезалась; длинная занимает строку целиком */
  .hqx .frow select { flex: 1 1 calc(50% - 4px); white-space: nowrap; }
}

/* ─────────────────── профиль: таблицы тоже в своей рамке ───────────────── */
/* Таблица команды и ряды Livedune шире узкого экрана — прокручиваем их, а не
   страницу (126 px на 1024 и 106 px на 390). */
#pfTeam, #ldTable, #sec-profile div:has(> table.pf-tbl) { overflow-x: auto; }

/* профиль: свой ИИ через MCP — адрес с ключом и «как подключить» */
#pfMcpUrl { word-break: break-all; }
.pf-how { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.pf-how summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.pf-how ol { padding-left: 18px; margin: 8px 0; }
.pf-how li { margin: 4px 0; }
.pf-how p { margin: 6px 0 0; }
.pf-how code { font-size: 11.5px; background: var(--sunken); padding: 1px 5px; border-radius: 6px; word-break: break-all; }

/* ═══════════════ дизайн-система: базовые элементы (24.09.2026) ═══════════════
   Токены — в :root app.html. Здесь один вид на один смысл: слой идёт последним
   и сводит варианты, которые разошлись по разделам. Замер до сведения
   (work/дизайн-система/компоненты-до.txt): 64 вида кнопок на 26 экранах,
   Arial в кнопках и полях без своего шрифта, скругления 8/10/12/20 у кнопок
   одного размера, пять разных заголовков таблиц. */

/* браузер ставит кнопкам и полям свой шрифт — наследуем шрифт страницы;
   текст сценария переопределяет это своим классом (var(--font-text)) */
button, input, select, textarea { font-family: inherit; }
/* подсказка в поле — обычным весом, даже если поле жирное, и светлее подписи (10.10):
   иначе её путают с введённым значением. Одно правило на все поля; Firefox гасит её opacity */
::placeholder { font-weight: 400; color: var(--muted-2); opacity: 1; }

/* кнопка и поле — одного радиуса; маленькая кнопка в строке таблицы — поменьше */
.btn, .pf-btn, .fb-btn, .rl-tab, .cx-eye, .fn-pick-btn, .ig-mode,
.hqx button.ghost, .hqx .frow button, #sec-audit .aud-run button { border-radius: var(--r-md); }
.mini, .srow-btn { border-radius: var(--r-sm); }
/* обычная кнопка одного размера во всех разделах: раньше в штабе 14.5 px и
   38 px высотой, в разборе аккаунта 44, в профиле и правилах 36. Компактные
   места (строка действий карточки, панель материала) сужают её своим правилом. */
.btn, .pf-btn, .hqx button:not(.mini):not(.tog):not(.fn-pick-btn):not(.seg *):not(.anx *):not(.fb-qbtn):not(.mpick-btn):not(.fdef *):not(.ct-colsbtn),
#sec-audit .aud-run button {
  font-size: 13.5px; font-weight: 700; line-height: 1; padding: 10px 16px;
}

/* скрыто на время (src/05-hidden.js): владелец видит на месте, но помеченным */
.side .nav-btn.is-hidden-own { opacity: .55; }
.sec-tabs button.is-hidden-own { opacity: .55; }
.sec-tabs .nav-hid { margin-left: 6px; }
.nav-hid {
  margin-left: auto; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border: 1px dashed var(--muted);
  border-radius: var(--r-pill); padding: 1px 7px;
}
.is-hidden-own[data-hide-why] {
  position: relative; opacity: .55; outline: 1.5px dashed var(--muted); outline-offset: 6px; border-radius: var(--r-lg);
  margin-top: 44px;   /* место под подпись «скрыто …» над блоком */
}
.is-hidden-own[data-hide-why]::before {
  content: attr(data-hide-why); position: absolute; top: -30px; left: 0; z-index: 2;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--sunken);
  border: 1px dashed var(--muted); border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap;
  max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis;   /* телефон: длинная причина — не за экран */
}

/* чипы и переключатели-«таблетки»: одна форма, один кегль */
.chip, .ig-chip, .kn-chip, .kb-tab, .aud-chip { border-radius: var(--r-pill); }
.ig-chip, .kn-chip, .aud-chip { font-size: 12.5px; font-weight: 650; }

/* заголовки таблиц: мелкие прописные серым, одним начертанием */
.hqx .t th, .fun-tbl th, .ad-table th, .pf-tbl th,
.kb-strat-tbl th {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}

/* карточки: белая плашка, тонкая рамка, скругление карточки */
.card, .panel, .pf-card, .kn-card, .hk-card,
.rub-card, .tm-card {
  border-radius: var(--r-lg);
}

/* ── выпадающие списки: один вид на весь хаб (24.09.2026) ──
   Раньше каждый раздел рисовал свой select, а раскрытый список был системным —
   серым окном Windows. Закрытый список везде одинаковый: белое поле, тонкая
   рамка, своя стрелка. Раскрытый — наша плашка там, где браузер это умеет
   (Chrome и Edge с версии 135, appearance: base-select); в Safari и Firefox
   список пока остаётся системным, закрытое поле — такое же. */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none; cursor: pointer; color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--r-md); background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a919e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
  transition: border-color .12s, box-shadow .12s;
}
select:not([multiple]):hover:not(:disabled) { border-color: rgba(var(--accent-rgb), .55); }
select:not([multiple]):focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
select:not([multiple]):disabled { cursor: default; color: var(--muted); }
/* значение в поле — одним начертанием на всей платформе (29.09.2026): список, список
   с галочками, выбор показателей графика и дата. Кегль и насыщенность задаёт только
   это правило: у раздела свои рост и поля, но не шрифт — иначе рядом стояли жирное
   12.5 и обычное 13.5. Сам текст значения — с маленькой буквы, кроме имён собственных
   (FINCOM, Instagram, Livedune), и правится в разметке и JS, а не text-transform. */
:is(select:not([multiple]), input[type="date"], .fn-pick-btn, .mpick-btn) {
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
}
/* поле даты в фильтрах — того же роста и рамки, что список рядом */
.fb-field input[type="date"] {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  padding: 0 10px; color: var(--ink);
}
.fb-field select, .fb-field input[type="date"] { height: 36px; box-sizing: border-box; }
.fb-field input[type="date"]:focus { outline: none; border-color: var(--accent); }
.fb-field.fb-date { min-width: 140px; }

/* список с галочками (multiPick в 12-filters.js): закрытым — как обычный
   select, раскрытым — как наша плашка выбора, только с галочками */
.mpick { position: relative; display: inline-flex; min-width: 0; }
.fb-field .mpick { display: flex; }
.mpick-btn {
  position: relative; display: block; width: 100%; min-width: 150px; max-width: 280px; height: 36px;
  padding: 0 30px 0 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-md); background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a919e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
  transition: border-color .12s, box-shadow .12s;
}
.mpick-btn:hover:not(:disabled) { border-color: rgba(var(--accent-rgb), .55); }
.mpick-btn[aria-expanded="true"], .mpick-btn:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15);
}
/* выбранное отличает цвет, а не жирность: начертание у всех полей одно. С 13.10.2026 значение по умолчанию («все рынки»,
   «любой тег») — серым, выбранное — синим; у обычных списков фильтров то же: в панели фильтров — по классу on
   (12-filters.js: значение не «все»), в строках фильтров «Рынка» и «Результатов» — по первому пункту, он и есть «все» */
.mpick-btn:not(.on) { color: var(--ink-2); }
.mpick-btn.on { color: var(--accent-ink); }
.fb-field select:not(.on), .frow select:has(> option:first-child:checked) { color: var(--ink-2); }
.fb-field select.on, .frow select:not(:has(> option:first-child:checked)) { color: var(--accent-ink); }
.fb-field select option, .frow select option { color: var(--ink); }
.mpick-btn:disabled { cursor: default; color: var(--muted); }
.mpick-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 70; min-width: 100%; width: max-content;
  max-width: min(340px, 86vw); max-height: min(340px, 60vh); overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 14px 34px rgba(20, 25, 45, .16);
}
.mpick-all {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r-sm); font: 500 13.5px var(--font); color: var(--ink-2);
}
.mpick-all:hover { background: var(--sunken); color: var(--ink); }
.mpick-all.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.mpick-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.mpick-opt:hover { background: var(--sunken); color: var(--ink); }
/* подпись варианта — обычным текстом: внутри поля фильтра span-подписи прописные */
.mpick-opt span { text-transform: none; letter-spacing: 0; font: inherit; color: inherit; }
.mpick-opt input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.mpick-opt:has(input:checked) { color: var(--ink); font-weight: 600; }
.mpick-none { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
/* в строке графика «Аналитики» органы компактнее — 30 px, как соседние */
.anx-wide .mpick-btn { height: 30px; min-width: 120px; padding-left: 9px; padding-right: 26px;
  background-position: right 9px center; }
/* в штабе у всех кнопок свой синий фон (.hqx button) — спискам он не нужен:
   ни с галочками, ни выбору показателей графика (синел при наведении) */
.hqx button.fn-pick-btn:hover, .hqx button.fn-pick-btn:focus { background-color: var(--surface); color: var(--ink); }
.hqx .mpick > button.mpick-btn, .hqx .mpick > button.mpick-btn:hover {
  background-color: var(--surface); color: var(--ink-2); border: 1px solid var(--border);
}
.hqx .mpick > button.mpick-btn:hover:not(:disabled) { border-color: rgba(var(--accent-rgb), .55); }
.hqx .mpick > button.mpick-btn {
  padding: 0 30px 0 12px; border-radius: var(--r-md);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a919e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
}
.hqx .anx-wide .mpick > button.mpick-btn { padding: 0 26px 0 9px; background-position: right 9px center; }

.hqx .mpick > button.mpick-btn[aria-expanded="true"] { border-color: var(--accent); }
.hqx .mpick > button.mpick-btn.on { color: var(--accent-ink); }
.hqx .mpick-pop button.mpick-all { background: transparent; color: var(--ink-2); border: 0; font-weight: 500; }
.hqx .mpick-pop button.mpick-all:hover { background: var(--sunken); color: var(--ink); }
.hqx .mpick-pop button.mpick-all.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }

@supports (appearance: base-select) {
  select:not([multiple]), ::picker(select) { appearance: base-select; }
  select:not([multiple]) {
    background-image: none; padding-right: 10px; display: inline-flex; align-items: center; gap: 8px;
    justify-content: space-between;
  }
  select:not([multiple])::picker-icon {
    content: ""; width: 10px; height: 6px; flex: none; transition: rotate .15s;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238a919e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center;
  }
  select:not([multiple]):open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
  select:not([multiple]):open::picker-icon { rotate: 180deg; }
  ::picker(select) {
    border: 1px solid var(--border); border-radius: var(--r-lg); padding: 6px; margin-block: 6px;
    background: var(--surface); box-shadow: 0 14px 34px rgba(20, 25, 45, .16);
    max-height: min(340px, 60vh); min-width: anchor-size(width); font-family: var(--font);
  }
  select:not([multiple]) option {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap;
    text-transform: none; letter-spacing: 0;
  }
  /* заголовок группы — как подпись поля: мелко, серым, капсом */
  select:not([multiple]) optgroup {
    padding: 8px 10px 2px; font-size: 10px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted);
  }
  select:not([multiple]) optgroup + optgroup, select:not([multiple]) optgroup + option { margin-top: 4px; }
  select:not([multiple]) option:hover, select:not([multiple]) option:focus-visible {
    background: var(--sunken); color: var(--ink); outline: none;
  }
  select:not([multiple]) option:checked { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
  /* галочка — знак выбора нескольких (multiPick); у одиночного списка выбранное просто подсвечено */
  select:not([multiple]) option::checkmark { display: none; }
  select:not([multiple]) option:disabled { color: var(--muted); cursor: default; }
}

/* ── Аналитика: фильтры и цифры одной карточкой (26.09) ── */
.anx-head {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-1); padding: 12px 14px 14px; margin-bottom: 16px;
}
.anx-head .anx-bar {
  background: none; border: 0; box-shadow: none; border-radius: 0; margin: 0;
  padding: 0 0 12px; border-bottom: 1px solid var(--hairline);
}
.anx-head .kpi-row { margin: 12px 0 0; }
.anx-head .kpi { box-shadow: none; background: var(--sunken); border-color: transparent; }
/* кнопка среза — та же «Фильтры», что в календаре (12-filters.js): значок,
   подпись и число включённых фильтров; стоит внизу строки, вровень с полями */
.anx-wide .fnf-box { align-self: flex-end; }
.hqx.anx-wide button.fb-btn {
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--border);
  height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 700; }
.hqx.anx-wide button.fb-btn:hover, .hqx.anx-wide button.fb-btn[aria-expanded="true"] {
  border-color: var(--accent); color: var(--accent-ink); background: var(--surface); }

/* ── навигация сверху — пробная раскладка (62-navtop.js, ?nav=top) ──
   боковая панель и прежняя шапка уходят; их органы переехали в строку */
.topnav { display: none; }
body.nav-top .shell { flex-direction: column; }
body.nav-top .side, body.nav-top .topbar { display: none; }
body.nav-top .topnav {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 30px; background: rgba(255, 255, 255, .35); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
body.nav-top .topnav .logo { width: 32px; height: 32px; flex: none; background: var(--logo-mark) center / contain no-repeat; }
body.nav-top .topnav .client-switch { margin: 0; padding: 6px 10px 6px 6px; width: 190px; border-radius: 12px; flex: none; }
body.nav-top .topnav .client-ava { width: 26px; height: 26px; border-radius: 8px; }
body.nav-top .topnav .client-menu { right: auto; width: 260px; }
body.nav-top #navGroups { display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: 8px; }
body.nav-top #navGroups .nav-btn { width: auto; height: 38px; padding: 0 13px; gap: 7px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
body.nav-top #navGroups .nav-btn .ic { width: 16px; height: 16px; }
body.nav-top #navGroups .nav-btn:hover { background: rgba(20, 25, 45, .045); color: var(--ink); }
body.nav-top #navGroups .nav-btn[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); }
body.nav-top #navGroups .nav-btn[aria-current="true"] .ic { color: var(--accent); }
body.nav-top #navGroups .nav-btn[data-grp="settings"] { display: none; }   /* настройки — шестерёнкой справа */
body.nav-top .nav-sep { display: none; }
body.nav-top .tn-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
body.nav-top .tn-right #hidToggle { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; color: var(--muted); }
body.nav-top .tn-right #hidToggle span { display: none; }
body.nav-top .tn-right #whoBtn { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
body.nav-top .tn-right #whoBtn .who-txt { display: none; }
body.nav-top .tn-right #whoBtn .who-ava { width: 36px; height: 36px; }
body.nav-top .tn-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; }
body.nav-top .tn-ic .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
body.nav-top .tn-ic:hover, body.nav-top .tn-ic[aria-current="true"] { border-color: var(--accent); color: var(--accent-ink); }
body.nav-top .main { padding-top: 18px; }
body.nav-top .tn-right .nav-assist { white-space: nowrap; }
body.nav-top .tn-right #whoBtn { width: auto; flex: none; }
/* строка по ширине окна (10.10, правка 3, 62-navtop.js: fitWire): разделы не налезают на правую часть — что не
   влезло, уходит в «Ещё»; правая часть не сжимается, поиск на узких — значком, шестерёнки в «Агентстве» нет */
body.nav-top #navGroups { flex: 0 1 auto; overflow: hidden; }
body.nav-top #navGroups .nav-btn { flex: none; }
body.nav-top #navGroups .nav-btn.tn-out { display: none; }
body.nav-top .tn-right, body.nav-top .tn-right > * { flex: none; }
body.nav-top .tn-ic[hidden] { display: none; }
body.nav-top .tn-more { position: relative; flex: none; }
body.nav-top .tn-more[hidden] { display: none; }
body.nav-top .tn-more-btn { width: auto; height: 38px; padding: 0 12px; gap: 7px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
body.nav-top .tn-more-btn .ic { width: 16px; height: 16px; }
body.nav-top .tn-more-btn:hover, body.nav-top .tn-more-btn[aria-expanded="true"] { background: rgba(20, 25, 45, .045); color: var(--ink); }
body.nav-top .tn-more-btn[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); }
body.nav-top .tn-more-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 220px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 25, 45, .14); }
body.nav-top .tn-more-menu[hidden] { display: none; }
body.nav-top .tn-more-it { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--ink-2); font: 600 14px var(--font); text-align: left; white-space: nowrap; cursor: pointer; }
body.nav-top .tn-more-it .ic { width: 16px; height: 16px; }
body.nav-top .tn-more-it:hover { background: var(--sunken); color: var(--ink); }
body.nav-top .tn-more-it[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); }
body.nav-top .tn-more-it .cnt { margin-left: auto; }
body.nav-top .tn-right .nav-find { width: 38px; height: 38px; border-radius: 50%; }
@media (max-width: 1365px) {
  body.nav-top .topnav { gap: 10px; padding: 0 18px; }
  body.nav-top .tn-right .nav-assist { padding: 0 11px; }
  body.nav-top .tn-right .nav-assist span { display: none; }
}
/* варианты выбора нескольких в строке фильтров штаба — не подписи полей: обычный текст */
.hqx .mpick-pop .mpick-opt { font: 500 13.5px var(--font); color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.hqx .mpick-pop .mpick-opt:has(input:checked) { color: var(--ink); font-weight: 600; }
/* выбор нескольких в строке фильтров штаба — как соседние выпадающие списки этой строки */
.hqx .frow .mpick > button.mpick-btn { height: 32px; min-width: 0; padding: 0 28px 0 10px; }

/* «без пробных / без раздачи» — без подложки (27.09.2026): переключатель и подпись, как текст */
.anx-bar .anx-toggle { background: none; border: 0; box-shadow: none; padding: 0 4px; }
/* название клиента и ник — плотно, как в его выпадающем списке (28.09.2026): межстрочный
   1,55 от body раздвигал их */
.client-switch .client-txt b, .client-switch .client-txt small { line-height: 1.2; }
.client-switch .client-txt small { margin-top: 1px; }
/* в строке меню сверху плашка клиента — компактнее: по размеру названия, ниже ростом */
body.nav-top .topnav .client-switch { width: auto; min-width: 150px; max-width: 220px; height: 40px; padding: 4px 30px 4px 5px;
  gap: 8px; border-radius: 11px; }
body.nav-top .topnav .client-switch::after { position: absolute; right: 11px; top: 50%; margin: -5px 0 0; width: 6px; height: 6px; }
body.nav-top .topnav .client-switch[aria-expanded="true"]::after { margin-top: -2px; }
body.nav-top .topnav .client-ava { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
body.nav-top .topnav .client-txt b { font-size: 13px; }
body.nav-top .topnav .client-menu { left: 0; }

/* ─────────── телефон: органы управления не ниже 36 px (28.09.2026) ─────────── */
/* Аудит на 390 px: переключатели видов, сегменты, фильтры, кнопки строк и
   вкладки были 24–34 px — мимо пальцем. Растёт только высота (у квадратных
   значков — и ширина), вид прежний. */
@media (max-width: 560px) {
  button.chip, .cx-seg button, .seg-group button, .anx-track button, .hqx .seg button,
  .fb-btn, .fb-qbtn, .btn, .pf-btn, .rl-tab, .srow-go, .tg-ic, .tg-node, .tg-plusrow,
  .hqx .frow button, .hqx .frow select, .hqx .frow .mpick > button.mpick-btn, .hqx .fn-pick-btn,
  .hqx button.mini, .mdl-foot button, .tg-bar select, .tg-node.k-sub, .cx-addmenu button,
  .fb-tog, .fb-reset, .kn-chip, .sp-body .tpl-regs .ed-ai-btn { min-height: 36px; }
  #calPrev, #calNext, .srow-btn, .sec-fold, .tg-pen, .pw-eye, .ast-x, .mdl-box .mdl-x { min-width: 36px; min-height: 36px; }
  /* «?» у заголовка, «✕» в чипах и плашки в шапке раздела досье — значки внутри
     строки: вырастить их — сломать строку, поэтому палец ловит невидимая рамка вокруг */
  .sec-info::before, .acct-chip button::before, .hqx .fn-line button::before {
    content: ""; position: absolute; inset: -9px;
  }
  .sp-hacts > button::before { content: ""; position: absolute; inset: -7px -2px; }
  .acct-chip button, .hqx .fn-line button, .sp-hacts > button { position: relative; }
}

/* Мелочи экранов (04.10.2026, обход на 390 и 1440):
   1) пометка «скрыто от всех, кроме владельца» у кнопок в шапке не встаёт подписью над кнопкой — она
      вылезала за край и налезала на шапку; хватает пунктира и бледности, причина — в подсказке;
   2) на телефоне вкладки раздела переносятся, и кнопка «свернуть заголовок» уезжала на пустую строку —
      теперь она в правом верхнем углу строки вкладок. */
.topbar .is-hidden-own[data-hide-why] { margin-top: 0; outline-offset: 2px; }
.topbar .is-hidden-own[data-hide-why]::before { display: none; }
@media (max-width: 760px) {
  .sec-tabsrow { position: relative; }
  .sec-tabsrow .sec-tabs { padding-right: 40px; }
  .sec-tabsrow .sec-fold { position: absolute; right: 0; top: 0; }
}
/* обложка карусели без своей — её первый слайд 4:5: в широкой рамке показываем верх, там заголовок */
img[src*="/slide1"] { object-position: top; }
/* «свой…» период в «Динамике по дням»: даты одной строкой на уровне остальных полей — раньше поля
   вставали столбиком над панелью (общее правило .pair — подпись над полем) */
.anx-wide .frow #fnOwnBox:not([hidden]) { flex-direction: row; align-items: center; align-self: flex-end; gap: 6px; }
.anx-wide .frow #fnOwnBox input[type="date"] { width: 148px; }

/* ─────────────── подсказка при наведении (13.10.2026, 14-tip.js) ───────────────
   как в Claude: тёмная, со скруглёнными углами, без стрелки, появляется быстро; текст — тот же title элемента.
   «?» у заголовков (.sec-info) — тем же видом */
.ktip { position: fixed; z-index: 1000; max-width: 320px; padding: 5px 9px; border-radius: 7px;
  background: #1f1e1d; color: #fff; font: 500 12.5px/1.4 var(--font); white-space: pre-line; text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); pointer-events: none; }
.ktip[hidden] { display: none; }
.sec-info::after { background: #1f1e1d; border-radius: 8px; padding: 7px 10px; }

/* ─────────────── единый размер органов управления (13.10.2026, просьба владельца) ───────────────
   Кнопки, поля, списки и переключатели в строках над списками и таблицами — одной высоты, 34 px, кнопки-значки —
   квадрат 34 × 34: стояли 27, 30, 32, 34, 36 и 38 px вперемешку, и строки выглядели криво. Высота — одна переменная,
   --ctl-h в :root (css/01-base.css) */
/* «Перелив» (13.10.2026): кнопка, за которой ждёт работа, — «Разобрать» у идей при неразобранных, «Проверить» у
   «Сценариев» при присланных на проверку (60-ideas.js: triageBtns, 47-scriptcheck.js: checkBtns). По рамке раз в
   четыре секунды пробегает цветной блик, по самой кнопке — лёгкая полоса; при prefers-reduced-motion блик стоит */
.btn-ghost.btn-shine, .btn-ghost.btn-shine:hover { position: relative; overflow: hidden; isolation: isolate; border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(100deg, var(--border) 30%, var(--accent) 42%, var(--c3) 48%, var(--c5) 54%, var(--c6) 60%, var(--border) 70%) border-box;
  background-size: 100% 100%, 300% 100%; background-position: 0 0, 100% 0; animation: btn-shine 4s ease-in-out infinite; }
.btn-ghost.btn-shine::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(var(--accent-rgb), .13) 50%, transparent 62%);
  background-size: 300% 100%; background-position: 100% 0; animation: btn-shine-in 4s ease-in-out infinite; }
@keyframes btn-shine { 0%, 20% { background-position: 0 0, 100% 0; } 75%, 100% { background-position: 0 0, 0% 0; } }
@keyframes btn-shine-in { 0%, 20% { background-position: 100% 0; } 75%, 100% { background-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) {
  .btn-ghost.btn-shine, .btn-ghost.btn-shine:hover { animation: none; background-position: 0 0, 50% 0; }
  .btn-ghost.btn-shine::after { animation: none; display: none; }
}
.fb-qbtn, .hqx button.fb-qbtn, .hqx button.cd-btn, .fdef > button.fdef-btn, .hqx .fdef > button.fdef-btn, .cx-eye,
.sec-alert { width: var(--ctl-h); height: var(--ctl-h); }
.fb-btn, .mpick-btn, .hqx .mpick > button.mpick-btn, .fb-field select, .fb-field input[type="date"],
.hqx .frow select, .hqx .frow input[type="search"], .hqx .frow input[type="text"],
.ct-colsbtn, .hqx button.ct-colsbtn, .tg-filter select, .tg-bar .tg-chk,
.sec-acts .btn, .cx-adds .btn, .cx-views .btn, .cx-tools .cx-nav .btn, #calIg, #calPlanMonth,
.hqx .frow .mpick > button.mpick-btn { height: var(--ctl-h); }
.sec-acts .btn, .cx-views .btn { padding-top: 0; padding-bottom: 0; font-size: 12.5px; }
.cx-tools .cx-nav .btn { min-width: var(--ctl-h); padding-top: 0; padding-bottom: 0; }
.cx-tools > .cx-seg { height: var(--ctl-h); align-items: center; }
.sec-alert { border-radius: 10px; }
/* боль в «Древе» — по общему правилу фильтров: «все идеи» серым, выбранная боль — синим */
.tg-filter select:has(> option:first-child:checked) { color: var(--ink-2); }
.tg-filter select:not(:has(> option:first-child:checked)) { color: var(--accent-ink); }

/* период «‹ Октябрь 2026 ›» в «Контент-плане» (13.10.2026) — одной плашкой, как фильтр рядом: рамка, высота строки
   органов, стрелки внутри без своих рамок, месяц — обычным начертанием, как значения фильтров */
.cx-tools > .cx-nav { gap: 0; height: var(--ctl-h); padding: 0 2px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); }
.cx-tools > .cx-nav:hover { border-color: rgba(var(--accent-rgb), .55); }
.cx-tools .cx-nav .btn { height: calc(var(--ctl-h) - 6px); min-width: 28px; padding: 0 6px; border: 0; background: transparent;
  box-shadow: none; color: var(--ink-2); font-weight: 500; border-radius: 8px; }
.cx-tools .cx-nav .btn:hover { background: var(--sunken); color: var(--ink); }
.cx-tools .cx-period { min-width: 112px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
