/* ============================================================
   3ТЭК · База знаний и кейсы (страницы собирает app/lib/content.js)
   ============================================================ */

/* ---------- общие элементы ---------- */
.cms-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.cms-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--mist); color: var(--ink-soft); border: 1px solid var(--line);
}
.cms-chip.is-cat { background: var(--blue-tint); color: var(--blue-deep); border-color: transparent; }
.cms-chip.is-new { background: var(--copper); color: #fff; border-color: transparent; }

.cms-search {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 0 14px; min-height: 50px; color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.cms-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint); }
.cms-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 15.5px; color: var(--ink); background: transparent; padding: 12px 0; }
.cms-search kbd { font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--muted); }
.cms-search.big { min-height: 58px; box-shadow: var(--shadow-sm); }
.cms-search .btn { flex-shrink: 0; }

.cms-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cms-filters button {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line); transition: all .2s;
}
.cms-filters button:hover { border-color: var(--blue); color: var(--blue-deep); transform: translateY(-1px); }
.cms-filters button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.cms-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 44px 0 20px; }
.cms-sec-head h2 { font-size: clamp(21px, 2.4vw, 28px); margin: 0; }
.cms-sec-head span, .cms-sec-head a { font-size: 14px; color: var(--muted); }
.cms-sec-head a { color: var(--blue-deep); font-weight: 600; }
.cms-empty { padding: 26px; text-align: center; color: var(--muted); background: var(--mist); border-radius: var(--radius); }
.cms-more { display: flex; margin: 26px auto 0; }
.cms-eq { display: flex; flex-wrap: wrap; gap: 6px; }
.cms-eq span { font-family: var(--font-mono); font-size: 12px; padding: 4px 9px; border-radius: 7px; background: var(--mist); border: 1px solid var(--line); color: var(--ink-soft); }
.is-hidden { display: none !important; }

