/* ══════════════════════════════════════════════
   Knowledge base template — categories, search, articles
   ══════════════════════════════════════════════ */

:root {
  --kb-bg: #f8fafc;
  --kb-fg: #0f172a;
  --kb-muted: #64748b;
  --kb-border: #e2e8f0;
  --kb-surface: #ffffff;
  --kb-accent: #2563eb;
  --kb-accent-dark: #1d4ed8;
  --kb-max: 1100px;
  --kb-head-h: 68px;
  --kb-radius: 12px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--kb-head-h) + 16px); }
body {
  background: var(--kb-bg);
  color: var(--kb-fg);
  margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

/* ── Typography: serif headings for warmer feel ── */
h1, h2, h3,
.kb-card__title,
.kb-hero h1,
.kb-article__head h1,
.kb-cat__head h1,
.kb-feat-card__title,
.kb-featured__head h2,
.kb-article__cta h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif Pro", Georgia, serif;
  font-weight: 700;
  letter-spacing: -.015em;
}

/* ── Header ── */
.kb-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--kb-surface);
  border-bottom: 1px solid var(--kb-border);
  height: var(--kb-head-h);
}
.kb-head__inner {
  max-width: var(--kb-max); margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.kb-brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; letter-spacing: -.01em;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.kb-brand__logo { height: 28px; width: auto; }
.kb-search {
  flex: 1;
  max-width: 420px;
}
.kb-search input {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid var(--kb-border);
  border-radius: 8px;
  background: var(--kb-bg);
  color: var(--kb-fg);
  font-size: .9rem;
}
.kb-search input:focus {
  outline: 2px solid var(--kb-accent);
  outline-offset: 0;
  border-color: var(--kb-accent);
}
.kb-head__nav {
  display: flex; gap: 1rem; align-items: center;
  font-size: .9rem; font-weight: 500;
  margin-left: auto;
}
.kb-head__nav a:hover { color: var(--kb-accent); }

.kb-head__calc-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .85rem;
  background: var(--kb-accent);
  color: #fff !important;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  transition: background .15s, transform .15s;
}
.kb-head__calc-link:hover {
  background: var(--kb-accent-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

/* ── Calculator index grid ────────────────────────────────── */
.kb-article__body .kb-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
  padding: 0;
  list-style: none;
}
.kb-article__body .kb-calc-grid li { margin: 0; padding: 0; list-style: none; }
.kb-article__body .kb-calc-grid li::before { display: none; }
.kb-article__body .kb-calc-grid a {
  display: block;
  padding: 1.1rem 1.25rem;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 12px;
  border-bottom: 1px solid var(--kb-border);
  transition: transform .15s, border-color .15s, box-shadow .2s;
  color: var(--kb-fg);
}
.kb-article__body .kb-calc-grid a:hover {
  transform: translateY(-2px);
  border-color: var(--kb-accent);
  box-shadow: 0 14px 24px rgba(15, 23, 42, .06);
}
.kb-article__body .kb-calc-grid a strong {
  display: block;
  font-size: 1rem;
  margin-bottom: .25rem;
  color: var(--kb-accent);
}
.kb-article__body .kb-calc-grid a small {
  display: block;
  color: var(--kb-muted);
  font-size: .85rem;
  line-height: 1.4;
}
.kb-article__body .kb-calc-grid h3 {
  grid-column: 1 / -1;
  margin: 1.5rem 0 .25rem;
  font-size: 1.1rem;
  color: var(--kb-fg);
  letter-spacing: 0;
}
.kb-article__body .kb-calc-grid h3:first-child { margin-top: 0; }
.kb-head__nav .theme-toggle {
  border: 1px solid var(--kb-border);
  background: transparent;
  color: var(--kb-fg);
  border-radius: 6px;
  padding: .3rem .55rem;
  cursor: pointer;
}

/* ── Hero ── */
.kb-hero {
  max-width: var(--kb-max);
  margin: 0 auto;
  padding: 4rem 1.5rem 2.5rem;
  text-align: center;
}
.kb-hero__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.kb-hero__logo img {
  max-width: 240px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, .08));
}
@media (max-width: 520px) {
  .kb-hero__logo img { max-width: 180px; max-height: 140px; }
}
.kb-hero h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 0 0 .75rem 0;
}
.kb-hero__lead {
  color: var(--kb-muted);
  max-width: 55ch;
  margin: 0 auto 2rem auto;
  font-size: 1.1rem;
}
.kb-hero__search {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  gap: .5rem;
}
.kb-hero__search input {
  flex: 1;
  padding: .85rem 1.1rem;
  border: 1px solid var(--kb-border);
  border-radius: 10px;
  background: var(--kb-surface);
  font-size: 1rem;
}
.kb-hero__search button {
  padding: .85rem 1.5rem;
  background: var(--kb-accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}
.kb-hero__search button:hover { background: var(--kb-accent-dark); }

.kb-hero__cta {
  margin-top: 1.75rem;
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Newsletter signup ── */
.kb-newsletter {
  max-width: var(--kb-max);
  margin: 3rem auto 4rem;
  padding: 0 1.5rem;
}
.kb-newsletter__inner {
  background: linear-gradient(135deg, rgba(255, 26, 117, .06), rgba(37, 99, 235, .04));
  border: 1px solid var(--kb-border);
  border-radius: 18px;
  padding: 2.25rem 2.5rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
}
.kb-newsletter__body h2 {
  margin: 0 0 .35rem;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
}
.kb-newsletter__body p {
  margin: 0;
  color: var(--kb-muted);
  font-size: .95rem;
}
.kb-newsletter__form {
  display: flex;
  gap: .5rem;
}
.kb-newsletter__form input[type="email"] {
  flex: 1;
  padding: .85rem 1rem;
  border: 1px solid var(--kb-border);
  border-radius: 10px;
  background: var(--kb-surface);
  color: var(--kb-fg);
  font-size: .95rem;
  font-family: inherit;
}
.kb-newsletter__form input[type="email"]:focus {
  outline: 2px solid var(--kb-accent);
}
.kb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@media (max-width: 720px) {
  .kb-newsletter__inner { grid-template-columns: 1fr; padding: 1.75rem 1.5rem; }
  .kb-newsletter__form { flex-direction: column; }
}

/* ── Sticky sidebar for category + article views ── */
.kb-cat__layout,
.kb-article__layout {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 960px) {
  .kb-cat__layout,
  .kb-article__layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
  }
  .kb-cat__sidebar,
  .kb-article__sidebar {
    position: sticky;
    top: calc(var(--kb-head-h) + 20px);
  }
}
.kb-cat__main { min-width: 0; }
.kb-article__layout .kb-article { padding: 1rem 0 5rem; max-width: none; }
.kb-cat__main .kb-cat__head { padding: 1.5rem 0 1rem; max-width: none; }
.kb-cat__main .kb-articles { padding: 0; margin-bottom: 2.5rem; max-width: none; }
.kb-cat__main .kb-cat__intro { padding: 0 0 1.5rem; max-width: none; }

.kb-side {
  margin-bottom: 2rem;
}
.kb-side__label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--kb-muted);
  margin-bottom: .7rem;
}
.kb-side ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.kb-side li a {
  display: block;
  padding: .55rem .85rem;
  border-radius: 8px;
  color: var(--kb-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.kb-side li a:hover {
  color: var(--kb-accent);
  background: rgba(37, 99, 235, .06);
}
.kb-side li a.is-active {
  color: var(--kb-accent);
  background: rgba(37, 99, 235, .1);
  font-weight: 600;
}

/* ── FAQ (dl/dt/dd) styling inside article/category body ── */
.kb-article__body dl,
.kb-cat__intro dl,
.kb-article__body .kb-faq,
.kb-cat__intro .kb-faq {
  margin: 1.5rem 0;
  border-top: 1px solid var(--kb-border);
}
.kb-article__body dt,
.kb-cat__intro dt {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 1rem 0 .35rem;
  color: var(--kb-fg);
}
.kb-article__body dd,
.kb-cat__intro dd {
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  color: var(--kb-muted);
  border-bottom: 1px solid var(--kb-border);
}

/* ── Stepper for /begin-hier ── */
.kb-article__body .kb-stepper {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  counter-reset: step;
}
.kb-article__body .kb-stepper li {
  counter-increment: step;
  padding: 1.25rem 1.5rem 1.25rem 4.2rem;
  margin-bottom: .85rem;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 12px;
  position: relative;
  transition: border-color .15s, transform .15s;
}
.kb-article__body .kb-stepper li:hover {
  border-color: var(--kb-accent);
  transform: translateX(2px);
}
.kb-article__body .kb-stepper li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1.2rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: var(--kb-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.kb-article__body .kb-stepper a { color: var(--kb-fg); border-bottom: 0; font-weight: 600; font-size: 1.05rem; }
.kb-article__body .kb-stepper a:hover { color: var(--kb-accent); }
.kb-article__body .kb-stepper small { display: block; color: var(--kb-muted); font-size: .88rem; margin-top: .2rem; font-weight: 400; }

/* ── Button sizes ── */
.kb-btn--lg {
  padding: 1rem 1.9rem;
  font-size: 1rem;
  border-radius: 12px;
}

/* ── Secondary pages (contact / sitemap / offerte / register / setup_account / tags) ── */
.kb-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
.kb-page__head {
  text-align: center;
  margin-bottom: 2rem;
}
.kb-page__head h1 {
  margin: 0 0 .6rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
}
.kb-page__lead {
  color: var(--kb-muted);
  font-size: 1.1rem;
  margin: 0;
}
.kb-page__hero {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 2rem;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, .08);
}
.kb-page__intro {
  color: var(--kb-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}
.kb-page__intro a { color: var(--kb-accent); border-bottom: 1px solid currentColor; }
.kb-page__cooldown {
  background: rgba(234, 88, 12, .08);
  border: 1px solid rgba(234, 88, 12, .25);
  border-radius: 10px;
  padding: .85rem 1.1rem;
  margin-bottom: 1.5rem;
  color: #9a3412;
  font-size: .9rem;
}
.kb-page__search {
  display: flex;
  gap: .5rem;
  max-width: 520px;
  margin: 0 auto 2.5rem;
}
.kb-page__search input {
  flex: 1;
  padding: .85rem 1.1rem;
  border: 1px solid var(--kb-border);
  border-radius: 10px;
  background: var(--kb-surface);
  font-size: 1rem;
  font-family: inherit;
}
.kb-page__search input:focus { outline: 2px solid var(--kb-accent); }

/* ── Form styling inside kb-page ── */
.kb-form {
  display: grid;
  gap: .75rem;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 14px;
  padding: 2rem 2.25rem;
}
.kb-form label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--kb-fg);
  margin-top: .35rem;
}
.kb-form input[type="text"],
.kb-form input[type="email"],
.kb-form input[type="password"],
.kb-form input[type="tel"],
.kb-form input:not([type]),
.kb-form textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--kb-border);
  border-radius: 10px;
  background: var(--kb-bg);
  color: var(--kb-fg);
  font-size: .95rem;
  font-family: inherit;
  box-sizing: border-box;
}
.kb-form textarea {
  resize: vertical;
  min-height: 140px;
  font-family: inherit;
}
.kb-form input:focus,
.kb-form textarea:focus {
  outline: 2px solid var(--kb-accent);
  border-color: var(--kb-accent);
}
.kb-form__error {
  color: #dc2626;
  font-size: .82rem;
  margin-top: .2rem;
}
.kb-form__hint {
  display: block;
  color: var(--kb-muted);
  font-size: .78rem;
  margin-top: -.25rem;
  margin-bottom: .4rem;
}
.kb-form__checkbox {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 500;
  margin-top: .75rem;
}
.kb-form__checkbox input[type="checkbox"] { margin: 0; }
.kb-form__actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

