:root {
  --primary: #D84A15;
  --primary-dark: #B23A0F;
  --primary-soft: rgba(216, 74, 21, 0.08);
  --bg: #f5f6fa;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.06);
  --text: #1f2937;
  --text-soft: #6b7280;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: 'Rubik', sans-serif;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-family: 'Oswald', sans-serif; letter-spacing: .3px; }

/* SHELL: full width, breathable */
.kb-shell {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.75rem clamp(1rem, 2vw, 2.5rem) 3rem;
}

/* HEADER */
.kb-header {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 90% -20%, rgba(216,74,21,0.35), transparent 60%),
    linear-gradient(135deg, #0f172a 0%, #111827 50%, #1f2937 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.75rem);
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-lg);
}
.kb-header::before {
  content: "";
  position: absolute; inset: -2px;
  background: radial-gradient(600px 200px at 0% 100%, rgba(255,255,255,0.06), transparent 70%);
  pointer-events: none;
}
.kb-header h1 {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 .35rem;
}
.kb-header p {
  margin: 0;
  opacity: .82;
  font-size: .98rem;
  max-width: 780px;
}

/* SEARCH BAR */
.kb-search-wrap {
  margin-top: 1.4rem;
  position: relative;
  max-width: 820px;
}
.kb-search-wrap i.bi-search {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: #9ca3af; font-size: 1.05rem;
}
.kb-search-wrap input {
  width: 100%;
  padding: 1rem 1.1rem 1rem 3rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #ffffff;
  font-size: 1rem;
  color: var(--text);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: box-shadow .2s ease, transform .2s ease;
}
.kb-search-wrap input:focus {
  box-shadow: 0 0 0 4px rgba(216,74,21,0.18), var(--shadow-md);
}

/* LAYOUT: wider sidebar + spacious main */
.kb-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .kb-layout { grid-template-columns: 1fr; }
}

/* SIDEBAR */
.kb-side {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  position: sticky; top: 1rem;
  height: fit-content;
  box-shadow: var(--shadow-sm);
}
.kb-side h6 {
  text-transform: uppercase;
  font-size: .7rem;
  color: var(--text-soft);
  letter-spacing: 1px;
  margin: .25rem .35rem .75rem;
}
.kb-cat-btn {
  display: flex; align-items: center; gap: .65rem;
  width: 100%;
  background: transparent; border: none;
  border-radius: 10px;
  padding: .65rem .8rem;
  font-size: .92rem;
  color: #374151;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.kb-cat-btn:hover { background: #f3f4f6; }
.kb-cat-btn.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}
.kb-cat-btn i { font-size: 1rem; opacity: .85; }
.kb-cat-btn .kb-count {
  margin-left: auto;
  font-size: .72rem;
  background: #eef0f3; color: #4b5563;
  padding: 2px 9px; border-radius: 999px;
  font-weight: 600;
}
.kb-cat-btn.active .kb-count { background: var(--primary); color: #fff; }

/* MAIN: results grid (2 columns on wide screens, 1 on mid/small) */
.kb-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.1rem;
}
@media (max-width: 720px) {
  .kb-results { grid-template-columns: 1fr; }
}

/* CARD */
.kb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.kb-card::before {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), #ff7a3d);
  opacity: .85;
}
.kb-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(216,74,21,0.25);
}
.kb-card h5 {
  margin: 0 0 .5rem 0;
  font-size: 1.08rem;
  font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
  color: #111827;
  padding-left: .25rem;
}
.kb-card h5 i { color: var(--primary); }
.kb-card .kb-tags {
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin: .25rem 0 .8rem;
  padding-left: .25rem;
}
.kb-tag {
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  border: 1px solid rgba(216,74,21,0.15);
}
.kb-card details { cursor: pointer; padding-left: .25rem; }
.kb-card details summary {
  list-style: none; outline: none;
  color: var(--primary);
  font-size: .88rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem 0;
}
.kb-card details summary::-webkit-details-marker { display: none; }
.kb-card details summary i { transition: transform .2s ease; }
.kb-card details[open] summary i { transform: rotate(90deg); }

.kb-body {
  padding: .9rem .25rem 0;
  color: #374151;
  font-size: .96rem;
  line-height: 1.7;
}
.kb-body p { margin: 0 0 .75rem; }
.kb-body ul, .kb-body ol { padding-left: 1.25rem; margin: .25rem 0 .75rem; }
.kb-body li { margin-bottom: .35rem; }
.kb-body strong, .kb-body b { color: #111827; }
.kb-body code {
  background: #f3f4f6; padding: 1px 6px; border-radius: 6px;
  font-size: .9em; color: #b23a0f;
}

/* HIGHLIGHT */
mark {
  background: linear-gradient(180deg, transparent 55%, #ffe28a 55%);
  padding: 0 2px; border-radius: 3px; color: inherit;
}

/* EMPTY STATE */
.kb-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-soft);
  background: var(--card);
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.kb-empty i { color: #cbd5e1; }

/* SCROLLBARS */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
