.ceh-custom-report-chapter-filter-block {
  width: 100%;

  /* Layout */
  --ceh-sidebar-width: 265px;
  --ceh-layout-gap: 2rem;
  --ceh-card-gap: 1.5rem;
  --ceh-card-radius: 12px;
  --ceh-card-padding: 1.25rem;
  --card-count: 3;
  --card-min-width: 220px;

  /* Header/toolbar offsets */
  --ceh-header-height: 111px;
  --ceh-header-offset: 4px;
  /* extra breathing room below header for sticky top */
  --ceh-bottom-spacing: 39px;
  /* reserved space below viewport for max-height calc */
  --ceh-toolbar-height: 0px;
  /* overridden to 60px when gin secondary toolbar is present */

  /* Colors */
  --ceh-border-color: #dfe3e8;
  --ceh-card-shadow: rgba(0, 0, 0, 0.04);
  --ceh-title-color: #1a1a1a;
  --ceh-heading-color: #1b1b1b;
  --ceh-text-color: #3a3a3a;
  --ceh-count-bg: #1cabe2;
  --ceh-scrollbar-thumb: #c1c1c1;
  --ceh-scrollbar-thumb-hover: #a8a8a8;
  --ceh-input-border: #c9ced3;
}

/* When logged in, Gin's secondary toolbar adds extra fixed height above the content */
body.gin-secondary-toolbar--frontend .ceh-custom-report-chapter-filter-block {
  --ceh-toolbar-height: 60px;
}

.ceh-custom-report-chapter-filter-title {
  margin: 0 0 1.5rem;
}

.ceh-custom-report-chapter-filter-layout {
  display: flex;
  gap: var(--ceh-layout-gap);
  align-items: flex-start;
}

.ceh-custom-report-chapter-filter-sidebar {
  flex: 0 0 var(--ceh-sidebar-width);
  max-width: var(--ceh-sidebar-width);
  width: 100%;
  position: sticky;
  top: calc(var(--ceh-header-height) + var(--ceh-header-offset) + var(--ceh-toolbar-height));
  max-height: calc(100vh - var(--ceh-header-height) - var(--ceh-bottom-spacing) - var(--ceh-toolbar-height));
  overflow: auto;

  /* Standard (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: var(--ceh-scrollbar-thumb) transparent;
  padding-right: 10px;
}

/* WebKit & Chromium (Chrome, Safari, Edge) */
.ceh-custom-report-chapter-filter-sidebar::-webkit-scrollbar {
  width: 6px;
}

.ceh-custom-report-chapter-filter-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.ceh-custom-report-chapter-filter-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--ceh-scrollbar-thumb);
  border-radius: 4px;
}

.ceh-custom-report-chapter-filter-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--ceh-scrollbar-thumb-hover);
}

.ceh-custom-report-chapter-filter-results-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

.ceh-custom-report-chapter-results {
  display: grid;
  grid-template-columns: repeat(var(--card-count), minmax(var(--card-min-width), 1fr));
  gap: var(--ceh-card-gap);
}

.ceh-custom-report-chapter-card {
  min-height: 100%;
}

.ceh-custom-report-chapter-card .he-card {
  display: flex;
  height: 100%;
  background: #fff;
  border: 1px solid var(--ceh-border-color);
  border-radius: var(--ceh-card-radius);
  padding: var(--ceh-card-padding);
  box-shadow: 0 2px 8px var(--ceh-card-shadow);
  text-decoration: none;
  color: inherit;
  flex-direction: column;
  gap: 14px;
}

.ceh-custom-report-chapter-card .label-ch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ceh-custom-report-chapter-card .label-text {
  font-size: .75rem;
  text-transform: uppercase;
  color: var(--ceh-title-color);
}

.ceh-custom-report-chapter-card .label-count {
  background: var(--ceh-count-bg);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.ceh-custom-report-chapter-card .dsc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ceh-text-color);
}

.chapter-search-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ceh-input-border);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
}

.chapter-filter-group {
  margin-bottom: 1rem;
}

.chapter-filter-group>summary,
.chapter-filter-group>.details-wrapper {
  border: 1px solid var(--ceh-border-color);
  background: #fff;
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
}

.chapter-filter-group .form-checkbox {
  margin-right: 0.6rem;
}

.report-chapter-filter-reset {
  margin-top: 1rem;
  width: max-content;
}

.ceh-custom-report-chapter-load-more {
  display: flex;
  margin-top: 2rem;
}

.ceh-custom-report-chapter-empty {
  width: 100%;
  text-align: center;
  padding: 50px;
  font-weight: 500;
}


.he-more-btn {
  display: inline-block;
  color: #212529;
  font-size: 1.125rem;
  font-weight: 700;
  position: relative;
  margin-top: auto;
  z-index: 3;
  width: max-content;
}

.he-more-btn:before {
  content: "";
  background-color: #1cabe2;
  position: absolute;
  left: .5rem;
  bottom: -0.125rem;
  width: 100%;
  height: .188rem;
  z-index: -1;
  transition: all .3s ease-in-out;
}

.he-more-btn:after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  content: "";
}

.he-card:hover .he-more-btn::after,
.he-card:hover .he-more-btn::before {
  left: -0.313rem;
  bottom: -0.125rem;
  height: calc(100% + .25rem);
  width: calc(100% + .625rem);
}

@media screen and (max-width: 1199px) {
  .ceh-custom-report-chapter-filter-block {
    --ceh-sidebar-width: 210px;
    --ceh-layout-gap: 1.5rem;
    --card-min-width: 210px;
  }
}

@media screen and (max-width: 991px) {
  .ceh-custom-report-chapter-filter-block {
    --card-count: 1;
    --card-min-width: 190px;
    --ceh-sidebar-width: 240px;
    --ceh-layout-gap: 1.25rem;
    --ceh-card-gap: 1rem;
  }
}

@media screen and (max-width: 767px) {
  .ceh-custom-report-chapter-filter-layout {
    flex-direction: column;
  }

  .ceh-custom-report-chapter-filter-sidebar {
    max-width: 100%;
    width: 100%;
    flex-basis: auto;
    position: static;
  }

  .ceh-custom-report-chapter-results {
    grid-template-columns: 1fr;
  }
}
