/* ═══════════════════════════════════════════════════════════════════════
   База знаний — навигация по патологиям × этапам
   Наследует токены и атомы из ../styles.css
   ═══════════════════════════════════════════════════════════════════════ */

/* ── slim sticky header ─────────────────────────────────────────────── */
.kb-top {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.kb-top .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.kb-top .compact-brand { font-family: var(--font-d); font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.kb-top .compact-brand b { color: var(--accent); }
.kb-nav { display: flex; gap: 4px; margin-left: auto; }
.kb-nav a { font-family: var(--font-b); font-size: 14px; color: var(--muted); padding: 9px 14px; border-radius: var(--r-sm); white-space: nowrap; transition: color .2s, background .2s; }
.kb-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.kb-nav a.is-current { color: var(--accent); }
.kb-top .btn { height: 44px; padding: 0 22px; font-size: 14px; }
@media (max-width: 760px) { .kb-nav { display: none; } .kb-top .btn { margin-left: auto; } }

/* ── витрина hero ───────────────────────────────────────────────────── */
.kb-hero { padding-block: clamp(34px, 4vw, 56px) clamp(26px,3vw,38px); }
.kb-hero .sec-num { margin-bottom: 16px; }
.kb-hero h1 { font-family: var(--font-d); font-weight: 500; line-height: 1.04; letter-spacing: -.012em; font-size: clamp(38px, 5vw, 64px); margin-bottom: 18px; }
.kb-hero .lead { max-width: 58ch; }

.kb-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: clamp(30px,3.4vw,44px); }
.kb-legend div { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.kb-legend .lg-ix { font-family: var(--font-d); font-style: italic; font-size: 18px; color: var(--accent); }
.kb-legend b { font-family: var(--font-b); font-size: 14px; font-weight: 600; }
.kb-legend span { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
@media (max-width: 760px) { .kb-legend { grid-template-columns: 1fr; gap: 0; } .kb-legend div { padding-block: 16px; } }

/* ── featured pathology (доступно сейчас) ───────────────────────────── */
.kb-feature { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: clamp(24px,3vw,40px); margin-bottom: clamp(34px,4vw,52px); background: var(--bg); }
.kf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: clamp(22px,2.6vw,32px); border-bottom: 1px solid var(--line); margin-bottom: clamp(24px,2.8vw,34px); }
.kf-head .sec-num { margin-bottom: 14px; }
.kf-title { font-family: var(--font-d); font-weight: 500; font-size: clamp(28px,3.2vw,42px); line-height: 1.06; letter-spacing: -.01em; margin-bottom: 10px; }
.kf-sub { font-family: var(--font-b); font-size: 14.5px; color: var(--muted); max-width: 52ch; }
.kf-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px,2.4vw,40px); }
.kf-stage { display: flex; flex-direction: column; }
.kf-stage-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line-strong); margin-bottom: 8px; }
.kf-stage-head:hover h3 { color: var(--accent); }
.kf-ix { font-family: var(--font-d); font-style: italic; font-size: 16px; color: var(--accent); }
.kf-stage-head h3 { font-family: var(--font-d); font-weight: 500; font-size: 19px; line-height: 1.1; transition: color .18s; }
.kf-count { margin-left: auto; font-family: var(--font-b); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--faint); }
.kf-stage ul { list-style: none; display: flex; flex-direction: column; }
.kf-stage li a { display: flex; align-items: center; gap: 12px; font-family: var(--font-b); font-size: 14.5px; line-height: 1.4; color: var(--accent); padding: 10px 0; border-bottom: 1px solid var(--line); transition: padding .18s; }
.kf-stage li a .kf-tt { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 26%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color .18s; }
.kf-stage li a .kf-ar { margin-left: auto; color: var(--faint); font-size: 14px; flex-shrink: 0; transition: transform .18s, color .18s; }
.kf-stage li a:hover { padding-left: 5px; }
.kf-stage li a:hover .kf-tt { text-decoration-color: var(--accent); }
.kf-stage li a:hover .kf-ar { color: var(--accent); transform: translateX(3px); }
.kf-more { font-family: var(--font-b); font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 12px; }
.kf-more:hover { padding-left: 4px; }

/* ── upcoming pathologies — accordion ───────────────────────────────── */
.kb-soon { margin-bottom: clamp(44px,6vw,80px); }
.kb-soon .sec-num { margin-bottom: 12px; }
.kb-soon-intro { font-family: var(--font-b); font-size: 14.5px; color: var(--muted); line-height: 1.55; max-width: 56ch; margin-bottom: clamp(20px,2.4vw,30px); }

