/* KPAutoMARK — оформление интерфейса.
 *
 * Палитра взята из самого отчёта: тёмно-синий заголовков (1C4587) и зелёный
 * колонки бренда. Светлая бумага, чёрная типографика, ни одного градиента
 * «в фиолетовый». Заголовки — Georgia: аналитический разворот, а не дашборд.
 * Тёмная тема остаётся по переключателю (класс .dark на html).
 * Никаких внешних шрифтов и CDN: работает на статике и офлайн.
 */

:root {
  --paper: #f7f5f0;
  --paper-2: #efece4;
  --panel: #ffffff;
  --panel-2: #faf8f4;
  --line: #e0dcd2;
  --line-soft: #ece9e1;
  --ink: #16181d;
  --ink-2: #555c68;
  --ink-3: #8b93a0;
  --primary: #1c4587;
  --primary-2: #163a75;
  --primary-soft: #e7edf8;
  --brand: #2f7d4f;
  --brand-soft: #e4f0e6;
  --alert: #b3261e;
  --alert-soft: #fbeae8;
  --gold: #a8761f;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 29, .06);
  --shadow: 0 10px 34px rgba(20, 24, 29, .09);
  --shadow-lg: 0 22px 60px rgba(20, 24, 29, .14);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

html.dark {
  --paper: #14161a;
  --paper-2: #1a1d23;
  --panel: #1b1e24;
  --panel-2: #22262e;
  --line: #333943;
  --line-soft: #2a2f38;
  --ink: #f0eee9;
  --ink-2: #b3b9c4;
  --ink-3: #7c8492;
  --primary: #7ba7e8;
  --primary-2: #a3c2f0;
  --primary-soft: #1f2b42;
  --brand: #6dc48c;
  --brand-soft: #1c2f24;
  --alert: #e8756c;
  --alert-soft: #33211f;
  --gold: #d9ad5c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Бумажная фактура: тонкая сетка вместо неонового свечения. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(28, 69, 135, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 69, 135, .045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
}
html.dark body::before { background-image:
  linear-gradient(to right, rgba(255, 255, 255, .04) 1px, transparent 1px),
  linear-gradient(to bottom, rgba(255, 255, 255, .04) 1px, transparent 1px); }

a { color: var(--primary); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ============ Шапка ============ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 26px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: padding .3s var(--ease), border-color .3s var(--ease), background .3s;
}
.topbar.pinned { padding: 9px 26px; border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.logo { display: flex; align-items: center; gap: 12px; }
.logo .mark {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  transition: transform .35s var(--ease);
}
.topbar.pinned .logo .mark { width: 30px; height: 30px; font-size: 16px; }
.logo:hover .mark { transform: rotate(-6deg) scale(1.06); }
.logo b { display: block; font-family: var(--serif); font-size: 19px; letter-spacing: -.2px; line-height: 1.1; }
.logo span { font-size: 11.5px; color: var(--ink-3); letter-spacing: .2px; }
.topbar.pinned .logo span { display: none; }
.topbar .spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.chip.live .dot { background: var(--brand); animation: pulse 2.2s infinite; }
.chip.demo .dot { background: var(--gold); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
  60% { box-shadow: 0 0 0 6px transparent; }
}
.chip button { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font-size: 12.5px; text-decoration: underline; }

.iconbtn {
  width: 36px; height: 36px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  display: grid; place-items: center; font-size: 15px;
  transition: .2s var(--ease);
}
.iconbtn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.iconbtn:active { transform: translateY(0) scale(.94); }

/* На узких экранах шапка ужимается: подпись логотипа и текст статуса лишние. */
@media (max-width: 700px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .logo span { display: none; }
  #modeText { display: none; }
  .shell { padding: 20px 16px 70px; }
}

/* ============ Каркас ============ */
.shell { position: relative; z-index: 1; max-width: 1480px; margin: 0 auto; padding: 26px 26px 90px; }

.hero { margin: 26px 0 34px; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px;
  font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700;
  color: var(--primary);
}
.hero .kicker::before { content: ""; width: 34px; height: 2px; background: var(--primary); }
.hero h1 {
  margin: 0 0 14px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 5.2vw, 58px); line-height: 1.04; letter-spacing: -1.2px;
  max-width: 20ch;
}
.hero h1 em { font-style: italic; color: var(--primary); }
.hero p { margin: 0; color: var(--ink-2); max-width: 68ch; font-size: 16px; }

/* появление заголовка по словам */
.hero h1 .w { display: inline-block; opacity: 0; transform: translateY(.5em); }
.hero h1.go .w { animation: wordUp .68s var(--ease) forwards; }
@keyframes wordUp { to { opacity: 1; transform: none; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.card:hover { box-shadow: var(--shadow); }
.card h2 {
  margin: 0 0 4px; font-family: var(--serif); font-weight: 400;
  font-size: 21px; letter-spacing: -.3px;
}
.sub { color: var(--ink-3); font-size: 13px; margin: 0; }

.grid-setup { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-setup { grid-template-columns: 1fr; } }

/* ============ Поля ============ */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label.lbl {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--ink-3); margin-bottom: 7px; text-transform: uppercase;
}

input[type=text], input[type=number], select {
  width: 100%; padding: 11px 13px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); outline: none;
  transition: .2s var(--ease);
}
input::placeholder { color: var(--ink-3); }
input:focus, select:focus {
  border-color: var(--primary); background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
input.bad { border-color: var(--alert); background: var(--alert-soft); }

.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.comp-row {
  display: grid; grid-template-columns: 28px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 36px;
  gap: 9px; align-items: center; margin-bottom: 9px;
  animation: rowIn .34s var(--ease);
}
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } }
.comp-row .idx {
  display: grid; place-items: center; height: 30px; border-radius: var(--radius);
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700;
}
@media (max-width: 720px) {
  .comp-row { grid-template-columns: 28px minmax(0, 1fr) 36px; }
  .comp-row .opt { display: none; }
}

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--primary); font-weight: 600; font-size: 14.5px;
  background: var(--primary); color: #fff;
  transition: .22s var(--ease);
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .35), transparent 55%);
  opacity: 0; transition: opacity .3s;
}
.btn:hover { background: var(--primary-2); transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 28%, transparent); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel); border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }
.btn.dashed {
  background: none; border: 1px dashed var(--line); color: var(--ink-2);
  width: 100%; font-weight: 500;
}
.btn.dashed:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.btn.sm { padding: 8px 14px; font-size: 13px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }

