.cqd-directory {
  color: #192137;
}

.cqd-archive-page {
  min-height: 60vh;
  padding: 32px 0 48px;
  background: #fff;
}

.cqd-archive-container {
  width: 100%;
  max-width: 1585px;
  margin: 0 auto;
  padding: 0 16px;
}

.cqd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: #6c757d;
  font-size: 14px;
}

.cqd-breadcrumb a {
  color: #28c76f;
  text-decoration: none;
}

.cqd-heading {
  margin: 0 0 18px;
  padding-left: 12px;
  border-left: 4px solid #28c76f;
  color: #1a2b4b;
  font-size: 24px;
  line-height: 1.35;
}

.cqd-subjects {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.cqd-subject {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #1a2b4b;
  font-size: 14px;
  text-decoration: none;
}

.cqd-subject:hover,
.cqd-subject.is-active {
  border-color: #28c76f;
  background: #28c76f;
  color: #fff;
}

.cqd-search {
  display: flex;
  max-width: 680px;
  margin: 0 0 22px;
}

.cqd-search input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #fff;
  box-shadow: none;
  color: #192137;
}

.cqd-search button {
  min-width: 100px;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: #22c55e;
  color: #fff;
  cursor: pointer;
}

.cqd-search button:hover {
  background: #16a34a;
  color: #fff;
}

.cqd-status {
  min-height: 0;
  color: #6c757d;
  font-size: 14px;
}

.cqd-class-section {
  margin-top: 30px;
}

.cqd-class-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.cqd-class-section > header h2 {
  margin: 0;
  color: #1a2b4b;
  font-size: 22px;
  line-height: 1.4;
}

.cqd-class-section > header a {
  flex: 0 0 auto;
  color: #28c76f;
  font-size: 14px;
  text-decoration: none;
}

.cqd-directory.is-loading .cqd-results {
  opacity: .55;
  pointer-events: none;
}

.cqd-directory--exam .cqd-heading {
  margin-bottom: 26px;
  padding-left: 0;
  border-left: 0;
  font-size: 28px;
}

.cqd-directory__description {
  margin: -12px 0 24px;
  color: #6c757d;
  line-height: 1.6;
}

.cqd-directory--university-child .cqd-heading {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  margin-bottom: 4px;
  padding-left: 80px;
  border-left: 0;
  font-size: 28px;
}

.cqd-directory--university-child .cqd-heading::before {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: #f1f3f7;
  color: #1a2b4b;
  content: "▤";
  font-size: 26px;
}

.cqd-directory__stats {
  margin: 0 0 28px 80px;
  color: #6c757d;
  font-size: 14px;
}

.cqd-directory__description--panel {
  margin: 0 0 26px;
  padding: 16px;
  border-radius: 6px;
  background: #f6f8fb;
}

.cqd-directory--university-child .cqd-search {
  max-width: none;
  margin-bottom: 28px;
}

.cqd-directory--exam .cqd-subjects {
  flex-wrap: wrap;
  margin-bottom: 24px;
  overflow: visible;
}

.cqd-directory--exam .cqd-subject {
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(26, 43, 75, .08);
}

.cqd-directory--exam .cqd-search {
  max-width: none;
  margin-bottom: 28px;
}

.cqd-exam-section {
  margin-top: 30px;
}

.cqd-exam-section > h2 {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid #28c76f;
  color: #1a2b4b;
  font-size: 22px;
  line-height: 1.4;
}

.cqd-university-child-section {
  margin-top: 30px;
}

.cqd-university-child-section > h2 {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid #22c55e;
  color: #1a2b4b;
  font-size: 22px;
  line-height: 1.4;
}

.cqd-directory--exam .cqd-grid {
  gap: 16px;
}

.cqd-directory--exam .cqd-card {
  min-height: 258px;
}

.cqd-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.cqd-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 210px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
}

.cqd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 43, 75, .08);
}

