/* Luminion Lead Hunter — тёмная панель управления.
   Montserrat хранится локально: ничего не загружается из интернета. */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #17232d;
  --topbar: #212f3c;
  --panel: #243240;
  --panel-muted: #1f2c38;
  --field: #1b2833;
  --border: #36495c;
  --border-soft: #2d3e4f;

  --text: #f1f5f9;
  --text-muted: #9aabbc;

  --accent: #7672fa;
  --accent-solid: #645bdd;
  --accent-hover: #5b52d2;
  --accent-text: #aeabff;
  --accent-soft: rgba(118, 114, 250, 0.16);
  --success: #4fd18b;
  --warning: #f0b95a;
  --danger: #ff7a80;
  --info: #6cb6ff;
  --dot-muted: #5a6e82;

  --radius: 16px;
  --radius-control: 10px;
  --control-h: 42px;
  --sidebar-w: 244px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 72px;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-wrap: break-word;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 16px; font-weight: 650; }
h3 { font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.icon { flex: none; display: block; }

/* ─── Шапка ─── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 28px;
  background: var(--topbar);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-start { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 16px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px; height: 34px;
  border-radius: var(--radius-control);
  background: var(--accent-solid);
  font-weight: 700;
  color: #fff;
}
.brand-text { white-space: nowrap; }
.brand-text strong { font-weight: 650; }
/* Подпись копии (APP_LABEL, например Demo): оранжевый значок и метка. */
.is-labeled .brand-mark { background: #f08a24; }
.brand-tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(240, 138, 36, 0.16);
  color: #ffb26b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
  flex: none;
}
.local-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-h);
  min-width: var(--control-h);
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav-toggle[hidden] { display: none; }
.nav-toggle-icon { display: inline-flex; }
.nav-toggle-icon-narrow { display: none; }
.nav-toggle-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Оболочка и боковая панель ─── */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
  transition: grid-template-columns 0.18s ease;
}
.content { min-width: 0; }

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  background: var(--bg);
  border-right: 1px solid var(--border-soft);
}