/* ── Sitemap nested list ── */
.kb-sitemap {
  margin-bottom: 2rem;
}
.kb-sitemap__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kb-sitemap__list li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--kb-border);
}
.kb-sitemap__list li:last-child { border-bottom: 0; }
.kb-sitemap__list a {
  font-weight: 600;
  color: var(--kb-fg);
}
.kb-sitemap__list a:hover { color: var(--kb-accent); }
.kb-sitemap__list .kb-sitemap__list {
  margin: .4rem 0 0 1.25rem;
  border-left: 2px solid var(--kb-border);
  padding-left: 1rem;
}
.kb-sitemap__list .kb-sitemap__list li {
  border-bottom: 0;
  padding: .3rem 0;
}
.kb-sitemap__list .kb-sitemap__list a {
  font-weight: 500;
  color: var(--kb-muted);
  font-size: .95rem;
}

@media (max-width: 520px) {
  .kb-form { padding: 1.5rem 1.4rem; }
  .kb-page__search { flex-direction: column; }
}

/* ── Calculator widgets inside article body ───────────────── */
.kb-calc {
  margin: 2rem 0;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, .06), rgba(255, 26, 117, .04));
  border: 1px solid var(--kb-border);
  border-radius: 14px;
}
.kb-calc__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kb-calc label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--kb-muted);
  margin-bottom: .3rem;
}
.kb-calc input[type="number"],
.kb-calc input[type="text"] {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--kb-border);
  border-radius: 8px;
  background: var(--kb-bg);
  color: var(--kb-fg);
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}
.kb-calc input:focus {
  outline: 2px solid var(--kb-accent);
  border-color: var(--kb-accent);
}
.kb-calc__checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--kb-fg);
  font-size: .9rem;
}
.kb-calc__result {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.kb-calc__headline {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--kb-accent);
  line-height: 1.1;
}
.kb-calc__headline small {
  font-size: .9rem;
  font-weight: 500;
  color: var(--kb-muted);
  letter-spacing: 0;
  margin-left: .35rem;
}
.kb-calc__hint {
  color: var(--kb-muted);
  font-size: .88rem;
  margin-top: .55rem;
  line-height: 1.55;
}

