.main-content > .page-card {
  min-width: 0;
  overflow: hidden;
}

.genre-toolbar {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.genre-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.genre-search {
  max-width: 320px;
  width: 100%;
}

.genre-index-meta {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.genre-pills-shell {
  position: relative;
}

.genre-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
  max-height: 132px;
  overflow: hidden;
  transition: max-height 0.24s ease;
}

.genre-pills-shell.expanded .genre-pills {
  max-height: 1000px;
}

.genre-pills-shell:not(.expanded)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0), rgba(247, 251, 255, 0.96));
  pointer-events: none;
}

.genre-index-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.genre-index-toggle {
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font-weight: 800;
  padding: 0;
}

.genre-section-card[hidden] {
  display: none !important;
}

.genre-section-controls {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.genre-load-more {
  min-width: 220px;
}

.genre-pill {
  border: 1px solid rgba(59, 167, 248, 0.18);
  background: var(--surface-soft);
  color: var(--blue-700);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  line-height: 1;
}

.genre-pill.active {
  background: linear-gradient(135deg, var(--blue-500), var(--rose-500));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 28px rgba(59, 167, 248, 0.2);
}

.genre-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(172px, 172px);
  gap: 14px;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.genre-rail::-webkit-scrollbar {
  display: none;
}

.genre-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(45, 97, 146, 0.12);
  text-decoration: none;
}

.genre-media {
  position: relative;
}

.genre-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.08) 0%, rgba(8, 14, 24, 0.42) 100%);
  pointer-events: none;
}

.genre-entry img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.genre-overlay {
  position: absolute;
  inset: 12px 12px 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.genre-meta-top {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.genre-copy {
  padding: 10px 12px 12px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 66px;
}

.genre-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.genre-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(237, 246, 255, 0.94);
  color: var(--blue-700);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.14);
  backdrop-filter: blur(6px);
  max-width: 100%;
  white-space: nowrap;
}

.genre-flag.is-trending {
  background: #fff1ec;
  color: #d4572e;
}

.genre-flag.is-popular {
  background: #eefbf2;
  color: #247a4f;
}

.genre-flag.is-top10 {
  background: #fff8df;
  color: #9a6b00;
}

.genre-flag.is-new-part {
  background: #eaf7ff;
  color: #0e6aa8;
}

.genre-copy > span {
  display: none;
}

.genre-copy h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.24;
}

.genre-copy .genre-title-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 2.48em;
}

.genre-copy p {
  display: none;
}

.genre-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 700;
}

.genre-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(12, 20, 35, 0.52);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.genre-meta .is-new-inline {
  gap: 4px;
}

.genre-meta .is-new-inline .new-part-text {
  color: #ffe082;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.genre-status-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.title-tooltip-shell {
  display: block;
  cursor: help;
}

.themed-title-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  max-width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(59, 167, 248, 0.16);
  box-shadow: 0 18px 34px rgba(45, 97, 146, 0.14);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: normal;
  pointer-events: none;
  z-index: 80;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.themed-title-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

body.dark-theme .themed-title-tooltip {
  background: rgba(18, 32, 51, 0.94);
  border-color: rgba(147, 167, 199, 0.14);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  color: #edf4ff;
}

body.dark-theme .genre-pills-shell:not(.expanded)::after {
  background: linear-gradient(180deg, rgba(9, 17, 30, 0), rgba(9, 17, 30, 0.96));
}

.genre-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  justify-content: flex-end;
}

.genre-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: right;
}

.date-pagination {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-indicator {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 44px;
  text-align: right;
}

.genre-loading,
.genre-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 24px;
  border: 1px dashed rgba(59, 167, 248, 0.22);
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .genre-rail {
    grid-auto-columns: minmax(148px, 148px);
  }

  .genre-copy h3 {
    font-size: 0.92rem;
  }

  .genre-meta {
    font-size: 0.68rem;
  }

  .genre-flag {
    font-size: 0.6rem;
    padding: 0 8px;
  }

  .genre-tools {
    width: 100%;
    justify-content: space-between;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .genre-rail {
    grid-auto-columns: minmax(160px, 160px);
  }
}

@media (min-width: 1200px) and (max-width: 1599.98px) {
  .genre-rail {
    grid-auto-columns: minmax(168px, 168px);
  }
}
