/* article-base.css — базовый слой компонентов статей.
   Порт продового css/article.css: best/article.css написан как слой overrides
   с !important поверх этой базы. Старые токены отображены на новую палитру. */
:root{
  /* цвета текста и поверхностей */
  --text-primary:var(--text);--text-secondary:var(--muted);--text-muted:var(--quiet);
  --bg-primary:var(--bg);--bg-surface:var(--surface);--bg-elevated:oklch(23.5% .008 95);
  --border:var(--line);--border-accent:var(--line-strong);
  /* акценты: терра — из новой палитры; зелёный — спокойный статусный, не брендовый */
  --accent-terra:var(--accent);
  --accent-terra-dim:color-mix(in oklch,var(--accent) 45%,transparent);
  --accent-terra-glow:color-mix(in oklch,var(--accent) 14%,transparent);
  --accent-green:oklch(62% .09 162);
  --accent-green-dim:oklch(62% .09 162/.45);
  --accent-green-glow:oklch(62% .09 162/.14);
  /* типографика */
  --font-display:var(--font);--font-body:var(--font);
  --font-mono:'JetBrains Mono',ui-monospace,Consolas,monospace;
  --weight-semibold:600;--weight-bold:700;
  --leading-tight:1.2;--leading-normal:1.55;--leading-relaxed:1.7;
  --text-xs:.8125rem;--text-sm:.9375rem;--text-base:clamp(1.0625rem,1.15vw,1.1875rem);
  --text-lg:clamp(1.1875rem,1.35vw,1.3125rem);--text-xl:clamp(1.375rem,1.9vw,1.625rem);
  --text-2xl:clamp(1.625rem,2.6vw,2.125rem);--text-3xl:clamp(2.125rem,3.6vw,2.875rem);
  /* интервалы и радиусы */
  --space-xs:.25rem;--space-sm:.5rem;--space-md:1rem;--space-lg:1.5rem;
  --space-xl:2.5rem;--space-2xl:4rem;--space-3xl:6rem;
  --radius-sm:4px;--radius-md:8px;--radius-lg:8px;--radius-xl:8px;
  --radius-full:9999px;--radius-circle:50%;
  /* движение */
  --duration-fast:150ms;--duration-normal:250ms;--ease-out:var(--ease);
  /* вердикты (семантические цвета данных, палитро-нейтральные) */
  --verdict-critical:oklch(71.2% .181 22.8);--verdict-critical-bg:oklch(71.2% .181 22.8/.12);--verdict-critical-border:oklch(71.2% .181 22.8/.25);
  --verdict-high:oklch(80.3% .146 64.6);--verdict-high-bg:oklch(80.3% .146 64.6/.12);--verdict-high-border:oklch(80.3% .146 64.6/.25);
  --verdict-borderline:oklch(88% .135 86.1);--verdict-borderline-bg:oklch(88% .135 86.1/.12);--verdict-borderline-border:oklch(88% .135 86.1/.3);
  --verdict-weak:oklch(83.4% .125 66.9);--verdict-weak-bg:oklch(83.4% .125 66.9/.12);--verdict-weak-border:oklch(83.4% .125 66.9/.3);
  --verdict-fail:oklch(76.1% .151 44.3);--verdict-fail-bg:oklch(76.1% .151 44.3/.12);--verdict-fail-border:oklch(76.1% .151 44.3/.28);
}

/* css/article.css — Blog article styles */

/* ============ ARTICLE HEADER ============ */
.article-header {
  padding-bottom: var(--space-xl);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.article-back {
  color: var(--accent-green);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
  /* ссылка возврата — самостоятельное действие, а не текст в абзаце:
     держим хит-зону 44px */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.article-back:hover {
  color: var(--text-primary);
}

.article-date,
.article-reading {
  white-space: nowrap;
}

.article-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
}

.article-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 65ch;
  margin-bottom: var(--space-lg);
}

.article-tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ============ ARTICLE AUTHOR ============ */
.article-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.article-author--bottom {
  border-bottom: none;
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
  margin-bottom: 0;
  padding-bottom: 0;
}

.article-author__photo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-circle);
  border: 2px solid var(--border-accent);
  object-fit: cover;
  flex-shrink: 0;
}

.article-author__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
}

.article-author__role {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.article-author__role a {
  color: var(--accent-green);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.article-author__role a:hover {
  text-decoration: underline;
}

/* ============ TL;DR ============ */
.article-tldr {
  background: var(--accent-green-glow);
  border: 1px solid var(--accent-green-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  position: relative;
}

.article-tldr__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.article-tldr p {
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
}

/* ============ TOC ============ */
.article-toc {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.article-toc__title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.article-body .article-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-body .article-toc__list li {
  list-style: none;
  margin-bottom: var(--space-sm);
  padding-left: var(--space-lg);
  position: relative;
}

.article-body .article-toc__list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: var(--weight-bold);
}

.article-body .article-toc__list a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
.article-body .article-toc__list a:hover,
.article-body .article-toc__list a:focus-visible {
  color: var(--accent-green);
}

/* ============ ARTICLE BODY ============ */
.article-body {
  padding-bottom: var(--space-3xl);
  overflow-x: clip;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.article-body h2[id],
.article-body h3[id] {
  scroll-margin-top: 88px;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-md);
}

.article-body p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
}

.article-body ul,
.article-body ol {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  padding-left: 1.1em;
  margin-bottom: var(--space-lg);
}

.article-body li {
  margin-bottom: var(--space-sm);
}

.article-body strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.article-lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-xl);
}

