.page-download .site-main,
.page-download .site-footer {
  width: calc(100vw - 32px);
  max-width: 1840px;
}

.site-header__catalog {
  flex: 0 1 420px;
  width: calc(100vw - 800px);
  width: min(420px, calc(100vw - 800px));
  max-width: 420px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.site-header__catalog svg,
.catalog-search svg,
.catalog-filter-button svg,
.catalog-filters__mobile-head svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.site-header__catalog input,
.catalog-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.site-header__catalog:focus-within,
.catalog-search:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.catalog-mobile-toolbar { display: none; }
.download-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (min-width: 1101px) {
  .page-download .download-layout,
  .page-changelog .download-layout {
    min-height: 0;
    flex: 1;
    align-items: stretch;
    overflow: hidden;
  }

  .page-download .catalog-left-rail,
  .page-download .catalog-results,
  .page-download .changelog-content,
  .page-changelog .catalog-left-rail,
  .page-changelog .catalog-results,
  .page-changelog .changelog-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .page-download.catalog-filter-open .catalog-results,
  .page-download.catalog-filter-open .changelog-content,
  .page-changelog.catalog-filter-open .catalog-results,
  .page-changelog.catalog-filter-open .changelog-content {
    overflow: hidden;
    overscroll-behavior: none;
  }
}

.catalog-left-rail {
  position: sticky;
  top: 74px;
  z-index: 3;
  max-height: calc(100vh - 90px);
  overflow: auto;
  scrollbar-width: thin;
}

@media (min-width: 1101px) {
  .page-download .catalog-left-rail,
  .page-changelog .catalog-left-rail {
    position: static;
    top: auto;
    height: 100%;
    max-height: none;
  }
}

.catalog-page-notices {
  gap: 8px;
  margin: 0 0 10px;
}
.catalog-page-notices .page-notice {
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.catalog-filters__mobile-head { display: none; }
.catalog-filter-groups { display: grid; gap: 10px; }

.catalog-filter-group {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.catalog-filter-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.catalog-filter-group summary::-webkit-details-marker { display: none; }
.catalog-filter-group summary svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .16s ease;
}
.catalog-filter-group:not([open]) summary svg { transform: rotate(-90deg); }

.catalog-filter-options {
  display: grid;
  gap: 3px;
  padding: 0 10px 12px;
}

.catalog-filter-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
}
.catalog-filter-option:hover { background: var(--panel-muted); color: var(--text); }
.catalog-filter-option input { width: 16px; height: 16px; accent-color: var(--accent); }
.catalog-filter-option input:checked + span { color: var(--text); }

.catalog-results { min-width: 0; }
.catalog-suggestions { margin-top: 28px; }
.catalog-load-more {
  min-height: 44px;
  padding: 12px 0;
  text-align: center;
}
.catalog-load-more button { min-height: 36px; }
.catalog-load-more span:not(:empty) {
  display: block;
  margin-top: 8px;
}
.catalog-suggestions > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16px;
}
.catalog-suggestions > h2::before,
.catalog-suggestions > h2::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}
.catalog-suggestions > h2 span { flex: 0 1 auto; text-align: center; }

.catalog-filter-backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(3px);
  touch-action: none;
}

.catalog-search {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.catalog-filter-button,
.catalog-filters__mobile-head button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.catalog-filter-button { padding: 0 13px; }
.catalog-filter-count {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #140f08;
  font-size: 12px;
}