details.more { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
details.more summary { cursor: pointer; font-size: 13px; color: var(--primary); font-weight: 600; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; font-weight: 700; }
details.more[open] summary::before { content: "− "; }
details.more > div { margin-top: 14px; }

/* ============ Прогресс ============ */
.progress { margin-top: 18px; display: none; }
.progress.on { display: block; animation: fade .3s var(--ease); }
.track { height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.track > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .5s var(--ease); }
.track.indet > i { width: 30%; animation: slide 1.25s infinite var(--ease); }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.progress .line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }

/* ============ Вкладки ============ */
.tabs {
  position: relative; display: flex; gap: 2px;
  border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto;
}
.tabs button {
  min-width: max-content; padding: 13px 20px; border: 0; cursor: pointer;
  background: none; color: var(--ink-3); font-size: 14px; font-weight: 600;
  white-space: nowrap; transition: color .22s var(--ease);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--primary); }
.tabs .ink {
  position: absolute; bottom: -1px; height: 2px; background: var(--primary);
  transition: left .34s var(--ease), width .34s var(--ease);
}

.pane { display: none; }
.pane.on { display: block; animation: fade .34s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* появление по скроллу */
.rv { opacity: 0; transform: translateY(16px); }
.rv.in { animation: rvIn .6s var(--ease) forwards; }
@keyframes rvIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rv, .hero h1 .w { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ============ Сводка ============ */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 20px; align-items: start; }
@media (max-width: 1040px) { .dash-top { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary); transform: scaleY(0); transform-origin: top;
  transition: transform .5s var(--ease);
}
.kpi.in::before { transform: scaleY(1); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi .t { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-3); font-weight: 700; }
.kpi .v { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin: 10px 0 4px; letter-spacing: -1px; }
.kpi .d { font-size: 13px; color: var(--ink-2); }
.kpi .d b { color: var(--ink); }
.kpi.good::before { background: var(--brand); }
.kpi.good .v { color: var(--brand); }
.kpi.bad::before { background: var(--alert); }
.kpi.bad .v { color: var(--alert); }

/* радар */
.radar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.radar h4 { margin: 0 0 2px; font-family: var(--serif); font-weight: 400; font-size: 18px; }
.radar svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.radar .grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar .axis { stroke: var(--line); stroke-width: 1; }
.radar .lbl { font-size: 9.5px; fill: var(--ink-3); }
.radar .poly { stroke-width: 2; stroke-linejoin: round; transition: opacity .3s; }
.radar .poly.me { fill: color-mix(in srgb, var(--brand) 20%, transparent); stroke: var(--brand); }
.radar .poly.lead { fill: color-mix(in srgb, var(--primary) 12%, transparent); stroke: var(--primary); stroke-dasharray: 4 3; }
.radar .legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-top: 12px; flex-wrap: wrap; }
.radar .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.section-title {
  margin: 34px 0 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--ink-3); font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.gaps { display: grid; gap: 10px; }