/* ============ NOTE ============ */
.article-note {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent-terra);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-2xl);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}
.article-note strong {
  color: var(--accent-terra);
}

/* Заголовок вреза остаётся мелким: h2 нужен только для порядка уровней,
   размер и разделитель от .article-body h2 здесь не к месту. */
.article-note h2 {
  font-size: var(--text-xl);
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ============ CASE CARDS (article version) ============ */
.case-card-article {
  display: flex;
  gap: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  transition: border-color var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.case-card-article:hover {
  border-color: var(--accent-green-dim);
  transform: translateY(-2px);
}

.case-card-article__num {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--accent-green);
  opacity: 0.3;
  line-height: 1;
  flex-shrink: 0;
  min-width: 48px;
}

.article-body .case-card-article__body h3,
.article-body .case-card-article__body h4 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.case-card-article__body p,
.case-card-article__body ul,
.case-card-article__body ol,
.case-card-article__body li {
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
}

.case-card-article__body li {
  margin-bottom: var(--space-xs);
}

.case-card-article__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.case-card-article__metrics span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-green);
  background: var(--accent-green-glow);
  border: 1px solid var(--accent-green-dim);
  border-radius: var(--radius-full);
  padding: 2px var(--space-md);
  white-space: nowrap;
}

/* ============ BREAKDOWN ============ */
.article-breakdown {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.article-body .article-breakdown > h3 {
  font-family: var(--font-body);
  margin-bottom: var(--space-lg);
}

.article-breakdown > p {
  font-size: var(--text-sm);
}

.article-breakdown__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  align-items: start;
}

.article-breakdown__item {
  min-width: 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Длинные блоки (>150 символов или списки) — на всю ширину */
.article-breakdown__item:has(ol),
.article-breakdown__item:has(ul) {
  grid-column: 1 / -1;
}

/* Первый блок в каждом breakdown обычно самый длинный */
.article-breakdown__item:first-child {
  grid-column: 1 / -1;
}

/* Два равных блока рядом — без растяжки первого */
.article-breakdown__grid--equal .article-breakdown__item:first-child {
  grid-column: auto;
}

/* Равные блоки тянутся по высоте строки, чтобы не было пустот */
.article-breakdown__grid--equal .article-breakdown__item {
  height: 100%;
  height: -webkit-fill-available;
}

@media (max-width: 640px) {
  .article-breakdown__grid {
    grid-template-columns: 1fr;
  }
}

.article-breakdown__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.article-breakdown__item p,
.article-breakdown__item ul,
.article-breakdown__item ol {
  font-size: var(--text-sm);
  margin-bottom: 0;
}

.article-breakdown__item li {
  margin-bottom: var(--space-xs);
}

/* ============ CALLOUT ============ */
.article-callout {
  background: var(--accent-green-glow);
  border: 1px solid var(--accent-green-dim);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.article-callout--terra {
  background: var(--accent-terra-glow);
  border-color: var(--accent-terra-dim);
}
.article-callout--terra strong {
  color: var(--accent-terra);
}

.article-callout + .article-note {
  margin-top: var(--space-xl);
}

/* ============ PULL-QUOTE ============ */
.article-pullquote {
  margin: var(--space-2xl) auto;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--accent-green-dim);
  border-bottom: 1px solid var(--accent-green-dim);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
  text-align: center;
  max-width: 85%;
}

/* ============ LEVERS GRID ============ */
.levers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.lever-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.lever-card:hover {
  border-color: var(--accent-green-dim);
  transform: translateY(-3px);
}

.lever-card__num {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--accent-green);
  opacity: 0.6;
  margin-bottom: var(--space-md);
}

.lever-card h4,
.lever-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-sm);
}

.lever-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============ STEP BLOCKS ============ */
.step-block {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border);
}
.step-block:last-of-type {
  border-bottom: none;
}

.step-block__num {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--accent-green);
  opacity: 0.6;
  line-height: 1;
  flex-shrink: 0;
  min-width: 48px;
  padding-top: var(--space-xs);
}

.step-block__content h3 {
  margin-bottom: var(--space-sm);
}

.step-block__content p {
  font-size: var(--text-sm);
}

.step-block__content ul,
.step-block__content ol {
  font-size: var(--text-sm);
}

/* ============ PHASES GRID ============ */
.phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.article-llm-guide .phases-intro {
  max-width: 68ch;
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
}

.phase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--duration-normal) var(--ease-out);
}
.phase-card:hover {
  border-color: var(--accent-green-dim);
}

.phase-card__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
  padding: 2px var(--space-md);
  background: var(--accent-green-glow);
  border-radius: var(--radius-full);
  display: inline-block;
}

.phase-card__label--terra {
  color: var(--accent-terra);
  background: var(--accent-terra-glow);
}

.phase-card h4,
.phase-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
   margin-bottom: 0;
}

.article-llm-guide .phases-grid {
  align-items: stretch;
}

.article-llm-guide .phase-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  height: 100%;
}

