:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1b1f24;
  --muted: #6b7480;
  --accent: #2f6feb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --surface: #1c2027;
    --border: #2b313a;
    --text: #e6e9ee;
    --muted: #98a1ad;
    --accent: #6ea0ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; }

.nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.is-active { background: var(--accent); color: #fff; }

/* Вкладки площадок: Ozon — голубые, Wildberries — фиолетовые. Выбранная —
   залита цветом площадки, жирным и с тенью: её видно с первого взгляда. */
.nav-link.nav-ozon { color: #0b6fb8; background: #e8f4fd; }
.nav-link.nav-ozon:hover { background: #d3eafb; color: #075a96; }
.nav-link.nav-wb { color: #6b2fb3; background: #f3ecfb; }
.nav-link.nav-wb:hover { background: #e6d8f7; color: #561f97; }
.nav-link.nav-ozon.is-active,
.nav-link.nav-wb.is-active {
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.nav-link.nav-ozon.is-active { background: #1e8fe0; }
.nav-link.nav-wb.is-active { background: #7e3fc6; }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

h1 { margin: 0 0 20px; font-size: 22px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.card:hover { border-color: var(--accent); }
.card h2 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

.badge {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* Фильтры сайта: то же, что фильтры внутри дашборда, но их можно положить
   в ссылку — на этом держится провал до артикула. */
.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.filter { display: flex; flex-direction: column; gap: 4px; }
.filter span { color: var(--muted); font-size: 12px; }

.filters input,
.search input {
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
}

.filters button,
.search button {
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.reset { align-self: center; color: var(--muted); font-size: 14px; }

.search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.search input { min-width: 260px; flex: 1; max-width: 420px; }

/* Выгрузки таблиц. Внутри дашборда кнопка скачивания тоже есть, но она
   появляется только при наведении на карточку — здесь всё видно сразу. */
.exports {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
}

.exports-label { color: var(--muted); }

.book-hint {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.book-hint b { color: var(--text); font-weight: 600; }

.export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.export a {
  text-decoration: none;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.export a:hover { border-color: var(--accent); }

/* SDK Superset создаёт iframe внутри контейнера и не задаёт ему размеров.
   Высоту от flex-родителя он не наследует — она схлопывается в полоску,
   поэтому задаём явно от высоты окна. */
#superset-mount {
  height: calc(100vh - 92px);
  min-height: 680px;
  width: 100%;
}

/* Высоту кадра ставит скрипт в пикселях: процент здесь не работает, см.
   комментарий в dashboard.html. */
#superset-mount iframe {
  width: 100%;
  border: 0;
}

/* Дашборд занимает всю оставшуюся высоту — BI скроллит внутри себя. */
/* Разделы на одной странице: активный занимает всю высоту, прочие спрятаны,
   но их кадры живут — при возврате дашборд не грузится заново. */
.panes, .pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.is-hidden { display: none !important; }

.dashboard-frame {
  flex: 1;
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.empty {
  max-width: 620px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.empty p { color: var(--muted); }
.hint { font-size: 14px; }
.hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}

a { color: var(--accent); }

/* Полоса над демо-разделом: гость должен сразу понимать, что цифры выдуманы. */
.demo-note {
  margin: 0;
  padding: 8px 20px;
  background: #fff4d6;
  border-bottom: 1px solid #f0dca6;
  color: #6b5518;
  font-size: 13px;
}
.demo-note a { color: #6b5518; }

/* Карточка режима справа в шапке: «Демо» или имя продавца. */
.account {
  /* margin-left: auto прижимает карточку к правому краю шапки-флексбокса. */
  margin-left: auto;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 2px; padding: 4px 10px; border: 1px solid #e3e6ea; border-radius: 8px;
  background: #fff; line-height: 1.25;
}
.account.is-demo { background: #fff4d6; border-color: #f0dca6; }
.account-name { font-size: 13px; font-weight: 600; color: #1f2933; }
.account-action { font-size: 12px; color: #2563eb; text-decoration: none; }
.account-links { display: flex; gap: 10px; }
.account-action:hover { text-decoration: underline; }

/* Полоса сброса выделения: появляется, только когда кросс-фильтр стоит. */
.crossfilter-bar {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 10px; padding: 7px 12px;
  background: #eef4ff; border: 1px solid #cddffb; border-radius: 8px;
  font-size: 13px; color: #24406b;
}
.crossfilter-bar button {
  padding: 4px 12px; font-size: 13px; cursor: pointer;
  background: #2563eb; color: #fff; border: 0; border-radius: 6px;
}
.crossfilter-bar button:hover { background: #1d4ed8; }

/* Описание отчётности: текстовая страница, читается как инструкция. */
.guide { max-width: 1000px; }
.guide h1 { margin: 0 0 14px; }
.guide h2 {
  margin: 26px 0 10px;
  font-size: 17px;
}
.guide p, .guide li, .guide dd { line-height: 1.55; }
.guide-lead {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.guide-list { margin: 0; }
.guide-list dt { margin-top: 12px; font-weight: 600; }
.guide-list dd { margin: 4px 0 0; }
.guide-steps, .guide-notes { padding-left: 22px; }
.guide-steps li, .guide-notes li { margin-bottom: 10px; }
.guide-foot { color: var(--muted); }

/* Подвал: описание и адрес для связи на каждой странице. */
.sitefoot {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 24px 14px;
  color: var(--muted);
  font-size: 13px;
}
.sitefoot a { color: inherit; }
.sitefoot-link { text-decoration: underline; }

/* Форма обратной связи. */
.feedback { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.feedback label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.feedback select, .feedback textarea, .feedback input {
  font: inherit; font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.feedback textarea { resize: vertical; }
.feedback button {
  align-self: flex-start;
  padding: 8px 18px;
  border: 0; border-radius: 8px;
  background: #2563eb; color: #fff; cursor: pointer;
}
.feedback button:hover { background: #1d4ed8; }
.feedback-ok { border-color: #b7eb8f; background: #f6ffed; }
.feedback-error { border-color: #ffa39e; background: #fff1f0; }

/* Факторный анализ в описании: подзаголовки и таблица примера. */
.guide h3 { margin: 18px 0 8px; font-size: 15px; }
.guide-table {
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 14px;
}
.guide-table th, .guide-table td {
  padding: 6px 12px;
  border: 1px solid var(--border);
  text-align: right;
}
.guide-table th:first-child, .guide-table td:first-child { text-align: left; }
.guide-table thead th { background: var(--surface); font-weight: 600; }
.guide-table-total td { font-weight: 700; }

/* Вводный текст описания — должен бросаться в глаза: цветная плашка с
   полосой слева, текст крупнее остальной страницы, абзацы с красной строкой. */
.guide-lead.guide-intro {
  padding: 20px 24px;
  font-size: 17px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-left: 6px solid var(--accent);
  border-radius: 12px;
}
.guide-intro p { margin: 0 0 10px; text-indent: 1.5em; }
.guide-intro p:last-child { margin-bottom: 0; }
/* Строки с галочками в первом экране описания. */
.guide-gains { list-style: none; margin: 0 0 18px; padding: 0; }
.guide-gains li {
  position: relative;
  margin: 0 0 6px;
  padding-left: 30px;
  font-size: 18px;
  font-weight: 700;
}
.guide-gains li::before {
  content: "✓";
  position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #16a34a; color: #fff;
  font: 700 14px/22px -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center;
}

/* ПЕРВЫЙ ЭКРАН описания (04.10.2026): заголовок, кнопки, ряды «вопрос →
   решение → картинка графика». Ряды чередуют сторону картинки. */
.hero {
  margin: 0 0 28px;
  padding: 26px 28px 18px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 14px;
}
.hero-title {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.2;
}
.hero-accent { color: var(--accent); white-space: nowrap; }
.hero-sub { margin: 0 0 14px; font-size: 18px; color: var(--text); }
.hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 0 0 26px;
}
.hero-btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 16px; font-weight: 700;
  text-decoration: none;
}
.hero-btn-main { background: var(--accent); color: #fff; border: 2px solid var(--accent); }
.hero-btn-main:hover { filter: brightness(1.08); }
.hero-btn-second { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); }
.hero-btn-second:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.hero-badge {
  padding: 6px 12px;
  border-radius: 8px;
  background: #f59e0b; color: #fff;
  font-size: 14px; font-weight: 700;
}
.benefit {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 22px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
}
.benefit-flip { grid-template-columns: 7fr 5fr; }
.benefit-flip .benefit-text { order: 2; }
.benefit-q {
  margin: 0 0 8px;
  font-size: 19px; font-weight: 700; line-height: 1.3;
  color: #c2323a;
}
.benefit-text p { margin: 0 0 8px; }
/* Ответ сайта — с зелёной галочкой, как строки под заголовком. */
.benefit-a { position: relative; padding-left: 28px; }
.benefit-a::before {
  content: "✓";
  position: absolute; left: 0; top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #16a34a; color: #fff;
  font: 700 13px/20px -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center;
}
/* Широкий ряд: картинка-таблица во всю ширину под текстом. */
.benefit-wide { grid-template-columns: 1fr; }
.benefit-link { font-weight: 600; text-decoration: none; }
.benefit-link:hover { text-decoration: underline; }
.benefit-pic { margin: 0; }
.benefit-pic img {
  display: block; width: 100%; height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.benefit-pic figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }
.hero-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
/* Призыв в конце первого экрана: повтор кнопки подключения. */
.hero-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin: 8px 0 4px; padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 12px;
}
.hero-cta-text { flex: 1 1 320px; margin: 0; font-size: 18px; font-weight: 700; }
.guide-title { margin-top: 0; }
@media (max-width: 760px) {
  .hero { padding: 18px 16px 12px; }
  .hero-title { font-size: 24px; }
  .hero-accent { white-space: normal; }
  .hero-sub { font-size: 16px; }
  .guide-gains li { font-size: 16px; }
  .benefit { grid-template-columns: 1fr; gap: 10px; }
  .benefit-flip { grid-template-columns: 1fr; }
  .benefit-flip .benefit-text { order: 0; }
}
@media (max-width: 600px) {
  .guide-lead.guide-intro { padding: 16px; font-size: 16px; }
}
}

/* Плашка демо-режима для гостя в описании — цветом полосы демо-разделов. */
.guide-demo {
  margin: 14px 0 0;
  padding: 10px 14px;
  background: #fff4d6;
  border: 1px solid #f0dca6;
  border-radius: 10px;
  color: #6b5518;
}

/* Статьи: список и текст статьи. */
.articles-list { list-style: none; padding: 0; margin: 16px 0; }
.articles-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.articles-list p { margin: 6px 0 0; line-height: 1.5; }
.articles-title { font-size: 17px; font-weight: 600; }
.articles-date { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.article-back { margin: 0 0 10px; font-size: 14px; }
.article-body { font-size: 16px; line-height: 1.6; }
.article-body h2 { font-size: 19px; margin: 26px 0 10px; }
.article-body h3 { font-size: 16px; margin: 20px 0 8px; }
.article-body p { margin: 0 0 12px; }
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 12px; }
.article-body li { margin-bottom: 6px; }
.article-body table { border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 6px 10px; }
.article-body blockquote {
  margin: 12px 0; padding: 10px 14px;
  background: var(--surface); border-left: 3px solid #2563eb;
}

/* Кнопка скачивания описания для ИИ. */
.guide-download {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
}
.guide-download:hover { background: #1d4ed8; }

/* Быстрый путь в начале описания: скачать файл и спросить ИИ. */
.guide-ai {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid #cddffb;
  border-radius: 12px;
  background: #eef4ff;
}
.guide-ai h2 { margin: 0 0 8px; font-size: 20px; }
.guide-ai p { margin: 0 0 12px; line-height: 1.55; }
.guide-ai-button {
  display: inline-block;
  margin: 2px 0 12px;
  padding: 10px 20px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.guide-ai-button:hover { background: #1d4ed8; }
.guide-ai-steps { margin: 0 0 10px; padding-left: 22px; }
.guide-ai-steps li { line-height: 1.5; margin-bottom: 2px; }
.guide-ai-note { color: var(--muted); font-size: 13px; margin: 0 !important; }

/* Пример использования ИИ в блоке быстрого пути — раскрывается по щелчку. */
.guide-ai-example { margin: 0 0 10px; }
.guide-ai-example summary {
  cursor: pointer;
  font-weight: 600;
  color: #1d4ed8;
}
.guide-ai-example ol { margin: 8px 0 0; padding-left: 22px; }
.guide-ai-example li { line-height: 1.5; margin-bottom: 4px; }

/* Страница «Подключить магазин». */
.connect-lead { font-size: 18px; margin: 0 0 18px; }
.connect-mail {
  padding: 18px 20px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 12px;
}
.connect-mail h2 { margin-top: 0; }
.connect-address { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 6px 0 10px; }
.connect-email { font-size: 24px; font-weight: 700; user-select: all; }
.connect-address .hero-btn { border: 2px solid var(--accent); cursor: pointer; font-family: inherit; }
.connect-hint { margin: 0; color: var(--muted); }
.connect-soon {
  margin-top: 22px; padding: 10px 14px;
  border: 1px dashed var(--border); border-radius: 10px; color: var(--muted);
}

/* Калькулятор юнит-экономики (/kalkulyator). Поля слева, расчёт справа;
   на узком экране — в одну колонку. */
.calc {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
  margin: 18px 0 10px;
}
.calc-inputs { display: flex; flex-direction: column; gap: 14px; }
.calc fieldset {
  margin: 0;
  padding: 10px 14px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.calc legend { padding: 0 6px; font-weight: 600; }
.calc label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.calc label[hidden] { display: none; }
.calc-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.calc input, .calc select {
  font: inherit;
  font-weight: 400;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.calc-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.calc-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.calc-card span { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.calc-card b { font-size: 18px; }
.calc-card .is-loss { color: #d4380d; }
.calc-card .is-gain { color: #2e9e5b; }
.calc-flow { width: 100%; margin-top: 0; }
.calc-step td { font-weight: 600; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.calc-breakeven { font-size: 14px; color: var(--muted); }
.calc-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
  .calc-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Ссылка на калькуляторы под кнопками первого экрана описания. */
.hero-calc { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.hero-calc a { font-weight: 600; }
