/* T-3216 (OWNER 13:35): «Главная v3» — CSS макета docs/review/home_etalon_skills_2026-10-20/style.css КАК ЕСТЬ.
   Между маркерами ниже — дословная копия файла макета внутри вложенного правила #home-v3 { … } (CSS nesting);
   правила макета не изменены. Замены только для изоляции, их сверяет test_home_v3_mock_t3216.js:
   «:root» / «html» / «body» → «&» (корень = #home-v3), «@keyframes flow» вынесен за #home-v3 (внутри правила он не действует).
   Ниже второго маркера — адаптер сайта: пока на экране v3 и открыт #/today, оболочка сайта уступает место оболочке макета. */
/* ==== MOCK START ==== */
#home-v3 {
/* ProfitOS · прежняя Главная по эталону, разобранная по дизайн-скиллам (20.10.2026, правка 2)
   Эталон: docs/review/home_etalon/home_etalon_owner_20261008.webp. Правила: docs/design/DESIGN_SKILLS.md.
   Правка 2 по владельцу: график прибыли за 30 дней, боковое меню сайта, выбор тёмной или светлой темы. */

/* ---------- 1. Токены: тёмная тема (по умолчанию, стиль «Рекламы») ---------- */
& {
  color-scheme: dark;

  --page: #010715;
  /* фон ровный, без смещённого пятна; свечение стоит за Центром решений (.orbit::before) */
  --page-bg: linear-gradient(180deg, #031326 0%, #020b19 38%, #010715 100%) fixed;
  --glow: rgba(9, 58, 96, 0.9);
  --bar-bg: #030c19;
  --side-bg: rgba(3, 10, 21, 0.94);
  --control-bg: #07172a;
  --surface: rgba(5, 15, 28, 0.82);
  --raised: #0b1d31;
  --surface-edge: rgba(148, 163, 184, 0.16);
  --center-edge: rgba(35, 215, 230, 0.32);

  --text: #e7edf6;
  --text-2: #cbd5e1;
  --text-muted: #9fb0c6;

  --accent-fill: #23d7e6;
  --accent-hover: #4ae2ee;
  --accent-ink: #23d7e6;
  --accent-ink-hover: #6ee8f1;
  --on-accent: #03131b;
  --good-ink: #34d399;
  --bad-ink: #ff5b72;
  --warn-ink: #f5ad29;
  --dot-ok: #34d399;
  --dot-partial: #f5ad29;
  --dot-none: #9fb0c6;

  --live-edge: rgba(35, 215, 230, 0.55);
  --live-edge-hover: rgba(35, 215, 230, 0.75);
  --live-tint: rgba(35, 215, 230, 0.06);
  --live-icon-bg: rgba(35, 215, 230, 0.1);
  --icon-bg: rgba(148, 163, 184, 0.08);
  --soft-bg: rgba(148, 163, 184, 0.06);
  --nav-active-bg: rgba(148, 163, 184, 0.12);

  --divider: rgba(148, 163, 184, 0.14);
  --control-edge: rgba(148, 163, 184, 0.26);
  --tint-hover: rgba(148, 163, 184, 0.05);
  --tint-press: rgba(35, 215, 230, 0.08);
  --skel: rgba(148, 163, 184, 0.14);
  --line-idle: rgba(148, 163, 184, 0.2);
  --line-live: rgba(35, 215, 230, 0.7);

  --pill-red-ink: #ff5b72;
  --pill-red-bg: rgba(255, 91, 114, 0.14);
  --pill-cyan-ink: #23d7e6;
  --pill-cyan-bg: rgba(35, 215, 230, 0.12);
  --risk-bg: rgba(255, 91, 114, 0.06);
  --risk-bg-hover: rgba(255, 91, 114, 0.1);
  --risk-edge: rgba(255, 91, 114, 0.3);

  --chart-grid: rgba(148, 163, 184, 0.14);
  --chart-zero: rgba(148, 163, 184, 0.42);
  --chart-line: #23d7e6;
  --chart-fill: rgba(35, 215, 230, 0.1);

  --selection: rgba(35, 215, 230, 0.3);
  --scrollbar: #2a3e55;
  --shadow-float: 0 18px 48px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.28);

  --radius-block: 18px;
  --radius-inner: 12px;
  --radius-control: 10px;

  --side-w: 220px;
  --fs-lead: 34px;
  --fs-kpi: 26px;
  --fs-empty: 20px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-press: 120ms;
  --t-hover: 150ms;
}