.article-llm-guide .phase-card__summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.phase-card ol {
  padding-left: var(--space-xl);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.phase-card li {
  margin-bottom: var(--space-sm);
}

.article-llm-guide .phase-card ol {
  margin: 0;
}

.article-llm-guide .phase-card__result {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.article-llm-guide .phase-card__result-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-green);
  margin-bottom: var(--space-xs);
}

.article-llm-guide .phase-card__result p {
  margin-bottom: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ============ ARTICLE TABLE ============ */
.article-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  margin-bottom: var(--space-2xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

.article-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  table-layout: auto;
}

.article-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-table thead {
  background: var(--bg-elevated);
}

.article-table th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.article-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.article-table tbody tr:last-child td {
  border-bottom: none;
}

.article-table tbody tr:hover {
  background: var(--bg-surface);
}

/* Priority badges */
.priority {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px var(--space-md);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.priority--critical {
  color: var(--verdict-critical);
  background: var(--verdict-critical-bg);
  border: 1px solid var(--verdict-critical-border);
}

.priority--high {
  color: var(--verdict-high);
  background: var(--verdict-high-bg);
  border: 1px solid var(--verdict-high-border);
}

.priority--mid {
  color: var(--accent-green);
  background: var(--accent-green-glow);
  border: 1px solid var(--accent-green-dim);
}

.priority--medium {
  color: var(--verdict-borderline);
  background: var(--verdict-borderline-bg);
  border: 1px solid var(--verdict-borderline-border);
}

.priority--low {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* ============ PROMPT BLOCK ============ */
.article-prompt {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-prompt__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-green);
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
}

/* ============ PROMPT WRAP (label + copy button) ============ */
.article-prompt-wrap {
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article-prompt-wrap .article-prompt__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.article-prompt-wrap .article-prompt__label {
  flex: 1;
  margin-bottom: 0;
}

.article-prompt-wrap .article-prompt {
  margin-bottom: 0;
  border: none;
  border-radius: 0;
}

.article-prompt__copy {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  min-height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.article-prompt__copy:hover,
.article-prompt__copy--copied {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

/* ============ CRAWL FLOW DIAGRAM ============ */
.crawl-flow {
  margin: var(--space-xl) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-xs);
}

.crawl-flow__row {
  display: flex;
  align-items: stretch;
  min-width: 540px;
}

.crawl-flow__node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  gap: 5px;
  min-width: 110px;
}

.crawl-flow__node--green {
  border-color: oklch(77.8% 0.145 169.7 / .45);
  background: oklch(77.8% 0.145 169.7 / .05);
}

.crawl-flow__node--warn {
  border-color: oklch(64.4% 0.105 45.1 / .5);
  background: oklch(64.4% 0.105 45.1 / .05);
}

.crawl-flow__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.crawl-flow__title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.crawl-flow__node--green .crawl-flow__title { color: var(--accent-green); }
.crawl-flow__node--warn .crawl-flow__title  { color: var(--accent-terra); }

.crawl-flow__desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.crawl-flow__conn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  gap: var(--space-xs);
  padding: 0 2px;
}

.crawl-flow__conn-line {
  width: 100%;
  height: 2px;
  background: var(--border);
  position: relative;
}

.crawl-flow__conn-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 7px solid var(--border);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.crawl-flow__conn--warn .crawl-flow__conn-line {
  background: var(--accent-terra);
}

.crawl-flow__conn--warn .crawl-flow__conn-line::after {
  border-left-color: var(--accent-terra);
}

.crawl-flow__conn-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
  text-align: center;
}

.crawl-flow__conn--warn .crawl-flow__conn-label {
  color: var(--accent-terra);
}

.crawl-flow__legend {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
  padding-left: 2px;
}

.crawl-flow__legend-item {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.crawl-flow__legend-item::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
}

.crawl-flow__legend-item--green::before { background: oklch(77.8% 0.145 169.7 / .6); }
.crawl-flow__legend-item--warn::before  { background: var(--accent-terra); }

/* ============ BOT COMPARE PANELS ============ */
.bot-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.bot-compare__panel {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.bot-compare__panel--bad  { border-color: oklch(64.4% 0.105 45.1 / .45); }
.bot-compare__panel--good { border-color: oklch(77.8% 0.145 169.7 / .35); }

.bot-compare__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-md);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bot-compare__panel--bad  .bot-compare__header { background: oklch(64.4% 0.105 45.1 / .07); border-bottom-color: oklch(64.4% 0.105 45.1 / .25); }
.bot-compare__panel--good .bot-compare__header { background: oklch(77.8% 0.145 169.7 / .05); border-bottom-color: oklch(77.8% 0.145 169.7 / .2); }

.bot-compare__dots {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.bot-compare__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-circle);
  background: var(--border);
}

.bot-compare__badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.bot-compare__panel--bad  .bot-compare__badge { color: var(--accent-terra); }
.bot-compare__panel--good .bot-compare__badge { color: var(--accent-green); }

.bot-compare__code {
  margin: 0;
  padding: var(--space-md);
  background: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre;
  flex: 1;
}

.bot-compare__code .bc-tag  { color: oklch(64.6% 0.128 263.1 / .85); }
.bot-compare__code .bc-attr { color: oklch(71.0% 0.082 91.7 / .8); }
.bot-compare__code .bc-val  { color: oklch(80.5% 0.114 141.0 / .8); }
.bot-compare__code .bc-empty { color: oklch(64.4% 0.105 45.1 / .55); }

