.catalog-home {
  width: min(100%, 1320px);
  min-height: 70vh;
  margin: 16px auto 24px;
  padding: 0 16px 16px;
  color: #142839;
  font: 14px/1.5 Inter, Arial, sans-serif;
}

.catalog-home,
.catalog-home * {
  box-sizing: border-box;
}

.catalog-home a {
  color: #1c439b;
  text-decoration: none;
}

.catalog-home a:hover {
  text-decoration: underline;
}

.catalog-home button,
.catalog-home input {
  font: inherit;
}

.catalog-home button:focus-visible,
.catalog-home a:focus-visible,
.catalog-home input:focus-visible,
.catalog-home [tabindex="0"]:focus-visible {
  outline: 3px solid #1c439b;
  outline-offset: 3px;
}

.catalog-home__welcome {
  margin: 10px 0 16px;
  padding: 18px;
  border: 1px solid #c4c7cc;
  border-radius: 8px;
  background: #fff;
}

.catalog-home__welcome h1 {
  margin: 0 0 4px;
  color: #1c439b;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  line-height: 1.25;
}

.catalog-home__welcome p {
  margin: 0 0 8px;
  color: #142839;
}

.catalog-home__genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.catalog-home__tag {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #d88b13;
  border-radius: 5px;
  background: #fea619;
  color: #142839;
  cursor: pointer;
  font-weight: 700 !important;
}

.catalog-home__tag:hover,
.catalog-home__tag.is-active {
  border-color: #142839;
  box-shadow: 0 0 0 1px #142839;
}

.catalog-home__search {
  display: flex;
  width: min(100%, 520px);
  min-height: 42px;
  border: 1px solid #788796;
  border-radius: 5px;
  overflow: hidden;
}

.catalog-home__search input {
  min-width: 0;
  flex: 1;
  padding: 8px 12px;
  border: 0;
  background: #fff;
  color: #142839;
}

.catalog-home__search button {
  padding: 7px 16px;
  border: 0;
  background: #2e51a2;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.catalog-home__welcome-note {
  margin: 9px 0 0 !important;
  color: #59636d;
  font-size: 12px;
}

.catalog-home__columns {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 270px;
  gap: 16px;
  align-items: start;
}

.catalog-home__left,
.catalog-home__main,
.catalog-home__right {
  min-width: 0;
}