/* ---------- 1б. Светлая тема: свои цвета текста, контраст ≥ 4.5:1 на белом ---------- */
&[data-theme="light"] {
  color-scheme: light;

  --page: #f3f5f8;
  --page-bg: #f3f5f8;
  --glow: rgba(35, 215, 230, 0.12);
  --bar-bg: #ffffff;
  --side-bg: #ffffff;
  --control-bg: #ffffff;
  --surface: #ffffff;
  --raised: #ffffff;
  --surface-edge: #e2e7ee;
  --center-edge: rgba(11, 125, 136, 0.35);

  --text: #0f172a;
  --text-2: #334155;
  --text-muted: #5b6779;

  --accent-fill: #23d7e6;
  --accent-hover: #12c4d3;
  --accent-ink: #0b7d88;
  --accent-ink-hover: #075f68;
  --on-accent: #03131b;
  --good-ink: #0d7f57;
  --bad-ink: #c4242a;
  --warn-ink: #a15c07;
  --dot-ok: #22b07d;
  --dot-partial: #e39b12;
  --dot-none: #94a3b8;

  --live-edge: rgba(11, 125, 136, 0.5);
  --live-edge-hover: rgba(11, 125, 136, 0.75);
  --live-tint: rgba(35, 215, 230, 0.07);
  --live-icon-bg: rgba(35, 215, 230, 0.14);
  --icon-bg: #f1f4f8;
  --soft-bg: #f5f7fa;
  --nav-active-bg: #eef2f6;

  --divider: #e7ebf0;
  --control-edge: #d5dbe3;
  --tint-hover: #f7f9fb;
  --tint-press: rgba(35, 215, 230, 0.1);
  --skel: #e8ecf1;
  --line-idle: rgba(100, 116, 139, 0.28);
  --line-live: rgba(11, 125, 136, 0.75);

  --pill-red-ink: #c4242a;
  --pill-red-bg: #ffedea;
  --pill-cyan-ink: #0b7d88;
  --pill-cyan-bg: rgba(35, 215, 230, 0.14);
  --risk-bg: #fff5f4;
  --risk-bg-hover: #ffedea;
  --risk-edge: #f6c7c3;

  --chart-grid: #e8ecf1;
  --chart-zero: #9aa6b6;
  --chart-line: #0b7d88;
  --chart-fill: rgba(35, 215, 230, 0.14);

  --selection: rgba(35, 215, 230, 0.3);
  --scrollbar: #c5ced9;
  --shadow-float: 0 16px 40px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* ---------- 2. База ---------- */
* { box-sizing: border-box; }

& { background: var(--page); scrollbar-color: var(--scrollbar) transparent; }

& {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--selection); }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

button, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: default; opacity: 0.5; }

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}

a { color: var(--accent-ink); text-decoration: none; }

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted { color: var(--text-muted); }
.phone-only { display: none; }
.unit { font-size: 0.6em; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }

/* ---------- 3. Каркас: боковое меню + содержимое ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 12px;
  background: var(--side-bg);
  border-right: 1px solid var(--divider);
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.brand span { color: var(--accent-ink); }
.brand-mark { color: var(--accent-ink); }
.side .brand { padding: 4px 8px 6px; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  font-size: 14px;
  color: var(--text-muted);
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease;
}

/* активный пункт — яркостью и нейтральной подложкой, без цветной полосы */
.nav a[aria-current="page"] { color: var(--text); background: var(--nav-active-bg); font-weight: 500; }
.nav a[aria-current="page"] .icon { color: var(--accent-ink); }

.content { min-width: 0; }

/* ---------- 4. Верхняя строка ---------- */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 64px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: none;
}