.bot-compare__footer {
  padding: 8px var(--space-md);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  letter-spacing: .03em;
}

.bot-compare__panel--bad  .bot-compare__footer { color: var(--accent-terra); border-top-color: oklch(64.4% 0.105 45.1 / .25); }
.bot-compare__panel--good .bot-compare__footer { color: var(--accent-green); border-top-color: oklch(77.8% 0.145 169.7 / .2); }

@media (max-width: 640px) {
  .bot-compare { grid-template-columns: 1fr; }
}

/* ============ CRAWLABLE LINKS SPLIT ============ */
.link-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.link-split__col {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.link-split__col--good { border-color: oklch(77.8% 0.145 169.7 / .35); }
.link-split__col--bad  { border-color: oklch(64.4% 0.105 45.1 / .4); }

.link-split__header {
  padding: 8px var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.link-split__col--good .link-split__header { background: oklch(77.8% 0.145 169.7 / .06); color: var(--accent-green); border-bottom-color: oklch(77.8% 0.145 169.7 / .2); }
.link-split__col--bad  .link-split__header { background: oklch(64.4% 0.105 45.1 / .06); color: var(--accent-terra); border-bottom-color: oklch(64.4% 0.105 45.1 / .2); }

.link-split__code {
  margin: 0;
  padding: var(--space-md);
  background: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre;
  overflow-x: auto;
}

.link-split__code .ls-tag  { color: oklch(64.6% 0.128 263.1 / .85); }
.link-split__code .ls-attr { color: oklch(71.0% 0.082 91.7 / .8); }
.link-split__code .ls-val  { color: oklch(80.5% 0.114 141.0 / .8); }
.link-split__code .ls-comment { color: var(--text-muted); font-style: italic; }

@media (max-width: 640px) {
  .link-split { grid-template-columns: 1fr; }
}

/* ============ TOOL BLOCK ============ */
.article-tool {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.article-tool__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.article-tool__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-green-glow);
  color: var(--accent-green);
  flex-shrink: 0;
}

.article-tool__title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.article-tool__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.article-tool__header .btn {
  margin-left: auto;
  flex-shrink: 0;
}

.article-tool__code {
  margin: 0;
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ============ CONCLUSION ============ */
.article-conclusion {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin-top: var(--space-2xl);
  text-align: center;
}

.article-conclusion h2 {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
  margin-bottom: var(--space-md);
}

.article-conclusion p {
  margin-bottom: var(--space-xl);
}

.article-conclusion__formula {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.article-conclusion__formula span {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  white-space: nowrap;
}

.article-conclusion__formula span:nth-child(even) {
  background: transparent;
  border: none;
  color: var(--accent-green);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  padding: 0;
}

/* ============ ARTICLE CTA ============ */
.article-cta {
  text-align: center;
  padding: var(--space-2xl);
  margin-top: var(--space-2xl);
  background: linear-gradient(135deg, var(--accent-green-glow), var(--accent-terra-glow));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
}

.article-cta h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
}

.article-cta p {
  color: var(--text-secondary);
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
}

/* ============ SCORE GRID ============ */
.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.score-card {
  background:
    radial-gradient(circle at top right, oklch(90.3% 0.191 143.8 / 0.12), transparent 45%),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.article-llm-guide .score-grid {
  align-items: stretch;
}

.article-llm-guide .score-card {
  height: 100%;
}

.score-card:hover {
  border-color: var(--accent-green-dim);
  transform: translateY(-3px);
}

.score-card__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.score-card__value {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1;
  color: var(--text-primary);
  margin-block: var(--space-md);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.score-card__note {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ============ BAR CHART ============ */
.bar-chart {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.bar-chart__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-lg);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 240px) 1fr auto;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-row__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.bar-row__track {
  position: relative;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  overflow: hidden;
  border: 1px solid var(--border);
}

.bar-row__fill {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, oklch(90.3% 0.191 143.8 / 0.4), oklch(90.3% 0.191 143.8 / 0.95));
}

.bar-row__fill--terra {
  background: linear-gradient(90deg, oklch(76.1% 0.151 44.3 / 0.35), oklch(76.1% 0.151 44.3 / 0.95));
}

.bar-row__value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  white-space: nowrap;
}

.bar-chart__note {
  margin: var(--space-lg) 0 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

/* ============ VERDICTS ============ */
.verdict-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-md);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.verdict-chip--pass {
  color: var(--accent-green);
  background: var(--accent-green-glow);
  border: 1px solid var(--accent-green-dim);
}

.verdict-chip--borderline {
  color: var(--verdict-borderline);
  background: var(--verdict-borderline-bg);
  border: 1px solid var(--verdict-borderline-border);
}

.verdict-chip--weak {
  color: var(--verdict-weak);
  background: var(--verdict-weak-bg);
  border: 1px solid var(--verdict-weak-border);
}

.verdict-chip--fail {
  color: var(--verdict-fail);
  background: var(--verdict-fail-bg);
  border: 1px solid var(--verdict-fail-border);
}

.verdict-chip--autofail {
  color: var(--verdict-critical);
  background: var(--verdict-critical-bg);
  border: 1px solid var(--verdict-critical-border);
}

/* ============ QUESTION BLOCK + ANSWER LEVELS (hiring interview) ============ */
.qa {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.qa__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.qa__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--bg-primary);
  background: var(--accent-green);
}

.article-body .qa__q {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.35;
}

.qa__intro {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.answer-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
  align-items: stretch;
}

.answer-levels--duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.answer-levels__item {
  min-width: 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border-top: 2px solid var(--border);
  overflow-wrap: anywhere;
}

.answer-levels__item--weak { border-top-color: var(--verdict-fail); }
.answer-levels__item--mid { border-top-color: var(--verdict-borderline); }
.answer-levels__item--strong { border-top-color: var(--accent-green); }

.answer-levels__item p {
  font-size: var(--text-sm);
  margin: var(--space-sm) 0 0;
}

/* Кнопка скачивания шаблона */
.article-download {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0 var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--accent-green-dim);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-decoration: none;
  min-height: 44px;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.article-download:hover {
  border-color: var(--accent-green);
}
.article-download svg {
  color: var(--accent-green);
  flex: none;
}
.article-download b {
  color: var(--accent-green);
}
.article-download span {
  color: var(--text-muted);
}

/* Подпись таблицы — семантика для парсеров/LLM */
.article-table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-bottom: var(--space-sm);
}