/* ---------- тело статьи / кейса ---------- */
.cms-body > p, .cms-body li { font-size: 16px; line-height: 1.72; color: var(--ink-soft); }
.cms-body > h2 { font-family: var(--font-display); font-size: clamp(19px, 2vw, 23px); margin: 36px 0 12px; scroll-margin-top: 90px; }
.cms-body > h3 { font-size: 18px; margin: 26px 0 10px; }
.cms-body .cms-list { padding-left: 22px; margin: 10px 0 18px; display: grid; gap: 8px; }
.cms-body .cms-list.is-num { counter-reset: n; list-style: none; padding-left: 0; }
.cms-body .cms-list.is-num li { counter-increment: n; position: relative; padding-left: 40px; }
.cms-body .cms-list.is-num li::before {
  content: counter(n); position: absolute; left: 0; top: 1px; width: 27px; height: 27px; border-radius: 50%;
  background: var(--copper-tint); color: var(--copper-deep); font-weight: 700; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center;
}
.cms-body .kb-callout { margin: 20px 0; font-size: 15px; line-height: 1.65; }
.cms-body .kb-callout.info { background: var(--blue-tint); border-color: var(--blue); color: var(--ink-soft); }
.cms-cover { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cms-cover img { width: 100%; height: auto; max-height: 460px; object-fit: cover; display: block; }
.cms-fig { margin: 22px 0; }
.cms-fig img, .cms-gallery img { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.cms-fig figcaption, .cms-gallery figcaption, .cms-video figcaption, .cms-ba figcaption {
  font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.45;
}
.cms-lb { display: block; cursor: zoom-in; border-radius: var(--radius-sm); overflow: hidden; }
.cms-lb img { transition: transform .35s ease; }
.cms-lb:hover img { transform: scale(1.025); }
.cms-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.cms-gallery.two { grid-template-columns: repeat(2, 1fr); }
.cms-gallery.one { grid-template-columns: 1fr; }
.cms-gallery figure { margin: 0; }
.cms-gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.cms-table { overflow-x: auto; margin: 18px 0 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cms-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cms-table th { text-align: left; background: var(--mist); font-weight: 700; color: var(--ink); }
.cms-table th, .cms-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; color: var(--ink-soft); }
.cms-table tr:last-child td { border-bottom: 0; }
.cms-toc { background: var(--mist); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 22px; }
.cms-toc b { display: block; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.cms-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.cms-toc a { color: var(--ink-soft); font-size: 14.5px; }
.cms-toc a:hover, .cms-toc a.active { color: var(--blue-deep); }

/* видео */
.cms-videos { display: grid; gap: 14px; margin: 22px 0; }
.cms-videos.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cms-video { margin: 0; }
.cms-video video { width: 100%; display: block; border-radius: var(--radius); background: #0a1626; max-height: 560px; aspect-ratio: 9 / 16; object-fit: cover; }

/* до / после */
.cms-ba { margin: 24px 0; }
.cms-ba-box { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4 / 3; background: var(--mist); --pos: 50%; user-select: none; }
.cms-ba-img, .cms-ba-img picture, .cms-ba-img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cms-ba-img img { object-fit: cover; }
.cms-ba-after { clip-path: inset(0 0 0 var(--pos)); }
.cms-ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(10, 22, 38, .15); pointer-events: none; }
.cms-ba-line span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cms-ba-tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(10, 22, 38, .72); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
.cms-ba-tag.l { left: 12px; } .cms-ba-tag.r { right: 12px; }
.cms-ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cms-ba figcaption b { color: var(--ink); }

/* «разобрано на практике» в статье */
.cms-practice { display: grid; gap: 12px; margin: 30px 0 0; }
.cms-practice a { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--copper-tint); color: var(--ink); text-decoration: none; transition: transform .2s; }
.cms-practice a:hover { transform: translateY(-2px); }
.cms-practice img { width: 110px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.cms-practice small { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-deep); }
.cms-practice b { display: block; margin: 3px 0; line-height: 1.35; }
.cms-practice em { font-style: normal; font-weight: 600; color: var(--copper-deep); font-size: 14px; }

/* лайтбокс */
.cms-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(6, 12, 22, .92); display: flex; align-items: center; justify-content: center; padding: 56px 64px; }
.cms-lightbox[hidden] { display: none; }
.cms-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.cms-lightbox p { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #d8e2ef; font-size: 14px; margin: 0; padding: 0 70px; }
.cms-lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.cms-lightbox button:hover { background: rgba(255, 255, 255, .24); }
.cms-lightbox .lb-x { top: 14px; right: 14px; }
.cms-lightbox .lb-p { left: 12px; top: 50%; transform: translateY(-50%); }
.cms-lightbox .lb-n { right: 12px; top: 50%; transform: translateY(-50%); }
.cms-lightbox .lb-c { position: absolute; top: 22px; left: 22px; color: #9fb0c6; font-family: var(--font-mono); font-size: 13px; }

/* ---------- страница кейса ---------- */
.case-hero { padding: 26px 0 40px; background: linear-gradient(180deg, var(--mist), #fff); }
.case-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.case-hero-grid.no-media { grid-template-columns: 1fr; max-width: 900px; }
.case-hero h1 { font-size: clamp(24px, 3vw, 38px); line-height: 1.18; margin: 0 0 14px; }
.case-hero .lead { font-size: 17px; }
.case-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 22px; }
.case-facts div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.case-facts span { display: block; font-size: 12.5px; color: var(--muted); }
.case-facts b { display: block; font-family: var(--font-display); font-size: 17px; margin-top: 4px; color: var(--ink); word-break: break-word; }
.case-hero-media { display: grid; gap: 12px; }
.case-hero-media.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-hero-media .cms-video video { max-height: 520px; }
.case-body-sec { padding-top: 34px; }
.case-body { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.case-body.no-toc { grid-template-columns: minmax(0, 1fr) 300px; }
.case-body .cms-toc.sticky { position: sticky; top: 96px; background: transparent; padding: 0; }
.case-body .cms-toc ol { list-style: none; padding: 0; border-left: 2px solid var(--line); }
.case-body .cms-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; }
.case-body .cms-toc li a.active { border-left-color: var(--copper); }
.case-aside { display: grid; gap: 16px; position: sticky; top: 96px; }
.case-aside .cms-eq { margin: 10px 0 6px; }
.cms-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cms-mini { display: block; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow, var(--shadow-sm)); color: var(--ink); text-decoration: none; transition: transform .25s, box-shadow .25s; }
.cms-mini:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cms-mini img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.cms-mini b { display: block; padding: 14px 16px 18px; line-height: 1.35; }

/* ---------- cases.html ---------- */
.csm-hero { padding: 26px 0 26px; background: linear-gradient(180deg, var(--mist), #fff); }
.csm-hero h1 { font-size: clamp(26px, 3.4vw, 42px); margin: 20px 0 12px; max-width: 900px; }
.csm-hero .lead { max-width: 820px; }
.csm-tools { display: grid; gap: 14px; margin-top: 22px; }
.csm-tools .cms-search { max-width: 560px; }
.csm-feat-sec { padding: 10px 0 0; }
.csm-feat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0; border-radius: 20px; overflow: hidden; background: var(--ink); color: #fff; text-decoration: none; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; }
.csm-feat:hover { transform: translateY(-4px); color: #fff; }
.csm-feat-txt { padding: 34px 36px; display: flex; flex-direction: column; }
.csm-feat-txt .cms-chip { background: rgba(255, 255, 255, .1); color: #dbe6f3; border-color: rgba(255, 255, 255, .14); }
.csm-feat-txt .cms-chip.is-new { background: var(--copper); color: #fff; }
.csm-feat-txt .cms-chip.is-cat { background: rgba(43, 140, 232, .22); color: #cfe5fb; }
.csm-feat h2 { color: #fff; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.2; margin: 4px 0 14px; }
.csm-feat p { color: #b9c7d9; line-height: 1.65; margin: 0 0 16px; }
.csm-feat .cms-eq span { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #e3ecf7; }
.csm-feat-foot { margin-top: auto; padding-top: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.csm-metrics { display: flex; gap: 22px; }
.csm-metrics b { display: block; font-family: var(--font-display); font-size: 24px; color: var(--copper); }
.csm-metrics span { font-size: 13px; color: #9fb0c6; }
.csm-feat em, .csm-card em, .kbm-card em, .kbm-case em, .hkb-tile em { font-style: normal; font-weight: 700; color: var(--copper); transition: transform .2s; display: inline-block; }
.csm-feat:hover em, .csm-card:hover em, .kbm-card:hover em, .kbm-case:hover em, .hkb-tile:hover em { transform: translateX(4px); }
.csm-feat-media { position: relative; display: grid; grid-template-columns: 1.5fr 1fr; gap: 4px; height: 440px; }
.csm-feat-main { overflow: hidden; } .csm-feat-side > * { overflow: hidden; min-height: 0; }
.csm-feat-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.csm-feat-main, .csm-feat-main picture { height: 100%; }
.csm-feat-side { display: grid; grid-template-rows: 1fr 1fr; gap: 4px; }
.csm-feat-side picture, .csm-feat-side img { height: 100%; min-height: 0; }
.csm-vid { position: absolute; left: 14px; bottom: 14px; display: inline-flex; gap: 6px; align-items: center; background: rgba(10, 22, 38, .8); color: #fff; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.csm-list-sec { padding-top: 34px; }
.csm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.csm-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; box-shadow: var(--card-shadow, var(--shadow-sm)); border: 1px solid var(--line); transition: transform .25s, box-shadow .25s; }
.csm-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); color: var(--ink); }
.csm-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--mist); }
.csm-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s; }
.csm-card:hover .csm-img img { transform: scale(1.04); }
.csm-img span { position: absolute; left: 12px; bottom: 12px; background: var(--copper); color: #fff; font-weight: 700; font-size: 13px; padding: 5px 11px; border-radius: 999px; }
.csm-txt { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.csm-txt small { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.csm-txt b { font-size: 17px; line-height: 1.32; }
.csm-txt p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.csm-txt em { margin-top: auto; padding-top: 6px; }
.csm-feat.is-hidden + * { margin-top: 0; }

/* ---------- knowledge.html ---------- */
.kbm-hero-wrap { background: linear-gradient(180deg, var(--mist), #fff); }
.kbm-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: end; padding-top: 26px; padding-bottom: 36px; }
.kbm-eyebrow { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--copper-deep); margin: 22px 0 12px; }
.kbm-hero h1 { font-size: clamp(26px, 3.3vw, 42px); line-height: 1.16; margin: 0 0 14px; }
.kbm-hero .lead { margin-bottom: 22px; }
.kbm-jump { margin: 10px 2px 0; font-size: 14.5px; }
.kbm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kbm-stats a { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s; }
.kbm-stats a:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--blue); }
.kbm-stats b { display: block; font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 34px); color: var(--ink); }
.kbm-stats span { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.kbm-sec { padding: 8px 0 56px; }
.kbm-nav { position: sticky; top: 72px; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); padding: 12px 0; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.kbm-nav-err { margin-left: auto; font-weight: 700; color: var(--copper-deep); font-size: 14.5px; }
.kbm-feat { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px; margin-top: 10px; }
.kbm-feat-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--ink); border-radius: 20px; overflow: hidden; color: #fff; text-decoration: none; box-shadow: var(--shadow); transition: transform .3s; }
.kbm-feat-main:hover { transform: translateY(-4px); color: #fff; }
.kbm-feat-main picture, .kbm-feat-main > img, .kbm-feat-main picture img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 300px; }
.kbm-feat-main > div { padding: 28px 28px 26px; display: flex; flex-direction: column; }
.kbm-feat-main .cms-chips { margin-top: 0; }
.kbm-feat-main .cms-chip.is-cat { background: rgba(43, 140, 232, .22); color: #cfe5fb; }
.kbm-feat-main h2 { color: #fff; font-size: clamp(20px, 2vw, 26px); line-height: 1.22; margin: 2px 0 12px; }
.kbm-feat-main p { color: #b9c7d9; line-height: 1.6; margin: 0 0 14px; }
.kbm-feat-main em { margin-top: auto; font-style: normal; font-weight: 700; color: var(--copper); }
.kbm-pop { background: var(--mist); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.kbm-pop > span { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kbm-pop a { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 10px; text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s; }
.kbm-pop a:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); }
.kbm-pop img, .kbm-pop-ic { width: 76px; height: 60px; object-fit: cover; border-radius: 9px; flex-shrink: 0; }
.kbm-pop-ic { display: flex; align-items: center; justify-content: center; background: var(--blue-tint); color: var(--blue-deep); }
.kbm-pop-ic svg { width: 28px; height: 28px; }
.kbm-pop small { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-deep); }
.kbm-pop b { display: block; font-size: 14.5px; line-height: 1.3; margin: 2px 0; }
.kbm-pop em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.kbm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.kbm-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; box-shadow: var(--card-shadow, var(--shadow-sm)); transition: transform .25s, box-shadow .25s; }
.kbm-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); color: var(--ink); }
.kbm-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--mist); }
.kbm-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s; }
.kbm-card:hover .kbm-img img { transform: scale(1.04); }
.kbm-img.is-icon { display: flex; align-items: center; justify-content: center; color: var(--blue); background: linear-gradient(135deg, var(--blue-tint), #fff); }
.kbm-img.is-icon svg { width: 64px; height: 64px; }
.kbm-img .cms-chip { position: absolute; top: 12px; left: 12px; }
.kbm-txt { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kbm-txt small { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-deep); }
.kbm-txt b { font-size: 17px; line-height: 1.32; }
.kbm-txt p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0; }
.kbm-txt em { margin-top: auto; padding-top: 6px; }
.kbm-bottom { padding-top: 10px; }
.kbm-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; }
.kbm-case { display: grid; grid-template-columns: 200px minmax(0, 1fr); background: var(--copper-tint); border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .25s; }
.kbm-case:hover { transform: translateY(-3px); color: var(--ink); }
.kbm-case img, .kbm-case picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.kbm-case > div { padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.kbm-case small { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--copper-deep); }
.kbm-case b { font-size: 18px; line-height: 1.32; }
.kbm-ask { background: var(--ink); color: #c6d3e3; border-radius: 20px; padding: 24px 26px; }
.kbm-ask b { display: block; color: #fff; font-family: var(--font-display); font-size: 20px; margin-bottom: 8px; }
.kbm-ask p { margin: 0 0 16px; line-height: 1.6; }
.kbm-ask div { display: flex; gap: 10px; flex-wrap: wrap; }
.kbm-ask .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .35); display: inline-flex; gap: 7px; align-items: center; }
.kbm-ask .btn-outline:hover { background: rgba(255, 255, 255, .1); }

/* ---------- главная: открытая база знаний ---------- */
.hkb { background: linear-gradient(180deg, #fff, var(--mist)); }
.hkb-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: end; margin-bottom: 28px; }
.hkb-free { display: inline-flex; gap: 8px; align-items: center; padding: 6px 13px; border-radius: 999px; background: var(--green-tint); color: var(--green); font-weight: 700; font-size: 13px; }
.hkb h2 { font-size: clamp(24px, 3vw, 38px); line-height: 1.16; margin: 14px 0 12px; }
.hkb-head p { color: var(--ink-soft); font-size: 16.5px; line-height: 1.65; margin: 0; }
.hkb-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.hkb-tile { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px 20px; text-decoration: none; color: var(--ink); box-shadow: var(--card-shadow, var(--shadow-sm)); transition: transform .25s, box-shadow .25s, border-color .25s; }
.hkb-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--blue); color: var(--ink); }
.hkb-tile small { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hkb-tile b { font-family: var(--font-display); font-size: clamp(30px, 3vw, 42px); line-height: 1; color: var(--ink); }
.hkb-tile > span { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.hkb-tile em { margin-top: auto; padding-top: 6px; }
.hkb-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.hkb-codes span { font-family: var(--font-mono); font-size: 12.5px; padding: 4px 9px; border-radius: 7px; background: var(--red-tint); color: var(--red); font-weight: 600; }
.hkb-img { border-radius: 10px; overflow: hidden; height: 96px; }
.hkb-img img, .hkb-img picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.hkb-model { background: var(--ink); color: #9fd0ff; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.6; }
.hkb-latest { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 14px 18px; background: #fff; border: 1px dashed var(--line); border-radius: 14px; font-size: 14.5px; color: var(--ink-soft); }
.hkb-latest > svg { color: var(--copper); flex-shrink: 0; }
.hkb-latest .hkb-all { margin-left: auto; font-weight: 700; white-space: nowrap; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .case-body { grid-template-columns: minmax(0, 1fr) 280px; }
  .case-body .cms-toc.sticky { display: none; }
  .hkb-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .kbm-hero, .hkb-head, .case-hero-grid, .kbm-feat, .kbm-bottom-grid, .csm-feat { grid-template-columns: 1fr; }
  .kbm-grid, .csm-grid, .cms-mini-grid { grid-template-columns: repeat(2, 1fr); }
  .case-body, .case-body.no-toc { grid-template-columns: 1fr; }
  .case-aside { position: static; }
  .csm-feat-media { height: 300px; order: -1; }
  .kbm-nav { top: 60px; }
}
@media (max-width: 640px) {
  .kbm-grid, .csm-grid, .cms-mini-grid, .hkb-tiles { grid-template-columns: 1fr; }
  .kbm-feat-main { grid-template-columns: 1fr; }
  .kbm-feat-main picture img, .kbm-feat-main > img { min-height: 190px; max-height: 220px; }
  .kbm-case { grid-template-columns: 1fr; }
  .kbm-case img { max-height: 180px; }
  .cms-gallery { grid-template-columns: repeat(2, 1fr); }
  .cms-videos.two, .case-hero-media.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .csm-feat-txt { padding: 24px 20px; }
  .csm-feat-media { grid-template-columns: 1fr; }
  .csm-feat-side { display: none; }
  .kbm-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .kbm-nav::-webkit-scrollbar { display: none; }
  .kbm-nav button { white-space: nowrap; }
  .kbm-nav-err { white-space: nowrap; }
  .hkb-latest { flex-wrap: wrap; }
  .hkb-latest .hkb-all { margin-left: 0; }
  .cms-lightbox { padding: 50px 10px; }
  .cms-lightbox .lb-p, .cms-lightbox .lb-n { top: auto; bottom: 10px; transform: none; }
  .kbm-stats b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .kbm-card, .csm-card, .hkb-tile, .csm-feat, .kbm-feat-main, .cms-lb img { transition: none !important; }
}
.cms-more[hidden], .cms-empty[hidden], .kbm-jump[hidden], .cms-lightbox button[hidden] { display: none !important; }
.kbm-ask .btn-outline { background: transparent; }
.cms-links { list-style: none; margin: 8px 0 0; padding: 0; }
.cms-links li + li { border-top: 1px solid var(--line); }
.cms-links a { display: block; padding: 10px 0; color: var(--ink); text-decoration: none; }
.cms-links a:hover { color: var(--blue-deep); }
.cms-links b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.cms-links code { font-family: var(--font-mono); font-size: 13.5px; background: var(--red-tint); color: var(--red); padding: 1px 6px; border-radius: 5px; }
.cms-links span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.cms-fig .cms-lb { display: flex; justify-content: center; background: var(--mist); }
.cms-fig img { width: auto; max-width: 100%; max-height: 620px; }
/* ссылки внутри текста статьи и кейса */
.cms-body p a, .cms-body li a, .cms-body td a, .cms-body .kb-callout a, .err-panel a, .landing-main .note-line a {
  color: var(--blue-deep); text-decoration: underline; text-decoration-color: rgba(20, 101, 186, .35); text-underline-offset: 3px;
}
.cms-body p a:hover, .cms-body li a:hover, .cms-body td a:hover, .cms-body .kb-callout a:hover { text-decoration-color: currentColor; }
