:root {
  --bg: #0f1923;
  --bg-card: #162231;
  --bg-input: #1a2b3d;
  --accent: #00d4aa;
  --accent-hover: #00e8bb;
  --accent-glow: rgba(0, 212, 170, 0.15);
  --text: #e4e8ec;
  --text-dim: #8899aa;
  --border: #243447;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(22, 34, 49, 0.92);
}
.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.topbar-logo {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-logo span.accent { color: var(--accent); }
.topbar-nav {
  display: flex;
  gap: 18px;
  font-size: 15px;
}
.topbar-nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.topbar-nav a:hover, .topbar-nav a.active {
  color: var(--accent);
}

.crumbs {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 16px;
}
.crumbs a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
}
.crumbs a:hover { color: var(--accent); border-color: var(--accent); }

h1 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 14px;
  color: var(--text);
}
@media (max-width: 600px) {
  h1 { font-size: 26px; }
}

.article-meta {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.article-meta .tag {
  background: var(--bg-input);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--accent);
}

.lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 28px;
  padding: 16px 18px;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
@media (max-width: 600px) {
  .lead { font-size: 17px; }
}

article h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 14px;
  color: var(--text);
  padding-top: 8px;
}
article h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text);
}
article p { margin: 0 0 18px; }

article ul, article ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
article li { margin-bottom: 8px; }

article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 212, 170, 0.4);
  text-underline-offset: 3px;
}
article a:hover { color: var(--accent-hover); text-decoration-color: var(--accent-hover); }

article strong { color: var(--text); font-weight: 700; }
article em { color: var(--text); font-style: italic; }

article blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--bg-input);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: 6px;
  font-style: italic;
}
article blockquote cite {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-style: normal;
  color: var(--text-dim);
}

article code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--accent);
}

.callout {
  margin: 24px 0;
  padding: 16px 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.callout-warn {
  border-left: 3px solid #f59e0b;
}
.callout-ok {
  border-left: 3px solid var(--success);
}
.callout-info {
  border-left: 3px solid var(--accent);
}
.callout strong { display: block; margin-bottom: 4px; }

.cta-block {
  margin: 40px 0 0;
  padding: 28px 22px;
  background: linear-gradient(135deg, rgba(0,212,170,0.15), rgba(0,212,170,0.03));
  border: 2px dashed var(--accent);
  border-radius: 16px;
  text-align: center;
}
.cta-block h3 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--accent);
}
.cta-block p {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 15px;
}
.cta-block .btn {
  display: inline-block;
  padding: 14px 28px;
  background: var(--accent);
  color: #0f1923;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  font-size: 16px;
  transition: background 0.2s;
}
.cta-block .btn:hover { background: var(--accent-hover); }

.related {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.related h2 { margin-top: 0; font-size: 20px; }
.related-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.related-list a {
  display: block;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}
.related-list a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.related-list a .title {
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.related-list a .desc {
  font-size: 14px;
  color: var(--text-dim);
}

/* Blog index */
.hero-title {
  text-align: center;
  margin-bottom: 50px;
}
.hero-title h1 { margin-bottom: 10px; }
.hero-title p { color: var(--text-dim); font-size: 17px; }

.articles-grid {
  display: grid;
  gap: 18px;
}
.article-card {
  display: block;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}
.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.article-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text);
}
.article-card .card-desc {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 10px;
}
.article-card .card-meta {
  font-size: 13px;
  color: var(--accent);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

footer.site-footer {
  margin-top: 80px;
  padding: 30px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  border-top: 1px solid var(--border);
}
footer.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
  margin: 0 8px;
}
footer.site-footer a:hover { color: var(--accent); }