/* Короткий ответ под H2 — для извлечения в AI-ответы */
.quick-answer {
  background: var(--accent-green-glow);
  border: 1px solid var(--accent-green-dim);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: 0 0 var(--space-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}
.quick-answer b,
.quick-answer strong {
  color: var(--accent-green);
}

/* Равномерный вертикальный ритм блоков внутри карточки вопроса */
.qa .answer-levels {
  margin-bottom: var(--space-lg);
}
.qa .article-note {
  margin-top: 0;
  margin-bottom: var(--space-lg);
}
.qa .article-callout {
  margin-bottom: var(--space-lg);
}
.qa > :last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .answer-levels,
  .answer-levels--duo {
    grid-template-columns: 1fr;
  }
  .qa {
    padding: var(--space-lg);
  }
}

/* ============ AUDIT FLOW ============ */
.audit-flow {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  position: relative;
}

.audit-flow::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, oklch(76.1% 0.151 44.3 / 0.55), oklch(90.3% 0.191 143.8 / 0.35));
}

.audit-flow__node {
  position: relative;
  background:
    radial-gradient(circle at top right, oklch(76.1% 0.151 44.3 / 0.14), transparent 42%),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-lg) var(--space-lg) calc(var(--space-2xl) + 10px);
  min-height: 0;
  overflow: hidden;
}

.audit-flow__node::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 20px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-circle);
  background: linear-gradient(135deg, oklch(76.1% 0.151 44.3 / 0.95), oklch(90.3% 0.191 143.8 / 0.85));
  box-shadow: 0 0 0 6px oklch(76.1% 0.151 44.3 / 0.08);
}

.audit-flow__node::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, oklch(76.1% 0.151 44.3 / 0.9), oklch(90.3% 0.191 143.8 / 0.55));
}

.audit-flow__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-terra);
  margin-bottom: var(--space-sm);
}

