/* Главная и блог helpmedoctor.ru — статичные страницы, без JS */
:root {
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-2: #eef4f3;
  --text: #0f1f1d;
  --muted: #56706c;
  --border: #dbe6e4;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #d8f0ed;
  --accent-contrast: #ffffff;
  --warn: #b45309;
  --shadow: 0 1px 2px rgba(15, 31, 29, .06), 0 8px 24px rgba(15, 31, 29, .06);
  --shadow-lg: 0 24px 60px rgba(15, 61, 55, .18);
  --radius: 18px;
  --maxw: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1413;
    --surface: #111d1c;
    --surface-2: #162624;
    --text: #e6f1ef;
    --muted: #93aca8;
    --border: #22403c;
    --accent: #2dd4bf;
    --accent-2: #5eead4;
    --accent-soft: #123b37;
    --accent-contrast: #062a26;
    --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 8px 20px rgba(15, 118, 110, .28); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn svg { width: 20px; height: 20px; }

/* Шапка */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; font-size: 18px; letter-spacing: -.01em; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.brand-logo svg { width: 22px; height: 22px; stroke: #fff; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--text); }
.top .btn { min-height: 40px; padding: 0 16px; font-size: 15px; }
@media (max-width: 860px) { .nav { display: none; } .top .btn { margin-left: auto; } }

/* Первый экран */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto 35%; height: 780px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 70%);
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; margin-bottom: 18px; }
.hero .lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 36em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.hero-note { font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero-note span::before { content: "✓ "; color: var(--accent); font-weight: 800; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .hero { padding-top: 32px; } }

/* Макет телефона */
.phone {
  justify-self: center; width: min(360px, 100%); border-radius: 38px; padding: 12px;
  background: linear-gradient(160deg, #1f2d2b, #0b1413); box-shadow: var(--shadow-lg);
}
.screen { border-radius: 28px; overflow: hidden; background: #eef3f1; color: #0f1f1d; font-size: 14px; line-height: 1.4; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; border-bottom: 1px solid #dfe8e6; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #d8f0ed; color: #0f766e; display: grid; place-items: center; font-weight: 800; }
.chat-head b { display: block; font-size: 15px; }
.chat-head small { color: #56706c; }
.chat { padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 84%; padding: 9px 12px; border-radius: 16px; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); }
.msg.pat { background: #fff; border-bottom-left-radius: 6px; }
.msg.doc { background: #0f766e; color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.card-mini { background: #fff; border-radius: 14px; padding: 10px 12px; border: 1px solid #dfe8e6; }
.card-mini .t { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #56706c; font-weight: 700; }
.score { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; border-radius: 14px; padding: 12px 14px; }
.score b { font-size: 22px; }

/* Секции */
section { padding: 72px 0; scroll-margin-top: 64px; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 18px; }
.alt { background: var(--surface-2); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 14px; }
.step p { color: var(--muted); margin: 0; font-size: 16px; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ico svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature p { color: var(--muted); margin: 0; font-size: 16px; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }

.audience { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.aud { border-radius: var(--radius); padding: 26px; background: var(--surface); border: 1px solid var(--border); }
.aud .emoji { font-size: 32px; margin-bottom: 8px; }
.aud ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) { .audience { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 9px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 15px; }

.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; display: flex; flex-direction: column; }
.plan.best { border: 2px solid var(--accent); box-shadow: var(--shadow); position: relative; }
.plan.best::before { content: "Выгодно"; position: absolute; top: -12px; left: 20px; background: var(--accent); color: var(--accent-contrast); font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.plan .name { font-weight: 700; color: var(--muted); }
.plan .price { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0; }
.plan .price small { font-size: 16px; font-weight: 600; color: var(--muted); }
.plan p { color: var(--muted); font-size: 15px; margin: 0; }
.pay-note { margin-top: 16px; color: var(--muted); font-size: 15px; }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .plans { grid-template-columns: repeat(2, 1fr); } }

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; color: var(--text); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; overflow: hidden; }
.post-card .post-cover { display: block; width: calc(100% + 44px); max-width: none; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; margin: -22px -22px 18px; border-bottom: 1px solid var(--border); }
.post-card .post-body { display: flex; flex-direction: column; flex: 1; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-card h3 { font-size: 19px; }
.post-card p { color: var(--muted); font-size: 15px; margin: 0 0 14px; flex: 1; }
.post-card .meta { font-size: 14px; color: var(--accent); font-weight: 700; }
@media (max-width: 960px) { .posts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .posts { grid-template-columns: 1fr; } }

.faq { max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); }

.final { text-align: center; }
.final .box { background: linear-gradient(135deg, #0f766e, #0d9488 55%, #14b8a6); color: #fff; border-radius: 28px; padding: 56px 24px; box-shadow: var(--shadow-lg); }
.final h2 { color: #fff; }
.final p { color: rgba(255, 255, 255, .88); font-size: 18px; max-width: 34em; margin: 0 auto 24px; }
.final .btn-primary { background: #fff; color: #0f766e; box-shadow: none; }
.final .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.final .cta { justify-content: center; }

/* Подвал */
footer { padding: 40px 0 56px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
footer a { color: var(--muted); }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }

/* Блог */
.page-head { padding: 48px 0 24px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.article { max-width: 760px; margin: 0 auto; padding: 0 20px 40px; }
.article h1 { font-size: clamp(30px, 4.4vw, 44px); }
.article .meta { color: var(--muted); font-size: 15px; margin-bottom: 28px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.article .lead { font-size: 20px; color: var(--text); }
.article h2 { font-size: 27px; margin-top: 1.6em; }
.article h3 { margin-top: 1.2em; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article .note { background: var(--accent-soft); border-radius: 14px; padding: 14px 18px; font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.tags li { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin: 0; }
.cta-box { margin: 40px 0 0; padding: 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.cta-box h2 { font-size: 24px; margin: 0 0 8px; }
.cta-box p { color: var(--muted); }
.related { max-width: 760px; margin: 0 auto; padding: 0 20px 72px; }
.related .posts { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .related .posts { grid-template-columns: 1fr; } }

.notfound { text-align: center; padding: 96px 20px; }

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

/* ---------- Обложка статьи ---------- */
.article-cover { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: var(--radius); margin: 0 0 28px; box-shadow: var(--shadow); }

/* ---------- Схемы внутри статей ---------- */
.fig { margin: 28px 0; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.fig figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }
.fig b { display: block; font-size: 15px; line-height: 1.3; }
.fig span { font-size: 14px; color: var(--muted); line-height: 1.35; }
/* Шаги */
.fig-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: none; }
.fig-steps.three { grid-template-columns: repeat(3, 1fr); }
.fig-steps.four { grid-template-columns: repeat(4, 1fr); }
.fig-steps li { position: relative; margin: 0; padding: 14px 14px 14px 52px; background: var(--surface-2); border-radius: 14px; min-height: 64px; display: flex; flex-direction: column; justify-content: center; }
.fig-steps .n { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-weight: 800; font-size: 15px; display: grid; place-items: center; }
.fig-steps.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 800; z-index: 1; }
.fig-steps.flow:not(.three):not(.four) li:nth-child(3n)::after { content: none; }
@media (max-width: 640px) {
  .fig-steps, .fig-steps.three, .fig-steps.four { grid-template-columns: 1fr; }
  .fig-steps.flow li::after { content: none !important; }
}
.fig-rails { display: grid; gap: 8px; margin-top: 12px; }
.fig-rails span { display: block; text-align: center; padding: 10px; border-radius: 12px; border: 1.5px dashed var(--accent); color: var(--accent); font-weight: 700; font-size: 14px; }
/* Плитки с буквами */
.fig-grid { display: grid; gap: 12px; }
.fig-grid.six { grid-template-columns: repeat(3, 1fr); }
.fig-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .fig-grid.six { grid-template-columns: repeat(2, 1fr); } .fig-grid.three { grid-template-columns: 1fr; } }
.fig-tile { padding: 14px; background: var(--surface-2); border-radius: 14px; display: flex; flex-direction: column; gap: 2px; }
.fig-tile .big { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 4px; }
/* Воронка */
.fig-funnel { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fig-funnel .lvl { width: calc(100% - var(--i) * 12%); padding: 12px 16px; border-radius: 12px; text-align: center; color: var(--text);
  background: color-mix(in srgb, var(--accent) calc(12% + var(--i) * 10%), var(--surface)); }
.fig-funnel .lvl:last-child { color: var(--accent-contrast); background: var(--accent); }
.fig-funnel .lvl:last-child span { color: inherit; opacity: .85; }
@media (max-width: 640px) { .fig-funnel .lvl { width: calc(100% - var(--i) * 6%); } }
/* Колонки */
.fig-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fig-split.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .fig-split, .fig-split.three { grid-template-columns: 1fr; } }
.fig-split .col { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.fig-split .col.danger { background: color-mix(in srgb, #dc2626 12%, var(--surface)); }
.fig-split .col.calm { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.fig-split h4 { margin: 0 0 6px; font-size: 16px; }
.fig-split .k { margin: 0 0 6px; font-weight: 700; color: var(--accent); font-size: 15px; }
.fig-split ul { margin: 0; padding-left: 18px; font-size: 15px; }
.fig-split li { margin-bottom: 3px; }
.fig-foot { grid-column: 1 / -1; font-size: 14px; color: var(--muted); padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--border); }
/* Полосы диапазонов */
.fig-bars { display: flex; flex-direction: column; gap: 10px; }
.fig-bars .bar { display: grid; grid-template-columns: 110px 1fr 76px; gap: 10px; align-items: center; }
.fig-bars .name { color: var(--text); font-weight: 600; }
.fig-bars .track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); }
.fig-bars .track i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); min-width: 4px; }
.fig-bars .v { text-align: right; font-variant-numeric: tabular-nums; }
/* Таймлайн */
.fig-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .fig-timeline { grid-template-columns: 1fr; } }
.fig-timeline .tl { padding: 14px; border-radius: 14px; background: var(--surface-2); border-top: 4px solid var(--accent); }
.fig-timeline .tl b { color: var(--accent); margin-bottom: 4px; }