/* ── Downloadable template cards ──────────────────────────── */
.kb-template {
  margin: 2rem 0;
  padding: 1.75rem 2rem;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 14px;
}
.kb-template__actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--kb-border);
}

/* ── Quiz (rechtsvorm) ─────────────────────────────────────── */
.kb-quiz {
  margin: 2rem 0;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, .04), rgba(255, 26, 117, .03));
  border: 1px solid var(--kb-border);
  border-radius: 14px;
}
.kb-quiz__q {
  margin-bottom: 1.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--kb-border);
}
.kb-quiz__q:last-of-type { border-bottom: 0; margin-bottom: .5rem; }
.kb-quiz__q > strong {
  display: block;
  margin-bottom: .65rem;
  font-size: 1rem;
}
.kb-quiz__q label {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .75rem;
  margin-bottom: .35rem;
  border: 1px solid var(--kb-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .92rem;
  transition: border-color .15s, background .15s;
}
.kb-quiz__q label:hover { border-color: var(--kb-accent); }
.kb-quiz__q input[type="radio"] { margin: 0; accent-color: var(--kb-accent); }
.kb-quiz__q input[type="radio"]:checked ~ * { color: var(--kb-accent); }
.kb-quiz__q input[type="radio"]:checked + span { font-weight: 600; }

/* ── Glossary + cost + compare tables ─────────────────────── */
.kb-article__body .kb-glossary {
  margin: 1.5rem 0 2.5rem;
  display: grid;
  gap: 1.25rem;
}
.kb-article__body .kb-glossary dt {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0;
  margin: 0 0 .3rem;
  border-top: 0;
  color: var(--kb-accent);
}
.kb-article__body .kb-glossary dd {
  margin: 0 0 .85rem;
  padding: 0 0 .85rem;
  color: var(--kb-fg);
  border-bottom: 1px solid var(--kb-border);
}
.kb-article__body .kb-glossary dd:last-child { border-bottom: 0; }

.kb-article__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .92rem;
}
.kb-article__body table th,
.kb-article__body table td {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--kb-border);
  vertical-align: top;
}
.kb-article__body table th {
  background: var(--kb-surface);
  font-weight: 700;
  font-size: .85rem;
  color: var(--kb-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kb-article__body table tr:hover { background: rgba(37, 99, 235, .03); }

/* ── Print styles for template posts ──────────────────────── */
@media print {
  .kb-head,
  .kb-foot,
  .kb-breadcrumb,
  .kb-article__cta,
  .kb-article__related,
  .kb-article__sidebar,
  .kb-prevnext,
  .kb-page__cooldown,
  [data-kb-print] {
    display: none !important;
  }
  .kb-article,
  .kb-article__layout,
  .kb-page {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .kb-article__body { font-size: 11pt !important; line-height: 1.5 !important; }
  body { background: #fff !important; }
}

/* ── Category grid ── */
.kb-grid {
  max-width: var(--kb-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.kb-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius);
  padding: 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  transition: transform .15s, border-color .15s, box-shadow .2s;
}
.kb-card:hover {
  transform: translateY(-2px);
  border-color: var(--kb-accent);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}
.kb-card__icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--kb-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}
.kb-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.kb-card__icon-glyph { font-weight: 800; font-size: 1.3rem; }
.kb-card__title {
  margin: 0 0 .4rem 0;
  font-size: 1.2rem;
  letter-spacing: -.01em;
}
.kb-card__excerpt {
  color: var(--kb-muted);
  font-size: .9rem;
  margin: 0 0 1rem 0;
  flex: 1;
}
.kb-card__meta {
  color: var(--kb-accent);
  font-size: .8rem;
  font-weight: 600;
  margin-top: auto;
}

/* ── Featured / recent articles on homepage ── */
.kb-featured {
  max-width: var(--kb-max);
  margin: 1rem auto 5rem;
  padding: 0 1.5rem;
}
.kb-featured__head {
  text-align: center;
  margin-bottom: 2rem;
}
.kb-featured__head h2 {
  margin: 0 0 .4rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.kb-featured__head p {
  margin: 0;
  color: var(--kb-muted);
  font-size: .95rem;
}
.kb-featured__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.kb-feat-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s, border-color .15s;
}
.kb-feat-card:hover {
  transform: translateY(-3px);
  border-color: var(--kb-accent);
  box-shadow: 0 16px 32px rgba(15, 23, 42, .08);
}
.kb-feat-card__link { display: block; }
.kb-feat-card__cover {
  aspect-ratio: 16 / 9;
  background: var(--kb-border);
  overflow: hidden;
}
.kb-feat-card__cover img,
.kb-feat-card__cover picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.kb-feat-card:hover .kb-feat-card__cover img { transform: scale(1.04); }
.kb-feat-card__body { padding: 1.1rem 1.3rem 1.35rem; }
.kb-feat-card__category {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--kb-accent);
  margin-bottom: .45rem;
}
.kb-feat-card__title {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--kb-fg);
}
.kb-feat-card:hover .kb-feat-card__title { color: var(--kb-accent); }
.kb-feat-card__excerpt {
  margin: 0;
  color: var(--kb-muted);
  font-size: .9rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Prev / next article nav ── */
.kb-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3rem 0 2rem;
}
.kb-prevnext__btn {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: border-color .15s, transform .15s;
}
.kb-prevnext__btn:hover {
  border-color: var(--kb-accent);
  transform: translateY(-2px);
}
.kb-prevnext__btn--next { text-align: right; }
.kb-prevnext__label {
  font-size: .72rem;
  color: var(--kb-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
.kb-prevnext__title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--kb-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Buttons ── */
.kb-btn {
  display: inline-block;
  padding: .75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  transition: background .15s, transform .15s, border-color .15s;
  border: 1px solid transparent;
  font-family: inherit;
}
.kb-btn--primary { background: var(--kb-accent); color: #fff; }
.kb-btn--primary:hover { background: var(--kb-accent-dark); transform: translateY(-1px); }
.kb-btn--ghost {
  background: transparent;
  color: var(--kb-fg);
  border-color: var(--kb-border);
}
.kb-btn--ghost:hover { border-color: var(--kb-accent); color: var(--kb-accent); }

/* ── End-of-article CTA strip ── */
.kb-article__cta {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--kb-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.kb-article__cta-item {
  padding: 1.75rem 1.85rem;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 12px;
}
.kb-article__cta-item h3 {
  margin: 0 0 .4rem;
  font-size: 1.15rem;
}
.kb-article__cta-item p {
  color: var(--kb-muted);
  font-size: .9rem;
  margin: 0 0 1rem;
}

@media (max-width: 720px) {
  .kb-prevnext, .kb-article__cta { grid-template-columns: 1fr; }
  .kb-prevnext__btn--next { text-align: left; }
}

/* ── Breadcrumb ── */
.kb-breadcrumb {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: .85rem;
  color: var(--kb-muted);
}
.kb-breadcrumb a:hover { color: var(--kb-accent); }

/* ── Category listing ── */
.kb-cat__head {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
}
.kb-cat__head h1 {
  margin: 0 0 .5rem 0;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  letter-spacing: -.02em;
}
.kb-cat__lead { color: var(--kb-muted); margin: 0; font-size: 1.05rem; }
.kb-cat__intro {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  color: var(--kb-muted);
  font-size: 1rem;
}
.kb-articles {
  max-width: 860px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
  list-style: none;
}
.kb-article-row {
  border-top: 1px solid var(--kb-border);
}
.kb-article-row:last-child { border-bottom: 1px solid var(--kb-border); }
.kb-article-row a {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.1rem 0;
  transition: padding .15s;
}
.kb-article-row a:hover {
  padding-left: .5rem;
}
.kb-article-row__thumb {
  display: block;
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--kb-border);
}
.kb-article-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kb-article-row__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(37, 99, 235, .04));
  color: var(--kb-accent);
  font-weight: 800;
  font-size: 1.8rem;
}
.kb-article-row__body {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}
.kb-article-row__title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--kb-fg);
}
.kb-article-row a:hover .kb-article-row__title { color: var(--kb-accent); }
.kb-article-row__excerpt {
  color: var(--kb-muted);
  font-size: .9rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 520px) {
  .kb-article-row a { grid-template-columns: 72px 1fr; gap: .9rem; }
  .kb-article-row__thumb { width: 72px; height: 54px; }
}