.audit-flow__node p {
  margin-bottom: 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ============ MOBILE ============ */
@media (max-width: 768px) {
  .article-meta {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .article-title {
    font-size: var(--text-2xl);
  }

  .article-body h2 {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
    line-height: 1.08;
  }

  .case-card-article {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .case-card-article__num {
    font-size: var(--text-xl);
    min-width: auto;
  }

  .step-block {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .step-block__num {
    min-width: auto;
    font-size: var(--text-xl);
  }


  .levers-grid,
  .phases-grid {
    grid-template-columns: 1fr;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .score-card {
    min-height: 0;
  }

  .bar-row {
    grid-template-columns: 1fr auto;
    gap: 4px var(--space-sm);
  }

  .bar-row__label {
    grid-area: 1 / 1;
  }

  .bar-row__value {
    grid-area: 1 / 2;
    text-align: right;
  }

  .bar-row__track {
    grid-area: 2 / 1 / 3 / 3;
  }

  .audit-flow__node {
    min-height: 0;
    padding-left: calc(var(--space-xl) + 10px);
  }

  .audit-flow::before {
    left: 18px;
  }

  .audit-flow__node::before {
    left: 10px;
  }

  .article-conclusion__formula {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .article-conclusion__formula span {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    max-width: 100%;
    width: 100%;
  }

  .article-conclusion__formula span:nth-child(even) {
    font-size: var(--text-base);
    width: auto;
  }

  .article-table {
    font-size: var(--text-xs);
  }

  .article-table th,
  .article-table td {
    padding: var(--space-sm);
  }

  .article-llm-guide .phase-card {
    padding: var(--space-lg);
  }

  .article-llm-guide .phase-card__summary,
  .article-llm-guide .phase-card__result p {
    font-size: var(--text-xs);
  }

  .article-llm-guide .phases-intro {
    margin-bottom: var(--space-lg);
  }

  .article-table-wrap[tabindex="0"]::after {
    content: "Свайп по таблице";
    display: block;
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: linear-gradient(180deg, oklch(15.1% 0.011 276.2 / 0), oklch(15.1% 0.011 276.2 / 0.92));
    border-top: 1px solid var(--border);
  }

  .article-body {
    padding-bottom: calc(var(--space-3xl) + 5.5rem);
  }

  .article-table th,
  .article-table td {
    min-width: clamp(132px, 36vw, 220px);
    vertical-align: top;
  }

  .article-breakdown__grid,
  .article-faq {
    grid-template-columns: 1fr;
  }

  .article-tool__header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .article-tool__header .btn {
    width: 100%;
    margin-left: 0;
  }

  .article-prompt,
  .article-tool__code {
    padding: var(--space-md);
    font-size: clamp(0.72rem, 2.7vw, 0.82rem);
    line-height: 1.55;
  }
}

@media (max-width: 480px) {
  .article-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  .article-llm-guide .article-body {
    padding-bottom: 7rem;
  }

  .article-cta {
    padding: var(--space-xl);
  }
}

@media (max-width: 640px) {
  body.article-page .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
    padding: 12px 14px;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
    transform: translateY(calc(100% + 20px));
  }
  body.article-page .cookie-banner--visible {
    transform: translateY(0);
  }
  body.article-page .cookie-banner__text {
    font-size: 0.7rem;
    line-height: 1.35;
  }
  body.article-page .cookie-banner__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.article-page .cookie-banner .btn {
    min-height: 40px;
    padding-inline: 10px;
  }
}

/* ============ TECH AUDIT ARTICLE ============ */
.article-tech-audit .article-header {
  position: relative;
  overflow: clip;
}

.article-tech-audit .article-header::before {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: min(42vw, 480px);
  aspect-ratio: 1;
  border-radius: var(--radius-circle);
  background:
    radial-gradient(circle, oklch(77.8% 0.145 169.7 / 0.2), oklch(77.8% 0.145 169.7 / 0.04) 45%, transparent 72%);
  filter: blur(8px);
  pointer-events: none;
}

.article-tech-audit .article-tldr {
  background:
    linear-gradient(135deg, oklch(77.8% 0.145 169.7 / 0.14), oklch(64.4% 0.105 45.1 / 0.1)),
    var(--bg-surface);
}

.audit-radar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.audit-radar__card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, oklch(100.0% 0 0 / 0.01), transparent),
    var(--bg-surface);
}

.audit-radar__card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-green), oklch(64.4% 0.105 45.1 / 0.9));
}

.audit-radar__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding: 4px var(--space-md);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-radar__value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.audit-radar__card p {
  margin-bottom: 0;
  font-size: var(--text-sm);
}

.signal-strip {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.signal-strip__item {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, oklch(77.8% 0.145 169.7 / 0.08), transparent 22%),
    var(--bg-surface);
}

.signal-strip__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-green);
}

.signal-strip__item p {
  margin-bottom: 0;
  font-size: var(--text-sm);
}

.audit-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.audit-check {
  position: relative;
  min-height: 100%;
  padding: var(--space-xl);
  padding-left: calc(var(--space-xl) + 18px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.audit-check::before {
  content: "";
  position: absolute;
  left: var(--space-lg);
  top: var(--space-xl);
  width: 8px;
  height: calc(100% - var(--space-xl) * 2);
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--accent-green), oklch(64.4% 0.105 45.1 / 0.45));
}

.audit-check__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  margin-bottom: var(--space-sm);
}

.audit-check p {
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
}

.audit-check ul {
  margin-bottom: 0;
  padding-left: var(--space-lg);
  font-size: var(--text-sm);
}

.priority-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.priority-quadrant {
  min-height: 250px;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.priority-quadrant--critical {
  background:
    linear-gradient(180deg, oklch(77.8% 0.145 169.7 / 0.12), oklch(77.8% 0.145 169.7 / 0.03)),
    var(--bg-surface);
  border-color: var(--accent-green-dim);
}

.priority-quadrant--strategic {
  background:
    linear-gradient(180deg, oklch(64.4% 0.105 45.1 / 0.14), oklch(64.4% 0.105 45.1 / 0.03)),
    var(--bg-surface);
  border-color: var(--accent-terra-dim);
}

.priority-quadrant__label {
  display: inline-flex;
  margin-bottom: var(--space-md);
  padding: 4px var(--space-md);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.priority-quadrant h3 {
  margin-bottom: var(--space-sm);
}

.priority-quadrant p {
  font-size: var(--text-sm);
}

.priority-quadrant ul {
  margin-bottom: 0;
  padding-left: var(--space-lg);
  font-size: var(--text-sm);
}

.priority-quadrant li:last-child {
  margin-bottom: 0;
}

.audit-summary-band {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.audit-summary-band span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

@media (max-width: 820px) {
  .signal-strip__item,
  .priority-matrix {
    grid-template-columns: 1fr;
  }
}

.article-tech-audit .score-card__label,
.article-tech-audit .audit-check__title,
.article-tech-audit .priority-quadrant h3 {
  letter-spacing: -0.02em;
}

.article-tech-audit .audit-check__title,
.article-tech-audit .priority-quadrant h3 {
  font-size: clamp(1rem, 1.25vw, 1.12rem);
}

/* ============ TECH CANVAS BLOCKS ============ */
.canvas-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-2xl);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid oklch(100.0% 0 0 / 0.06);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, oklch(100.0% 0 0 / 0.02), oklch(100.0% 0 0 / 0)),
    var(--bg-surface);
  box-shadow: inset 0 1px 0 oklch(100.0% 0 0 / 0.03);
}