/* ── other sections — laconic directory ─────────────────────────────── */
.kb-dir { list-style: none; border-top: 1px solid var(--line-strong); }
.kb-dir li { border-bottom: 1px solid var(--line); }
.kb-dir a { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: clamp(16px,2vw,28px); padding: 19px 4px; transition: padding .2s; }
.kb-dir a:hover { padding-left: 10px; }
.dir-ix { font-family: var(--font-d); font-style: italic; font-size: 15px; color: var(--faint); transition: color .2s; }
.kb-dir a:hover .dir-ix { color: var(--accent); }
.dir-name { font-family: var(--font-d); font-weight: 500; font-size: clamp(19px,1.9vw,23px); line-height: 1.2; color: var(--ink); transition: color .2s; }
.kb-dir a:hover .dir-name { color: var(--accent); }
.dir-sub { grid-column: 2; font-family: var(--font-b); font-size: 13px; color: var(--muted); margin-top: 4px; }
.dir-ar { grid-row: 1 / span 2; align-self: center; font-size: 17px; color: var(--faint); transition: transform .2s, color .2s; }
.kb-dir a:hover .dir-ar { color: var(--accent); transform: translateX(4px); }
@media (max-width: 720px) { .kf-stages { grid-template-columns: 1fr; gap: 24px; } }

/* ── cta band ───────────────────────────────────────────────────────── */
.kb-cta { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: clamp(28px,3.4vw,46px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; background: var(--surface); margin-bottom: clamp(46px,6vw,84px); }
.kb-cta-txt h2 { font-family: var(--font-d); font-weight: 500; font-size: clamp(22px,2.4vw,32px); line-height: 1.14; max-width: 24ch; }
.kb-cta-txt p { font-size: 14.5px; color: var(--muted); margin-top: 10px; max-width: 46ch; }

/* ── hub + article shell ────────────────────────────────────────────── */
.kb-shell { padding-block: clamp(26px,3vw,38px) clamp(60px,8vw,112px); }
.kb-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-family: var(--font-b); font-size: 13px; color: var(--muted); margin-bottom: clamp(28px,3.4vw,44px); }
.kb-breadcrumb a:hover { color: var(--accent); }
.kb-breadcrumb .sep { color: var(--faint); }
.kb-breadcrumb .here { color: var(--ink); }

.kb-layout { display: grid; grid-template-columns: minmax(220px, 256px) 1fr; gap: clamp(32px,5vw,80px); align-items: start; }
.kb-side { position: sticky; top: 96px; display: flex; flex-direction: column; }
.kb-side-label { font-family: var(--font-b); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 22px; margin-bottom: 6px; }
.kb-side-label:first-child { margin-top: 0; }
.kb-side-nav, .kb-side-stages { display: flex; flex-direction: column; }
.kb-side-nav a, .kb-side-stages a { display: flex; align-items: center; font-family: var(--font-b); font-size: 14.5px; color: var(--muted); padding: 9px 0; border-bottom: 1px solid var(--line); transition: color .18s, padding .18s; }
.kb-side-nav a:hover, .kb-side-stages a:hover { color: var(--accent); padding-left: 6px; }
.kb-side-nav a.is-current, .kb-side-stages a.is-active { color: var(--ink); font-weight: 600; }
.kb-side-stages a.is-active { color: var(--accent); }
.kb-side-nav a.is-soon { color: var(--faint); }
.kb-side-nav a.is-soon::after { content: "скоро"; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-left: auto; border: 1px solid var(--line-strong); padding: 1px 7px; border-radius: 999px; }

.kb-main { min-width: 0; }
.kb-pathhead { margin-bottom: clamp(40px,5vw,64px); }
.kb-pathhead .sec-num { margin-bottom: 20px; }
.kb-pathhead h1 { font-family: var(--font-d); font-weight: 500; line-height: 1.04; letter-spacing: -.012em; font-size: clamp(38px,5vw,68px); margin-bottom: 22px; }