.site-bar-inner {
  width: min(1392px, calc(100% - 48px));
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-bar .brand { display: none; }
.page-title { margin-right: auto; font-size: 20px; line-height: 28px; font-weight: 600; }

.picker {
  height: 40px;
  min-width: 168px;
  padding: 0 34px 0 12px;
  background-color: var(--control-bg);
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-ink) 50%), linear-gradient(135deg, var(--accent-ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  transition: border-color var(--t-hover) ease;
}

/* переключатель темы: два положения словами */
.theme {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
  background: var(--control-bg);
}

.theme button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-muted);
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}

.theme button .icon { width: 16px; height: 16px; flex-basis: 16px; }
.theme button[aria-pressed="true"] { color: var(--text); background: var(--nav-active-bg); }
.theme button:active { transform: scale(0.97); }

/* ---------- 5. Страница и сетка ---------- */
.page {
  width: min(1392px, calc(100% - 48px));
  margin: 20px auto 24px;
}

.slice { margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }

/* две колонки; левая — один блок, поэтому высокий отчёт не растягивает её строки */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.board-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.block {
  background: var(--surface);
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius-block);
}

.block-title { font-size: 17px; line-height: 24px; font-weight: 600; }

.demo-foot {
  width: min(1392px, calc(100% - 48px));
  margin: 0 auto 72px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- 6. Четыре числа: один блок, главная цифра — «Оборот сегодня» ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }

.kpi {
  position: relative;
  min-width: 0;
  padding: 18px 22px 16px;
  text-align: left;
  container-type: inline-size;
  transition: background-color var(--t-hover) ease;
}

.kpi + .kpi { box-shadow: inset 1px 0 0 var(--divider); }

.kpi-label {
  display: block;
  padding-right: 18px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  display: flex;
  align-items: flex-end;
  height: 42px;
  margin-top: 8px;
  font-size: var(--fs-kpi);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.kpi--lead .kpi-value { font-size: var(--fs-lead); }
.kpi .kpi-value.is-empty { font-size: var(--fs-empty); font-weight: 500; color: var(--text-muted); }
.kpi--forecast .kpi-value { color: var(--text-2); }

/* причина не обрезается: переносится на вторую строку, плитки ряда выравниваются по высоте */
.kpi-sub {
  display: block;
  min-height: 20px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-muted);
}

.good { color: var(--good-ink); font-weight: 600; }
.bad { color: var(--bad-ink); font-weight: 600; }

.q {
  position: absolute;
  right: 18px;
  top: 23px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-none);
}

.q[data-q="ok"] { background: var(--dot-ok); }
.q[data-q="partial"] { background: var(--dot-partial); }

/* ---------- 7. AI-директор: строка, а не баннер с кристаллом ---------- */
.ai { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }

.ai-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--radius-inner);
  background: var(--live-icon-bg);
  color: var(--accent-ink);
}

.ai-mark .icon { width: 22px; height: 22px; }
.ai-copy { min-width: 0; }
.ai-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.ai-name { font-size: 19px; line-height: 26px; font-weight: 600; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pill-cyan-ink);
  background: var(--pill-cyan-bg);
}

.ai-line { margin-top: 2px; font-size: 13px; color: var(--text-2); }

.ai-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ai-meta b { color: var(--text); font-weight: 500; }

/* ---------- 8. Агенты вокруг Центра ---------- */
.orbit {
  position: relative;
  display: grid;
  grid-template-columns: minmax(196px, 230px) minmax(280px, 1fr) minmax(196px, 230px);
  grid-template-areas: "left center right";
  column-gap: 32px;
  align-items: stretch;
}

/* свечение ровно за Центром решений: центр — средняя колонка, поэтому середина блока = середина центра */
.orbit::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
  z-index: 0;
}

.agents-head { display: none; }

.agents {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.agents--left { grid-area: left; }
.agents--right { grid-area: right; }

/* плитка: имя / чем занят / число / статус — каждая строка во всю ширину, ничего не обрезается */
.agent {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  column-gap: 10px;
  align-content: center;
  min-height: 108px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--surface-edge);
  border-radius: 14px;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease;
}