.canvas-panel > * {
  position: relative;
  z-index: 1;
}

.canvas-panel__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.article-body .canvas-panel__title {
  margin-top: 0;
  margin-bottom: 0.6rem;
  padding-top: 0;
  border-top: none;
}

.canvas-panel__desc {
  max-width: 62ch;
  margin-bottom: 1.1rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.growth-fall-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

.growth-fall-column {
  padding: var(--space-md);
  border: 1px solid oklch(100.0% 0 0 / 0.06);
  border-radius: var(--radius-lg);
  background: oklch(14.8% 0.013 284.7 / 0.34);
}

.growth-fall-column--growth {
  background: linear-gradient(180deg, oklch(77.8% 0.145 169.7 / 0.09), oklch(77.8% 0.145 169.7 / 0.02));
}

.growth-fall-column--fall {
  background: linear-gradient(180deg, oklch(64.4% 0.105 45.1 / 0.11), oklch(64.4% 0.105 45.1 / 0.02));
}

.growth-fall-column__title {
  margin-bottom: 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  letter-spacing: -0.02em;
}

.canvas-list {
  display: grid;
  gap: var(--space-sm);
}

.canvas-list__item {
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid oklch(100.0% 0 0 / 0.05);
  background: oklch(100.0% 0 0 / 0.018);
}

.canvas-list__item strong {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm);
}

.canvas-list__item span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.flow-canvas {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  align-items: center;
}

.flow-canvas__node {
  flex: 0 0 150px;
  width: 150px;
  min-height: 110px;
  padding: 0.9rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid oklch(100.0% 0 0 / 0.05);
  background:
    linear-gradient(180deg, oklch(100.0% 0 0 / 0.028), oklch(100.0% 0 0 / 0.012)),
    oklch(100.0% 0 0 / 0.015);
}

.flow-canvas__node strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.flow-canvas__node span {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.flow-canvas__arrow {
  position: relative;
  flex: 0 0 26px;
  width: 26px;
  min-width: 26px;
  height: 110px;
  font-size: 0;
  color: transparent;
  align-self: center;
}

.flow-canvas__arrow::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 8px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, oklch(77.8% 0.145 169.7 / 0.25), oklch(77.8% 0.145 169.7 / 0.8));
  transform: translateY(-50%);
}

.flow-canvas__arrow::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid oklch(77.8% 0.145 169.7 / 0.85);
  border-right: 1.5px solid oklch(77.8% 0.145 169.7 / 0.85);
  transform: translateY(-50%) rotate(45deg);
}

.split-canvas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

.split-canvas__side {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(100.0% 0 0 / 0.05);
  background: oklch(100.0% 0 0 / 0.018);
}

.split-canvas__side--bot {
  box-shadow: inset 0 0 0 1px oklch(64.4% 0.105 45.1 / 0.12);
}

.split-canvas__side--user {
  box-shadow: inset 0 0 0 1px oklch(77.8% 0.145 169.7 / 0.12);
}