.project-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.project-mark {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.project-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.project-label { font-size: 12px; color: var(--text-muted); }
.project-name { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }

.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--panel);
  border: 1px solid transparent;
}
.side-link:hover { color: var(--text); border-color: var(--border); text-decoration: none; }
.side-link.is-active {
  background: #5249c9;
  border-color: #5249c9;
  color: #fff;
}
.side-link-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-foot {
  margin: auto 0 0;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.scrim { display: none; }

/* Свёрнутая панель — только на широком экране. */
@media (min-width: 901px) {
  .nav-collapsed .shell { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .nav-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
  .nav-collapsed .project-card { justify-content: center; padding: 8px; }
  .nav-collapsed .project-text,
  .nav-collapsed .side-foot,
  .nav-collapsed .side-more-toggle { display: none; }
  .nav-collapsed .side-link { justify-content: center; padding: 0; }
  .nav-collapsed .side-link-text {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ─── Раскладка страницы ─── */

.layout { max-width: 1320px; margin: 0 auto; padding: 30px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-bottom: 24px;
}
.page-head-main { flex: 1 1 360px; min-width: 0; }
.page-head p { margin: 0; max-width: 76ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 10px; font-size: 14px; color: var(--text-muted);
}
.back-link:hover { color: var(--text); }

.columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.columns > * { min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.panel-muted { background: var(--panel-muted); }
.panel-centered { text-align: center; padding: 40px 24px; }

.muted { color: var(--text-muted); }
.empty { color: var(--text-muted); padding: 8px 0; margin: 0; }
.spacer { flex: 1; }
.error-code { font-size: 56px; line-height: 1.1; font-weight: 700; margin: 0 0 8px; color: var(--accent-text); }
.actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ─── Формы ─── */

.form { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.field-row { display: flex; gap: 16px; width: 100%; flex-wrap: wrap; }
.field-row .field { flex: 1 1 180px; }
label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

input[type="text"], input[type="search"], input:not([type]), textarea, select {
  width: 100%;
  min-width: 0;
  height: var(--control-h);
  padding: 0 12px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
/* Consistent inset for dropdown chevrons; keep native select behavior. */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23c3cfda' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
}
select.lead-select { padding-right: 40px; }
select[multiple], select[size]:not([size="1"]) { background-image: none; padding-right: 12px; }
@media (forced-colors: active) {
  select { appearance: auto; background-image: none; }
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #70849a; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.input-narrow { max-width: 140px; }
.field-hint { margin: 0; font-size: 13px; color: var(--text-muted); }
.field-error { margin: 0; font-size: 13px; color: var(--danger); }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 16px;
  align-items: end;
}
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-field-wide { grid-column: span 2; }
.filter-actions { display: flex; gap: 10px; flex-wrap: wrap; grid-column: 1 / -1; }

.checkbox { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 14px; min-height: var(--control-h); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }

/* ─── Кнопки ─── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel-muted);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.button:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.button-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; font-weight: 600; }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-ghost { background: transparent; }
.button-warning { background: transparent; border-color: var(--warning); color: var(--warning); }
.button-warning:hover { background: rgba(240, 185, 90, 0.12); border-color: var(--warning); }
.button-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.button-danger:hover { background: rgba(255, 122, 128, 0.12); border-color: var(--danger); }
.button[disabled], .button:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.button-small { height: 36px; padding: 0 12px; font-size: 13px; }

.button-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.danger-zone {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}

/* ─── Значки и сообщения ─── */

.badge {
  display: inline-block;
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-neutral { background: rgba(154, 171, 188, 0.14); color: #c3cfda; border-color: var(--border); }
.badge-muted { background: transparent; color: var(--text-muted); border-color: var(--border); }
.badge-info { background: rgba(108, 182, 255, 0.15); color: var(--info); }
.badge-success { background: rgba(79, 209, 139, 0.15); color: var(--success); }
.badge-warning { background: rgba(240, 185, 90, 0.15); color: var(--warning); }
.badge-danger { background: rgba(255, 122, 128, 0.15); color: var(--danger); }

.banner {
  padding: 12px 16px;
  border-radius: var(--radius-control);
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid transparent;
}
.banner-success { background: rgba(79, 209, 139, 0.12); border-color: rgba(79, 209, 139, 0.35); color: #8be8b6; }
.banner-danger { background: rgba(255, 122, 128, 0.12); border-color: rgba(255, 122, 128, 0.38); color: #ffb3b6; }
.banner-muted { background: var(--panel-muted); border-color: var(--border); color: var(--text-muted); }

/* ─── Состояние задания ─── */

.status-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.status-step { color: var(--text-muted); font-size: 14px; }
.status-head form { margin-left: auto; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 18px; }
.metric {
  background: var(--field);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.metric dt { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
.metric dd { margin: 0; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }

.facts { margin: 0 0 18px; display: grid; gap: 0; }
.facts > div {
  display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 12px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.facts > div:last-child { border-bottom: none; }
.facts dt { color: var(--text-muted); font-size: 14px; }
.facts dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }

.job-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
/* min-width: 0 обязателен: элементы grid и flex по умолчанию не сжимаются
   ниже ширины содержимого, и длинное название распирало бы панель. */
.job-list li {
  display: flex; flex-direction: column; gap: 4px; align-items: stretch;
  font-size: 14px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.job-list li:last-child { border-bottom: none; }
.job-list a { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.job-list li > .muted { white-space: nowrap; font-size: 12.5px; }
.job-list-title { min-width: 0; overflow-wrap: anywhere; }

/* ─── Таблица ─── */

.table-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wide { min-width: 780px; }
.table-companies { min-width: 1180px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table thead th {
  background: var(--panel-muted);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom-color: var(--border);
}
.table thead th a { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.table thead th a:hover { color: var(--text); text-decoration: none; }
.table tbody tr:hover { background: rgba(118, 114, 250, 0.07); }
.table tbody tr:last-child td { border-bottom: none; }
.cell-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cell-title:hover { color: var(--accent-text); }
.table-companies td:nth-child(3) { min-width: 180px; max-width: 280px; }
.table-companies td:nth-child(4) { min-width: 150px; }
/* Контакты и даты читаются целиком; горизонтальная прокрутка остаётся внутри таблицы. */
.table-companies td:nth-child(7),
.table-companies td:nth-child(8),
.table-companies td:nth-child(9),
.table-companies td:nth-child(10) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-num { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 48px; }
/* Домен не разрываем по буквам: таблица и так прокручивается вбок,
   длинное имя обрезается многоточием, полное видно во всплывающей подсказке. */
.cell-url { max-width: 240px; }
.cell-url a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-check { width: 40px; }

.lead-select { width: auto; min-width: 140px; height: 36px; padding: 0 8px; font-size: 13px; }

.pagination { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 6px 0 24px; }

.contacts, .sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.contacts li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.contacts li:last-child { border-bottom: none; }
.contact-type { color: var(--text-muted); font-size: 13px; min-width: 84px; }
.contact-value { overflow-wrap: anywhere; min-width: 0; }
.sources li { padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; overflow-wrap: anywhere; }
.sources li:last-child { border-bottom: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Аудит сайта (этап 2) ─── */

.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; }
.panel-head .back-link { margin: 0 0 0 auto; }

.metrics-compact .metric { padding: 10px 12px; }
.metrics-compact .metric dd { font-size: 20px; }
.audit-when { font-size: 13px; margin: 10px 0 0; }
.audit-start { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.analysis-start .field { max-width: 420px; }

.analysis-images {
  display: grid; gap: 16px; margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.analysis-image-card {
  min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere;
}
.analysis-image-card:target { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.analysis-image-thumb {
  display: block; width: 100%; height: auto; max-height: 320px;
  object-fit: contain; background: var(--border-soft); border-radius: 6px;
}
.analysis-gaps { padding-left: 20px; overflow-wrap: anywhere; }

.audit-runs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.run-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-muted); font-size: 13px; white-space: nowrap;
}
.run-chip:hover { border-color: var(--accent); text-decoration: none; }
.run-chip.is-active { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }

.signal-group { font-size: 14px; margin: 20px 0 10px; color: var(--text); }
.signal-group:first-of-type { margin-top: 0; }
.signal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.signal {
  background: var(--field); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 12px 14px;
}
.signal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.signal-title { font-weight: 600; }
.signal-detail { margin: 8px 0 0; font-size: 14px; color: var(--text-muted); }

.evidence { margin-top: 10px; font-size: 14px; }
.evidence summary { cursor: pointer; color: var(--accent-text); font-size: 13px; }
.evidence summary:hover { text-decoration: underline; }
.evidence-value { margin: 10px 0 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.evidence-page { margin: 8px 0 0; font-size: 12px; overflow-wrap: anywhere; }
/* Чужая разметка показывается как текст и не вырывается из рамки. */
.evidence-code {
  margin: 10px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-control); overflow-x: auto; max-height: 260px;
  white-space: pre-wrap; word-break: break-all; font-size: 12px; color: var(--text-muted);
}
.evidence-shot { display: block; margin-top: 10px; max-width: 320px; border-radius: var(--radius-control); }

.shot-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.shot { margin: 0; min-width: 0; }
.shot img {
  width: 100%; height: 220px; object-fit: cover; object-position: top;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
}
.shot-missing {
  height: 220px; display: grid; place-items: center; text-align: center; padding: 12px;
  border: 1px dashed var(--border); border-radius: 12px; color: var(--text-muted);
  font-size: 13px;
}
.shot figcaption {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 13px; overflow-wrap: anywhere;
}
.metric-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ─── Отчёт аудита: сводка, разделы, замечания ─── */

.summary-line { margin: 0 0 16px; }

.summary-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.summary-card {
  padding: 16px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--panel-muted);
}
.summary-card h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; font-size: 14px; font-weight: 600;
}
.summary-card ul { margin: 0; padding-left: 18px; font-size: 14px; }
.summary-card li { margin-bottom: 4px; }
.summary-card p { margin: 0 0 4px; font-size: 14px; }
.summary-count { font-size: 28px; font-weight: 700; line-height: 1.1; }

/* Цветная точка статуса: значок читается и без цвета — рядом всегда подпись. */
.dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--text-muted); display: inline-block;
}
.dot-success { background: var(--success); }
.dot-warning { background: var(--warning); }
.dot-danger { background: var(--danger); }
.dot-muted { background: var(--dot-muted); }

.category .panel-head h2 { display: flex; align-items: center; gap: 10px; }
.category-note { margin: 0 0 14px; font-size: 14px; }
.category-passed { border-left: 3px solid var(--success); }
.category-attention { border-left: 3px solid var(--warning); }
.category-problem { border-left: 3px solid var(--danger); }
.category-unchecked { border-left: 3px solid var(--dot-muted); }

.finding-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.finding-list-muted { opacity: 0.88; }
.limitations-title { margin: 20px 0 10px; font-size: 14px; color: var(--text-muted); }

.finding {
  padding: 14px 16px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--panel-muted);
}
.finding-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.finding-title { font-weight: 600; }

.finding-facts { margin: 0 0 12px; display: grid; gap: 6px; }
.finding-facts > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; }
.finding-facts dt { color: var(--text-muted); font-size: 13px; }
.finding-facts dd { margin: 0; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.finding-action { font-weight: 500; }
.finding-scope { margin: 0; font-size: 13px; }
.finding-evidence { margin: 8px 0 0; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

.table-compact th, .table-compact td { padding: 8px 10px; font-size: 13px; }
.cell-sub { display: block; font-size: 12px; margin-top: 2px; }
.cell-evidence { max-width: 320px; }
.evidence-hint { display: block; margin-top: 6px; font-size: 12px; }

.plan { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.plan-item { font-size: 14px; }
.plan-action { display: block; font-weight: 500; margin: 2px 0; }
.plan-why { display: block; font-size: 13px; }

/* ─── Страница «Аудит» ─── */

.audit-launch { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.audit-launch select { min-width: 320px; flex: 1 1 320px; width: auto; }
.field-inline { color: var(--text-muted); font-size: 14px; }

.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.queue-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.queue-item:last-child { border-bottom: none; }
.queue-name { font-weight: 500; overflow-wrap: anywhere; }

/* ─── Отчёт 2.8: показатели, проверки браузера, пройденное ─── */

.group-title { margin: 20px 0 10px; font-size: 14px; color: var(--text-muted); }
.group-title-danger { color: var(--danger); }
.group-title-warning { color: var(--warning); }

.reading-list, .lh-check-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }

.reading {
  padding: 12px 14px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--panel-muted);
}
.reading-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.reading-title { font-weight: 500; flex: 1 1 auto; }
.reading-value { font-variant-numeric: tabular-nums; font-weight: 700; }
.reading-bar {
  display: block; height: 6px; margin: 8px 0 6px; border-radius: 3px;
  background: rgba(154, 171, 188, 0.2); overflow: hidden;
}
.reading-fill { display: block; height: 100%; border-radius: 3px; background: var(--text-muted); }
.reading-fill-success { background: var(--success); }
.reading-fill-warning { background: var(--warning); }
.reading-fill-danger { background: var(--danger); }
.reading-meaning { margin: 0; font-size: 13px; }

.lh-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.lh-group:first-of-type { margin-top: 8px; padding-top: 0; border-top: 0; }
.lh-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lh-group-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.lh-group-meaning { margin: 6px 0 0; font-size: 14px; }
.lh-subtitle { margin: 16px 0 8px; font-size: 14px; color: var(--text-muted); }

.lh-check {
  padding: 12px 14px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--panel-muted);
}
.lh-check-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.lh-check-title { font-weight: 500; }
.lh-check-text { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }
.lh-items { margin-top: 8px; font-size: 13px; }
.lh-item-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 8px; }
.lh-item-url { word-break: break-all; }
.lh-item-code {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: rgba(154, 171, 188, 0.16); font-size: 12px;
}
.lh-diagnostics { margin-top: 14px; font-size: 13px; }

.tech-block, .passed-block, .skipped-block { margin-top: 16px; font-size: 14px; }
.tech-block summary, .passed-block summary, .skipped-block summary,
.lh-items summary, .lh-diagnostics summary { cursor: pointer; color: var(--text-muted); }
.passed-list { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.passed-list-muted { color: var(--text-muted); }

.summary .panel-head { flex-wrap: wrap; gap: 10px; }
.shot-warning {
  display: block; margin-top: 6px; font-size: 12px; color: var(--warning);
}

/* ─── Планшет и узкий экран ─── */

@media (max-width: 1000px) {
  .columns { grid-template-columns: 1fr; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .layout { padding: 22px 16px; }

  .shell { display: block; }

  /* Без JavaScript панель — обычный блок над содержимым. */
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
    padding: 16px;
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; }

  .js .nav-toggle-icon-wide { display: none; }
  .js .nav-toggle-icon-narrow { display: inline-flex; }
  .js .nav-toggle-label {
    position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible;
  }
  .js .nav-toggle { padding: 0 14px; }

  .js .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    height: auto;
    width: min(300px, 86vw);
    z-index: 40;
    border-bottom: 0;
    border-right: 1px solid var(--border);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.18s ease, visibility 0.18s;
  }
  .js .side-nav { flex-direction: column; flex-wrap: nowrap; }
  .js .side-foot { margin-top: auto; }
  .js.nav-open .sidebar { transform: none; visibility: visible; }
  .js.nav-open .scrim {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    z-index: 35;
    background: rgba(10, 17, 23, 0.6);
  }
}

@media (max-width: 640px) {
  .filter-field-wide { grid-column: auto; }
  .table-actions .button, .filter-actions .button { flex: 1 1 auto; }
  .button-group { width: 100%; }
  .button-group .button { flex: 1 1 auto; }
  .shot-gallery { grid-template-columns: 1fr; }
  .evidence-shot { max-width: 100%; }
  .finding-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .audit-launch select { min-width: 0; }
  .panel { padding: 18px; }
  h1 { font-size: 23px; }
}

@media (max-width: 560px) {
  .local-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .local-badge { padding: 0 10px; }
  .brand-text strong { display: none; }
}

@media (max-width: 400px) {
  .topbar-start { gap: 8px; }
  .nav-toggle-label { display: none; }
  .js .nav-toggle { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Печать рабочей страницы ─── */

@media print {
  :root {
    --bg: #fff; --topbar: #fff; --panel: #fff; --panel-muted: #fff; --field: #fff;
    --border: #bbb; --border-soft: #ddd; --text: #000; --text-muted: #444;
    --accent-text: #1a1a6e;
  }
  body { background: #fff; color: #000; }
  .topbar, .sidebar, .scrim, .page-actions, .back-link,
  .button, .table-actions, .filter-actions, .pagination,
  .danger-zone, .audit-start, .nav-toggle { display: none !important; }
  .shell { display: block; }
  .layout { max-width: none; padding: 0; }
  .panel { break-inside: avoid; }
}

/* Long evidence titles must wrap inside the analysis panel on narrow screens. */
.analysis-fact-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Human review and local drafts. */
.outreach-form { display: grid; gap: 24px; }
.outreach-findings { border: 0; padding: 0; margin: 0; min-width: 0; }
.outreach-findings legend { font-weight: 600; margin-bottom: 12px; }
.outreach-finding { padding: 18px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.outreach-choice { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; line-height: 1.6; }
.outreach-choice input[type=checkbox] { flex: 0 0 auto; margin-top: 5px; }
.outreach-statement { display: block; margin-top: 4px; }
.outreach-evidence { margin: 10px 0 0 34px; font-size: .9rem; }
.outreach-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.outreach-confirm { padding: 18px; border: 1px solid var(--border); border-radius: 12px; }
.outreach-body { width: 100%; min-height: 280px; resize: vertical; line-height: 1.65; }
@media (max-width: 640px) { .outreach-fields { grid-template-columns: minmax(0, 1fr); } }

/* Manual email preview, confirmation and history. Scoped; selects keep the shared inset. */
.delivery-panel .delivery-table td { white-space: nowrap; }
.delivery-form { display: grid; gap: 20px; max-width: 720px; }
.delivery-facts dd { overflow-wrap: anywhere; }
.delivery-body {
  margin: 0; padding: 18px; background: var(--field); color: var(--text);
  border: 1px solid var(--border-soft); border-radius: var(--radius-control);
  font: inherit; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 520px; overflow: auto;
}
.delivery-confirm { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-muted); }
.delivery-cancel { margin: 0 0 24px; }
.delivery-events { list-style: none; margin: 0; padding: 0; }
.delivery-events li {
  display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.delivery-events li:last-child { border-bottom: none; }

/* Per-run customer consent: readable form within the existing analysis layout. */
.analysis-start .analysis-consent {
  width: 100%; min-width: 0; max-width: 640px; margin: 12px 0 0;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-control);
}
.analysis-consent legend { padding: 0 6px; font-weight: 600; }
.analysis-consent textarea { height: auto; min-height: 96px; resize: vertical; }
.first-contact-form textarea { height: auto; min-height: 280px; resize: vertical; }
.analysis-consent .checkbox input { flex: 0 0 auto; }
.analysis-consent-record .pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ─── Сводка дня автопилота ─── */
.day-summary { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; margin: 16px 0 12px; }
.day-figure {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 14px 18px; border: 1px solid var(--border-soft); border-radius: 12px;
  background: var(--panel-muted); min-width: 180px;
}
.day-count { font-size: 44px; line-height: 1; font-weight: 600; color: var(--accent-text); }
.day-of { font-size: 14px; color: var(--text-muted); }
.day-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.day-slots { display: flex; gap: 5px; margin-top: 10px; }
.day-slot {
  width: 26px; height: 8px; border-radius: 4px;
  background: var(--field); border: 1px solid var(--border-soft);
}
.day-slot-filled { background: var(--accent-solid); border-color: var(--accent-solid); }
.day-tiles { display: flex; flex-wrap: wrap; gap: 12px; flex: 1 1 320px; }
.day-tile {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  flex: 1 1 140px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--panel-muted);
}
.day-tile-value { font-size: 26px; font-weight: 600; line-height: 1; }
.day-tile-label { font-size: 13px; color: var(--text-muted); }
.day-hours { display: flex; gap: 6px; margin: 4px 0 14px; }
.day-hour { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.day-hour-mark {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 30px; border-radius: 8px;
  background: var(--field); border: 1px solid var(--border-soft);
  font-size: 13px; font-weight: 600; color: var(--bg);
}
.day-hour-past .day-hour-mark { background: var(--panel); }
.day-hour-sent .day-hour-mark { background: var(--success); border-color: var(--success); }
.day-hour-now .day-hour-mark { border-color: var(--accent-text); }
.day-hour-label { font-size: 12px; color: var(--text-muted); }
.day-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.day-list li { color: var(--text); }
.day-time { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
@media (max-width: 640px) {
  .day-hours { flex-wrap: wrap; }
  .day-hour { flex: 1 1 52px; }
}

/* ─── Итоги за период ─── */
.totals { margin: 18px 0 6px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.totals-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.totals-head h3 { margin: 0; font-size: 16px; }
.totals-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.totals-dates label { font-size: 13px; color: var(--text-muted); }
.totals-dates input[type="date"] { width: auto; min-width: 150px; }
.totals-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 12px; }
.totals-card {
  display: flex; flex-direction: column; gap: 3px; flex: 1 1 150px;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--panel-muted);
}
.totals-card-main { background: var(--accent-soft); border-color: var(--accent-solid); }
.totals-value { font-size: 30px; font-weight: 600; line-height: 1; }
.totals-good { color: var(--success); }
.totals-bad { color: var(--danger); }
.totals-quiet { color: var(--text-muted); }
.totals-label { font-size: 13px; }
.totals-note { font-size: 12px; color: var(--text-muted); }
.totals-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; gap: 2px; }
.totals-part {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--bg); min-width: 24px;
}
.totals-part-good { background: var(--success); }
.totals-part-bad { background: var(--danger); }
.totals-part-quiet { background: var(--border); color: var(--text); }

/* ─── Кнопка «Что здесь делать» ─── */
.howto { margin: 0 0 20px; }
.howto-button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 14px; border-radius: 10px; list-style: none;
  border: 1px solid var(--border); background: var(--panel-muted);
  color: var(--text); font-size: 14px; user-select: none;
}
.howto-button::-webkit-details-marker { display: none; }
.howto-button:hover { border-color: var(--accent-solid); }
.howto[open] .howto-button { border-color: var(--accent-solid); background: var(--accent-soft); }
.howto-body {
  margin-top: 10px; padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--panel-muted); max-width: 760px;
}
.howto-title { margin: 0 0 10px; font-weight: 600; }
.howto-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.howto-steps li { line-height: 1.5; }
.howto-note { margin: 12px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

/* ─── Простой путь из 4 шагов ─── */

.side-step-num {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); font-weight: 700; font-size: 13px;
}
.side-link.is-active .side-step-num { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.side-more { margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.side-more-toggle { cursor: pointer; color: var(--text-muted); font-size: 13px; padding: 6px 12px; list-style: none; }
.side-more-toggle::-webkit-details-marker { display: none; }
.side-more-toggle::before { content: "▸ "; }
.side-more[open] .side-more-toggle::before { content: "▾ "; }
.side-nav-more { margin-top: 6px; }
.side-nav-more .side-link { font-size: 14px; }

.stepper { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; }
.stepper-item {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  color: var(--text-muted); font-weight: 600; font-size: 15px;
}
.stepper-item:hover { text-decoration: none; color: var(--text); }
.stepper-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border); font-weight: 700;
}
.stepper-item.is-current { color: var(--text); }
.stepper-item.is-current .stepper-num { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.stepper-item.is-done { color: var(--success); }
.stepper-item.is-done .stepper-num { border-color: var(--success); color: var(--success); }
.stepper-line { flex: 1 1 24px; height: 2px; background: var(--border); min-width: 12px; }
.stepper-line.is-done { background: var(--success); }

.flow-head { margin-bottom: 20px; }
.flow-head h1 { font-size: 32px; }
.flow-lead { font-size: 17px; color: var(--text-muted); margin: 0; max-width: 720px; }
.flow-panel { max-width: 880px; }
.flow-form { gap: 22px; }
.flow-label { font-size: 16px; font-weight: 600; }
.input-big { font-size: 17px; min-height: 52px; }
.flow-extra { width: 100%; color: var(--text-muted); }
.flow-extra summary { cursor: pointer; font-size: 14px; margin-bottom: 10px; }
.flow-continue { margin-top: 18px; font-size: 15px; color: var(--text-muted); }

.button-huge { height: 60px; padding: 0 32px; font-size: 18px; font-weight: 700; border-radius: 14px; gap: 10px; }
.flow-next {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  max-width: 880px; margin: 28px 0 8px;
}
.flow-next-hint { margin: 0; color: var(--text-muted); font-size: 14px; }
.flow-next span.button[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.flow-empty { max-width: 880px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; font-size: 17px; }
.flow-empty p { margin: 0; }

.flow-search-name { font-size: 18px; font-weight: 650; margin: 0 0 16px; }
.flow-progress { display: flex; align-items: center; gap: 12px; font-size: 16px; margin: 0 0 16px; }
.flow-bigaction { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0 0 20px; }
.flow-bigaction p { margin: 0; }
.flow-done { font-size: 17px; color: var(--success); font-weight: 600; margin: 0; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.flow-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-soft); }
.flow-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border-soft); }
.flow-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.flow-row-title { color: var(--text); font-weight: 600; font-size: 16px; }
.flow-row-site { font-size: 13px; }
.flow-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--dot-muted); }
.flow-dot-busy, .flow-dot-queue { background: var(--info); }
.flow-dot-done { background: var(--success); }
.flow-dot-fail, .flow-dot-skip { background: var(--warning); }
.flow-state { font-size: 15px; white-space: nowrap; color: var(--text-muted); }
.flow-state-busy, .flow-state-queue { color: var(--info); }
.flow-state-done, .flow-state-done a { color: var(--success); font-weight: 600; }
.flow-state-fail, .flow-state-skip { color: var(--warning); }

.flow-demo-note { max-width: 880px; margin-bottom: 20px; }
.letter { max-width: 880px; margin-bottom: 20px; }
.letter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.letter-company { font-size: 20px; margin: 0 0 2px; }
.letter-to { margin: 0 0 12px; }
.letter-why { margin: 0 0 16px; color: var(--text-muted); }
.letter-why summary { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.letter-why ul { margin: 10px 0 0; padding-left: 20px; }
.letter-why li { margin-bottom: 6px; }
.letter-form { gap: 14px; align-items: stretch; }
.letter-form textarea { font-size: 15px; line-height: 1.55; }

.funnel { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.funnel-item { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.funnel-num { font-size: 40px; font-weight: 750; line-height: 1.1; }
.funnel-label { color: var(--text-muted); font-size: 15px; }
.funnel-item-accent { border-color: var(--accent); }
.funnel-item-accent .funnel-num { color: var(--accent-text); }
.flow-table td:not(:first-child), .flow-table th:not(:first-child) { text-align: center; }
