.photo-categories {
  --category-ink: #253244;
  --category-muted: #93a3b8;
  --category-line: #b6c0cf;
  --category-slate: #253245;
  --category-canvas: #e2e7ef;
  --category-border: 1px solid #d2d9e3;
  --category-shadow: 0 0 5px #99a8bd70;
  min-width: 320px;
  color: #fff;
  min-height: 100%;
  height: auto;
  background: #253448 linear-gradient(#121923 110px, #253448 440px) top / 100% 440px no-repeat;
}

.photo-categories [hidden] {
  display: none !important;
}

.photo-categories :focus-visible {
  outline: 2px solid #4d86bb;
  outline-offset: 3px;
}

.categories-skip {
  position: fixed;
  z-index: 70;
  top: 8px;
  left: 8px;
  padding: 10px 15px;
  border-radius: 6px;
  background: var(--category-slate);
  transform: translateY(-150%);
}

.categories-skip:focus {
  transform: none;
}

.categories-header.header {
  position: relative;
}

.categories-header .header__container {
  max-width: 1900px;
  padding-inline: clamp(20px, 2.3vw, 42px);
}

.categories-header .header__left {
  flex: 0 0 auto;
}

.categories-header .header__right,
.categories-header .header__search,
.categories-header .search__item,
.categories-header .search__input {
  min-width: 0;
}

.categories-header .search__item,
.categories-header .search__input {
  flex: 1 1 auto;
}

.categories-header .search__input {
  width: 100%;
  font-size: 15px;
}

.categories-header .search__input::placeholder {
  color: #e7ecf4;
}

.categories-header .search__filter {
  flex: 0 0 auto;
}

.categories-header__mobile-search {
  display: none;
}

.categories-header .icon-menu {
  width: 32px;
  height: 24px;
}

.categories-header .icon-menu::before,
.categories-header .icon-menu::after,
.categories-header .icon-menu span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 0;
  background: #f4f6fb;
}

.categories-header .icon-menu::before {
  top: 1px;
}

.categories-header .icon-menu::after {
  bottom: 1px;
}

.categories-header .icon-menu span {
  top: 11px;
}

.menu-open .categories-header .icon-menu span {
  opacity: 0;
}

.categories-main {
  width: min(100% - 40px, 1840px);
  margin: 0 auto;
}

.categories-frame {
  --frame-padding: 20px;
  --gallery-gap: 20px;
  --sidebar-width: 240px;
  --gallery-columns: 4;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  align-items: start;
  gap: var(--gallery-gap);
  padding: 20px var(--frame-padding) var(--frame-padding);
  border-radius: 15px;
  color: var(--category-ink);
  background: var(--category-canvas);
}

.categories-workspace {
  display: grid;
  gap: var(--gallery-gap);
  min-width: 0;
}

.categories-heading {
  display: flex;
  gap: var(--gallery-gap);
  min-width: 0;
}

.categories-heading h1 {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 80px;
  padding: 13px clamp(27px, 2.8vw, 56px);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--category-shadow);
  color: #080808;
  font-size: clamp(26px, 1.68vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.categories-heading .categories-upload {
  --upload-icon: 83px;
  display: flex;
  align-items: center;
  flex: 0 0 clamp(235px, 18vw, 344px);
  min-height: 80px;
  padding: 10px 15px 10px calc(var(--upload-icon) + 35px);
  border: 1px solid #383f4c;
  box-shadow: inset 0 1px 1px #fff3, inset 0 -2px 2px #202630;
  background-size: var(--upload-icon) auto, auto;
}

.categories-upload:hover,
.category-panel__apply:hover {
  filter: brightness(1.09);
}

.categories-upload span {
  line-height: 1.08;
}

.categories-mobile-controls {
  display: none;
}

/* The sorting control uses the list-photos filter and select classes. */
.categories-sort {
  position: relative;
  z-index: 4;
  min-width: 0;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--category-shadow);
}

.categories-sort .filter__body {
  min-width: 0;
  min-height: 60px;
  padding: 8px 12px 8px 24px;
  border-radius: inherit;
  box-shadow: none;
}

.categories-ready .categories-sort .filter__body {
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.categories-sort .filter__body::-webkit-scrollbar {
  display: none;
}

.categories-sort .filter__label {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 16px;
  align-items: center;
  white-space: nowrap;
  font-size: 15px;
}

.categories-sort .filter__label::before,
.categories-mobile-sort::before {
  content: "";
  display: block;
  width: 20px;
  height: 25px;
  flex: 0 0 20px;
  background: url(../img/categories/sort.webp) center / contain no-repeat;
}

.categories-sort .filter__selects {
  flex: 0 0 auto;
  gap: 9px;
}

.categories-sort .filter__select {
  flex: 0 0 auto;
  min-width: 0;
}

.categories-sort .filter__select .select__title,
.categories-sort .filter__select > select {
  min-height: 40px;
  white-space: nowrap;
}

.categories-sort .filter__select .select__title {
  padding: 8px 36px 8px 14px;
}

.categories-sort .filter__select .select__content::before {
  box-shadow: inset 0 0 0 1px #a9b5c5;
}

.categories-sort .filter__select .categories-select-active .select__title {
  background: #d1dce9;
  border-color: #7893b2;
}

.categories-sort .filter__select .select__option {
  display: block;
  min-height: 32px;
  padding: 7px 16px 7px 34px;
  position: relative;
  color: var(--category-ink);
  line-height: 1.15;
  white-space: normal;
  text-decoration: underline;
  text-decoration-color: #7d8b9b;
  text-underline-offset: 3px;
}

.categories-sort .filter__select .select__option::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1px solid #8394aa;
  border-right: 1px solid #8394aa;
  transform: translateY(-50%) rotate(45deg);
}

.categories-sort .filter__select .select__option:hover,
.categories-sort .filter__select .select__option:focus-visible,
.categories-sort .filter__select .select__option[aria-pressed="true"] {
  background: #d7e1ef;
}

.categories-sort .filter__select .select__options {
  border-radius: 16px;
  background: var(--category-canvas);
}

.categories-sort .categories-options-floating {
  position: fixed;
  z-index: 35;
  top: var(--options-top);
  right: auto;
  bottom: var(--options-bottom);
  left: var(--options-left);
  width: var(--options-width);
  min-width: 0;
  padding: 21px 0;
  border: 1px solid #aeb9ca;
  border-radius: 16px;
  box-shadow: 0 7px 18px #283e5d24;
}

.categories-sort .categories-options-floating .select__scroll {
  max-height: var(--options-limit) !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.categories-sort .filter__reset {
  flex: 0 0 auto;
  margin-inline: 5px;
  padding: 8px 0;
  font-size: 13px;
  white-space: nowrap;
}

.categories-sort-size {
  margin-left: auto;
  display: flex;
  align-items: center;
  column-gap: 8px;
  white-space: nowrap;
  font-size: 13px;
}

.categories-no-js {
  padding: 8px;
  border: 1px solid var(--category-line);
  border-radius: 6px;
}

/* Sidebar */
.categories-sidebar {
  min-width: 0;
  scroll-margin-top: 144px;
}

.categories-panels {
  display: grid;
  gap: 20px;
}

.category-panel {
  min-width: 0;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--category-shadow);
}

.category-panel__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 90px;
  padding: 4px 16px 4px 28px;
  border-radius: 15px 15px 0 0;
  background: #8f9eb2 var(--category-panel-art, url(../img/categories/panel-238.webp)) center / 100% 100% no-repeat;
  color: #fff;
  text-align: left;
}

.category-panel__toggle[aria-expanded="false"] {
  border-radius: 15px;
}

.category-panel__toggle picture {
  order: 2;
  flex: 0 0 80px;
  margin-left: auto;
}

.category-panel__toggle img {
  display: block;
  width: 80px;
  height: 80px;
}

.category-panel__label {
  font-size: clamp(20px, 1.45vw, 24px);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 2px 4px #14334b99;
}

.category-panel__chevron {
  display: none;
}

.category-panel__fields {
  display: flex;
  flex-direction: column;
  padding: var(--field-top, 30px) var(--field-side, 20px) var(--field-bottom, 24px);
}

.category-panel_dates .category-panel__fields { min-height: var(--date-height, 582px); }
.category-panel_location .category-panel__fields { min-height: var(--location-height, 330px); }
.category-panel_number .category-panel__fields { min-height: var(--number-height, 221px); }

.category-panel_location .category-panel__fields { padding-top: var(--location-top, var(--field-top, 30px)); }
.category-panel_number .category-panel__fields { padding-top: var(--number-top, var(--field-top, 30px)); }

.category-tree {
  --tree-line: #c6d1de;
  --tree-root-indent: 35px;
  --tree-first-step: 31px;
  --tree-next-step: 22px;
  font-size: 16px;
  line-height: 1.2;
}

.category-tree__current {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 100px;
  padding: 13px 15px;
  background: var(--category-slate);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  overflow-wrap: anywhere;
}

.category-tree__current-icon,
.category-tree__toggle {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
}