/* ── Single article ── */
.kb-article {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
}
.kb-article__head {
  margin-bottom: 2rem;
}
.kb-article__head h1 {
  margin: .5rem 0;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  letter-spacing: -.02em;
  line-height: 1.15;
}
.kb-article__lead {
  color: var(--kb-muted);
  font-size: 1.15rem;
  margin: 0 0 1rem 0;
}
.kb-article__meta {
  color: var(--kb-muted);
  font-size: .85rem;
  display: flex;
  gap: .5rem;
}
.kb-article__hero {
  margin: 2rem 0 2.5rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 23, 42, .08);
}
.kb-article__hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.kb-article__body-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 1050px) {
  .kb-article__body-wrap {
    grid-template-columns: 1fr 200px;
  }
  .kb-toc {
    position: sticky;
    top: calc(var(--kb-head-h) + 16px);
    align-self: start;
  }
}
.kb-article__body { font-size: 1.05rem; line-height: 1.75; }
.kb-article__body h2 { font-size: 1.55rem; margin: 2.25rem 0 .9rem; letter-spacing: -.01em; }
.kb-article__body h3 { font-size: 1.25rem; margin: 1.75rem 0 .75rem; }
.kb-article__body p { margin: 0 0 1.1rem; }
.kb-article__body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.25rem 0; }
.kb-article__body a { color: var(--kb-accent); border-bottom: 1px solid currentColor; }
.kb-article__body ul, .kb-article__body ol { margin: 0 0 1.1rem; padding-left: 1.5rem; }
.kb-article__body blockquote {
  border-left: 3px solid var(--kb-accent);
  padding-left: 1rem;
  color: var(--kb-muted);
  margin: 1.5rem 0;
}
.kb-article__body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .85rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.kb-article__body code {
  background: var(--kb-border);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .9em;
}

