/* SITRA Yandex Max V4: Optimized for Behavioral Factors (ПФ) and Snippets */
:root {
  --brand: #fc0; /* Yandex-ish default accent, overridden by themes */
  --brand-2: #f59e0b;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text-main: #111827;
  --text-muted: #4b5563;
  --border: #e2e8f0;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
  --wrap: 1200px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
img, svg { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* Yandex ПФ: Scroll Progress Bar */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  width: 0%;
  transition: width 0.1s ease-out;
}

.skip-link {
  position: absolute; top: -100px; left: 20px; z-index: 1001;
  background: var(--text-main); color: var(--surface); padding: 8px 16px;
  border-radius: var(--radius-sm); font-weight: bold;
}
.skip-link:focus { top: 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-grid {
  display: flex; justify-content: space-between; align-items: center; height: 100%;
}
.brand-mark {
  display: flex; align-items: center; gap: 12px;
}
.brand-letter {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 900; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text strong { display: block; font-size: 18px; line-height: 1.2; color: var(--text-main); }
.brand-text em { font-style: normal; font-size: 12px; color: var(--text-muted); }

.main-nav { display: flex; gap: 24px; }
.main-nav a { color: var(--text-main); font-weight: 600; font-size: 15px; }
.main-nav a:hover, .main-nav a.active { color: var(--brand); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text-main); margin: 5px 0; transition: 0.3s; }

/* Buttons */
.primary-btn, .header-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff !important; font-weight: 700;
  padding: 12px 24px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); transition: transform 0.2s, box-shadow 0.2s;
}
.primary-btn:hover, .header-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.full-width { width: 100%; }
.pulse-btn { animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb, 245, 158, 11), 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(var(--brand-rgb, 245, 158, 11), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb, 245, 158, 11), 0); }
}

/* Layout */
.layout-sidebar {
  display: grid; grid-template-columns: 1fr 340px; gap: 40px;
  padding: 40px 20px; align-items: start;
}

/* Main Content */
.content-col { min-width: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 24px; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); font-weight: 500; }

.hero-article { background: var(--surface); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }

.meta-tags { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; font-size: 13px; color: var(--text-muted); align-items: center; }
.tag { background: var(--surface-alt); padding: 4px 10px; border-radius: 20px; font-weight: 600; color: var(--brand); border: 1px solid var(--border); }
.update-date, .read-time { display: flex; align-items: center; gap: 6px; }

h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 20px; padding-bottom: 12px; border-bottom: 2px solid var(--surface-alt); }
h3 { font-size: 20px; margin: 0 0 16px; }

.lead-text { font-size: 18px; color: var(--text-muted); margin-bottom: 32px; }

/* TOC - Yandex Snippet Links */
.toc-block { background: var(--surface-alt); border-radius: var(--radius-md); padding: 24px; margin: 40px 0; border: 1px solid var(--border); }
.toc-title { font-weight: 700; margin: 0 0 16px; font-size: 16px; }
.toc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.toc-list a { color: var(--text-main); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.toc-list a::before { content: "→"; color: var(--brand); }
.toc-list a:hover { color: var(--brand); padding-left: 4px; }
.toc-list a { transition: all 0.2s; }

.content-section { margin-top: 56px; }
.text-block p { margin: 0 0 16px; }
.text-block ul, .text-block ol { margin: 0 0 20px; padding-left: 24px; }
.text-block li { margin-bottom: 8px; }

/* Trust Box */
.trust-box { display: flex; gap: 20px; background: rgba(16, 185, 129, 0.05); border: 1px solid rgba(16, 185, 129, 0.2); border-radius: var(--radius-md); padding: 24px; margin-top: 32px; }
.trust-icon { font-size: 32px; line-height: 1; }
.trust-content strong { display: block; color: #065f46; margin-bottom: 8px; font-size: 18px; }

/* Intent Cards */
.intent-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 24px; }
.intent-cards article { background: var(--surface-alt); border: 1px solid var(--border); padding: 20px; border-radius: var(--radius-md); }
.intent-cards span { display: inline-block; color: var(--brand); font-weight: 700; font-size: 12px; text-transform: uppercase; margin-bottom: 12px; }

/* Steps */
.interactive-steps { margin-top: 48px; }
.steps-grid { display: grid; gap: 16px; counter-reset: step-counter; margin-top: 24px; }
.step-card { position: relative; padding: 20px 20px 20px 60px; background: var(--surface-alt); border-radius: var(--radius-md); border: 1px solid var(--border); }
.step-card::before { counter-increment: step-counter; content: counter(step-counter); position: absolute; left: 20px; top: 20px; width: 28px; height: 28px; background: var(--brand); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; }

/* Bonus & Warning */
.bonus-cards { display: grid; gap: 16px; margin: 24px 0; }
.bonus-cards > div { padding: 20px; border: 2px dashed var(--brand); border-radius: var(--radius-md); background: rgba(var(--brand-rgb, 245, 158, 11), 0.05); }
.warning-banner { background: #fffbeb; border-left: 4px solid #f59e0b; padding: 16px 20px; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin-top: 24px; }
.warning-banner strong { color: #b45309; display: block; margin-bottom: 4px; }

/* FAQ Accordion */
.faq-accordion { display: grid; gap: 12px; margin-top: 24px; }
.faq-accordion details { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md); }
.faq-accordion summary { padding: 20px; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 40px; }
.faq-accordion summary::-webkit-details-marker { display: none; }
.faq-accordion summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--brand); }
.faq-accordion details[open] summary::after { content: "−"; }
.faq-accordion details[open] summary { border-bottom: 1px solid var(--border); }
.faq-accordion p { padding: 20px; margin: 0; color: var(--text-muted); }

/* Table */
.table-responsive { overflow-x: auto; margin-top: 24px; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-alt); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Sidebar */
.sticky-sidebar { position: sticky; top: calc(var(--header-h) + 40px); display: grid; gap: 24px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.action-widget { text-align: center; background: linear-gradient(180deg, var(--surface), var(--surface-alt)); }
.widget-badge { display: inline-block; padding: 4px 12px; background: rgba(16, 185, 129, 0.1); color: #059669; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 16px; }
.widget-value { font-size: 28px; font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.action-widget p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.widget-title { font-size: 18px; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.facts-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.facts-list li { display: flex; justify-content: space-between; font-size: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.facts-list li:last-child { border-bottom: none; padding-bottom: 0; }
.facts-list b { color: var(--text-main); text-align: right; }
.facts-list span { color: var(--text-muted); }

.signals-list { display: grid; gap: 16px; }
.signal-card { background: var(--surface-alt); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.signal-card strong { display: block; font-size: 14px; margin-bottom: 4px; }
.signal-card span { font-size: 13px; color: var(--text-muted); }

/* Footer */
.site-footer { background: #0f172a; color: #94a3b8; padding: 60px 0 40px; margin-top: 80px; }
.footer-content { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; }
.footer-brand strong { color: #fff; font-size: 20px; display: block; margin-bottom: 12px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: #cbd5e1; }
.footer-disclaimer { grid-column: 1 / -1; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; }

@media (max-width: 1024px) {
  .layout-sidebar { grid-template-columns: 1fr; }
  .sticky-sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
  .hero-article { padding: 24px; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--surface); padding: 20px; border-bottom: 1px solid var(--border); flex-direction: column; box-shadow: var(--shadow-md); }
  .site-header.open .main-nav { display: flex; }
  .header-cta { display: none; }
  .footer-content { grid-template-columns: 1fr; }
}
