.category-page {
  color: #172033;
  background-color: #f5f7fa;
}

.subpage-header-category {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(213, 220, 231, 0.9);
  background: rgba(249, 251, 253, 0.96);
  box-shadow: 0 4px 20px rgba(28, 39, 58, 0.05);
}

.category-header-shell {
  padding: 14px 16px 20px;
}

.category-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-back-link,
.category-directory-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  gap: 7px;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #526074;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.category-back-link {
  padding: 0 12px;
}

.category-directory-link {
  padding: 0 11px;
}

.category-back-link:hover,
.category-directory-link:hover {
  border-color: #a9c7f7;
  background: #eef5ff;
  color: #1d63d7;
  transform: translateY(-1px);
}

.category-header-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  align-items: end;
  gap: 28px;
  margin-top: 18px;
}

.category-identity-block {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.category-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #fff;
  color: #2870df;
  box-shadow: 0 9px 22px rgba(40, 74, 124, 0.11), 0 1px 2px rgba(15, 23, 42, 0.06);
}

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

.category-visual .ui-svg-icon {
  font-size: 25px;
}

.category-title-group {
  min-width: 0;
}

.category-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #2f6fcf;
  font-size: 10px;
  font-weight: 700;
}

.category-title-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.category-title-line h1 {
  overflow: hidden;
  margin: 0;
  color: #151d2b;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid #cfe0fb;
  border-radius: 999px;
  background: #edf5ff;
  color: #2766c5;
  font-size: 11px;
  font-weight: 600;
}

.category-summary {
  display: -webkit-box;
  overflow: hidden;
  max-width: 620px;
  margin: 5px 0 0;
  color: #657287;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.category-updated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: #3e8b72;
  font-size: 11px;
  font-weight: 500;
}

.category-updated .ui-svg-icon {
  font-size: 10px;
}

.category-desktop-tools,
.category-mobile-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 8px;
}

.category-mobile-tools {
  display: none;
}

.category-search-control,
.category-search-control label {
  display: block;
  width: 100%;
}

.category-search-control label,
.category-sort-control {
  position: relative;
}

.category-search-control label > span,
.category-sort-control > .ui-svg-icon {
  position: absolute;
  top: 50%;
  z-index: 1;
  color: #91a0b5;
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-50%);
}

.category-search-control label > span {
  left: 13px;
}

.category-sort-control > .ui-svg-icon {
  right: 12px;
}

.category-search-control input,
.category-sort-control select {
  width: 100%;
  height: 41px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #344156;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(22, 34, 54, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.category-search-control input {
  padding: 0 13px 0 36px;
}

.category-sort-control select {
  appearance: none;
  padding: 0 32px 0 12px;
  cursor: pointer;
}

.category-search-control input:focus,
.category-sort-control select:focus {
  border-color: #7aa8ec;
  box-shadow: 0 0 0 3px rgba(48, 112, 214, 0.12);
}

.collection-main[data-mode="category"] {
  width: 100%;
  margin-top: 0;
  padding-top: 24px;
  padding-bottom: 54px;
}

.category-apps-section {
  min-width: 0;
}

.category-apps-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 11px;
  padding: 0 2px;
}

.category-apps-heading span,
.category-explorer-heading > div > span {
  display: block;
  margin-bottom: 2px;
  color: #8290a4;
  font-size: 10px;
  font-weight: 650;
}

.category-apps-heading h2,
.category-explorer-heading h2 {
  margin: 0;
  color: #1d2737;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.category-apps-heading strong {
  color: #66758a;
  font-size: 12px;
  font-weight: 600;
}

.category-software-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.collection-main[data-mode="category"] .collection-software-card {
  border-color: rgba(220, 227, 237, 0.96);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 16px rgba(31, 44, 66, 0.055);
}

.collection-main[data-mode="category"] .collection-software-card:hover {
  border-color: #acc9f5;
  box-shadow: 0 9px 25px rgba(31, 68, 125, 0.11);
}

.collection-main[data-mode="category"] .category-explorer {
  margin-top: 26px;
  padding: 17px 18px 18px;
  border: 1px solid #dbe6f4;
  border-radius: 8px;
  background: rgba(240, 246, 253, 0.94);
}

.category-explorer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.category-explorer .load-more-btn {
  min-width: 0;
  height: 34px;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid #cbd9eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #52667f;
  font-size: 11px;
  font-weight: 600;
}

.category-explorer .load-more-btn:hover {
  border-color: #9dbdeb;
  background: #fff;
  color: #2466c8;
}

.category-explorer #categoryList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.category-explorer #categoryList > a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d9e2ed;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #415067;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.category-explorer #categoryList > a::after {
  color: #9aa8ba;
  content: "›";
  font-size: 16px;
  line-height: 1;
}

.category-explorer #categoryList > a:hover {
  border-color: #aac5eb;
  background: #fff;
  color: #225fba;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .category-header-main {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
  }

  .category-software-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  body.category-page.desktop-bg {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
  }
}

@media (max-width: 700px) {
  .subpage-header-category {
    box-shadow: 0 3px 14px rgba(28, 39, 58, 0.045);
  }

  .category-header-shell {
    padding: 10px 11px 14px;
  }

  .category-back-link,
  .category-directory-link {
    min-height: 34px;
    font-size: 11px;
  }

  .category-back-link {
    width: 34px;
    padding: 0;
  }

  .category-back-link span {
    display: none;
  }

  .category-directory-link {
    padding: 0 9px;
  }

  .category-header-main {
    display: block;
    margin-top: 13px;
  }

  .category-identity-block {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
  }

  .category-visual {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(40, 74, 124, 0.1);
  }

  .category-eyebrow {
    margin-bottom: 2px;
    font-size: 9px;
  }

  .category-title-line {
    gap: 6px;
  }

  .category-title-line h1 {
    font-size: 19px;
  }

  .category-count {
    padding: 2px 6px;
    font-size: 9px;
  }

  .category-summary {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.4;
    -webkit-line-clamp: 1;
  }

  .category-updated {
    margin-top: 3px;
    font-size: 10px;
  }

  .category-desktop-tools {
    display: none;
  }

  .category-mobile-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 7px;
    margin-top: 13px;
  }

  .category-search-control input,
  .category-sort-control select {
    height: 39px;
    font-size: 11px;
  }

  .collection-main[data-mode="category"] {
    margin-top: 0;
    padding: 16px 10px 40px;
  }

  .category-apps-heading {
    margin-bottom: 8px;
    padding: 0 1px;
  }

  .category-apps-heading span,
  .category-explorer-heading > div > span {
    font-size: 9px;
  }

  .category-apps-heading h2,
  .category-explorer-heading h2 {
    font-size: 15px;
  }

  .category-apps-heading strong {
    font-size: 11px;
  }

  .collection-main[data-mode="category"] .category-explorer {
    margin-top: 20px;
    padding: 14px 12px;
  }

  .category-explorer-heading {
    gap: 10px;
  }

  .category-explorer .load-more-btn {
    height: 32px;
    padding: 0 9px;
  }

  .category-explorer #categoryList {
    gap: 7px;
    margin-top: 11px;
  }

  .category-explorer #categoryList > a {
    min-height: 32px;
    padding: 0 9px;
    font-size: 11px;
  }
}

@media (max-width: 370px) {
  .category-title-line h1 {
    font-size: 17px;
  }

  .category-mobile-tools {
    grid-template-columns: minmax(0, 1fr) 98px;
  }

  .category-directory-link span {
    display: none;
  }

  .category-directory-link {
    width: 34px;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-back-link,
  .category-directory-link,
  .category-explorer #categoryList > a {
    transition: none;
  }
}