table.compat {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
table.compat th, table.compat td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
table.compat th {
  background: var(--bg-input);
  color: var(--accent);
  font-weight: 600;
}
table.compat td { color: var(--text); }

/* ==================== V2 ADDITIONS — VISUAL ANCHORS ==================== */

/* TL;DR box — bright summary at top of each article */
.tldr {
  margin: 0 0 32px;
  padding: 20px 22px 22px;
  background: linear-gradient(135deg, rgba(0,212,170,0.18), rgba(0,212,170,0.05));
  border: 2px solid var(--accent);
  border-radius: 16px;
  position: relative;
}
.tldr::before {
  content: "⚡ КОРОТКО";
  position: absolute;
  top: -12px;
  left: 16px;
  background: var(--accent);
  color: #0f1923;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.tldr h3 {
  margin: 0 0 8px;
  font-size: 19px;
  color: var(--accent);
  font-weight: 700;
}
.tldr p {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}
.tldr strong { color: var(--accent); }

/* Table of Contents with jump links */
.toc {
  margin: 0 0 36px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.toc-title {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toc ol {
  margin: 0;
  padding-left: 22px;
  counter-reset: toc;
  list-style: none;
}
.toc ol li {
  counter-increment: toc;
  margin-bottom: 6px;
  position: relative;
}
.toc ol li::before {
  content: counter(toc);
  position: absolute;
  left: -22px;
  top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  width: 18px;
  text-align: right;
}
.toc a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.toc a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Critical step — MUST DO box (big, noticeable) */
.critical-step {
  margin: 28px 0;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.03));
  border: 2px solid #f59e0b;
  border-radius: 14px;
  position: relative;
}
.critical-step::before {
  content: "❗ ВАЖНО — НЕ ПРОПУСТИТЕ";
  position: absolute;
  top: -12px;
  left: 20px;
  background: #f59e0b;
  color: #0f1923;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.critical-step h3 {
  margin: 4px 0 10px;
  color: #f59e0b;
  font-size: 20px;
}
.critical-step p { margin-bottom: 12px; }
.critical-step p:last-child { margin-bottom: 0; }

/* Numbered step cards (big badges) */
.step-big {
  display: flex;
  gap: 16px;
  margin: 16px 0;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.step-big:hover { border-color: var(--accent); }
.step-big__num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #0f1923;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}
.step-big__body { flex: 1; }
.step-big__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.step-big__desc {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}
.step-big__desc strong { color: var(--text); }
.step-big__desc a { color: var(--accent); }

/* Inline highlighter — yellow background for key phrases */
.hl {
  background-color: rgba(245,158,11,0.45);
  background-image: linear-gradient(180deg, transparent 45%, rgba(245,158,11,0.55) 45%);
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 700;
  color: var(--text);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Section anchor smooth scroll + offset (topbar sticky) */
html { scroll-behavior: smooth; }
article h2 { scroll-margin-top: 80px; }

/* Sticky CTA — compact widget on desktop, wide bar on mobile */
.sticky-cta-bar {
  position: fixed;
  bottom: 24px;
  right: max(16px, calc((100vw - 760px) / 2 - 240px));
  z-index: 90;
  padding: 13px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 210px;
  backdrop-filter: blur(10px);
}
.sticky-cta-bar__label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2px;
  line-height: 1.3;
}
.sticky-cta-bar a {
  padding: 10px 12px;
  border-radius: 9px;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
}
.sticky-cta-bar a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.sticky-cta-bar a:active { transform: scale(0.97); }
.sticky-cta-bar a .ico { font-size: 16px; line-height: 1; }
.sticky-cta-bar a.tg { background: #229ED9; color: #fff; }
.sticky-cta-bar a.vk { background: #4a76a8; color: #fff; }
.sticky-cta-bar a.web { background: var(--accent); color: #0f1923; }

@media (max-width: 720px) {
  .sticky-cta-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    bottom: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
    padding: 8px;
    box-sizing: border-box;
  }
  .sticky-cta-bar__label {
    grid-column: 1 / -1;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    margin: 0;
  }
  .sticky-cta-bar a {
    padding: 9px 4px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    text-overflow: ellipsis;
  }
  .sticky-cta-bar a .ico { font-size: 16px; }
  body { padding-bottom: 100px; }
}

/* On very small phones (<360px) — hide icons, keep only text */
@media (max-width: 359px) {
  .sticky-cta-bar a .ico { display: none; }
  .sticky-cta-bar a { flex-direction: row; }
}

/* Reading progress bar at top */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 200;
  transition: width 0.15s ease-out;
}

/* Bigger article title with gradient accent underline */
article > h1 {
  position: relative;
  padding-bottom: 14px;
}
article > h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

/* Emphasized paragraph — pull-quote style */
.pull {
  margin: 28px -10px;
  padding: 22px 26px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}
@media (max-width: 600px) {
  .pull { margin: 24px 0; font-size: 17px; padding: 18px 20px; }
}

/* Long/short labels — switch by screen size */
.sticky-cta-bar .lbl-short { display: none; }
@media (max-width: 480px) {
  .sticky-cta-bar .lbl-long { display: none; }
  .sticky-cta-bar .lbl-short { display: inline; }
}

/* Topbar CTA button — always visible */
.topbar-nav a.topbar-cta {
  padding: 7px 14px;
  background: var(--accent);
  color: #0f1923 !important;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.topbar-nav a.topbar-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,212,170,0.4);
}
@media (max-width: 520px) {
  .topbar-nav { gap: 12px; font-size: 14px; }
  .topbar-nav a.topbar-cta { padding: 6px 10px; font-size: 11px; }
}

/* TL;DR action buttons — inline CTA after short summary */
.tldr-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(0,212,170,0.35);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tldr-actions__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}
.tldr-btn {
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.tldr-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tldr-btn--site { background: var(--accent); color: #0f1923 !important; }
.tldr-btn--vk { background: #4a76a8; color: #fff !important; }
.tldr-btn--tg { background: #229ED9; color: #fff !important; }

@media (max-width: 480px) {
  .tldr-actions { gap: 6px; }
  .tldr-actions__label { font-size: 12px; flex-basis: 100%; margin-bottom: 4px; }
  .tldr-btn { flex: 1 1 0; min-width: 0; text-align: center; padding: 9px 6px; font-size: 13px; }
}