.kb-stage { margin-bottom: clamp(44px,5vw,72px); scroll-margin-top: 96px; }
.kb-stage:last-child { margin-bottom: 0; }
.kb-stage-head { display: flex; align-items: baseline; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line-strong); margin-bottom: 6px; flex-wrap: wrap; }
.kb-stage-ix { font-family: var(--font-d); font-style: italic; font-size: 24px; color: var(--accent); }
.kb-stage-head h2 { font-family: var(--font-d); font-weight: 500; font-size: clamp(24px,2.6vw,34px); line-height: 1.12; }
.kb-stage-head .st-count { margin-left: auto; font-family: var(--font-b); font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.kb-stage-head p { font-family: var(--font-b); font-size: 14px; color: var(--muted); flex-basis: 100%; line-height: 1.55; }

.kb-articles { list-style: none; display: flex; flex-direction: column; }
.kb-articles li { border-bottom: 1px solid var(--line); }
.kb-articles a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 19px 4px; transition: padding .2s; }
.kb-articles a:hover { padding-left: 10px; }
.ka-title { font-family: var(--font-d); font-weight: 500; font-size: clamp(18px,1.7vw,22px); line-height: 1.25; }
.kb-articles a:hover .ka-title { color: var(--accent); }
.ka-dek { display: block; font-family: var(--font-b); font-size: 13.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.kb-articles .ar { color: var(--faint); font-size: 18px; transition: transform .2s, color .2s; }
.kb-articles a:hover .ar { color: var(--accent); transform: translateX(4px); }
.kb-articles a[data-soon] .ka-title { color: var(--muted); }
.ka-soon { font-family: var(--font-b); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); border: 1px solid var(--line-strong); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

/* ── article reading column ─────────────────────────────────────────── */
.kb-hub-sections { display: grid; gap: 28px; margin-bottom: 64px; }
.kb-hub-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.kb-hub-list a { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: center; padding: 16px 2px; border-bottom: 1px solid var(--line); transition: padding .2s, color .2s; }
.kb-hub-list a:hover { padding-left: 9px; color: var(--accent); }
.kb-hub-list span { color: var(--faint); font: 600 11px/1.4 var(--font-b); letter-spacing: .05em; text-transform: uppercase; }
.kb-hub-list b { font: 500 15px/1.45 var(--font-b); }
.kb-hub-list i { color: var(--accent); font-style: normal; }
.kb-general { margin-bottom: 64px; }
.kb-general h2 { margin: 12px 0 24px; font: 500 clamp(28px,4vw,44px)/1.1 var(--font-d); }
.kb-article { min-width: 0; max-width: 72ch; }
.art-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--font-b); font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }
.art-meta .tag { color: var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kb-article h1 { font-family: var(--font-d); font-weight: 500; font-size: clamp(32px,4vw,52px); line-height: 1.08; letter-spacing: -.01em; margin-bottom: 26px; }
.art-lead { font-family: var(--font-d); font-size: clamp(18px,1.8vw,23px); font-weight: 400; line-height: 1.5; color: var(--ink); margin-bottom: 34px; }
.kb-article h2 { font-family: var(--font-d); font-weight: 500; font-size: clamp(22px,2.2vw,30px); line-height: 1.2; margin: 42px 0 16px; }
.kb-article h3 { font-family: var(--font-d); font-weight: 500; font-size: 20px; margin: 30px 0 12px; }
.kb-article p { font-size: 16.5px; line-height: 1.76; color: color-mix(in srgb, var(--ink) 88%, var(--muted)); margin-bottom: 18px; }
.kb-article ul, .kb-article ol { margin: 0 0 22px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.kb-article ul li { display: flex; gap: 14px; font-size: 16px; line-height: 1.62; color: color-mix(in srgb, var(--ink) 88%, var(--muted)); }
.kb-article ul li::before { content: ""; width: 18px; height: 1px; background: var(--accent); flex-shrink: 0; margin-top: 12px; }
.kb-article ol { counter-reset: s; }
.kb-article ol li { display: flex; gap: 14px; font-size: 16px; line-height: 1.62; counter-increment: s; color: color-mix(in srgb, var(--ink) 88%, var(--muted)); }
.kb-article ol li::before { content: counter(s); font-family: var(--font-d); font-style: italic; color: var(--accent); flex-shrink: 0; min-width: 18px; }
.kb-callout { border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; padding: 20px 26px; margin: 32px 0; }
.kb-callout .kc-lbl { display: block; font-family: var(--font-b); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.kb-callout p { font-size: 15px; line-height: 1.65; margin: 0; color: var(--muted); }
.kb-disclaimer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--font-b); font-size: 13px; color: var(--faint); line-height: 1.7; }

.kb-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.kb-prevnext a { display: flex; flex-direction: column; gap: 7px; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); transition: border-color .2s, background .2s; }
.kb-prevnext a:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, transparent); }
.kb-prevnext .pn-dir { font-family: var(--font-b); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.kb-prevnext .pn-title { font-family: var(--font-d); font-weight: 500; font-size: 16.5px; line-height: 1.25; }
.kb-prevnext .next { text-align: right; align-items: flex-end; }

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .kb-layout { grid-template-columns: 1fr; }
  .kb-side { position: static; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 8px; }
  .kb-prevnext { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .kb-hub-list a { grid-template-columns: 1fr auto; }
  .kb-hub-list span { grid-column: 1 / -1; }
  .kbm-head { display: none; }
  .kbm-row { grid-template-columns: 1fr; border-top: 2px solid var(--line-strong); }
  .kbm-cell { border-left: 0; border-top: 1px solid var(--line); }
  .kbm-cell::before { content: attr(data-stage); font-weight: 600; color: var(--muted); margin-right: 6px; }
  a.kbm-cell .ar { margin-left: auto; }
}
