.kb-hero .hero__inner {
  grid-template-columns: minmax(0, .91fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 92px);
}
.kb-hero .hero__lead { color: var(--text-2); }
.kb-hero h1 { font-size: clamp(44px, 5vw, 74px); max-width: 13ch; }
.kb-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Папка с закладками. Радиокнопки переключают пример и без JavaScript. */
.kb-demo {
  min-inline-size: 0; position: relative; isolation: isolate; margin: 12px 0 0;
  padding: clamp(18px, 2.5vw, 36px); border: none; border-radius: 6px 28px 28px 28px;
  background: linear-gradient(128deg, #2649a4, #17357e 70%, #213e82); color: #fff;
}
.kb-demo::before {
  content: ""; position: absolute; top: -10px; left: 0; z-index: -1;
  width: 32%; height: 18px; background: #2649a4; border-radius: 12px 14px 0 0;
  transform: skewX(18deg); transform-origin: left bottom;
}
.kb-demo__head, .kb-demo__brand, .kb-demo__agent, .kb-demo__source,
.kb-library__head, .kb-library a { display: flex; align-items: center; gap: 10px; }
.kb-demo__head { justify-content: space-between; }
.kb-demo__brand { font-size: 15px; font-weight: 600; }
.kb-demo__brand .icon { width: 22px; height: 22px; }
.kb-demo__label { font-size: 13px; color: #d7e4ff; }
.kb-demo__prompt { margin: 24px 0 16px; font-weight: 650; font-size: clamp(21px, 2vw, 30px); line-height: 1.15; letter-spacing: -.025em; }
.kb-demo__tabs { display: flex; gap: 5px; position: relative; }
.kb-demo__tabs label {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px clamp(8px, 1.3vw, 19px); background: #294993;
  border: 1px solid #6c8dcd; border-bottom: 0; border-radius: 10px 10px 0 0; color: #fff;
  font-size: var(--fs-small); font-weight: 600;
}
.kb-demo__tabs label:hover { background: #3355a4; }
.kb-demo__tabs input:checked + label { color: var(--text-1); background: var(--bg); border-color: var(--bg); }
.kb-demo__tabs input:focus-visible + label { outline: 3px solid #ffcf66; outline-offset: -4px; }
.kb-demo__tabs .icon, .kb-demo__agent .icon, .kb-demo__source .icon, .kb-library a .icon { flex: none; width: 18px; height: 18px; }
.kb-demo__sheet {
  position: relative; padding: clamp(17px, 2.2vw, 30px); min-height: 240px;
  border-radius: 0 6px 13px 13px; background: var(--bg); color: var(--text-1);
  box-shadow: 0 4px 0 -1px #8ba9e4, 0 8px 0 -3px #6888c5;
}
.kb-demo__example { display: none; }
.kb-demo:has(#topic-1:checked) #example-1,
.kb-demo:has(#topic-2:checked) #example-2,
.kb-demo:has(#topic-3:checked) #example-3 { display: block; }
.kb-demo__question {
  width: fit-content; max-width: 100%; margin: 0 0 18px auto; padding: 8px 15px;
  background: var(--surface-2); border-radius: 16px 16px 3px 16px; font-weight: 600;
}
.kb-demo__agent { color: var(--link); font-size: 14px; font-weight: 700; }
.kb-demo__answer { margin: 6px 0 12px; max-width: 52ch; line-height: 1.5; }
.kb-demo__source { color: var(--text-2); font-size: 14px; }
.kb-benefits {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 70px); margin: var(--s-6) 0 0; padding: 0; list-style: none;
}
.kb-benefits li { border-top: 1px solid var(--border-strong); padding-top: var(--s-5); }
.kb-benefits li > .icon { color: var(--link); width: 28px; height: 28px; margin-bottom: 14px; }
.kb-benefits h3, .kb-library h3 { font-size: var(--fs-h3); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); }
.kb-benefits p, .kb-faq details p { margin: 12px 0 0; line-height: var(--lh-body); color: var(--text-2); }
.kb-benefits .xlink { margin-top: 12px; }
.kb-start, .kb-faq { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 7vw, 100px); align-items: center; }
.kb-start .sec__text + .sec__text { margin-top: var(--s-4); }
.kb-library { padding: clamp(20px, 3vw, 36px); border: 1px solid var(--border-strong); border-radius: var(--r-4); }
.kb-library__head { gap: 14px; margin-bottom: 18px; }
.kb-library__icon { display: grid; place-items: center; flex: none; width: 46px; height: 52px; border-radius: 4px 10px 10px 4px; background: #274ba2; color: white; box-shadow: inset 5px 0 #17377b; }
.kb-library__head div > span { color: var(--text-3); font-size: 14px; }
.kb-library a { min-height: 49px; gap: 10px; border-top: 1px solid var(--border-strong); color: var(--text-1); text-decoration: none; }
.kb-library a .icon:last-child { margin-left: auto; color: var(--text-3); }
.kb-library .kb-library__all, .kb-library a:hover { color: var(--link); }
.kb-library .kb-library__all { justify-content: flex-start; padding-top: 12px; font-weight: 600; }
.kb-library .kb-library__all .icon { margin: 0; color: inherit; }
.kb-faq { align-items: start; grid-template-columns: .75fr 1.25fr; }
.kb-faq details { border-bottom: 1px solid var(--border-strong); }
.kb-faq details:first-child { border-top: 1px solid var(--border-strong); }
.kb-faq summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 0; cursor: pointer; font-weight: 650; list-style: none; }
.kb-faq summary::-webkit-details-marker { display: none; }
.kb-faq summary .icon { width: 19px; height: 19px; flex: none; }
.kb-faq details[open] summary .icon { transform: rotate(180deg); }
.kb-faq details p { margin: 0 0 20px; }
.kb-final {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-5);
  padding: clamp(24px, 4vw, 64px); border: 1px solid var(--border-strong);
  border-radius: var(--r-4); background: var(--surface-1);
}
.kb-final .btn { flex: none; }
@media (max-width: 900px) {
  .kb-hero .hero__inner { grid-template-columns: 1fr; }
  .kb-demo { width: 100%; max-width: 620px; }
  .kb-start, .kb-faq { grid-template-columns: 1fr; }
  .kb-final { align-items: start; flex-direction: column; }
}
@media (max-width: 680px) {
  .kb-hero h1 { font-size: clamp(39px, 10vw, 56px); }
  .kb-demo__tabs label { flex: 1; font-size: 14px; }
  .kb-demo__sheet { min-height: 245px; }
  .kb-benefits { grid-template-columns: 1fr; gap: 20px; }
  .kb-benefits li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 16px; }
  .kb-benefits li > .icon { margin: 0; }
  .kb-benefits li > :not(.icon) { grid-column: 2; }
}
@media (max-width: 390px) {
  .kb-demo__tabs label .icon { display: none; }
}