.category-tree__current-icon {
  background: var(--category-muted);
  color: #fff;
}

.category-tree__current-icon::before {
  content: "";
  width: 12px;
  height: 10px;
  border-block: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}

.category-tree__parent {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px;
  padding: 9px 12px;
  border: 1px solid #d5deea;
  border-radius: 12px;
  color: var(--category-ink);
  background: #edf2f8;
}

.category-tree__parent:hover {
  border-color: #9babbe;
  background: #e4ecf7;
}

.category-tree__parent-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid #aebdd0;
  border-radius: 50%;
  color: #4a678b;
  background: #fff;
}

.category-tree__parent-icon::before {
  content: "";
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: translateX(1px) rotate(45deg);
}

.category-tree__parent-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.category-tree__parent-title small {
  display: block;
  margin-bottom: 3px;
  color: #566a82;
  font-size: 11px;
  font-weight: 400;
}

.category-tree__list summary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 42px;
  list-style: none;
  cursor: pointer;
}

.category-tree__list summary::-webkit-details-marker {
  display: none;
}

.category-tree__item a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-tree__item a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.category-tree__list_root > .category-tree__item_branch {
  border-bottom: 1px solid #aeb9c7;
}

.category-tree__list_root > li > details > summary {
  min-height: 70px;
  padding: 14px 15px 14px calc(var(--tree-root-indent) - 15px);
  gap: var(--branch-gap, 18px);
}

.category-tree__toggle {
  color: #647d9a;
  border: 1px solid #90a4bf;
  background: #fff;
}

.category-tree__toggle::before,
.category-tree__toggle::after {
  content: "";
  position: absolute;
  border-radius: 2px;
  background: currentColor;
}

.category-tree__toggle::before {
  width: 12px;
  height: 2px;
}

.category-tree__toggle::after {
  width: 2px;
  height: 12px;
}

.category-tree details[open] > summary > .category-tree__toggle {
  color: #fff;
  border-color: transparent;
  background: #879ab1;
}

.category-tree details[open] > summary > .category-tree__toggle::after {
  content: none;
}

.category-tree summary:hover .category-tree__toggle {
  border-color: #687f9b;
}

.category-tree__list:not(.category-tree__list_root) {
  --tree-step: var(--tree-first-step);
  --tree-line-up: 21px;
  position: relative;
  margin: 0 10px 12px var(--tree-root-indent);
  padding-left: var(--tree-step);
}

.category-tree__list .category-tree__list .category-tree__list {
  --tree-step: var(--tree-next-step);
  --tree-line-up: 10px;
  margin-left: 12px;
  margin-right: 0;
  margin-bottom: 5px;
}

.category-tree__list:not(.category-tree__list_root)::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 100%;
  width: 1px;
  height: var(--tree-line-up);
  background: var(--tree-line);
  pointer-events: none;
}

.category-tree__list:not(.category-tree__list_root) > li,
.category-tree__list_root > li:not(.category-tree__item_branch) {
  --tree-junction: 12px;
  --tree-line-left: calc(-1 * var(--tree-step));
  display: flow-root;
  position: relative;
}

.category-tree__list_root > li:not(.category-tree__item_branch) {
  --tree-step: var(--tree-first-step);
  --tree-line-left: 0px;
  margin-inline: var(--tree-root-indent) 10px;
  padding-left: var(--tree-step);
}

.category-tree__list_root > li:not(.category-tree__item_branch):first-child,
.category-tree__list_root > .category-tree__item_branch + li:not(.category-tree__item_branch) {
  margin-top: 12px;
}

.category-tree__list_root > li:not(.category-tree__item_branch):last-child {
  margin-bottom: 12px;
}

.category-tree__list_root > li:not(.category-tree__item_branch):has(+ .category-tree__item_branch) {
  margin-bottom: 12px;
}

.category-tree__list:not(.category-tree__list_root) > .category-tree__item_branch {
  --tree-junction: 21px;
}

.category-tree__list:not(.category-tree__list_root) > li::before,
.category-tree__list:not(.category-tree__list_root) > li::after,
.category-tree__list_root > li:not(.category-tree__item_branch)::before,
.category-tree__list_root > li:not(.category-tree__item_branch)::after {
  content: "";
  position: absolute;
  left: var(--tree-line-left);
  background: var(--tree-line);
  pointer-events: none;
}

.category-tree__list:not(.category-tree__list_root) > li::before,
.category-tree__list_root > li:not(.category-tree__item_branch)::before {
  top: 0;
  bottom: 0;
  width: 1px;
}

.category-tree__list:not(.category-tree__list_root) > li:last-child::before,
.category-tree__list_root > li:not(.category-tree__item_branch):last-child::before {
  bottom: auto;
  height: var(--tree-junction);
}

.category-tree__list_root > li:not(.category-tree__item_branch):has(+ .category-tree__item_branch)::before {
  bottom: auto;
  height: var(--tree-junction);
}

.category-tree__list:not(.category-tree__list_root) > li::after,
.category-tree__list_root > li:not(.category-tree__item_branch)::after {
  top: var(--tree-junction);
  width: var(--tree-step);
  height: 1px;
}

.category-tree__list:not(.category-tree__list_root) .category-tree__toggle {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.category-tree__leaf {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 24px;
  padding: 3px 4px;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #7d8999;
}

.category-tree__leaf::before {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  margin-top: 6px;
  border-top: 2px solid var(--category-muted);
  border-right: 2px solid var(--category-muted);
  transform: rotate(45deg);
}

.category-tree_catalog > .category-tree__list_root > li {
  border-bottom: 1px solid #aeb9c7;
}

.category-tree_catalog > .category-tree__list_root > li:not(.category-tree__item_branch) {
  margin: 0;
  padding: 0;
}

.category-tree_catalog > .category-tree__list_root > li:not(.category-tree__item_branch)::before,
.category-tree_catalog > .category-tree__list_root > li:not(.category-tree__item_branch)::after {
  content: none;
}

.category-tree_catalog > .category-tree__list_root > .category-tree__item > .category-tree__leaf,
.category-tree_catalog > .category-tree__list_root > .category-tree__item > details > summary {
  align-items: center;
  min-height: 46px;
  padding: 8px 14px 8px calc(var(--tree-root-indent) - 13px);
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
}

.category-tree_catalog > .category-tree__list_root > li > .category-tree__leaf::before {
  margin: 0 10px;
}

.category-tree_catalog > .category-tree__list_root > li > details > summary > .category-tree__toggle {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
}

.category-tree_catalog > .category-tree__list_root > .category-tree__item > details[open] > .category-tree__list {
  margin-top: 0;
  margin-left: var(--tree-root-indent);
}

.category-tree_catalog > .category-tree__list_root > li > details[open] > summary {
  position: relative;
}

.category-tree_catalog > .category-tree__list_root > li > details[open] > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  bottom: 0;
  left: var(--tree-root-indent);
  width: 1px;
  background: var(--tree-line);
  pointer-events: none;
}

.category-tree_catalog > .category-tree__list_root > li > details > .category-tree__list::before {
  content: none;
}

.category-tree__map {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  min-height: 70px;
  color: #fff;
  background: var(--category-slate);
  border-radius: 0 0 15px 15px;
  font-size: 14px;
  font-weight: 700;
}

.category-tree__map span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 2px solid var(--category-muted);
  border-radius: 6px;
}

.category-tree__map span::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--category-muted);
  box-shadow: -6px -6px var(--category-muted), 0 -6px var(--category-muted), 6px -6px var(--category-muted),
    -6px 0 var(--category-muted), 6px 0 var(--category-muted),
    -6px 6px var(--category-muted), 0 6px var(--category-muted), 6px 6px #d24747;
}

.category-date {
  min-width: 0;
  border: 0;
  margin: 0;
}

.category-date + .category-date { margin-top: var(--date-gap, 17px); }

.category-date legend {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 0 var(--date-label-gap, 8px);
  color: var(--category-ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.category-date legend img {
  flex: 0 0 32px;
}

.category-date__word {
  display: none;
}

.category-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.category-range input {
  min-width: 0;
  min-height: 40px;
  width: 100%;
  padding: 6px 7px;
  border: 1px solid #c8d0dd;
  border-radius: 10px;
  background: #f1f3f7;
  color: var(--category-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.category-range input {
  text-align: center;
}

.category-range input[type="date"] {
  padding-inline: 5px;
  font-size: clamp(10px, 1vw, 14px);
}

.category-range input::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
  opacity: .63;
}

.category-range input::placeholder {
  color: #50627a;
}

.category-periods {
  border: 0;
  margin: var(--period-top, 22px) 0 var(--period-bottom, 18px);
}

.category-periods legend {
  position: relative;
  width: 100%;
  padding: 0 36px 14px 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.22;
}

.category-periods legend::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 32px;
  height: 34px;
  background: url(../img/categories/recent.webp) center / contain no-repeat;
}

.category-periods__options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--period-gap, 5px);
}

.category-periods__options label {
  position: relative;
}