/* «горит» только тот агент, который реально работает (решение владельца 08.10) */
.agent[data-state="live"] {
  border-color: var(--live-edge);
  background: linear-gradient(var(--live-tint), var(--live-tint)), var(--surface);
}

.agent-icon {
  grid-row: 1 / span 4;
  align-self: start;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--icon-bg);
  color: var(--text-muted);
}

.agent[data-state="live"] .agent-icon { color: var(--accent-ink); background: var(--live-icon-bg); }

.agent-top { min-width: 0; }
.agent-name { display: block; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-desc { font-size: 12px; line-height: 18px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.agent-num {
  margin-top: 4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-num b { font-size: 17px; font-weight: 600; color: var(--text); margin-right: 4px; }
.agent .status { margin-top: 2px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-muted);
  white-space: nowrap;
}

.status::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: currentColor; }

.status[data-state="live"] { color: var(--accent-ink); }
.status[data-state="ready"] { color: var(--good-ink); }
.status[data-state="error"] { color: var(--warn-ink); }
.status[data-state="none"] { color: var(--text-muted); }

/* линии от агентов к центру: спокойные; движется только у работающих */
.links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.links path { fill: none; stroke: var(--line-idle); stroke-width: 1.2; }

.links path.is-live {
  stroke: var(--line-live);
  stroke-width: 1.6;
  stroke-dasharray: 5 9;
  animation: flow 1.4s linear infinite;
}

/* @keyframes flow — вынесен за #home-v3 */

/* ---------- 9. Центр принятия решений — главный блок ---------- */
.center {
  grid-area: center;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  border-color: var(--center-edge);
}

.center-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.center-state { font-size: 13px; }

.center-figs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.fig { min-width: 0; padding: 14px 0; }
.fig + .fig { padding-left: 18px; box-shadow: inset 1px 0 0 var(--divider); }
.fig-label { font-size: 12px; line-height: 18px; color: var(--text-muted); }
.fig-value { margin-top: 4px; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; }
.fig-value.is-empty { font-size: 17px; font-weight: 500; color: var(--text-muted); }
.fig-sub { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.decision { margin-top: 16px; }
.decision-label { font-size: 12px; line-height: 18px; color: var(--text-muted); }

.decision-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  font-size: 17px;
  line-height: 24px;
  font-weight: 600;
}

.decision-text.is-empty { font-size: 14px; font-weight: 400; color: var(--text-muted); }

/* «Почему»: что сказал каждый работающий агент — основание решения */
.reasons { margin-top: 14px; }

.reason {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
}

.reason .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-ink); }
.reason b { font-weight: 600; color: var(--text); }

/* «Если сказать «да»»: лимит, оценка (не факт), замер, откат */
.change {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-inner);
  background: var(--soft-bg);
  font-size: 13px;
  line-height: 20px;
}

.change dt { color: var(--text-muted); }
.change dd { margin: 0; color: var(--text-2); }
.change dd b { font-weight: 600; color: var(--good-ink); }

.ready { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--text-muted); }
.ready-track { flex: 1 1 120px; height: 6px; border-radius: 6px; background: var(--skel); overflow: hidden; }
.ready-fill { height: 100%; border-radius: 6px; background: var(--accent-fill); }
.ready b { color: var(--text); font-weight: 600; }

.last { margin-top: auto; padding-top: 16px; }

.last-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 10px;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-inner);
  background: var(--soft-bg);
}

.last-row .icon { grid-row: 1 / span 3; color: var(--good-ink); margin-top: 1px; }
.last-text { font-size: 14px; line-height: 20px; font-weight: 500; }
.last-time { font-size: 12px; line-height: 18px; color: var(--text-muted); }
.last-effect { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--text-muted); }
.last-effect b { margin-right: 6px; font-size: 15px; font-weight: 600; color: var(--good-ink); }

.center-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, border-color var(--t-hover) ease;
}