.catalog-home__box {
  margin-bottom: 14px;
  border: 1px solid #d3d9e5;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.catalog-home__box > h2,
.catalog-home__section-heading {
  display: flex;
  min-height: 42px;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #c4c7cc;
  background: #e1e7f5;
  color: #142839;
  font-size: 15px;
  font-weight: 800;
}

.catalog-home__box > h2 a,
.catalog-home__section-heading > a {
  color: #1c439b;
  font-size: 12px;
  font-weight: 700;
}

.catalog-home__link-list,
.catalog-home__top-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-home__link-list li,
.catalog-home__top-list > li {
  padding: 8px 10px;
  border-bottom: 1px dotted #c4c7cc;
}

.catalog-home__link-list li:last-child,
.catalog-home__top-list > li:last-child {
  border-bottom: 0;
}

.catalog-home__link-list button {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1c439b;
  cursor: pointer;
  text-align: left;
}

.catalog-home__link-list button:hover {
  text-decoration: underline;
}

.catalog-home__box-content {
  padding: 12px;
  color: #394958;
}

.catalog-home__button {
  display: inline-block;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #1c439b;
  border-radius: 4px;
  background: #2e51a2;
  color: #fff !important;
  font-weight: 700;
}

.catalog-home__button--orange {
  border-color: #d88b13;
  background: #fea619;
  color: #142839 !important;
}

.catalog-home__section-heading {
  margin-bottom: 10px;
}

.catalog-home__section-heading h2 {
  min-width: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.catalog-home__section-heading > span {
  color: #394958;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-home__feature-section,
.catalog-home__community-section {
  min-width: 0;
  margin-bottom: 22px;
}

.catalog-home__genre-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.catalog-home__genre-jump {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #c4c7cc;
  border-radius: 18px;
  background: #fff;
  color: #142839;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.catalog-home__genre-jump:hover,
.catalog-home__genre-jump.is-active {
  border-color: #2e51a2;
  background: #e1e7f5;
}

.catalog-home__genre-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #2e51a2;
}

.catalog-home__genre-dot--romance { background: #a83661; }
.catalog-home__genre-dot--fantasy { background: #6741a5; }
.catalog-home__genre-dot--horror { background: #8a3228; }
.catalog-home__genre-dot--thriller { background: #a25700; }
.catalog-home__genre-dot--mystery { background: #286544; }
.catalog-home__genre-dot--children { background: #1b6584; }

.catalog-home__carousel-shell {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.catalog-home__arrow {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #1c439b;
  border-radius: 50%;
  background: #fff;
  color: #1c439b;
  cursor: pointer;
  font-size: 23px !important;
  font-weight: 700 !important;
}

.catalog-home__arrow:hover {
  background: #e1e7f5;
}

.catalog-home__book-track,
.catalog-home__community-track {
  display: flex;
  min-width: 0;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 5px 2px 12px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-color: #8796a5 #e1e7f5;
  scrollbar-width: thin;
  touch-action: pan-x;
}

.catalog-home__book-track {
  align-items: flex-start;
}

.catalog-home__book-card {
  display: flex;
  width: 132px;
  min-width: 132px;
  flex: 0 0 132px;
  flex-direction: column;
  scroll-snap-align: start;
  color: #1c439b;
}

.catalog-home__cover {
  display: block;
  width: 132px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(20, 40, 57, .22);
  border-radius: 4px;
  background: #e1e7f5;
  box-shadow: 0 2px 5px rgba(20, 40, 57, .14);
}

.catalog-home__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-home__book-title,
.catalog-home__book-original,
.catalog-home__book-genre,
.catalog-home__book-source {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.catalog-home__book-title {
  margin-top: 7px;
  color: #142839;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-line-clamp: 2;
}

.catalog-home__book-original {
  margin-top: 3px;
  color: #394958;
  font-size: 11px;
  line-height: 1.3;
  -webkit-line-clamp: 2;
}

.catalog-home__book-genre {
  margin-top: 5px;
  color: #1c439b;
  font-size: 11px;
  font-weight: 700;
  -webkit-line-clamp: 1;
}

.catalog-home__book-source {
  color: #394958;
  font-size: 10px;
  -webkit-line-clamp: 1;
}

.catalog-home__community-track {
  align-items: stretch;
}

.catalog-home__topic-card {
  display: flex;
  width: 248px;
  min-width: 248px;
  min-height: 205px;
  flex: 0 0 248px;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #c4c7cc;
  border-radius: 7px;
  background: #fff;
  scroll-snap-align: start;
}

.catalog-home__topic-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #394958;
  font-size: 11px;
}

.catalog-home__topic-category {
  color: #1c439b;
  font-weight: 800;
}

.catalog-home__topic-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-home__topic-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #394958;
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-home__topic-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  color: #394958;
  font-size: 11px;
}

.catalog-home__user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  background: #2e51a2;
  color: #fff;
  font-weight: 800;
}

.catalog-home__topic-user {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-home__topic-replies {
  flex: 0 0 auto;
  font-weight: 700;
}

.catalog-home__top-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-home__top-cover {
  display: block;
  width: 42px;
  height: 60px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid rgba(20, 40, 57, .2);
  background: #e1e7f5;
}

.catalog-home__top-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-home__top-details {
  min-width: 0;
}

.catalog-home__top-details a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-home__rank {
  min-width: 16px;
  color: #1c439b;
  font: bold 13px Arial, sans-serif;
}

.catalog-home__top-list small {
  display: block;
  color: #684000;
}

.catalog-home__small-note {
  color: #394958;
  font-size: 12px;
}

.catalog-home__empty {
  margin: 0;
  padding: 14px;
  border: 1px solid #c4c7cc;
  border-radius: 5px;
  background: #fff;
  color: #394958;
}

.catalog-home [hidden] {
  display: none !important;
}

@media (max-width: 1050px) {
  .catalog-home__columns {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .catalog-home__left {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .catalog-home__left .catalog-home__box {
    margin-bottom: 0;
  }

  .catalog-home__main {
    grid-column: 1;
  }

  .catalog-home__right {
    grid-column: 2;
  }
}

@media (max-width: 700px) {
  .catalog-home {
    margin-top: 10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .catalog-home__columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .catalog-home__left,
  .catalog-home__main,
  .catalog-home__right {
    grid-column: 1;
  }

  .catalog-home__left {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .catalog-home__left .catalog-home__box:last-child {
    margin-bottom: 0;
  }

  .catalog-home__right {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .catalog-home__right .catalog-home__box {
    margin-bottom: 0;
  }

  .catalog-home__carousel-shell {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 4px;
  }

  .catalog-home__arrow {
    width: 44px;
    height: 44px;
    border-radius: 6px;
  }

  .catalog-home__topic-card {
    width: min(76vw, 248px);
    min-width: min(76vw, 248px);
    flex-basis: min(76vw, 248px);
  }

  .catalog-home__section-heading {
    align-items: flex-start;
  }

  .catalog-home__section-heading > span {
    white-space: normal;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-home__book-track,
  .catalog-home__community-track {
    scroll-behavior: auto;
  }
}