.category-periods__options input {
  position: absolute;
  opacity: 0;
}

.category-periods__options span {
  display: grid;
  min-height: 31px;
  place-items: center;
  padding: 3px;
  border: 1px solid #c8d0dd;
  border-radius: 10px;
  background: #f1f3f7;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}

.category-periods__options input:checked + span {
  border-color: #6787a9;
  background: #dce8f6;
  color: #153250;
}

.category-periods__options input:focus-visible + span {
  outline: 2px solid #4d86bb;
  outline-offset: 2px;
}

.category-undated {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.category-undated input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid #c8d0dd;
  border-radius: 2px;
  background: #f1f3f7;
  cursor: pointer;
}

.category-undated input:checked { background: #536d8c; }
.category-undated input:checked::after {
  content: "";
  width: 11px;
  height: 6px;
  margin-bottom: 3px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.category-location {
  display: grid;
  gap: 13px;
}

.category-location label {
  font-size: 16px;
  font-weight: 700;
}

.category-panel__actions {
  display: grid;
  gap: 9px;
  justify-items: center;
  margin-top: auto;
  padding-top: var(--action-gap, 18px);
}

.category-panel__apply {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 70px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(#647884, #233145);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  line-height: 1.1;
}

.category-panel__apply img {
  flex: 0 0 34px;
  filter: drop-shadow(0 0 12px #4bdc83);
}

.category-panel__reset {
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--category-ink);
  font-size: 14px;
}

.category-panel__reset span {
  border-bottom: 1px dotted #68788c;
}

.category-panel__reset::before {
  content: "×";
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 2px solid #c6ced8;
  border-radius: 50%;
  color: #98a6ba;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.categories-sidebar__nav {
  display: none;
}

/* The cards and pagination retain the personal-account components. */
.categories-results {
  min-width: 0;
  scroll-margin-top: 12px;
}

.categories-results:focus {
  outline: 0;
}

.categories-status,
.categories-status.is-error {
  margin: 0;
}

.categories-status:not(.is-error) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.categories-status.is-error,
.categories-empty {
  padding: 18px 24px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--category-shadow);
  line-height: 1.45;
}

.categories-status.is-error {
  color: #8e3030;
}

.categories-empty a {
  text-decoration: underline;
}

[data-category-results][aria-busy="true"] {
  opacity: .55;
}

.categories-grid {
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  gap: var(--gallery-gap);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.categories-card.card-list-photos {
  container-type: inline-size;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: var(--card-padding, 10px);
  border: 0;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--category-shadow), inset 0 0 0 1px #d2d9e3;
}

.categories-card .card-list-photos__image {
  height: auto;
  min-height: 0;
  position: relative;
  padding: 4px;
  border: 1px solid #c4cfdf;
  border-radius: 14px;
  background: #e4e9f2;
  box-shadow: 0 0 4px #7f91ac99, inset 0 0 2px #fff;
}

.categories-card__picture {
  display: block;
  border-radius: 9px;
  overflow: hidden;
  background: #d7e0ec;
}

.categories-card .card-list-photos__img {
  display: block;
  height: auto;
  width: 100%;
  aspect-ratio: var(--category-thumbnail-ratio, 1.32);
  object-fit: cover;
}

.categories-card__favorite {
  position: static;
}

.categories-card .card-list-photos__star {
  position: absolute;
  z-index: 1;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid #e4e9f3;
  border-radius: 10px;
  background: #fff;
  color: #bac5d6;
  box-shadow: 0 0 5px #13223980;
}

.categories-card .card-list-photos__star::before {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  box-shadow: none;
  font-size: 18px;
}

.categories-card .card-list-photos__star[aria-pressed="true"] {
  color: #f6b600;
}

.categories-card .card-list-photos__title {
  gap: 9px;
  padding: var(--title-top, 11px) 4px 5px var(--card-inset, 9px);
  line-height: 1.25;
}

.categories-card .card-list-photos__title a {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #8796aa;
}

.categories-card .card-list-photos__inner {
  position: relative;
  flex-wrap: nowrap;
  gap: var(--card-date-gap, clamp(10px, 10cqw, 39px));
  padding-inline: var(--card-inset, 9px) 0;
}

.categories-card .card-list-photos__date,
.categories-card .card-list-photos__downloads {
  gap: 8px;
  min-height: 32px;
  white-space: nowrap;
  font-size: 12px;
}

.categories-card .card-list-photos__autor {
  flex: 1;
  padding: 5px 4px 0 var(--card-inset, 9px);
  white-space: nowrap;
  min-width: 0;
}

.categories-card .card-list-photos__autor a,
.categories-card .card-list-photos__autor b {
  overflow: hidden;
  min-width: 0;
  margin-left: 3px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #8796aa;
}

.categories-card .card-list-photos__autor a {
  border-bottom: 0;
}

.categories-card .card-list-photos__box {
  min-height: 58px;
  gap: clamp(7px, 1vw, 22px);
  margin: var(--stats-top, 13px) 0 0;
  padding: 6px 8px;
  border-radius: 10px;
}

.categories-card .card-list-photos__likes {
  flex: 0 0 auto;
  font-size: 13px;
}

.categories-card .card-list-photos__likes span {
  display: block;
}

.categories-card .card-list-photos__likes span::before {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 16px;
  color: var(--category-muted);
}

.categories-card .card-list-photos__likes u {
  min-width: 54px;
  padding: 8px;
  color: var(--category-muted);
}

.categories-card .card-list-photos__likes.is-liked u,
.categories-card .card-list-photos__likes.is-liked span::before {
  background: var(--category-muted);
  color: #fff;
  box-shadow: none;
}

.categories-card .card-list-photos__items {
  flex: 0 1 var(--stats-width, 146px);
  min-width: 0;
  align-items: stretch;
  row-gap: 6px;
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}

.categories-card .card-list-photos__item {
  align-items: center;
  column-gap: 3px;
}

.categories-card .card-list-photos__item u {
  gap: 8px;
}

.categories-card .card-list-photos__item::after {
  min-width: 2px;
}

.categories-card .card-list-photos__item u::before,
.categories-card .card-list-photos__item::before {
  font-size: 12px;
  color: var(--category-muted);
}

.categories-card .card-list-photos__item_comments u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.categories-card .card-list-photos__item_views u {
  text-decoration: none;
}

.categories-pagination {
  margin-top: var(--gallery-gap);
  container: paging / inline-size;
  padding: 26px 30px 24px;
}

.categories-pagination .pagination-personal-account__top {
  min-height: 59px;
  margin-bottom: 4px;
}

.categories-pagination .pagination-personal-account__list {
  gap: clamp(4px, 1cqw, 18px);
  flex-wrap: wrap;
  row-gap: 4px;
}

.categories-pagination .pagination-personal-account__link_active {
  flex: 0 0 auto;
  text-align: center;
}

.categories-pagination [aria-disabled="true"] {
  color: #899aaf;
  opacity: .72;
}

.categories-footer {
  position: relative;
  isolation: isolate;
  color: #fff;
}

.categories-footer .footer__container {
  max-width: 1840px;
}

.categories-footer .footer__copyright {
  line-height: 1.9;
}

.categories-footer .footer__body {
  padding-inline: 10px;
}

@container (max-width: 261px) {
  .categories-card .card-list-photos__inner {
    gap: 8px;
    padding-inline: var(--card-inset, 0px) 0;
  }

  .categories-card .card-list-photos__date,
  .categories-card .card-list-photos__downloads {
    gap: 5px;
    font-size: 11px;
  }

  .categories-card .card-list-photos__box {
    padding-inline: 6px;
  }

  .categories-card .card-list-photos__title {
    padding-top: var(--title-top, 11px);
  }
}

@media (min-width: 480px) {
  @container (max-width: 263px) {
    .categories-card .card-list-photos__item u,
    .categories-card .card-list-photos__item::after {
      display: none;
    }

    .categories-card .card-list-photos__item::before {
      display: inline-block;
    }

    .categories-card .card-list-photos__item {
      justify-content: end;
      gap: 8px;
    }

    .categories-card .card-list-photos__item_comments span {
      text-decoration: underline;
      text-underline-offset: 3px;
    }
  }
}

@media (min-width: 1200px) {
  .category-tree__current {
    z-index: 1;
    color: var(--category-ink);
    padding-inline: 20px;
    isolation: isolate;
  }

  .category-tree__current::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: -20px;
    right: 10px;
    top: 20px;
    height: 60px;
    border-radius: 3px 14px 14px 3px;
    background: #fff;
    box-shadow: 0 5px 10px #101e3126;
  }
}

@media (min-width: 1400px) {
  .categories-frame {
    --sidebar-width: 280px;
  }

  .categories-heading h1,
  .categories-heading .categories-upload {
    min-height: 89px;
  }
}

@media (min-width: 1730px) {
  .categories-main {
    margin-top: 4px;
  }

  .categories-frame {
    --sidebar-width: 344px;
    padding-top: 16px;
  }

  .categories-heading h1,
  .categories-heading .categories-upload {
    min-height: 89px;
  }

  .category-panel__title-break,
  .category-panel__title-full {
    display: none;
  }

  .category-tree__current {
    padding-left: 20px;
  }

  .categories-sort .filter__label {
    font-size: 17px;
  }

  .categories-card .card-list-photos__likes u {
    min-width: 68px;
  }

  .categories-header .header__menu {
    visibility: hidden;
  }
}

@media (min-width: 1400px) and (max-width: 1729px) {
  .categories-sort .filter__label span {
    display: none;
  }

  .categories-grid {
    --category-thumbnail-ratio: 1.275;
    --title-top: 11px;
  }
}

@media (min-width: 1366px) and (max-width: 1729px) {
  .categories-header .header__container {
    padding-left: 54px;
    padding-right: 20px;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .categories-main {
    width: calc(100% - 50px);
  }

  .categories-frame {
    --sidebar-width: 238px;
  }

  .categories-heading h1 {
    font-size: 28px;
  }

  .category-panel__title-full {
    display: none;
  }

  .categories-ready .categories-sort .filter__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    overflow: visible;
  }

  .categories-sort .filter__label {
    display: none;
  }

  .categories-sort .filter__selects {
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }
}

@media (min-width: 1200px) and (max-width: 1279px) {
  .categories-frame {
    --gallery-columns: 3;
  }
}

@media (max-width: 1399px) {
  .categories-frame {
    padding-top: 20px;
  }

  .categories-heading .categories-upload {
    --upload-icon: 67px;
    padding-left: 91px;
  }

  .categories-sort .filter__body {
    padding-inline: 14px 10px;
  }

  .category-panel__toggle {
    padding-inline: 17px 7px;
  }

  .category-panel__toggle picture {
    flex-basis: 78px;
  }

  .category-panel__toggle img {
    width: 78px;
    height: 78px;
  }

  .category-periods__options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) {
  .categories-frame {
    --sidebar-width: 280px;
    --gallery-columns: 3;
    --gallery-gap: 20px;
  }

  .categories-frame.categories-ready {
    --sidebar-width: 60px;
  }

  .categories-frame.is-rail-open {
    --sidebar-width: 280px;
    --workspace-width: calc(100vw - 160px);
  }

  .categories-frame.is-rail-open .categories-workspace {
    grid-template-columns: var(--workspace-width);
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 2px 2px 4px;
    margin: -2px calc(-1 * var(--frame-padding)) -4px -2px;
    border-radius: 0 0 12px 0;
  }

  .categories-heading h1,
  .categories-heading .categories-upload {
    min-height: 70px;
  }

  .categories-heading .categories-upload {
    flex-basis: 240px;
    font-size: 16px;
  }

  .categories-sort .filter__label span {
    display: inline;
  }

  .categories-sort .filter__selects {
    gap: 10px;
  }

  .categories-sort .filter__body {
    padding-left: 19px;
  }

  .categories-grid {
    --category-thumbnail-ratio: 1.25;
  }

  .categories-panels {
    gap: 0;
    border-radius: 15px;
    background: #536378;
    box-shadow: var(--category-shadow);
  }

  .category-panel {
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .category-panel + .category-panel {
    border-top: 1px solid #718198;
  }

  .category-panel__toggle {
    min-height: 60px;
    padding: 6px 13px 6px 12px;
    border-radius: 0;
    background: transparent;
  }

  .category-panel__toggle[aria-expanded="false"] {
    border-radius: 0;
  }

  .category-panel__toggle picture {
    order: 0;
    flex-basis: 48px;
    margin-left: 0;
  }

  .category-panel__toggle img {
    width: 48px;
    height: 48px;
  }

  .category-panel__label {
    font-size: 15px;
  }

  .category-panel__chevron,
  .categories-sidebar__collapse {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid #9baabc;
    border-radius: 50%;
    margin-left: auto;
  }

  .category-panel__chevron::before,
  .categories-sidebar__collapse span {
    content: "";
    width: 6px;
    height: 6px;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: translateX(-1px) rotate(45deg);
  }

  .category-panel__toggle[aria-expanded="true"] .category-panel__chevron::before {
    transform: translateY(-1px) rotate(135deg);
  }

  .category-panel__body {
    margin: 0 10px 14px;
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
  }

  .category-tree {
    font-size: 16px;
  }

  .category-tree__current {
    min-height: 70px;
    font-size: 16px;
  }

  .category-tree__map {
    border-radius: 0;
  }

  .categories-sidebar {
    --field-side: 20px;
    --field-top: 38px;
    --location-top: 22px;
    --number-top: 20px;
    --field-bottom: 18px;
    --date-height: 576px;
    --number-height: 219px;
    --date-label-gap: 10px;
    --period-gap: 8px;
  }

  .category-periods__options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .categories-sidebar__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
  }

  .categories-sidebar__up {
    display: block;
    opacity: .85;
  }

  .categories-sidebar__collapse {
    display: none;
    margin-left: 0;
    color: #72849b;
  }

  .is-rail-open .categories-sidebar__collapse {
    display: grid;
  }

  .categories-sidebar__collapse span {
    transform: translateX(1px) rotate(-135deg);
  }

  .categories-ready:not(.is-rail-open) .category-panel__toggle {
    padding-inline: 6px;
    justify-content: center;
  }

  .categories-ready:not(.is-rail-open) .category-panel__label,
  .categories-ready:not(.is-rail-open) .category-panel__chevron {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 959px) {
  .categories-frame {
    --gallery-columns: 2;
  }

  .categories-heading h1,
  .categories-heading .categories-upload {
    min-height: 60px;
  }

  .categories-heading .categories-upload {
    --upload-icon: 53px;
    flex-basis: 180px;
    padding-left: 73px;
    background-position: 8px 50%, 0 0;
    font-size: 12px;
  }

  .categories-sort .filter__label span {
    display: none;
  }

  .categories-grid {
    --category-thumbnail-ratio: 1.31;
  }
}

@media (min-width: 768px) and (max-width: 1060px) {
  .categories-pagination .pagination-personal-account__bottom {
    gap: 10px;
  }
}

@media (min-width: 768px) and (max-width: 1365px) {
  .categories-header .header__container {
    padding-inline: 24px 20px;
  }

  .categories-header .header__body {
    column-gap: clamp(16px, 4vw, 62px);
  }

  .categories-header .header__left {
    column-gap: 16px;
  }

  .categories-header .header__right {
    column-gap: clamp(12px, 2.3vw, 28px);
  }

  .categories-header .search__item {
    padding-right: 10px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .categories-header .header__right {
    gap: 40px;
  }

  .categories-header .header__search {
    position: relative;
  }

  .categories-header .search__item {
    padding-right: 59px;
  }

  .categories-header .search__item::before {
    display: none;
  }

  .categories-header .search_mod .search__button {
    display: grid;
    position: absolute;
    right: 12px;
    top: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    transform: translateY(-50%);
  }

  .categories-header .search_mod .search__button::before {
    display: block;
    width: auto;
    height: auto;
    color: #fff;
    background: transparent;
    font-size: 20px;
  }

  .categories-header .search_mod .search__button span {
    display: none;
  }

  .categories-header .search__filter {
    padding-inline: 17px;
  }
}

@media (max-width: 767.98px) {
  .photo-categories {
    background-image: linear-gradient(#121923 85px, #253448 415px);
  }

  .categories-header .header__container {
    padding-inline: 20px;
  }

  .categories-header .header__body {
    padding-block: 12px;
    min-height: 80px;
  }

  .categories-header .header__logo {
    padding-right: 0;
  }

  .categories-header .icon-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .categories-header .header__left,
  .categories-header .header__right {
    column-gap: clamp(8px, 2vw, 14px);
  }

  .categories-header .header__right {
    margin-left: auto;
  }

  .categories-header .header__search {
    display: none;
  }

  .categories-header__mobile-search {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #3e454f;
    color: #fff;
  }

  .categories-header__mobile-search[data-category-search] {
    display: none;
  }

  .categories-header.categories-ready .categories-header__mobile-search[data-category-search] {
    display: grid;
  }

  .categories-header__mobile-search::before {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-2px, -2px);
  }

  .categories-header__mobile-search::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: translate(7px, 7px) rotate(45deg);
  }

  .categories-header.is-search-open .header__search {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    z-index: 7;
    top: calc(100% + 3px);
    left: 10px;
    right: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #202c3e;
    box-shadow: 0 6px 20px #0005;
  }

  .categories-header.is-search-open .search__input {
    display: block;
    padding: 10px;
    font-size: 16px;
    background: #314259;
    border-radius: 8px;
  }

  .categories-header.is-search-open .search__input::placeholder {
    color: #d9e0ea;
  }

  .categories-header.is-search-open .search__item::before,
  .categories-header.is-search-open .search__button::before {
    display: none;
  }

  .categories-header.is-search-open .search__button {
    display: block;
    padding: 8px 12px;
  }

  .categories-header.is-search-open .search__button span {
    display: inline;
  }

  .categories-main {
    width: calc(100% - 40px);
  }

  .categories-frame,
  .categories-frame.categories-ready {
    --frame-padding: 20px;
    --gallery-gap: 16px;
    --gallery-columns: 1;
    display: grid;
    grid-template-areas: "heading" "controls" "sidebar" "sort" "results";
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    position: relative;
    padding: 0 0 12px;
    background: none;
  }

  .categories-frame::before {
    content: "";
    grid-row: controls-start / results-end;
    grid-column: 1;
    align-self: stretch;
    margin-bottom: -12px;
    z-index: -1;
    border-radius: 15px;
    background: var(--category-canvas);
  }

  .categories-frame {
    isolation: isolate;
  }

  .categories-workspace {
    display: contents;
  }

  .categories-heading {
    grid-area: heading;
    margin-bottom: 20px;
  }

  .categories-heading h1,
  .categories-heading .categories-upload {
    min-height: 60px;
  }

  .categories-heading h1 {
    padding: 10px 26px;
    font-size: 24px;
  }

  .categories-heading .categories-upload {
    --upload-icon: 57px;
    flex: 0 0 68px;
    min-width: 0;
    padding: 0;
    background-position: center;
  }

  .categories-heading .categories-upload span {
    display: none;
  }

  .categories-mobile-controls {
    grid-area: controls;
    gap: 15px;
    padding: var(--frame-padding) var(--frame-padding) 0;
  }

  .categories-ready .categories-mobile-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .categories-mobile-controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 60px;
    padding: 6px;
    border: var(--category-border);
    border-radius: 15px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    line-height: 1.2;
  }

  .categories-mobile-controls .categories-mobile-filters {
    border-color: #394253;
    background: linear-gradient(#566172, #293342);
    color: #fff;
    box-shadow: inset 0 1px 2px #fff5, inset 0 -2px 2px #1119;
  }

  .categories-mobile-sort {
    background: #fff;
    color: var(--category-ink);
    box-shadow: var(--category-shadow);
  }

  .categories-mobile-controls button[aria-expanded="true"] {
    filter: brightness(.97);
  }

  .categories-sidebar,
  .categories-sort,
  .categories-results {
    margin: var(--gallery-gap) var(--frame-padding) 0;
  }

  .categories-sidebar {
    grid-area: sidebar;
    scroll-margin-top: 10px;
  }

  .categories-sort {
    grid-area: sort;
  }

  .categories-results {
    grid-area: results;
  }

  .categories-ready:not(.is-sidebar-open) .categories-sidebar,
  .categories-ready:not(.is-sort-open) .categories-sort,
  .categories-ready .categories-sidebar__nav {
    display: none;
  }

  .categories-ready:not(.is-rail-open) .category-panel__label {
    display: block;
  }

  .categories-ready:not(.is-rail-open) .category-panel__chevron {
    display: grid;
  }

  .categories-ready:not(.is-rail-open) .category-panel__toggle {
    min-height: 80px;
    justify-content: start;
    gap: 16px;
    padding-inline: 20px;
  }

  .category-tree {
    font-size: 17px;
  }

  .category-panel__label {
    font-size: 16px;
  }

  .categories-sidebar {
    --field-top: 38px;
    --location-top: 34px;
    --number-top: 39px;
    --field-bottom: 29px;
    --date-height: 589px;
    --location-height: 376px;
    --number-height: 261px;
    --date-gap: 10px;
    --period-top: 27px;
    --period-bottom: 15px;
    --period-gap: 8px;
  }

  .category-range input {
    min-height: 51px;
  }

  .category-range input[type="date"] {
    font-size: 14px;
  }

  .category-date__word {
    display: inline;
  }

  .category-date legend,
  .category-periods legend {
    font-size: 16px;
  }

  .category-periods__options label:nth-child(1) { order: 1; }
  .category-periods__options label:nth-child(2) { order: 4; }
  .category-periods__options label:nth-child(3) { order: 2; }
  .category-periods__options label:nth-child(4) { order: 5; }
  .category-periods__options label:nth-child(5) { order: 3; }
  .category-periods__options label:nth-child(6) { order: 6; }

  .category-location select {
    min-height: 51px;
    font-size: 16px;
  }

  .categories-ready .categories-sort .filter__body {
    display: block;
    overflow: visible;
    padding: 0;
  }

  .categories-sort .filter__label,
  .categories-sort .categories-sort-size,
  .categories-sort:not(.has-changed-sort) .filter__reset {
    display: none;
  }

  .categories-sort .filter__selects {
    display: block;
  }

  .categories-sort .filter__selects > div + div {
    border-top: 1px solid #c8d1de;
  }

  .categories-sort .filter__select .select__title {
    min-height: 64px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 16px;
    padding-inline: 29px 57px;
  }

  .categories-sort .filter__select .select__content::before {
    right: 21px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
  }

  .categories-sort .filter__select .select__value::before {
    right: 36px;
    width: 6px;
    height: 6px;
    border: solid var(--category-muted);
    border-width: 1px 1px 0 0;
    background: transparent;
    transform: translateY(-50%) rotate(45deg);
  }

  .categories-sort .filter__select .select__value::after {
    display: none;
  }

  .categories-sort .filter__select ._select-open .select__value::before {
    transform: translateY(-65%) rotate(135deg);
  }

  .categories-sort .filter__select .select__options {
    position: static;
    min-width: 0;
    padding: 7px 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--category-line);
  }

  .categories-sort .filter__select .select__option {
    min-height: 39px;
    padding-inline: 40px 20px;
  }

  .categories-sort .filter__reset {
    margin: 0 10px;
    padding: 14px 8px;
  }

  .categories-grid {
    --category-thumbnail-ratio: 1.32;
  }

  .categories-card .card-list-photos__title {
    padding-top: var(--title-top, 10px);
  }

  .categories-pagination {
    padding: 16px 12px 21px;
  }

  .categories-pagination .pagination-personal-account__caption {
    display: none;
  }

  .categories-pagination .pagination-personal-account__top {
    margin-bottom: 8px;
  }

  .categories-pagination .pagination-personal-account__list {
    flex: 1;
    gap: 4px;
    justify-content: space-between;
  }

  .categories-pagination .pagination-personal-account__link {
    padding: 8px 5px;
  }

  .categories-pagination .pagination-personal-account__link_active {
    width: 50px;
    height: 50px;
  }

  .categories-pagination .pagination-personal-account__bottom {
    flex-direction: column;
    align-items: center;
    row-gap: 18px;
  }

  .categories-pagination .pagination-personal-account__buttons {
    column-gap: 14px;
    font-size: 16px;
  }


}

@media (min-width: 440px) and (max-width: 599px) {
  .categories-heading {
    gap: 20px;
  }

  .categories-heading .categories-upload {
    flex-basis: 70px;
  }

  .categories-mobile-controls {
    gap: 20px;
  }

  .categories-card.card-list-photos {
    padding: 20px;
  }

  .categories-results {
    margin-top: 20px;
  }

  .categories-card .card-list-photos__box {
    margin-top: 22px;
  }
}

@media (min-width: 600px) and (max-width: 767.98px) {
  .categories-frame.categories-ready {
    --gallery-columns: 2;
  }
}

@media (max-width: 439px) {
  .categories-header .header__container {
    padding-inline: 10px;
  }

  .categories-header .header__body {
    min-height: 68px;
    padding-block: 8px;
    column-gap: 10px;
  }

  .categories-header .header__left {
    column-gap: clamp(14px, 9.5vw, 36px);
  }

  .categories-header .logo__img {
    max-width: 49px;
  }

  .categories-header .logo__text {
    font-size: 16px;
  }

  .categories-main {
    width: calc(100% - 20px);
  }

  .categories-frame,
  .categories-frame.categories-ready {
    --frame-padding: 10px;
    --gallery-gap: 10px;
  }

  .categories-heading {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }

  .categories-heading h1 {
    justify-content: center;
    text-align: center;
  }

  .categories-heading .categories-upload {
    --upload-icon: 55px;
    justify-content: center;
    flex-basis: auto;
    order: -1;
    padding: 8px 10px 8px 63px;
    background-position: 30px center, 0 0;
  }

  .categories-heading .categories-upload span {
    display: block;
  }

  .categories-mobile-controls {
    gap: 9px;
  }

  .categories-mobile-controls button {
    font-size: 16px;
  }

  .categories-grid {
    --category-thumbnail-ratio: 1.32;
  }
}

@media (max-width: 359px) {
  .categories-header__mobile-search {
    width: 41px;
    height: 41px;
  }

  .categories-heading h1,
  .categories-mobile-controls button {
    min-height: 50px;
  }

  .categories-heading h1 {
    font-size: 21px;
  }

  .categories-heading .categories-upload {
    min-height: 59px;
    background-position: 16px center, 0 0;
    font-size: 13px;
  }

  .categories-header .logo__img {
    max-width: 45px;
  }

  .categories-header .logo__text {
    font-size: 14px;
  }

  .categories-header .icon-menu {
    width: 26px;
  }

  .categories-mobile-controls button {
    font-size: 13px;
  }

  .categories-sort .filter__select .select__title {
    min-height: 64px;
  }

  .categories-card .card-list-photos__inner {
    gap: 28px;
  }

  .categories-grid {
    --category-thumbnail-ratio: 1.32;
  }

  .categories-card .card-list-photos__items {
    font-size: 11px;
  }

  .categories-card .card-list-photos__likes span::before {
    width: 36px;
    height: 36px;
  }

  .categories-card .card-list-photos__likes u {
    min-width: 45px;
  }

  .categories-pagination .pagination-personal-account__buttons {
    font-size: 13px;
  }
}

.categories-sort .categories-options-floating { padding-block: 24px; }
.categories-sort [data-sort-group="date"] .categories-options-floating .select__scroll {
  max-height: min(192px, var(--options-limit)) !important;
}

.menu-open .categories-header .icon-menu::before { top: 11px; }
.menu-open .categories-header .icon-menu::after { bottom: 11px; }
.categories-header.header:not(._open-photo) { background: transparent; }
.menu-open .categories-header.header { background: #101923; }
.categories-pagination .categories-page_compact { display: none; }
.categories-pagination .categories-pagination__word { display: none; border: 0; }
.categories-pagination .pagination-personal-account__more { padding-inline: 5px; }
.categories-pagination .pagination-personal-account__button[aria-disabled] { opacity: 1; }

@container paging (max-width: 700px) {
  .categories-pagination .categories-page_wide { display: none; }
  .categories-pagination .categories-page_compact { display: list-item; }
  .categories-pagination .pagination-personal-account__more.categories-page_compact { display: flex; }
  .categories-pagination .pagination-personal-account__list { flex-wrap: nowrap; }
}
@container paging (min-width: 460px) and (max-width: 700px) {
  .categories-pagination__size-text { display: none; }

  .categories-pagination .pagination-personal-account__buttons { gap: 22px; }
}
@container paging (min-width: 1080px) {
  .categories-pagination .categories-pagination__word { display: inline; }
  .categories-pagination .pagination-personal-account__buttons { column-gap: 65px; }
}

/* The original footer illustration uses the same scale as the matching PSD at each width. */
.categories-footer {
  --footer-height: 655px;
  --footer-top: 40px;
  --footer-art: 1728px;
  --footer-art-bottom: -52px;
  --footer-art-offset: 20px;
  --footer-side: 3.35%;
  --footer-copy-width: 30.3%;
  padding-top: var(--footer-top);
  overflow: hidden;
  background: #253448;
}
.categories-footer .footer__container {
  max-width: 1920px;
  width: 100%;
  min-height: calc(var(--footer-height) - var(--footer-top));
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.categories-footer .footer__container::before {
  left: calc(50% + var(--footer-art-offset));
  bottom: var(--footer-art-bottom);
  width: var(--footer-art);
  height: auto;
  aspect-ratio: 1920 / 696;
}
.categories-footer .footer__body {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, var(--footer-copy-width)) minmax(0, 1fr);
  gap: 0;
  padding: 0 var(--footer-side);
}
.categories-footer .footer__columns {
  display: grid;
  grid-template-columns: 29% 22% 30% minmax(0, 1fr);
  gap: 0;
  padding: 0;
  font-size: 18px;
  line-height: 20px;
}
.categories-footer .footer__list { gap: 0; }
.categories-footer .footer__item { min-height: 40px; }
.categories-footer .footer__link {
  display: inline-block;
  padding: 0 0 2px;
  border-bottom: 2px solid #939faa;
}
.categories-footer .footer__copyright { max-width: 260px; font-size: 16px; line-height: 2; }

@media (min-width: 768px) {
  .categories-header .header__search { min-height: 64px; }
  .categories-header .search__item { align-self: stretch; }
  .categories-header .search_mod .search__button { font-weight: 700; }
  .categories-card .card-list-photos__autor::before,
  .categories-card .card-list-photos__date::before,
  .categories-card .card-list-photos__downloads::before {
    display: grid;
    place-items: center;
    padding: 0;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }
}
@media (min-width: 1200px) {
  .category-panel__toggle { padding-right: 22px; }
  .category-panel__toggle picture { flex-basis: 80px; }
  .category-panel__toggle img { width: 80px; height: 80px; }
  .category-tree__current::after {
    content: "";
    position: absolute;
    z-index: -2;
    left: -10px;
    top: 78px;
    width: 14px;
    height: 13px;
    background: linear-gradient(140deg, #788598, transparent 62%);
  }
}
@media (min-width: 1200px) and (max-width: 1399px) {
  .categories-sidebar { --field-top: 20px; --location-top: 30px; --field-bottom: 30px; --branch-gap: 10px; }
  .category-tree__current { gap: 10px; }
  .category-tree__current::before { left: -28px; right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
  .category-tree { --tree-root-indent: 25px; --tree-first-step: 12px; --tree-next-step: 16px; }
  .category-tree__list_root > li > details > summary { font-weight: 700; }
  .category-tree__list_root > li > details:not([open]) > summary { min-height: 50px; padding-block: 9px; }
  .category-tree > .category-tree__list > li > details[open] > .category-tree__list { margin-top: -12px; margin-left: 24px; }
  .category-tree details .category-tree__list summary { font-size: 14px; font-weight: 700; }
  .category-tree__map { min-height: 50px; padding: 8px 35px 8px 10px; gap: 15px; }
  .category-panel__apply { min-height: 61px; }
  .category-periods legend { padding-right: 25px; padding-left: 10px; }
  .category-tree > .category-tree__list > li > details[open] > .category-tree__list { margin-bottom: 11px; }
  .categories-grid { --category-thumbnail-ratio: 1.326; --card-inset: 0px; --stats-top: 10px; --title-top: 10px; row-gap: 22px; }
}
@media (min-width: 1400px) and (max-width: 1729px) {
  .categories-frame { --category-panel-art: url(../img/categories/panel-280.webp); }
  .categories-sidebar { --field-side: 30px; --field-bottom: 28px; --date-height: 590px; --location-height: 349px; --number-height: 241px; --branch-gap: 10px; }
  .category-panel__label { font-size: 20px; }
  .category-panel__toggle { padding-left: 30px; }
  .category-tree__current { gap: 10px; }
  .category-tree__current::before { left: -28px; right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
  .category-tree summary { font-weight: 700; }
  .category-tree > .category-tree__list > li > details > summary { font-size: 18px; }
  .categories-heading h1, .categories-heading .categories-upload { min-height: 90px; }
  .categories-grid { --title-top: 10px; }
  .category-periods__options { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .categories-footer { --footer-top: 50px; --footer-height: 668px; --footer-side: 5%; --footer-copy-width: 32.6%; }
  .categories-footer .footer__columns { grid-template-columns: 26.7% 24% 29% minmax(0,1fr); }
}
@media (min-width: 1200px) and (max-width: 1729px) {
  .category-periods__options label:nth-child(2) { order: 4; }
  .category-periods__options label:nth-child(4) { order: 5; }
  .category-periods__options label:nth-child(6) { order: 6; }
}
@media (min-width: 1730px) {
  .categories-frame { --category-panel-art: url(../img/categories/panel-344.webp); }
  .categories-sidebar {
    --field-side: 30px; --field-bottom: 29px; --date-height: 588px; --location-height: 371px; --number-height: 251px; --location-top: 20px;
 --date-label-gap: 10px; --date-gap: 10px; --period-top: 27px; --period-bottom: 28px;
  }
  .category-panel__toggle { padding-left: 32px; }
  .category-tree, .category-tree__map, .category-date legend, .category-periods legend, .category-location label,
  .category-panel__apply, .category-undated, .category-tree__current { font-size: 18px; font-weight: 400; }
  .category-range input, .category-location select { min-height: 51px; }
  .category-date__word { display: inline; }
  .category-panel__reset, .category-location select { font-size: 16px; }
  .category-tree__current { gap: 20px; }
  .category-tree details .category-tree__list summary { gap: 18px; }
  .category-tree__map { gap: 22px; }
  .category-periods__options { grid-auto-flow: column; grid-template-rows: repeat(2, auto); }
  .categories-grid { --category-thumbnail-ratio: 1.325; --title-top: 16px; --card-inset: 14px; --card-date-gap: 34px; --stats-top: 13px; }
  .categories-pagination { padding: 30px 35px 20px 70px; margin-inline: -4px 4px; }
  .categories-frame { padding-bottom: 25px; }
  .categories-main { position: relative; left: 1px; }
  .categories-footer { --footer-height: 664px; --footer-top: 46px; --footer-side: 4.3%; --footer-copy-width: 26%; --footer-art: 1920px; --footer-art-bottom: -57px; --footer-art-offset: 27px; }
  .categories-footer .footer__columns { grid-template-columns: 23.5% 23% 23.5% minmax(0,1fr); }
  .categories-footer .footer__copyright { max-width: 340px; }
}
@media (max-width: 1365px) {
  .categories-footer { --footer-height: 673px; --footer-side: 8%; --footer-art: 1440px; --footer-art-bottom: 24px; --footer-art-offset: 18px; }
  .categories-footer .footer__body { display: block; }
  .categories-footer .footer__columns { grid-template-columns: 24.3% 25.7% minmax(0,1fr); }
  .categories-footer .footer__copyright { max-width: none; padding: 18px 12px; line-height: 20px; }
  .categories-footer .footer__bottom::before { height: 106px; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .category-tree summary { font-weight: 700; }
  .category-tree__map { padding-right: 45px; font-size: 16px; }
  .category-panel__body { margin-bottom: 10px; }
  .category-panel_tree .category-panel__body { margin-bottom: 12px; }
  .category-panel__toggle { gap: 9px; }
  .category-panel__label { font-size: 16px; }
  .category-periods__word { display: none; }
  .category-date legend, .category-periods legend, .category-location label { font-size: 18px; font-weight: 400; }
  .category-undated { font-size: 16px; }
  .categories-header .header__left { column-gap: clamp(26px, calc(4.7vw - 10px), 39px); }
  .categories-header .header__body { column-gap: clamp(28px, calc(15vw - 86px), 66px); }
}
@media (min-width: 768px) and (max-width: 959px) {
  .categories-grid { --category-thumbnail-ratio: 1.307; --title-top: 10px; --stats-top: 12px; }
  .categories-footer { --footer-height: 582px; --footer-top: 54px; --footer-side: 6.5%; --footer-art: 1152px; --footer-art-bottom: 18px; --footer-art-offset: 14px; }
  .categories-footer .footer__columns { grid-template-columns: 27.7% 28.3% minmax(0,1fr); }
}
@media (max-width: 767.98px) {
  .categories-frame, .categories-frame.categories-ready { padding-bottom: var(--frame-padding); }
  .categories-frame::before { margin-bottom: calc(-1 * var(--frame-padding)); }
  .categories-ready:not(.is-rail-open) .category-panel__toggle { min-height: 79px; }
  .category-panel__chevron { color: #a4b1c2; }
  .category-panel__body { margin-bottom: 20px; }
  .category-panel:last-child .category-panel__body { margin-bottom: 10px; }
  .categories-panels { display: flex; flex-direction: column; overflow: hidden; }
  .category-tree, .category-tree__map, .category-tree__current, .category-date legend, .category-periods legend,
  .category-location label, .category-panel__apply { font-size: 18px; font-weight: 400; }
  .category-undated, .category-panel__reset { font-size: 16px; }
  .category-location { gap: 16px; }
  .category-location label { gap: 8px; }
  .category-tree { --tree-first-step: 32px; }
  .category-tree details .category-tree__list summary { gap: 18px; }
  .category-tree__current { padding-left: 20px; gap: 20px; }
  .category-date legend img { width: 32px; height: 32px; }
  .categories-pagination .pagination-personal-account__list { gap: 2px; }
  .categories-pagination .pagination-personal-account__link { padding-inline: 3px; }
  .categories-pagination .pagination-personal-account__buttons { justify-content: space-between; width: 100%; }
  .categories-pagination .pagination-personal-account__bottom { row-gap: 18px; }
  .categories-pagination { padding-inline: 20px; }
  .categories-pagination .pagination-personal-account__button { gap: 8px; }

  .categories-footer { --footer-height: 675px; --footer-top: 34px; --footer-side: 12.5%; --footer-art: 806px; --footer-art-bottom: 46px; --footer-art-offset: 8px; }
  .categories-footer .footer__columns { grid-template-columns: 52.5% minmax(0,1fr); font-size: 16px; }
  .categories-footer .footer__column:nth-child(3) { grid-column: 1 / -1; }
  .categories-footer .footer__copyright { padding: 18px 10px 24px; font-size: 14px; line-height: 18px; }
  .categories-footer .footer__copyright br { display: inline; }
  .categories-footer .footer__bottom::before { height: calc(var(--footer-art-bottom) + 52px); }
}
@media (min-width: 440px) and (max-width: 599px) {
  .categories-frame, .categories-frame.categories-ready { --gallery-gap: 20px; }
  .categories-grid { --title-top: 17px; --card-inset: 14px; --card-date-gap: 60px; }
  .categories-card .card-list-photos__star { top: 14px; right: 14px; }
  .category-panel__body { margin-inline: 21px; }
  .categories-sidebar { --field-side: clamp(20px, calc(50vw - 200px), 40px); }
  .categories-ready:not(.is-rail-open) .category-panel__toggle { padding-inline: 30px; gap: 20px; min-height: 78px; }
  .category-panel__title-break { display: none; }
  .categories-pagination { padding: 20px 32px 22px; }
  .categories-pagination .pagination-personal-account__top { margin-bottom: 14px; }
  .categories-pagination .pagination-personal-account__link_active { width: 60px; height: 60px; }
  .categories-pagination .pagination-personal-account__bottom { gap: 18px; }
  .categories-pagination .pagination-personal-account__buttons, .categories-pagination .pagination-personal-account__select { font-size: 18px; }

}
@media (max-width: 439px) {
  .categories-grid { --card-inset: 9px; --card-date-gap: 26px; }
  .categories-ready:not(.is-rail-open) .category-panel__toggle { min-height: 78px; gap: 19px; }
  .categories-footer { --footer-side: 30px; --footer-height: 662px; --footer-top: 29px; --footer-art: 672px; --footer-art-bottom: 32px; }
  .categories-footer .footer__columns { grid-template-columns: minmax(0,157px) minmax(0,1fr); font-size: 18px; }
  .categories-pagination { padding-inline: 12px; }
}
@media (max-width: 359px) {
  .categories-grid { --category-thumbnail-ratio: 1.323; --card-inset: 0px; --card-date-gap: 41px; }
  .categories-card .card-list-photos__inner { gap: var(--card-date-gap); padding-left: 0; }
  .categories-card .card-list-photos__title, .categories-card .card-list-photos__autor { padding-left: 0; }
  .categories-heading h1 { font-size: 18px; }
  .categories-mobile-controls button { font-size: 14px; }
  .categories-sort .filter__select .select__title { padding-left: 19px; font-size: 14px; }
  .categories-sort .filter__select .select__content::before { right: 15px; }
  .categories-sort .filter__select .select__value::before { right: 30px; }
  .categories-sidebar {
    --date-height: 576px; --location-height: 330px; --number-height: 219px;
    --field-bottom: 18px; --location-top: 22px; --number-top: 20px; --picker-image: none;
    --date-gap: 17px; --period-top: 22px; --period-bottom: 18px;
  }
  .category-range input, .category-location select { min-height: 40px; font-size: 14px; }
  .category-panel__body { margin-bottom: 12px; }
  .category-tree { --tree-first-step: 16px; --tree-next-step: 14px; }
  .category-tree details .category-tree__list summary { gap: 11px; }
  .category-tree__map { padding-right: 42px; }
  .category-date__word, .category-periods__word { display: none; }
  .category-periods__options label:nth-child(n) { order: 0; }
  .category-panel__apply { padding-inline: 24px; font-size: 16px; font-weight: 700; }
  .category-panel__reset { font-size: 14px; }
  .categories-pagination { padding-inline: 10px; }
  .categories-pagination .pagination-personal-account__link_active { width: 40px; height: 40px; }
  .categories-pagination .pagination-personal-account__list { font-size: 14px; }
  .categories-pagination .pagination-personal-account__top { min-height: 58px; }
  .categories-pagination .pagination-personal-account__buttons, .categories-pagination .pagination-personal-account__select { font-size: 14px; }

  .categories-footer { --footer-height: 674px; --footer-top: 34px; --footer-art-bottom: 71px; }
  .categories-footer .footer__columns { font-size: 16px; }
  .categories-footer .footer__copyright { font-size: 12px; line-height: 16px; }
}

@media (min-width: 1366px) {
  .categories-header .header__left {
    display: grid;
    grid-template-columns: var(--logo-space, 232px) 70px 217px;
    column-gap: 0;
  }
  .categories-header .header__logo { justify-self: start; column-gap: 25px; }
  .categories-header .header__menu, .categories-header .header__photo { margin: 0; }
  .categories-header .photo-header__button { width: 217px; min-height: 60px; }
  .categories-header .header__body { column-gap: 34px; min-height: 124px; }
  .categories-header .header__search { gap: 24px; align-items: center; }
  .categories-header .header__search .search__item { height: 60px; align-self: center; }
  .categories-header .header__search .search__button { height: 64px; flex: 0 0 124px; }
}
@media (min-width: 1366px) and (max-width: 1399px) {
  .categories-header .header__container { padding-inline: 59px 42px; }
  .categories-header .header__search { gap: 29px; }
}
@media (min-width: 1730px) {
  .categories-header .header__container { max-width: 1920px; padding-inline: 56px 40px; }
  .categories-header .header__search { gap: 20px; }
}
@media (min-width: 768px) {
  .categories-pagination { min-height: 170px; }
}
@media (min-width: 960px) and (max-width: 1199px) {
  .categories-grid { --category-thumbnail-ratio: 1.255; row-gap: 18px; }
  .categories-pagination { margin-top: 18px; }
}
@media (max-width: 767.98px) {
  .categories-sort .filter__selects > div:last-child .select__title { min-height: 63px; }
  .category-panel__toggle[aria-expanded="true"] .category-panel__chevron::before { transform: translateX(-1px) rotate(45deg); }
}
@media (min-width: 360px) and (max-width: 599px) {
  .category-panel_tree .category-panel__body { margin-bottom: 22px; }
  .category-panel_dates .category-panel__body { margin-bottom: 26px; }
  .category-panel_location .category-panel__body { margin-bottom: 21px; }
}
@media (min-width: 440px) and (max-width: 599px) {
  .category-panel:last-child .category-panel__body { margin-bottom: 20px; }
}
@media (min-width: 360px) and (max-width: 439px) {
  .categories-pagination { min-height: 196px; }
}
@media (max-width: 359px) {
  .photo-categories { background-image: linear-gradient(#253448 10px, #121923 10px 85px, #253448 415px); }
  .categories-footer .footer__body { padding-right: 10px; }
}

/* Calendar and select menus for the category filter and page size. */
.category-range__date,
.category-select,
.category-place {
  min-width: 0;
}

.category-place { display: grid; gap: 7px; }
.category-select { width: 100%; }

.category-select select,
.category-control {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: var(--control-height, 40px);
  padding: 8px 30px 8px 12px;
  appearance: none;
  border: 1px solid #b9c6d7;
  border-radius: 11px;
  color: var(--category-ink);
  background: #f1f3f7 url(../img/categories/chevron.webp) right 11px center / 13px auto no-repeat;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  font: inherit;
  font-size: var(--control-font, 14px);
  line-height: 1.2;
  cursor: pointer;
}

.category-select select:disabled,
.category-control:disabled {
  border-color: #d7dfe9;
  color: #66778d;
  background-color: #f5f7fa;
  cursor: default;
}

.category-select select:hover:not(:disabled),
.category-control:hover:not(:disabled),
.category-control[aria-expanded="true"] {
  border-color: #849ab7;
  background-color: #e8eef8;
}

.category-control_date {
  min-height: var(--date-control-height, 40px);
  padding-inline: 5px 22px;
  background-image: url(../img/categories/date-picker.webp);
  background-size: 13px auto;
  background-position: right 6px center;
  text-align: center;
  font-size: clamp(12px, 1vw, 14px);
  font-variant-numeric: tabular-nums;
}

.categories-sort-size .category-select {
  --control-height: 40px;
  flex: 0 0 64px;
}

.categories-pagination .category-select {
  --control-height: 50px;
  --control-font: 17px;
  flex: 0 0 86px;
}

.categories-pagination .pagination-personal-account__select {
  gap: 10px;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
}

.categories-pagination .pagination-personal-account__select label {
  line-height: 1.2;
}

.category-popup {
  position: fixed;
  z-index: 90;
  inset: auto;
  min-width: 0;
  margin: 0;
  padding: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #afbdd0;
  border-radius: 13px;
  background: #f5f7fb;
  color: var(--category-ink);
  box-shadow: 0 7px 22px #192c4750;
  font-size: 14px;
  line-height: 1.25;
}

.category-popup__option {
  display: block;
  position: relative;
  width: 100%;
  min-height: 38px;
  padding: 8px 26px 8px 10px;
  border-radius: 7px;
  text-align: left;
  overflow-wrap: anywhere;
}

.category-popup__option[aria-selected="true"] {
  background: #e0e9f6;
  color: #1d3858;
  font-weight: 700;
}

.category-popup__option[aria-selected="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 10px;
  height: 6px;
  border: solid #567ba3;
  border-width: 0 0 2px 2px;
  transform: translateY(-70%) rotate(-45deg);
}

.category-popup__option:hover,
.category-popup__option:focus-visible { background: #d6e3f4; }
.category-popup button:focus-visible { outline-offset: -2px; }

.category-popup_size { padding: 4px; }

.category-popup_size .category-popup__option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-inline: 6px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.category-popup_size .category-popup__option[aria-selected="true"]::after {
  position: static;
  flex: 0 0 9px;
  transform: translateY(-1px) rotate(-45deg);
}

.category-popup_calendar {
  padding: 8px;
  border-radius: 15px;
  background: #fff;
}

.category-calendar__heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 65px 34px;
  gap: 5px;
  margin-bottom: 6px;
  padding: 6px;
  border: 1px solid #485e79;
  border-radius: 10px;
  background: linear-gradient(#536882, #293b53);
  color: #fff;
}

.category-calendar__heading select,
.category-calendar__heading input,
.category-calendar__step {
  min-width: 0;
  min-height: 38px;
  padding: 4px 6px;
  border: 1px solid #8094af;
  border-radius: 8px;
  background: #354a65;
  color: inherit;
  font-size: 16px;
}

.category-calendar__heading select {
  width: 100%;
  padding-inline: 8px 22px;
  appearance: none;
  background: #354a65 url(../img/categories/chevron.webp) right 7px center / 10px auto no-repeat;
  text-overflow: ellipsis;
}
.category-calendar__heading option { color: #253448; background: #fff; }
.category-calendar__heading :focus-visible { outline-color: #b6d5f8; }
.category-calendar__year { text-align: center; appearance: textfield; font-variant-numeric: tabular-nums; }
.category-calendar__year::-webkit-inner-spin-button { appearance: none; }
.category-calendar__step { display: grid; place-items: center; }
.category-calendar__step:disabled { opacity: .4; }
.category-calendar__step::before {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: translateX(1px) rotate(45deg);
}
.category-calendar__step_next::before { transform: translateX(-1px) rotate(225deg); }

.category-calendar__week,
.category-calendar__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  text-align: center;
}

.category-calendar__week {
  padding-block: 7px;
  color: #546880;
  font-size: 12px;
  font-weight: 700;
}

.category-calendar__days {
  padding-top: 4px;
  border-top: 1px solid #e3eaf3;
}

.category-calendar__day {
  position: relative;
  min-height: 34px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.category-calendar__week span:nth-last-child(-n+2),
.category-calendar__day:nth-child(7n+6),
.category-calendar__day:nth-child(7n) { color: #566d8b; }

.category-calendar__day[aria-current="date"] {
  box-shadow: inset 0 0 0 1px #819abb;
  font-weight: 700;
}

.category-calendar__day[aria-pressed="true"] { background: #2d4565; color: #fff; font-weight: 700; }
.category-calendar__day:not([aria-pressed="true"]):hover { background: #e3ecf8; }
.category-calendar__step:not(:disabled):hover { background: #526e90; }

.category-calendar__actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e3eaf3;
}

.category-calendar__actions button {
  min-height: 34px;
  padding-inline: 10px;
  border-radius: 8px;
  color: #365578;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.category-calendar__actions [data-calendar-today] {
  border: 1px solid #bfcee0;
  background: #edf3fa;
  text-decoration: none;
}

.category-calendar__actions button:hover:not(:disabled) { background: #dce8f7; }
.category-calendar__actions button:disabled { opacity: .55; }

.categories-card .card-list-photos__likes button {
  display: block;
  border-radius: 50%;
}

.categories-card .card-list-photos__likes button:disabled,
.categories-card .card-list-photos__star:disabled { cursor: default; }

.categories-card .card-list-photos__autor a {
  padding-bottom: 3px;
  margin-bottom: -3px;
  text-decoration: underline;
  text-decoration-color: #667a97;
  text-underline-offset: 2px;
}

@container paging (min-width: 460px) and (max-width: 700px) {
  .categories-pagination .category-select { --control-height: 40px; flex-basis: 70px; }
}

@media (min-width: 1730px), (min-width: 360px) and (max-width: 767.98px) {
  .category-range__date { --date-control-height: 51px; }
  .category-place { --control-height: 51px; --control-font: 16px; }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .categories-sort .filter__selects { gap: 4px; }
  .categories-sort .filter__select .select__title { padding-inline: 10px 31px; font-size: 13px; }
  .categories-sort .filter__reset { margin-inline: 0; }
  .categories-sort .categories-sort-size { font-size: 12px; }
}

@media (max-width: 767.98px) {
  .categories-pagination .pagination-personal-account__select { justify-content: center; }
  .categories-pagination .category-select { --control-height: 42px; flex-basis: 70px; }
  .category-popup__option { min-height: 44px; font-size: 16px; }
  .category-calendar__day { min-height: 39px; }
}

@media (max-width: 359px) {
  .categories-pagination .category-select { --control-height: 36px; --control-font: 14px; flex-basis: 63px; }
  .category-control_date { padding-inline: 5px 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-categories *,
  .photo-categories *::before,
  .photo-categories *::after {
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
  }
}