.gap {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--alert);
  border-radius: var(--radius); padding: 14px 18px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.gap:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); }
.gap .nm { font-size: 14.5px; font-weight: 600; }
.gap .why { font-size: 12.5px; color: var(--ink-3); }
.gap .v { text-align: right; font-family: var(--serif); font-size: 22px; color: var(--alert); }
.gap.lead { border-left-color: var(--brand); }
.gap.lead .v { color: var(--brand); }

.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.barblock { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.barblock h4 { margin: 0 0 14px; font-size: 13.5px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.barblock h4 em { font-style: normal; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.barline { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 76px; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.barline:last-child { margin-bottom: 0; }
.barline .nm { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barline.me .nm { color: var(--brand); font-weight: 700; }
.barline .bar { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.barline .bar > i {
  display: block; height: 100%; border-radius: 4px; background: var(--primary); width: 0;
  transition: width .9s var(--ease);
}
.barline.me .bar > i { background: var(--brand); }
.barline .val { text-align: right; color: var(--ink); font-weight: 700; }

/* ============ Таблица ============ */
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; max-height: 76vh; background: var(--panel); }
table.report { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.report th, table.report td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 9px 14px; text-align: center; white-space: nowrap; }
table.report thead th {
  /* Шапка на почти белом фоне терялась — даём ей плотность бумаги и
     заметную нижнюю границу, чтобы столбцы читались как столбцы. */
  position: sticky; top: 0; z-index: 3; background: var(--paper-2);
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink);
  font-weight: 700; border-bottom: 2px solid var(--primary); padding: 12px 14px;
}
table.report thead th.brandcol { color: var(--brand); }
table.report thead th small { display: block; font-size: 9.5px; letter-spacing: .6px; color: var(--ink-3); font-weight: 400; }
table.report td.lbl, table.report th.lbl {
  position: sticky; left: 0; z-index: 2; text-align: left; background: var(--panel);
  font-weight: 600; color: var(--ink-2); min-width: 244px; border-right: 1px solid var(--line);
}
table.report thead th.lbl { z-index: 4; background: var(--paper-2); }
/* Строки-заголовки блоков (и строки соцсетей) — сплошная синяя полоса.
   Липким делаем только первую ячейку: если приклеить к left:0 все, они
   наезжают друг на друга. Класс .lbl тут перебиваем явно — иначе его
   собственный фон разрывает полосу белым куском. */
table.report tr.sec td,
table.report tr.sec td.lbl {
  background: var(--primary); color: #fff; font-weight: 700;
  font-size: 10.5px; letter-spacing: 1.2px; text-align: left;
}
table.report tr.sec td:first-child { position: sticky; left: 0; z-index: 2; }
table.report tr.sec td a { color: #fff; border-bottom-color: rgba(255, 255, 255, .45); }
table.report td.brandcell { background: var(--brand-soft); font-weight: 700; }
table.report td.leader { color: var(--brand); font-weight: 700; }
table.report td.nodata { color: var(--ink-3); }
/* Подсветку строки под курсором не пускаем на заголовки блоков: светло-синяя
   заливка поверх синей полосы делала белый текст нечитаемым. */
table.report tbody tr:not(.sec):hover td:not(.lbl):not(.brandcell) { background: var(--primary-soft); }
table.report td[contenteditable="true"] { cursor: text; }
table.report td[contenteditable="true"]:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--panel-2); }
.tablebar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.tablebar .sub { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 21px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: .2s var(--ease); margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .2s var(--ease); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(17px); }

/* ============ Юнит-экономика ============ */
.econ-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .econ-grid { grid-template-columns: 1fr; } }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.plan {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary); }
.plan.best { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan .badge {
  position: absolute; top: -10px; right: 16px; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 4px 10px;
  border-radius: 999px; background: var(--brand); color: #fff;
}
.plan h4 { margin: 0 0 2px; font-family: var(--serif); font-weight: 400; font-size: 20px; }
.plan .price { font-family: var(--serif); font-size: 27px; letter-spacing: -.8px; margin: 12px 0 2px; }
.plan .price small { font-family: var(--sans); font-size: 12px; color: var(--ink-3); letter-spacing: 0; }
.plan ul { list-style: none; margin: 14px 0 0; padding: 0; font-size: 12.5px; color: var(--ink-2); }
.plan li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.plan li b { color: var(--ink); font-weight: 700; }

.calcrow { display: grid; grid-template-columns: 1fr 106px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--ink-2); }
.calcrow input { text-align: right; padding: 8px 11px; }

table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.mini th, table.mini td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; }
table.mini th:first-child, table.mini td:first-child { text-align: left; color: var(--ink-2); }
table.mini thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-3); }
table.mini tr.total td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); }
table.mini tbody tr:hover td { background: var(--panel-2); }