.btn--primary { color: var(--on-accent); background: var(--accent-fill); }
.btn--ghost { border: 1px solid var(--control-edge); font-weight: 500; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: var(--accent-ink);
  transition: color var(--t-hover) ease;
}

/* ---------- 10. Лента активности: одна ячейка на агента ---------- */
.feed { padding: 16px 20px 18px; }
.feed-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; }
.feed-head .muted { font-size: 13px; }
.feed-toggle { margin-left: auto; min-height: 36px; font-size: 13px; color: var(--text-muted); transition: color var(--t-hover) ease; }

.feed-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid var(--divider); }
.feed.is-collapsed .feed-grid,
.feed.is-collapsed .feed-empty { display: none; }

.cell { min-width: 0; padding: 14px 14px 12px 0; border-bottom: 1px solid var(--divider); }
.cell:not(:nth-child(5n + 1)) { padding-left: 14px; box-shadow: inset 1px 0 0 var(--divider); }
.cell:nth-last-child(-n + 5) { border-bottom: 0; }

.cell-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.cell-head .icon { width: 16px; height: 16px; flex-basis: 16px; color: var(--text-muted); }
.cell-time { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text-muted); }

.cell-what {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
}

.cell-effect { margin-top: 6px; font-size: 13px; line-height: 20px; color: var(--text-muted); }
.cell-effect b { font-weight: 600; color: var(--good-ink); }
.cell.is-quiet .cell-what { color: var(--text-muted); min-height: 0; }

.feed-empty { margin-top: 12px; padding: 16px 0 4px; border-top: 1px solid var(--divider); font-size: 14px; color: var(--text-muted); }

/* ---------- 11. Отчёт директору ---------- */
.report { padding: 18px 20px 8px; }
.report > .block-title { margin-bottom: 12px; }
.rep { padding: 16px 0; border-top: 1px solid var(--divider); }
.rep-title { font-size: 14px; line-height: 20px; font-weight: 600; }
.rep-list { margin-top: 8px; }

.rep-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
}

.rep-list li .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--text-muted); }
.rep-list li.done .icon { color: var(--good-ink); }
.rep-list .when { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.rep-list .eff { font-weight: 600; color: var(--good-ink); white-space: nowrap; }
.rep-list .eff.is-wait { font-weight: 400; color: var(--text-muted); }
.rep-empty { margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--text-muted); }

/* график прибыли: факт по закрытым дням, одна линия, ноль виден */
.profit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.profit-value { margin-top: 6px; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; }
.profit-delta { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--text-muted); }
.profit-note { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-muted); }
.chart { position: relative; margin-top: 10px; }
.chart svg { display: block; width: 100%; height: 150px; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .zero { stroke: var(--chart-zero); stroke-width: 1.2; }
.chart .tick { fill: var(--text-muted); font-size: 11px; }
.chart .area { fill: var(--chart-fill); stroke: none; }
.chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end { fill: var(--chart-line); }
.chart .hit { fill: transparent; }
.chart-tip {
  position: absolute;
  top: -6px;
  transform: translate(-50%, -100%);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--raised);
  box-shadow: var(--shadow-float);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.chart-tip.is-on { opacity: 1; }
.chart-empty { margin-top: 8px; font-size: 13px; color: var(--text-muted); }

.risks .rep-title { display: flex; align-items: center; gap: 8px; }

.risk {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  text-align: left;
  border-radius: var(--radius-inner);
  background: var(--risk-bg);
  transition: background-color var(--t-hover) ease;
}

.risk-title { display: block; font-size: 13px; line-height: 19px; font-weight: 600; }
.risk-meta { display: block; margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-muted); }
.risk-meta b { color: var(--text); font-weight: 600; }

.pill-red {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--pill-red-ink);
  background: var(--pill-red-bg);
  white-space: nowrap;
}

/* на ПК риски живут в отчёте; на планшете и телефоне — строкой наверху (блок с действием поднимается) */
.risks-top { display: none; }

/* ---------- 12. Нижнее меню (планшет и телефон) ---------- */
.bottom-nav { display: none; }
.more-sheet { display: none; }

