.codepi-kb{ box-sizing:border-box; }
.codepi-kb *{ box-sizing:border-box; }

.codepi-kb-question-form{
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:20px;
  padding:24px;
  box-shadow:0 20px 60px rgba(15,23,42,.08);
  max-width:720px;
  margin:0 auto 32px;
}
.codepi-kb-question-form__form{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.codepi-kb-form-fields-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:14px;
  margin-bottom:18px;
}
.codepi-kb-form-fields-row--bottom{
  align-items:flex-end;
  gap:16px;
  margin-top:6px;
}
.codepi-kb-form-field label{
  display:block;
  font-weight:600;
  margin-bottom:6px;
  color:#0f172a;
}
.codepi-kb-form-field textarea,
.codepi-kb-form-field select,
.codepi-kb-form-field input{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  font-size:15px;
  font-family:inherit;
  background:#f8fafc;
}
.codepi-kb-form-field--flex{
  display:flex;
  flex-direction:column;
}
.codepi-kb-form-field--security{
  background:#f1f5f9;
  padding:18px;
  border-radius:14px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.codepi-kb-form-field__security{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  font-weight:600;
}
.codepi-kb-form-field__security span{
  flex:1 1 auto;
  min-width:220px;
}
.codepi-kb-form-field__security input{
  width:140px;
  max-width:100%;
  flex:0 0 auto;
}
.codepi-kb-btn{
  align-self:flex-start;
  padding:12px 24px;
  border:none;
  border-radius:999px;
  background:#0ea5e9;
  color:#fff;
  font-weight:700;
  cursor:pointer;
  transition:transform .2s ease;
}
.codepi-kb-btn:hover{
  transform:translateY(-2px);
}
.codepi-kb-form-notice{
  padding:12px 16px;
  border-radius:12px;
  margin-bottom:12px;
  font-weight:600;
}
.codepi-kb-form-notice-success{
  background:#dcfce7;
  color:#166534;
}
.codepi-kb-form-notice-error{
  background:#fee2e2;
  color:#9f1239;
}

.codepi-kb-search-shell{
  background:#fff;
  border:1px solid rgba(15,23,42,.1);
  border-radius:22px;
  padding:22px;
  box-shadow:0 20px 60px rgba(15,23,42,.08);
  margin-bottom:32px;
}
.codepi-kb-search-shell__form{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.codepi-kb-search-shell__form input,
.codepi-kb-search-shell__form select{
  flex:1;
  min-width:160px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  background:#f8fafc;
}
.codepi-kb-search-shell__form button{
  padding:10px 18px;
  border-radius:12px;
  border:none;
  background:#0ea5e9;
  color:#fff;
  font-weight:700;
  cursor:pointer;
}
.codepi-kb-search-shell__ajax-results{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:16px;
}
.codepi-kb-search-shell__ajax-item{
  padding:12px 16px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.08);
  text-decoration:none;
  color:#0f172a;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.codepi-kb-search-shell__ajax-item strong{
  font-size:16px;
}
.codepi-kb-search-shell__ajax-item em{
  font-size:12px;
  color:#475569;
}
.codepi-kb-search-shell__ajax-item .meta{
  font-size:12px;
  display:flex;
  justify-content:space-between;
  color:#64748b;
}
.codepi-kb-search-shell__ajax-answer{
  font-size:13px;
  color:#475569;
  margin:0;
}
.codepi-kb-search-shell__ajax-empty{
  color:#475569;
  font-size:14px;
  margin:0;
}

.codepi-kb-cats{
  display:grid;
  gap:16px;
  margin: 14px 0;
}
.codepi-kb-cats.cols-1{ grid-template-columns:1fr; }
.codepi-kb-cats.cols-2{ grid-template-columns:repeat(2, 1fr); }
.codepi-kb-cats.cols-3{ grid-template-columns:repeat(3, 1fr); }
.codepi-kb-cats.cols-4{ grid-template-columns:repeat(4, 1fr); }
.codepi-kb-cats.cols-5{ grid-template-columns:repeat(5, 1fr); }
.codepi-kb-cats.cols-6{ grid-template-columns:repeat(6, 1fr); }

.codepi-kb-cat{
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  overflow:hidden;
  text-decoration:none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.codepi-kb-cat:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
}
.codepi-kb-cat-img{
  width:100%;
  height:160px;
  object-fit:cover;
  display:block;
  background:#f4f4f5;
}
.codepi-kb-cat-img.placeholder{
  height:160px;
  background:linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}
.codepi-kb-cat-body{ padding:14px; }
.codepi-kb-cat .title{
  font-weight:700;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:#0f172a;
}
.codepi-kb-cat .count{
  font-weight:600;
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(0,0,0,.06);
  color:#0f172a;
}
.codepi-kb-cat .desc{
  margin-top:8px;
  font-size:13px;
  color:#334155;
  opacity:.85;
  line-height:1.6;
}

.codepi-kb-articles{ margin: 14px 0; }
.codepi-kb-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.codepi-kb-back{
  text-decoration:none;
  font-weight:600;
}
.codepi-kb-search{
  display:flex;
  gap:8px;
}
.codepi-kb-search input{
  padding:8px 10px;
  border:1px solid rgba(0,0,0,.15);
  border-radius:10px;
}
.codepi-kb-search button{
  padding:8px 12px;
  border:1px solid rgba(0,0,0,.15);
  border-radius:10px;
  background:#fff;
  cursor:pointer;
}
.codepi-kb-heading{
  margin: 10px 0 8px;
  font-size:20px;
}
.codepi-kb-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.codepi-kb-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  text-decoration:none;
  background:#fff;
}
.codepi-kb-item .q{ font-weight:650; color:#0f172a; }
.codepi-kb-item .meta{ font-size:12px; color:#64748b; white-space:nowrap; }
.codepi-kb-item-cat{
  display:inline-block;
  margin-left:8px;
  font-size:11px;
  padding:2px 8px;
  background:rgba(14,165,233,.1);
  border-radius:999px;
  color:#0ea5e9;
}
.codepi-kb-empty{ padding:14px; background:#fff; border:1px dashed rgba(0,0,0,.2); border-radius:14px; }

.codepi-kb-single{
  width:100%;
}
.codepi-kb-single-wrapper{
  width:100%;
}
.codepi-kb-single-article{
  background:#fff;
  border-radius:28px;
  padding:32px;
  box-shadow:0 40px 80px rgba(15,23,42,.08);
  margin-bottom:48px;
  margin-top:48px;
}
.codepi-kb-single-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:18px;
}
.codepi-kb-single-header h1{
  margin:0;
  font-size:32px;
  line-height:1.2;
}
.codepi-kb-single-meta{
  margin:0;
  font-weight:600;
  color:#475569;
  font-size:13px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.codepi-kb-single-meta__category{
  text-decoration:none;
  color:inherit;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(15,23,42,.06);
}
.codepi-kb-single-meta__category:hover{
  background:rgba(15,23,42,.1);
}
.codepi-kb-single-thumb{
  margin:24px 0;
}
.codepi-kb-single-question-text{
  font-size:18px;
  line-height:1.8;
  margin-bottom:24px;
}
.codepi-kb-single-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:20px;
}
.codepi-kb-single-card{
  border:1px solid rgba(15,23,42,.08);
  border-radius:20px;
  padding:20px;
  background:linear-gradient(180deg, #fff, #f8fafc);
}
.codepi-kb-single-card h2{
  margin-top:0;
  margin-bottom:12px;
  font-size:18px;
}
.codepi-kb-single-question p,
.codepi-kb-single-answer__content{
  margin:0;
  line-height:1.7;
}
.codepi-kb-single-answer{
  margin-top:32px;
}
.codepi-kb-single-answer__empty{
  color:#475569;
}
.codepi-kb-single-tags{
  margin-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  font-size:14px;
}
.codepi-kb-single-tag-label{
  font-weight:600;
  color:#0f172a;
}
.codepi-kb-single-tag{
  padding:6px 12px;
  border-radius:999px;
  background:#e0f2fe;
  color:#0369a1;
  font-weight:600;
}
.codepi-kb-single-related{
  margin-top:28px;
}
.codepi-kb-single-related h3{
  margin-bottom:12px;
}
.codepi-kb-single-related-list{
  display:grid;
  gap:12px;
}
.codepi-kb-single-related-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.08);
  text-decoration:none;
  color:#0f172a;
  font-weight:600;
}
.codepi-kb-single-related-item small{
  font-size:12px;
  font-weight:400;
  color:#475569;
}

@media (max-width: 900px) {
  .codepi-kb-cats{
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  }
}
@media (max-width: 560px) {
  .codepi-kb-cats{
    display:flex;
    overflow-x:auto;
    gap:12px;
    padding-bottom:6px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
  }
  .codepi-kb-cats.cols-1,
  .codepi-kb-cats.cols-2,
  .codepi-kb-cats.cols-3,
  .codepi-kb-cats.cols-4,
  .codepi-kb-cats.cols-5,
  .codepi-kb-cats.cols-6{
    grid-template-columns:none;
  }
  .codepi-kb-cat{
    flex:0 0 86%;
    scroll-snap-align:start;
  }
  .codepi-kb-cat-img,
  .codepi-kb-cat-img.placeholder{
    height:140px;
  }
  .codepi-kb-form-field--security{
    flex-direction:column;
    align-items:stretch;
  }
  .codepi-kb-form-field__security{
    width:100%;
    flex-direction:column;
    align-items:stretch;
  }
  .codepi-kb-form-field__security span{
    min-width:0;
  }
  .codepi-kb-form-field__security input{
    width:100%;
  }
  .codepi-kb-btn{
    width:100%;
    justify-content:center;
    text-align:center;
  }
}