/* ============ Отчёт о сборе ============ */
.srcgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.srccard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; transition: box-shadow .25s var(--ease); }
.srccard:hover { box-shadow: var(--shadow-sm); }
.srccard .dom { font-weight: 700; font-size: 14px; margin-bottom: 11px; display: flex; align-items: center; gap: 8px; }
.srccard .dom .me { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; letter-spacing: .5px; }
.srccard .s { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 0; color: var(--ink-2); }
.tag { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.t-ok { background: var(--brand-soft); color: var(--brand); }
.t-warn { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.t-err { background: var(--alert-soft); color: var(--alert); }

.notice { border-radius: var(--radius); padding: 13px 16px; font-size: 13.5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); border-left: 3px solid var(--ink-3); }
.notice.warn { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold) 7%, var(--panel)); }
.notice.err { border-left-color: var(--alert); background: var(--alert-soft); color: var(--ink); }

/* ============ Модалка ============ */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 20px; background: rgba(20, 24, 29, .5); backdrop-filter: blur(3px); }
.modal.on { display: grid; animation: fade .24s var(--ease); }
.modal .box { width: min(540px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-lg); animation: popIn .32s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 99;
  transform: translate(-50%, 26px); opacity: 0; pointer-events: none;
  transition: .28s var(--ease);
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 11px 20px; font-size: 13.5px; box-shadow: var(--shadow-lg);
  max-width: min(440px, calc(100vw - 32px)); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

footer.foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px 22px; }

@media print {
  body::before, .topbar, .tabs, .actions, .tablebar, footer.foot { display: none !important; }
  .pane { display: block !important; }
  .rv { opacity: 1 !important; transform: none !important; }
  .card, .kpi, .tablewrap { box-shadow: none; break-inside: avoid; }
  .tablewrap { max-height: none; overflow: visible; }
}

/* Пояснения источника в отчёте о сборе: какие каналы найдены и что отброшено. */
.srccard .notes { display: grid; gap: 2px; margin: 2px 0 8px; padding-left: 10px;
  border-left: 2px solid var(--line); }
.srccard .notes span { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

/* ============ История проектов ============ */
#projectsBtn { gap: 7px; }
#projectsBtn .cnt {
  min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center;
}

.projbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.projname {
  flex: 1; max-width: 520px; padding: 8px 12px;
  font-family: var(--serif); font-size: 20px; letter-spacing: -.3px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
}
.projname:hover { border-color: var(--line); }
.projname:focus { background: var(--panel); border-color: var(--primary); }
.saved {
  font-size: 12px; color: var(--ink-3); opacity: 0;
  transition: opacity .3s var(--ease);
}
.saved.on { opacity: 1; }
.saved.warn { color: var(--alert); opacity: 1; }

.modal .box.wide { width: min(720px, 100%); }
.projlist { display: grid; gap: 8px; margin: 18px 0 4px; max-height: 52vh; overflow: auto; }
.projrow {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); transition: .2s var(--ease);
}
.projrow:hover { border-color: var(--primary); background: var(--panel); }
.projrow.cur { border-left: 3px solid var(--brand); }
.projrow .nm { font-weight: 650; font-size: 14px; }
.projrow .ops { display: flex; gap: 6px; align-items: center; }
.projrow .iconbtn { width: 30px; height: 30px; font-size: 13px; }
.projrow .iconbtn.danger:hover { color: var(--alert); border-color: var(--alert); }
@media (max-width: 640px) {
  .projrow { grid-template-columns: 1fr; }
  .projrow .ops { justify-content: flex-start; }
}