/* ---------- 13. Загрузка ---------- */
.skel { display: block; border-radius: 6px; background: var(--skel); }
.kpi-value .skel { width: 60%; height: 24px; }
.kpi--lead .kpi-value .skel { height: 30px; }
.kpi-sub .skel { width: 70%; height: 12px; margin-top: 4px; }
.fig-value .skel { width: 70%; height: 24px; margin-top: 4px; }
.decision .skel { width: 86%; height: 16px; margin-top: 8px; }
.agent-num .skel { width: 60%; height: 14px; margin-top: 3px; }
.cell .skel { height: 12px; margin-top: 8px; }
.rep .skel { height: 12px; margin-top: 10px; }
.rep .skel-chart { height: 150px; margin-top: 12px; border-radius: 10px; }
.is-loading .q, .is-loading .status { visibility: hidden; }

/* ---------- 14. Стенд ---------- */
.stand {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--control-bg);
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
}

.stand a { padding: 4px 9px; border-radius: 6px; font-size: 11px; color: var(--text-muted); }
.stand a.active { color: var(--accent-ink); background: var(--nav-active-bg); }
.capture .stand { display: none; }

/* ---------- 15. Наведение только у мыши ---------- */
@media (hover: hover) and (pointer: fine) {
  .kpi:hover, .agent:hover { background-color: var(--tint-hover); }
  .agent[data-state="live"]:hover { border-color: var(--live-edge-hover); }
  .btn--primary:hover { background: var(--accent-hover); }
  .btn--ghost:hover { border-color: var(--live-edge); }
  .text-link:hover, .nav a:hover { color: var(--accent-ink-hover); }
  .nav a:hover { color: var(--text); background: var(--tint-hover); }
  .feed-toggle:hover, .theme button:hover { color: var(--text); }
  .risk:hover { background: var(--risk-bg-hover); }
  .picker:hover { border-color: var(--live-edge); }
}

.kpi:active, .agent:active { background-color: var(--tint-press); }

/* ---------- 16. Узкий ПК: меню полосой значков, отчёт уже ---------- */
@media (max-width: 1399px) and (min-width: 1200px) {
  & { --side-w: 72px; }
  .side { align-items: center; padding: 18px 10px; }
  .side .brand { padding: 4px 0 6px; }
  .side .brand-text, .nav a span { display: none; }
  .nav a { justify-content: center; width: 48px; padding: 0; }
  .ai-meta { display: none; }
}

/* ---------- 17. Планшет: одна колонка, агенты в 2 колонки, нижнее меню ---------- */
@media (max-width: 1199px) {
  & { --fs-lead: 30px; --fs-kpi: 24px; --side-w: 0px; }

  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 72px; }
  .side { display: none; }
  .site-bar .brand { display: flex; margin-right: auto; }
  .page-title { display: none; }

  .site-bar-inner, .page, .demo-foot { width: min(780px, calc(100% - 40px)); }

  .board { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .board-main { gap: 16px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { box-shadow: none; }
  .kpi:nth-child(2) { box-shadow: inset 1px 0 0 var(--divider); }
  .kpi:nth-child(3) { box-shadow: inset 0 1px 0 var(--divider); }
  .kpi:nth-child(4) { box-shadow: inset 1px 0 0 var(--divider), inset 0 1px 0 var(--divider); }

  .risks-top {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 10px 16px;
    text-align: left;
    border-color: var(--risk-edge);
  }

  .risks-top.is-quiet { border-color: var(--surface-edge); }
  .risks-top .risk-text { flex: 1; min-width: 0; font-size: 13px; line-height: 19px; color: var(--text-2); }
  .risks-top .chev { color: var(--text-muted); }
  .report .risks { display: none; }

  .ai-meta { display: none; }

  .orbit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "center center" "head head" "left right";
    column-gap: 12px;
    row-gap: 12px;
  }

  .links { display: none; }
  .orbit::before { top: 0; height: 640px; transform: translate(-50%, -12%); }
  .agents-head { grid-area: head; display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
  .agents { grid-template-rows: none; gap: 10px; }
  .agent { min-height: 96px; }

  .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell:not(:nth-child(5n + 1)) { padding-left: 0; box-shadow: none; }
  .cell:nth-child(2n) { padding-left: 14px; box-shadow: inset 1px 0 0 var(--divider); }
  .cell:nth-last-child(-n + 5) { border-bottom: 1px solid var(--divider); }
  .cell:nth-last-child(-n + 2) { border-bottom: 0; }

  .report .rep-lists { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--bar-bg);
    border-top: 1px solid var(--divider);
  }

  .bottom-nav a,
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    font-size: 11px;
    line-height: 14px;
    color: var(--text-muted);
  }

  .bottom-nav [aria-current="page"] { color: var(--text); }
  .bottom-nav [aria-current="page"] .icon { color: var(--accent-ink); }

  .more-sheet {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 7;
    padding: 8px;
    border-radius: var(--radius-block);
    background: var(--raised);
    box-shadow: var(--shadow-float);
    opacity: 1;
    transform: none;
    transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
  }

  .more-sheet.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }

  @starting-style {
    .more-sheet.is-open { opacity: 0; transform: translateY(8px); }
  }

  .more-sheet a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-control); font-size: 14px; color: var(--text); }

  .stand { bottom: 84px; }
}