/* ── TOC ── */
.kb-toc {
  font-size: .85rem;
}
.kb-toc__label {
  text-transform: uppercase;
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--kb-muted);
  margin-bottom: .65rem;
}
.kb-toc ol { list-style: none; padding: 0; margin: 0; }
.kb-toc__item { margin-bottom: .4rem; }
.kb-toc__item--h3 { padding-left: .9rem; }
.kb-toc__item--h4 { padding-left: 1.6rem; }
.kb-toc__item a { color: var(--kb-muted); }
.kb-toc__item a:hover { color: var(--kb-accent); }

/* ── Related + feedback ── */
.kb-article__related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--kb-border);
}
.kb-article__related h2 { font-size: 1.15rem; margin: 0 0 .75rem 0; }
.kb-article__related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.kb-article__related a { color: var(--kb-accent); font-weight: 500; }
.kb-article__related a:hover { text-decoration: underline; }

.kb-article__feedback {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.kb-article__feedback-label { font-weight: 500; }
.kb-article__feedback-btn {
  padding: .55rem 1.2rem;
  background: var(--kb-accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
}
.kb-article__feedback-btn:hover { background: var(--kb-accent-dark); }

/* ── Empty ── */
.kb-empty {
  max-width: 640px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  text-align: center;
  color: var(--kb-muted);
}

/* ── Footer ── */
.kb-foot {
  border-top: 1px solid var(--kb-border);
  padding: 2rem 1.5rem;
  font-size: .85rem;
  color: var(--kb-muted);
  background: var(--kb-surface);
}
.kb-foot__inner {
  max-width: var(--kb-max);
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.kb-foot__inner a { color: var(--kb-muted); }
.kb-foot__inner a:hover { color: var(--kb-accent); }

/* ── Responsive ── */
@media (max-width: 720px) {
  .kb-head__inner { flex-wrap: wrap; padding: .75rem 1rem; gap: .75rem; }
  .kb-head { height: auto; }
  .kb-search { order: 3; width: 100%; max-width: none; }
  .kb-head__nav { margin-left: 0; }
  .kb-hero { padding: 3rem 1.25rem 2rem; }
  .kb-hero__search { flex-direction: column; }
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --kb-bg: #0b1120;
  --kb-fg: #e2e8f0;
  --kb-muted: #94a3b8;
  --kb-border: #1f2937;
  --kb-surface: #0f172a;
  --kb-accent: #60a5fa;
  --kb-accent-dark: #3b82f6;
}
[data-theme="dark"] .kb-card__icon { background: rgba(96, 165, 250, .12); }
[data-theme="dark"] .kb-article__body pre { background: #020617; }