.split-canvas__title {
  margin-bottom: var(--space-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.split-canvas__stack {
  display: grid;
  gap: var(--space-sm);
}

.split-canvas__stack div {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: oklch(100.0% 0 0 / 0.024);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.debt-canvas {
  display: grid;
  gap: 10px;
}

.debt-canvas__layer {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(100.0% 0 0 / 0.05);
  background: oklch(100.0% 0 0 / 0.018);
}

.debt-canvas__layer strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.debt-canvas__layer span {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.dashboard-canvas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.dashboard-canvas__item {
  min-height: 136px;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(100.0% 0 0 / 0.05);
  background: oklch(100.0% 0 0 / 0.018);
}

.dashboard-canvas__item strong {
  display: block;
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.dashboard-canvas__item p {
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
}

.dashboard-canvas__item span {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.master-checklist {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.master-checklist__group {
  padding: clamp(1rem, 2vw, 1.4rem);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(100.0% 0 0 / 0.06);
  background:
    linear-gradient(180deg, oklch(100.0% 0 0 / 0.02), oklch(100.0% 0 0 / 0)),
    var(--bg-surface);
}

.master-checklist__title {
  margin-bottom: 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  letter-spacing: -0.02em;
}

.master-checklist__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.master-checklist__list li {
  position: relative;
  margin: 0;
  padding-left: 2rem;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.master-checklist__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32rem;
  width: 1rem;
  height: 1rem;
  border-radius: var(--space-xs);
  border: 1px solid oklch(77.8% 0.145 169.7 / 0.4);
  background: oklch(77.8% 0.145 169.7 / 0.08);
  box-shadow: inset 0 0 0 2px oklch(11.7% 0.009 284.9 / 0.9);
}

@media (max-width: 900px) {
  .growth-fall-grid,
  .split-canvas,
  .dashboard-canvas {
    grid-template-columns: 1fr;
  }

  .flow-canvas {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .flow-canvas__node {
    width: 100%;
    max-width: none;
    flex: none;
    min-height: 0;
    padding: 0.95rem 1rem;
  }

  .flow-canvas__arrow {
    display: none;
  }

  .debt-canvas__layer {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
}

/* ============ ARTICLE STATS ============ */
.article-stats {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-left: auto;  /* push to right end of .article-meta flex row */
}

.article-stats__views {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-stats__views svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.article-stats__like-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  /* по горизонтали кнопка была 28px — палец мимо */
  min-width: 44px;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.article-stats__like-btn:hover,
.article-stats__like-btn--liked {
  color: var(--accent-terra);
}

.article-stats__like-btn svg {
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.article-stats__like-btn:hover svg,
.article-stats__like-btn--liked svg {
  transform: scale(1.2);
}

.article-stats__like-btn:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .article-stats__like-btn,
  .article-stats__like-btn svg { transition: none; }
}

/* ============ STICKY TOC SIDEBAR (desktop ≥ 1300px) ============
   JS wraps everything after .article-header in .article-below-header
   (two-column grid) and moves .article-toc into .article-toc-rail
   (right column). TOC is visible from the author card — screen 1.

   Fallback (no JS): article-body stays a grid, TOC in col 2.
   ================================================================ */
@media (min-width: 1300px) {
  /* Remove gutter so all container--narrow blocks show 800px of content */
  .container--narrow {
    padding-inline: 0;
  }

  /* ── JS-activated layout ── */
  .article-below-header {
    display: grid;
    grid-template-columns: 800px minmax(0, 335px);
    column-gap: var(--space-2xl);
    justify-content: center;
  }

  .article-below-header__content { min-width: 0; }

  /* article-body reverts to normal flow once TOC is in the rail */
  .article-body.article-body--sidebar {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Sticky TOC rail — right column of .article-below-header */
  .article-toc-rail {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    padding-top: var(--space-xl);
  }

  /* ── Fallback: article-body grid (no JS) ── */
  .article-body:not(.article-body--sidebar) {
    display: grid;
    grid-template-columns: 800px minmax(0, 335px);
    column-gap: var(--space-2xl);
    max-width: none;
    justify-content: center;
    align-items: start;
  }

  .article-body:not(.article-body--sidebar) > *:not(.article-toc) {
    grid-column: 1;
    min-width: 0;
  }

  .article-body:not(.article-body--sidebar) > .article-toc {
    grid-column: 2;
    grid-row: 1 / 9999;
    align-self: start;
    position: sticky;
    top: 80px;
  }

  /* ── TOC styles (shared: sidebar rail + fallback) ── */
  .article-toc {
    padding: var(--space-md);
    margin-bottom: 0;
  }

  .article-toc .article-toc__title {
    font-size: 10px;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
  }

  .article-toc .article-toc__list li {
    margin-bottom: 2px;
    padding-left: var(--space-md);
  }

  .article-toc .article-toc__list li::before { font-size: 10px; }

  .article-toc .article-toc__list a {
    font-size: var(--text-xs);
    line-height: 1.45;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 3px 4px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
  }

  .article-toc .article-toc__list a.toc-active {
    color: var(--accent-green);
    background: var(--accent-green-glow);
  }
}

/* ============ ARTICLE: kak-ii-vidit-brend (.article-ai-brand) ============ */
/* 3 равные колонки вместо 2+1 c дырой; score-grid — симметричные 2x2 */
@media (min-width: 720px) {
  .article-ai-brand .levers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* 3 phase-card: 2 сверху + третья на всю ширину, без дыры */
  .article-ai-brand .phases-grid .phase-card:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }
  .article-ai-brand .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Таблицы статьи узкие (2-3 колонки) — вписывать в контейнер вместо скролла */
  .article-ai-brand .article-table {
    width: 100%;
  }
}
/* Приоритет-бейдж под текстом симптома в диагностической таблице */
.article-ai-brand .article-table td .priority {
  display: inline-flex;
  margin-top: var(--space-xs);
}


/* ======== Тепловая карта сходства (статья про 18 нейросетей) ======== */
.heatmap {
  font-family: var(--font-mono);
  border-collapse: collapse;
}

.heatmap th {
  color: var(--text-muted);
  font-weight: 500;
}

.heatmap td,
.heatmap th {
  border-color: #1c1c1f;
}

/* подписи строк не уезжают при горизонтальном скролле */
.heatmap tbody th,
.heatmap thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-surface);
}

.heatmap thead th:first-child {
  z-index: 2;
}

/* контраст подписей на цветных ячейках: WCAG AA */
.heatmap td {
  box-shadow: inset 0 0 0 100vmax rgb(0 0 0 / 0.25);
}

/* ======== Тач-таргеты на мобильном (44px) ======== */
@media (max-width: 768px) {
  .article-toc a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .article-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ======== Таблицы статей на мобильном ========
   Идёт после правила .article-table th/td { min-width: clamp(132px, 36vw, 220px) }
   и перебивает его при равной специфичности. */
@media (max-width: 768px) {
  /* Узкие таблицы вписываются в экран вместо свайпа ради одной колонки */
  .article-table:not(.heatmap) {
    width: 100%;
  }

  .article-table:not(.heatmap) th,
  .article-table:not(.heatmap) td {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Тепловая карта: 18 колонок при min-width 132px растягиваются на 2667px —
     восемь экранов свайпа. Компактная ячейка возвращает виду матрицы. */
  .heatmap th,
  .heatmap td {
    min-width: 42px;
  }

  .heatmap tbody th,
  .heatmap thead th:first-child {
    min-width: 72px;
  }
}