/* ---------- 18. Телефон 390 — главный вид ---------- */
@media (max-width: 560px) {
  & { --fs-lead: 28px; --fs-kpi: 21px; --fs-empty: 17px; }

  .site-bar { height: 58px; }
  .site-bar-inner, .page, .demo-foot { width: calc(100% - 32px); }
  .site-bar-inner { gap: 8px; }
  .site-bar .brand { font-size: 16px; }
  .site-bar .brand-text { display: none; }
  .picker { min-width: 0; width: 150px; height: 40px; }
  .picker--period { display: none; }
  .theme button span { display: none; }
  .theme button { width: 34px; padding: 0; justify-content: center; }

  .page { margin-top: 14px; }
  .slice { font-size: 12px; margin-bottom: 10px; }

  .kpi { padding: 14px 12px 12px; }
  .kpi-label { font-size: 12px; line-height: 17px; }
  .kpi-value { height: 32px; margin-top: 8px; }
  .kpi-sub {
    height: 28px;
    margin-top: 6px;
    font-size: 11px;
    line-height: 14px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .q { right: 12px; top: 18px; }
  .desk-only { display: none; }
  .phone-only { display: inline; }

  .board { margin-top: 14px; gap: 14px; }
  .board-main { gap: 14px; }

  .ai { padding: 14px; gap: 12px; align-items: flex-start; }
  .ai-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .ai-name { font-size: 17px; line-height: 24px; }
  .ai-line { font-size: 12px; line-height: 18px; }

  .center { padding: 16px 14px; }
  .fig-value { font-size: 21px; line-height: 28px; }
  .fig + .fig { padding-left: 14px; }
  .decision-text { font-size: 16px; line-height: 22px; }
  .center-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  .center-actions .btn { width: 100%; }
  .center-actions .text-link { justify-content: center; }

  .orbit {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "center" "head" "left" "right";
    row-gap: 0;
  }

  .agents-head { margin: 14px 0 8px; }
  .agents { gap: 0; }

  /* агенты — компактный список строк (принято владельцем для телефона) */
  .agent {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 60px;
    padding: 10px 12px;
    border-radius: 0;
    border-width: 0 0 1px;
    border-color: var(--divider);
  }

  .agents--left .agent:first-child { border-radius: 14px 14px 0 0; }
  .agents--right .agent:last-child { border-radius: 0 0 14px 14px; border-bottom: 0; }
  .agent[data-state="live"] { border-color: var(--divider); }
  .agent-icon { grid-row: 1 / span 2; align-self: center; width: 28px; height: 28px; }
  .agent-top { grid-column: 2; }
  .agent-desc { display: none; }
  .agent-num { grid-column: 2; margin-top: 0; font-size: 12px; line-height: 18px; }
  .agent-num b { font-size: 14px; }
  .agent .status { grid-column: 3; grid-row: 1 / span 2; margin: 0; }

  .feed { padding: 14px; }
  .feed-grid { grid-template-columns: minmax(0, 1fr); }
  .cell, .cell:nth-child(2n) { padding: 12px 0; box-shadow: none; border-bottom: 1px solid var(--divider); }
  .cell:nth-last-child(-n + 2) { border-bottom: 1px solid var(--divider); }
  .cell:last-child { border-bottom: 0; }
  .cell-what { min-height: 0; }
  .cell.is-quiet { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
  .cell.is-quiet .cell-head { font-weight: 500; }
  .cell.is-quiet .cell-what { margin: 0 0 0 auto; font-size: 12px; }

  .report { padding: 14px 14px 4px; }
  .report .rep-lists { display: block; }
  .rep-list li { grid-template-columns: 18px minmax(0, 1fr); }
  .rep-list .when, .rep-list .eff { grid-column: 2; }

  .stand { right: 6px; padding: 3px; gap: 0; }
  .stand a { padding: 4px 7px; }
}

/* ---------- 19. Меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  .links path.is-live { animation: none; stroke-dasharray: none; }
  .btn:active:not(:disabled), .theme button:active { transform: none; }
  .more-sheet { transition: opacity 150ms ease; }
}
}
/* ==== MOCK END ==== */

@keyframes flow { to { stroke-dashoffset: -28; } }

/* ---------- Адаптер сайта (T-3216) ----------
   Пока v3 на экране (html.hv3-on ставит/снимает home_v3.js) и открыт #/today: своя оболочка макета (.side,
   .site-bar, .bottom-nav) вместо оболочки сайта; отступы body и ширина .view сайта сняты. Другие разделы не меняются. */
html.hv3-on body:has(#v-today.view.active) { padding: 0 !important; margin: 0 !important; background: none !important; }
html.hv3-on body:has(#v-today.view.active) .shell-sidebar,
html.hv3-on body:has(#v-today.view.active) .shell-topbar,
html.hv3-on body:has(#v-today.view.active) .shell-mobnav { display: none !important; }
html.hv3-on body:has(#v-today.view.active) #v-today { max-width: none; margin: 0; padding: 0; }
html.hv3-on #v-today > :not(#home-v3) { display: none !important; }
/* T-3124: длинные строки сервера (живые данные, не демо) не распирают 390 — поверх макета, без правки его правил */
html.hv3-on #home-v3 { max-width: 100%; overflow-x: clip; }
html.hv3-on #home-v3 .page { overflow-wrap: anywhere; }
/* T-3331 (OWNER 22:55): статус агента — одна строка ≤ ~28 символов, не вылезает за карточку; полный текст — в title */
html.hv3-on #home-v3 .agent { min-width: 0; overflow: hidden; }
html.hv3-on #home-v3 .agent .status { display: block; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
html.hv3-on #home-v3 .agent .status::before { display: inline-block; margin-right: 6px; vertical-align: 1px; }
@media (max-width: 560px) { html.hv3-on #home-v3 .agent .status { max-width: 16ch; } }
/* T-3399: защита от переполнения на 820/390 — flex/grid-потомки с текстом сервера (живые длинные строки) */
html.hv3-on #home-v3 .kpi-value { min-width: 0; max-width: 100%; overflow: hidden; }
html.hv3-on #home-v3 .rep-list li > * { min-width: 0; }
html.hv3-on #home-v3 .rep-list .when,
html.hv3-on #home-v3 .rep-list .eff { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
html.hv3-on #home-v3 .profit-head > *,
html.hv3-on #home-v3 .cell-head > *,
html.hv3-on #home-v3 .ready > *,
html.hv3-on #home-v3 .agents-head > * { min-width: 0; }
html.hv3-on #home-v3 .cell-time { margin-left: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
html.hv3-on #home-v3 .agents-head { flex-wrap: wrap; }
html.hv3-on #home-v3 .page-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
html.hv3-on #home-v3 .chart-tip { max-width: min(260px, 80vw); overflow: hidden; text-overflow: ellipsis; }