.cqd-card__title {
  margin: 0 0 12px;
  color: #192137;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cqd-card__subject {
  margin: 0 0 18px;
  color: #6c757d;
  font-size: 14px;
}

.cqd-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: #6c757d;
  font-size: 14px;
}

.cqd-card__actions {
  margin-top: 18px;
}

.cqd-card__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  border-radius: 7px;
  background: #22c55e;
  color: #fff;
  text-decoration: none;
}

.cqd-card__button:hover {
  background: #16a34a;
  color: #fff;
}

.cqd-card__button.is-disabled {
  background: #a8b0ba;
  cursor: not-allowed;
}

.cqd-empty {
  padding: 22px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  color: #6c757d;
  text-align: center;
}

.cqd-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
}

.cqd-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  color: #1a2b4b;
  text-decoration: none;
}

.cqd-pagination .page-numbers.current {
  border-color: #1a2b4b;
  background: #1a2b4b;
  color: #fff;
}

.cqd-university {
  color: #192137;
}

.cqd-university__header {
  margin-bottom: 28px;
}

.cqd-university__header h1,
.cqd-university__header h2 {
  margin: 0 0 10px;
  color: #1a2b4b;
  font-size: 28px;
  line-height: 1.3;
}

.cqd-university__header p {
  margin: 0;
  padding: 16px;
  border-radius: 6px;
  background: #f6f8fb;
  color: #6c757d;
  line-height: 1.6;
}

.cqd-university__section {
  margin-bottom: 34px;
}

.cqd-university__section > h2,
.cqd-university__section > h3 {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid #28c76f;
  color: #1a2b4b;
  font-size: 24px;
  line-height: 1.35;
}

.cqd-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
}

.cqd-category-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 354px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.cqd-category-card h4 {
  margin: 0 0 8px;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.cqd-category-card__image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 200px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 6px;
  background: #f4f7f9;
}

.cqd-category-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cqd-category-card__image span {
  color: #28c76f;
  font-size: 54px;
  font-weight: 700;
}

.cqd-category-card footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  color: #6c757d;
  font-size: 14px;
  text-align: left;
}

.cqd-category-card footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 36px;
  padding: 8px 20px;
  border-radius: 8px;
  background: #28c76f;
  color: #fff;
  text-decoration: none;
}

.cqd-category-card footer a:hover {
  background: #23af60;
  color: #fff;
}

.header-nav .cqd-menu-root > .nav-dropdown,
.header-nav .cqd-menu-root > .sub-menu,
.cqd-menu-root > .nav-dropdown,
.cqd-menu-root > .sub-menu {
  display: block !important;
  width: 280px;
  max-height: min(40rem, 72vh) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

.cqd-menu-root > .nav-dropdown > .cqd-menu-category > a,
.cqd-menu-root > .sub-menu > .cqd-menu-category > a {
  padding: 8px 12px;
  color: #192137;
  font-size: 14px;
  line-height: 1.35;
  text-transform: none;
}

.cqd-menu-root > .nav-dropdown > .cqd-menu-category > a:hover,
.cqd-menu-root > .sub-menu > .cqd-menu-category > a:hover {
  color: #22c55e;
}

.cqd-menu-search {
  position: sticky;
  z-index: 2;
  top: 0;
  margin: 0;
  padding: 8px;
  background: #fff;
  list-style: none;
}

.cqd-menu-search input[type="search"] {
  width: 100%;
  height: 38px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
  font-size: 14px;
  text-transform: none;
}

.cqd-menu-category.is-cqd-hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .cqd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .cqd-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }

  .cqd-category-card {
    min-height: 310px;
    padding: 12px;
  }

  .cqd-category-card__image {
    height: 160px;
  }
}

@media (max-width: 640px) {
  .cqd-heading {
    font-size: 20px;
  }

  .cqd-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cqd-search button {
    min-width: 86px;
  }
}
