.filters {
  position: sticky;
  top: 8px;
  z-index: 4;
  border-radius: 22px;
  padding: 12px 12px 10px;
  border: 1px solid var(--app-panel-border, rgba(150, 168, 255, 0.1));
  background: var(--app-toolbar-bg,
    radial-gradient(180px 100px at 0% 0%, rgba(141, 178, 255, 0.08), transparent 72%),
    linear-gradient(180deg, rgba(21, 28, 53, 0.96), rgba(14, 20, 39, 0.96)));
  backdrop-filter: blur(16px);
  box-shadow: var(--app-card-shadow-soft, 0 10px 22px rgba(4, 8, 24, 0.18));
}

.discoverFilters {
  margin-bottom: 6px;
}

.discoverPage {
  position: relative;
  padding-bottom: 4px;
  overflow-x: hidden;
}

.discoverPage.discoverFilterSheetOpen {
  z-index: 130;
}

.discoverFilters {
  display: grid;
  gap: 10px;
}

.searchBox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 18px;
  border: 1px solid var(--app-input-border, rgba(150, 168, 255, 0.1));
  background: var(--app-input-bg,
    linear-gradient(180deg, rgba(17, 22, 42, 0.98), rgba(12, 17, 33, 0.98)),
    rgba(255, 255, 255, 0.02));
  box-shadow: var(--app-input-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.05));
}

.sIco {
  color: var(--faint);
  font-size: 13px;
}

.sIn {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text, rgba(238, 242, 255, 0.94));
  font-size: 13px;
}

.sIn::placeholder {
  color: rgba(191, 201, 232, 0.48);
}

.searchBox:focus-within {
  border-color: var(--app-accent-strong, rgba(141, 178, 255, 0.26));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 3px rgba(141, 178, 255, 0.08);
}

.typeHost {
  padding-top: 1px;
}

.typeTabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0;
  scroll-snap-type: x mandatory;
}

.typeTab {
  appearance: none;
  border: 1px solid var(--app-chip-border, rgba(150, 168, 255, 0.1));
  background: var(--app-chip-bg,
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.025));
  color: var(--muted, rgba(238, 242, 255, 0.72));
  padding: 9px 13px;
  border-radius: 15px;
  font-weight: 900;
  font-size: 11.5px;
  cursor: pointer;
  scroll-snap-align: start;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.typeTab.active {
  color: var(--app-chip-strong-fg, rgba(245, 243, 194, 0.96));
  border-color: var(--app-primary-border, rgba(245, 243, 194, 0.18));
  background: var(--app-chip-strong-bg,
    radial-gradient(140px 56px at 50% 0%, rgba(245, 243, 194, 0.16), transparent 72%),
    linear-gradient(180deg, rgba(245, 243, 194, 0.08), rgba(141, 178, 255, 0.08)));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 16px rgba(12, 19, 44, 0.14);
}

.characterGroupHost[hidden] {
  display: none;
}

.characterGroupRow {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 0 2px;
  scroll-snap-type: x proximity;
}

.characterGroupPill {
  appearance: none;
  scroll-snap-align: start;
  white-space: nowrap;
  border: 1px solid var(--app-chip-border, rgba(150, 168, 255, 0.12));
  background: var(--app-chip-bg,
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.024)),
    rgba(255, 255, 255, 0.026));
  color: var(--muted, rgba(238, 242, 255, 0.74));
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.characterGroupPill.active {
  color: var(--app-chip-strong-fg, rgba(245, 243, 194, 0.98));
  border-color: var(--app-primary-border, rgba(245, 243, 194, 0.2));
  background: var(--app-chip-strong-bg,
    radial-gradient(110px 50px at 50% 0%, rgba(245, 243, 194, 0.18), transparent 72%),
    linear-gradient(180deg, rgba(245, 243, 194, 0.1), rgba(141, 178, 255, 0.08)));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(12, 19, 44, 0.15);
}

.characterGroupPill.random {
  border-style: dashed;
}

.sortRow {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 0 0;
  scroll-snap-type: x proximity;
}

.sortRow .pill {
  scroll-snap-align: start;
  white-space: nowrap;
}

.helperRow {
  padding-top: 2px;
  min-height: 24px;
}

.hint {
  color: var(--muted);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0;
}

.pill.active {
  border-color: var(--app-primary-border, rgba(245, 243, 194, 0.18));
  background: var(--app-chip-strong-bg, rgba(245, 243, 194, 0.10));
  color: var(--app-chip-strong-fg, rgba(245, 243, 194, 0.98));
}

.chip.active {
  border-color: var(--app-primary-border, rgba(245, 243, 194, 0.18));
  background: var(--app-chip-strong-bg, rgba(245, 243, 194, 0.10));
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 0 12px;
}

.segBtn {
  appearance: none;
  border: 1px solid rgba(150, 168, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 242, 255, 0.80);
  min-height: 48px;
  padding: 13px 0;
  border-radius: 16px;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}

.segBtn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.94);
}

.pillRow {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 2px 0;
}

.spacer {
  flex: 1;
}

.pill {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 11px;
  border: 1px solid var(--app-action-border, rgba(150, 168, 255, 0.1));
  background: var(--app-action-bg,
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.04));
  color: var(--text, rgba(238, 242, 255, 0.86));
  font-weight: 800;
  font-size: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pill.hot {
  border-color: rgba(245, 243, 194, 0.16);
  background:
    linear-gradient(180deg, rgba(245, 243, 194, 0.10), rgba(255, 255, 255, 0.03)),
    rgba(245, 243, 194, 0.08);
}

.chip {
  appearance: none;
  border: 1px solid var(--app-chip-border, rgba(150, 168, 255, 0.1));
  background: var(--app-chip-bg,
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    var(--chip));
  color: var(--text, rgba(238, 242, 255, 0.80));
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chip.ghost {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(150, 168, 255, 0.08);
}

.typeTab:hover,
.pill:hover,
.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 168, 255, 0.18);
}

.discoverFilterBtn {
  min-width: 50px;
  min-height: 34px;
  justify-content: center;
}

.searchClear {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 242, 255, 0.72);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.searchClear[hidden] {
  display: none;
}

.selectBtn {
  appearance: none;
  border: 1px solid rgba(150, 168, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 242, 255, 0.86);
  padding: 10px 14px;
  border-radius: 15px;
  font-weight: 900;
  cursor: pointer;
}

.discoverHome,
.discoverResultsSection {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.discoverHome {
  padding-top: 12px;
}

.discoverFeature,
.discoverSection,
.discoverResultsSection {
  border-radius: 26px;
  border: 1px solid var(--app-panel-border, rgba(150, 168, 255, 0.11));
  background: var(--app-feature-bg,
    radial-gradient(220px 140px at 8% 10%, rgba(141, 178, 255, 0.08), transparent 72%),
    linear-gradient(180deg, rgba(24, 32, 61, 0.9), rgba(15, 21, 40, 0.96)),
    rgba(255, 255, 255, 0.02));
  box-shadow: var(--app-card-shadow-soft, 0 12px 28px rgba(4, 8, 24, 0.16));
  backdrop-filter: blur(14px);
}

.discoverFeature {
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.discoverFeatureMedia {
  position: relative;
  min-height: 236px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--app-media-glow-bg,
    radial-gradient(160px 120px at 24% 18%, rgba(255, 255, 255, 0.1), transparent 66%),
    linear-gradient(180deg, rgba(77, 95, 170, 0.18), rgba(21, 27, 49, 0.18)));
}

.discoverFeatureImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discoverFeatureImg.isHidden {
  display: none;
}

.discoverFeatureMedia .discoverFeatureFallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: clamp(56px, 10vw, 88px);
  color: rgba(239, 243, 255, 0.76);
}

.discoverFeatureCopy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  align-content: start;
}

.discoverFeatureEyebrow {
  color: var(--hot, rgba(245, 243, 194, 0.86));
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.discoverFeatureTitle,
.discoverSectionTitle {
  color: rgba(245, 248, 255, 0.98);
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
}

.discoverFeatureTitle {
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.06;
}

.discoverFeatureSub,
.discoverSectionSub {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.68;
}

.discoverFeatureSub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.discoverFeatureMeta {
  color: rgba(226, 233, 255, 0.78);
  font-size: 11.5px;
  font-weight: 700;
}

.discoverFeatureActions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 4px;
}

.discoverHeroBtn,
.discoverSectionMore {
  appearance: none;
  border: 1px solid var(--app-action-border, rgba(150, 168, 255, 0.11));
  border-radius: 999px;
  background: var(--app-action-bg,
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.04));
  color: var(--text, rgba(241, 245, 255, 0.94));
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.discoverHeroBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  font-size: 12px;
  text-decoration: none;
}

.discoverHeroBtn.primary {
  border-color: var(--app-primary-border, rgba(245, 243, 194, 0.18));
  background: var(--app-primary-bg,
    radial-gradient(160px 60px at 50% 0%, rgba(245, 243, 194, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(141, 178, 255, 0.20), rgba(55, 67, 125, 0.24)));
  color: var(--app-primary-text, rgba(255, 250, 220, 0.98));
  box-shadow: var(--app-primary-shadow, 0 10px 22px rgba(10, 16, 38, 0.18));
}

.discoverFeatureInvite {
  background: var(--app-feature-bg,
    radial-gradient(220px 140px at 8% 10%, rgba(245, 143, 190, 0.16), transparent 72%),
    linear-gradient(180deg, rgba(42, 23, 49, 0.92), rgba(20, 21, 42, 0.96)));
}

.discoverFeatureInviteMedia {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 160px;
  padding: 12px;
  text-decoration: none;
  color: var(--app-primary-text, rgba(255, 250, 220, 0.98));
}

.discoverInviteQr {
  display: block;
  width: min(140px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 18px;
  border: 8px solid rgba(255, 255, 255, 0.96);
  background: #fff;
  box-shadow: var(--app-primary-shadow, 0 14px 34px rgba(10, 16, 38, 0.24));
}

.discoverInviteQr.isHidden {
  display: none;
}

.discoverFeatureInviteMedia.qrMissing {
  min-height: 120px;
  border: 1px dashed rgba(255, 225, 236, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(150px 90px at 50% 0%, rgba(255, 171, 205, 0.18), transparent 72%),
    rgba(255, 255, 255, 0.045);
}

.discoverInviteText {
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  color: var(--muted, rgba(238, 242, 255, 0.72));
}

.discoverSection,
.discoverResultsSection {
  padding: 14px;
}

.discoverSection {
  overflow: hidden;
}

.discoverSectionHead,
.discoverResultsHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.discoverSectionCopy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.discoverSectionTitle {
  font-size: 18px;
}

.discoverSectionMore {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 11.5px;
}

.discoverRail {
  display: flex;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}

.discoverRail::-webkit-scrollbar {
  display: none;
}

.discoverRailCard {
  flex: 0 0 clamp(184px, 60vw, 208px);
  scroll-snap-align: start;
}

.discoverResultsSection {
  margin-top: 14px;
}

.discoverResultsSection .discoverGrid {
  padding-top: 0;
}

.discoverResultsMore[hidden] {
  display: none;
}

.discoverResultsFooter {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 0 2px;
}

.discoverResultsFooter .discoverSectionMore {
  min-width: min(100%, 180px);
}

.discoverResultsFooter .discoverSectionMore:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.discoverLoadState {
  min-height: 16px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}

.discoverFeature.discoverFeatureFallback {
  min-height: 220px;
  align-items: end;
}

.discoverFeature.discoverFeatureFallback .discoverFeatureCopy {
  max-width: 560px;
}

.discoverHeroBtn:hover,
.discoverSectionMore:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 168, 255, 0.16);
}

.grid2 {
  padding-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cardX {
  border: 1px solid var(--app-panel-border, rgba(150, 168, 255, 0.11));
  border-radius: 22px;
  overflow: hidden;
  background: var(--app-panel-bg-soft,
    linear-gradient(180deg, rgba(28, 37, 68, 0.94), rgba(17, 23, 44, 0.98)),
    rgba(255, 255, 255, 0.02));
  box-shadow: var(--app-card-shadow-soft, 0 10px 24px rgba(3, 8, 23, 0.16));
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.cardX:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 168, 255, 0.18);
  box-shadow: 0 14px 28px rgba(3, 8, 23, 0.2);
}

.cardX[data-tokens="0"] .badge.left,
.cardX[data-heat="0"] .badge.right,
.cardCategory {
  display: none;
}

.cardCover {
  position: relative;
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(160px 120px at 30% 20%, rgba(255, 255, 255, 0.08), transparent 62%),
    linear-gradient(180deg, rgba(104, 126, 216, 0.14), rgba(18, 24, 47, 0.04));
  background-size: cover;
  background-position: center;
}

.cardCoverImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cardCoverImg.isHidden {
  display: none;
}

.cardCoverFallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: clamp(34px, 24%, 58px);
  color: rgba(238, 242, 255, 0.24);
  transform: translate(18%, 20%);
  pointer-events: none;
}

.cardX.hasCover .cardCoverFallback,
.discoverFeature.hasCover .discoverFeatureFallback {
  display: none;
}

.cardX.noCover .cardCoverFallback {
  display: grid;
}

.cardCover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.24) 62%, rgba(0, 0, 0, 0.46));
  pointer-events: none;
}

.badge {
  position: absolute;
  top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 15, 30, 0.40);
  color: rgba(255, 255, 255, 0.86);
}

.badge.left {
  left: 12px;
}

.badge.right {
  right: 12px;
}

.badge.hot {
  border-color: rgba(245, 243, 194, 0.16);
  background: rgba(245, 243, 194, 0.12);
  color: rgba(245, 243, 194, 0.98);
}

.coverBottomTag {
  position: absolute;
  left: 10px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(11, 15, 30, 0.36);
  font-weight: 900;
  font-size: 10.5px;
}

.cardBody {
  padding: 12px 12px 13px;
  display: grid;
  gap: 8px;
}

.cardTitle {
  font-family: var(--display);
  font-size: 14.5px;
  line-height: 1.28;
  font-weight: 700;
  margin: 0;
}

.cardDesc {
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 12px;
}

.cardMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.author {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ava {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(150, 168, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
  font-size: 10px;
}

.authorName {
  color: rgba(238, 242, 255, 0.84);
  font-weight: 850;
  font-size: 11.5px;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.likes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
}

.cardX.compact .cardBody {
  padding: 10px 10px 11px;
  gap: 6px;
}

.cardX.compact .cardTitle {
  font-size: 13.5px;
}

.cardX.compact .cardDesc {
  -webkit-line-clamp: 1;
}

.cardX.compact .authorName {
  max-width: 58px;
}

.cardX.compact .likes {
  font-size: 10px;
}

.cardSkeleton {
  pointer-events: none;
}

.cardSkeleton .cardCover::after {
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  background-size: 220% 100%;
  animation: discoverSkeleton 1.2s ease-in-out infinite;
}

.skLine {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.skLine.title {
  width: 78%;
  height: 13px;
}

.skLine.short {
  width: 54%;
}

@keyframes discoverSkeleton {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.cardCategory {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discoverFilterOverlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0 max(8px, env(safe-area-inset-left)) max(4px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--app-overlay-bg, rgba(0, 0, 0, 0.38)) 62%, transparent);
  backdrop-filter: blur(7px) saturate(108%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.discoverPage > .discoverFilterOverlay {
  position: fixed;
  z-index: 120;
}

.discoverFilterOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

.discoverFilterPanel {
  width: min(calc(100vw - 16px), var(--app-shell-fixed-width, 460px));
  max-height: min(62dvh, 520px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 8px 14px max(12px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 12px 12px;
  border: 1px solid var(--app-panel-border, rgba(150, 168, 255, 0.18));
  background: var(--app-panel-bg-strong,
    linear-gradient(180deg, rgba(24, 31, 57, 0.98), rgba(12, 17, 32, 0.99)));
  box-shadow: var(--app-panel-shadow, 0 -16px 38px rgba(4, 8, 24, 0.32));
  color: var(--text);
}

.filterSheetHandle {
  justify-self: center;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 28%, transparent);
}

.filterSheetHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.filterSheetTitleBlock {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.filterSheetTitle {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
}

.filterSheetSummary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.filterSheetClear {
  appearance: none;
  border: 1px solid var(--app-action-border, rgba(150, 168, 255, 0.12));
  background: var(--app-action-bg, rgba(255, 255, 255, 0.05));
  color: var(--text);
  min-height: 34px;
  padding: 0 12px;
  border-radius: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.filterSheetBody {
  display: grid;
  gap: 13px;
}

.filterGroup {
  display: grid;
  gap: 8px;
}

.filterGroupTitle {
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
}

.filterChoiceGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filterChoice {
  appearance: none;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--app-chip-border, rgba(150, 168, 255, 0.14));
  background: var(--app-chip-bg, rgba(255, 255, 255, 0.05));
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.filterChoice.active {
  border-color: var(--app-primary-border, rgba(245, 243, 194, 0.22));
  background: var(--app-chip-strong-bg, rgba(245, 243, 194, 0.11));
  color: var(--app-chip-strong-fg, var(--text));
}

.filterChoiceMark {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  font-size: 12px;
}

.filterSheetFooter {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.filterSheetDone {
  appearance: none;
  min-width: 112px;
  min-height: 42px;
  border: 1px solid var(--app-primary-border, rgba(245, 243, 194, 0.20));
  border-radius: 15px;
  background: var(--app-primary-bg,
    linear-gradient(180deg, rgba(141, 178, 255, 0.22), rgba(55, 67, 125, 0.30)));
  color: var(--app-primary-text, var(--text));
  font-weight: 950;
  cursor: pointer;
  box-shadow: var(--app-primary-shadow, 0 12px 24px rgba(4, 8, 24, 0.22));
}

.discoverFilterPanel,
.discoverFilterPanel * {
  box-sizing: border-box;
}

.discoverFilterPanel .filterChoice,
.discoverFilterPanel .filterSheetClear,
.discoverFilterPanel .filterSheetDone {
  text-align: center;
}

@media (max-width: 560px) {
  .filters {
    top: 0;
    border-radius: 16px;
    padding: 8px;
  }

  .discoverFilters {
    gap: 6px;
    margin-inline: -2px;
  }

  .searchBox {
    min-height: 38px;
    padding: 0 8px 0 10px;
    border-radius: 14px;
  }

  .sIn {
    font-size: 13px;
  }

  .discoverFilterBtn {
    min-width: 44px;
    min-height: 30px;
    padding-inline: 9px;
  }

  .discoverFilterPanel {
    width: min(calc(100vw - 16px), var(--app-shell-fixed-width, 460px));
    max-height: min(58dvh, 460px);
    gap: 10px;
    padding: 8px 13px max(10px, env(safe-area-inset-bottom));
  }

  .filterSheetTitle {
    font-size: 18px;
  }

  .filterSheetSummary {
    font-size: 11px;
  }

  .filterSheetClear {
    min-height: 32px;
    padding-inline: 11px;
    border-radius: 12px;
  }

  .filterSheetBody {
    gap: 10px;
  }

  .filterGroup {
    gap: 7px;
  }

  .filterGroupTitle {
    font-size: 11px;
  }

  .filterChoiceGrid {
    gap: 6px;
  }

  .filterChoice {
    min-height: 34px;
    padding-inline: 11px;
    border-radius: 12px;
    font-size: 12px;
  }

  .filterSheetFooter {
    padding-top: 0;
  }

  .filterSheetDone {
    width: 100%;
    min-height: 40px;
    border-radius: 14px;
  }

  .typeTabs,
  .sortRow {
    gap: 6px;
  }

  .typeTab {
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 11px;
  }

  .pill {
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 10.5px;
  }

  .helperRow {
    display: flex;
    min-height: 28px;
    padding: 0 2px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .helperRow .hint {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
  }

  .helperRow .chip {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .discoverFilters > .pillRow:not(.helperRow) {
    display: none;
  }

  .discoverHome {
    gap: 8px;
    padding-top: 8px;
  }

  .discoverDesktopShelf {
    display: none;
  }

  .discoverFeature {
    grid-template-columns: minmax(0, 1fr) 94px;
    align-items: stretch;
    gap: 10px;
    min-height: 118px;
    padding: 10px;
  }

  .discoverFeatureMedia {
    min-height: 0;
    height: auto;
    border-radius: 14px;
  }

  .discoverFeatureCopy {
    min-width: 0;
    gap: 5px;
  }

  .discoverFeatureEyebrow {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .discoverFeatureTitle {
    font-size: 17px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .discoverFeatureSub {
    font-size: 11.5px;
    line-height: 1.45;
    -webkit-line-clamp: 1;
  }

  .discoverFeatureMeta {
    font-size: 10.5px;
  }

  .discoverFeatureActions {
    margin-top: auto;
    padding-top: 0;
    gap: 6px;
  }

  .discoverHeroBtn {
    min-height: 32px;
    padding: 0 11px;
    font-size: 11px;
  }

  .discoverHeroBtn:not(.primary) {
    display: none;
  }

  .discoverHeroBtn.primary {
    width: 100%;
    justify-content: center;
  }

  .discoverFeature.discoverFeatureFallback {
    min-height: 168px;
    grid-template-columns: 1fr;
  }

  .discoverFeature.discoverFeatureFallback .discoverFeatureActions {
    display: flex;
  }

  .discoverSection,
  .discoverResultsSection {
    padding: 11px;
  }

  .discoverSectionTitle {
    font-size: 16px;
  }

  .discoverRail {
    gap: 10px;
    padding: 2px 1px 8px;
    scroll-padding-inline: 1px;
  }

  .discoverRailCard {
    flex-basis: clamp(220px, 76vw, 258px);
  }

  .grid2 {
    gap: 10px;
  }

  .cardX {
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(3, 8, 23, 0.14);
  }

  .cardBody {
    padding: 9px 9px 10px;
    gap: 6px;
  }

  .cardTitle {
    font-size: 13px;
    line-height: 1.26;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .cardDesc {
    display: none;
  }

  .badge {
    top: 7px;
    padding: 4px 6px;
    font-size: 9px;
  }

  .badge.left {
    left: 7px;
  }

  .badge.right {
    right: 7px;
  }

  .coverBottomTag {
    left: 7px;
    bottom: 7px;
    padding: 4px 6px;
    font-size: 9px;
  }

  .ava {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .authorName {
    max-width: 54px;
    font-size: 10px;
  }

  .likes {
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .filters {
    border-radius: 18px;
    padding: 9px 9px 7px;
  }

  .discoverFeature,
  .discoverSection,
  .discoverResultsSection {
    border-radius: 18px;
  }

  .discoverFeature {
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  .discoverFeatureTitle {
    font-size: 16px;
  }

  .discoverFeatureActions {
    display: flex;
  }

  .discoverHeroBtn {
    width: 100%;
    justify-content: center;
  }

  .discoverRailCard {
    flex-basis: clamp(206px, 80vw, 238px);
  }

  .cardX.compact .cardDesc {
    display: none;
  }

  .cardX.compact .authorName {
    max-width: 52px;
  }
}

@media (max-width: 560px) {
  .discoverResultsSection {
    margin-top: 10px;
  }

  .discoverResultsHead {
    align-items: center;
  }

  .discoverSectionSub {
    font-size: 11px;
    line-height: 1.35;
  }
}

@media (min-width: 900px) {
  .discoverFilters {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .discoverFilters .searchBox,
  .discoverFilters .typeHost,
  .discoverFilters .helperRow {
    grid-column: 1 / -1;
  }

  .discoverFilters > .pillRow:not(.helperRow) {
    grid-column: 2;
    justify-self: end;
    padding-top: 0;
  }

  .discoverHome {
    gap: 18px;
  }

  .discoverFeature {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .discoverFeatureMedia {
    min-height: 360px;
  }

  .discoverFeatureTitle {
    font-size: 36px;
  }

  .discoverRailCard {
    flex-basis: 286px;
  }

  .discoverGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-top: 14px;
  }

  .cardBody {
    padding: 14px 14px 15px;
  }
}

@media (min-width: 1240px) {
  .discoverGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .discoverRailCard {
    flex-basis: 312px;
  }
}

@media (max-width: 380px) {
  .grid2 {
    gap: 9px;
  }
}

/* polish: 2026-05-27 - give the discover page a denser, more refined surface rhythm around filters and results. */
.discoverPage {
  --discover-polish-border: color-mix(in srgb, var(--app-accent, #8db2ff) 24%, rgba(255,255,255,0.12));
  --discover-polish-glow: color-mix(in srgb, var(--app-accent, #8db2ff) 18%, rgba(3,8,24,0.22));
}

/* polish: 2026-05-27 - make the sticky filter bar read like a premium toolbar instead of a flat container. */
.discoverPage .filters {
  border-color: var(--discover-polish-border);
  background:
    radial-gradient(260px 110px at 12% 0%, color-mix(in srgb, var(--app-accent, #8db2ff) 12%, transparent), transparent 74%),
    linear-gradient(180deg, rgba(24, 31, 58, 0.96), rgba(13, 19, 38, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 14px 32px rgba(3, 8, 24, 0.22);
}

/* polish: 2026-05-27 - improve search field contrast and focus polish for long browsing sessions. */
.discoverPage .searchBox {
  border-color: color-mix(in srgb, var(--app-accent, #8db2ff) 18%, rgba(255,255,255,0.10));
  background:
    linear-gradient(180deg, rgba(18, 24, 45, 0.98), rgba(10, 15, 31, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 8px 18px rgba(3, 8, 24, 0.12);
}

/* polish: 2026-05-27 - make filter chips feel tactile and consistent with chat controls. */
.discoverPage .typeTab,
.discoverPage .characterGroupPill,
.discoverPage .pill,
.discoverPage .chip,
.discoverPage .searchClear,
.discoverPage .selectBtn,
.discoverPage .discoverHeroBtn,
.discoverPage .discoverSectionMore {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

/* polish: 2026-05-27 - sharpen active filters with a restrained warm accent instead of a flat fill. */
.discoverPage .typeTab.active,
.discoverPage .characterGroupPill.active,
.discoverPage .pill.active,
.discoverPage .chip.active {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 8px 18px color-mix(in srgb, var(--app-accent, #8db2ff) 16%, rgba(3,8,24,0.18));
}

/* polish: 2026-05-27 - upgrade section cards to better frame character lists without nested-card heaviness. */
.discoverPage .discoverFeature,
.discoverPage .discoverSection,
.discoverPage .discoverResultsSection {
  border-color: color-mix(in srgb, var(--app-accent, #8db2ff) 18%, rgba(255,255,255,0.10));
  background:
    radial-gradient(280px 140px at 0% 0%, color-mix(in srgb, var(--app-accent, #8db2ff) 8%, transparent), transparent 74%),
    linear-gradient(180deg, rgba(24, 31, 58, 0.90), rgba(14, 20, 39, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 14px 34px rgba(3, 8, 24, 0.18);
}

/* polish: 2026-05-27 - refine role cards with better rounded covers, depth, and hover lift. */
.discoverPage .cardX {
  border-radius: 20px;
  border-color: color-mix(in srgb, var(--app-accent, #8db2ff) 17%, rgba(255,255,255,0.10));
  background:
    linear-gradient(180deg, rgba(28, 36, 66, 0.96), rgba(15, 21, 42, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 12px 26px rgba(3, 8, 24, 0.18);
}

/* polish: 2026-05-27 - make role-card hover feel intentional on pointer devices. */
@media (hover: hover) and (pointer: fine) {
  .discoverPage .cardX:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--app-accent, #8db2ff) 34%, rgba(255,255,255,0.16));
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.07),
      0 18px 36px rgba(3, 8, 24, 0.26);
  }
}

/* polish: 2026-05-27 - add a subtle image polish layer so covers look less raw on mixed artwork. */
.discoverPage .cardCover {
  overflow: hidden;
  border-radius: 19px 19px 10px 10px;
}

/* polish: 2026-05-27 - smooth cover zoom only where hover exists, avoiding mobile scroll jank. */
@media (hover: hover) and (pointer: fine) {
  .discoverPage .cardCoverImg {
    transition: transform 220ms ease, filter 220ms ease;
  }

  /* polish: 2026-05-27 - add a restrained cover zoom that preserves card layout. */
  .discoverPage .cardX:hover .cardCoverImg {
    transform: scale(1.025);
    filter: saturate(1.04) contrast(1.02);
  }
}

/* polish: 2026-05-27 - improve badge glass treatment over busy cover art. */
.discoverPage .badge,
.discoverPage .coverBottomTag {
  border-color: rgba(255,255,255,0.16);
  background: rgba(8, 12, 25, 0.48);
  backdrop-filter: blur(8px) saturate(125%);
  -webkit-backdrop-filter: blur(8px) saturate(125%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* polish: 2026-05-27 - improve card typography hierarchy for Chinese titles and descriptions. */
.discoverPage .cardTitle {
  font-weight: 850;
  line-height: 1.32;
  letter-spacing: 0;
  color: rgba(245, 248, 255, 0.96);
}

/* polish: 2026-05-27 - make role descriptions calmer and easier to skim. */
.discoverPage .cardDesc {
  color: rgba(205, 215, 244, 0.72);
  line-height: 1.58;
}

/* polish: 2026-05-27 - make author avatars and metadata feel deliberate instead of incidental. */
.discoverPage .ava {
  border-color: color-mix(in srgb, var(--app-accent, #8db2ff) 24%, rgba(255,255,255,0.12));
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--app-accent, #8db2ff) 16%, transparent), transparent 62%),
    rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* polish: 2026-05-27 - keep loading skeletons on-theme with softer shimmer contrast. */
.discoverPage .cardSkeleton .cardCover::after {
  background: linear-gradient(110deg, rgba(255,255,255,0.035), rgba(141,178,255,0.14), rgba(255,255,255,0.035));
  background-size: 220% 100%;
}

/* polish: 2026-05-27 - improve mobile card touch density and prevent overly round thumbnails. */
@media (max-width: 560px) {
  .discoverPage .cardX {
    border-radius: 17px;
  }

  /* polish: 2026-05-27 - keep mobile cover corners aligned with the tighter card radius. */
  .discoverPage .cardCover {
    border-radius: 16px 16px 9px 9px;
  }

  /* polish: 2026-05-27 - make mobile role titles readable without expanding card height too much. */
  .discoverPage .cardTitle {
    font-size: 13.5px;
    line-height: 1.3;
  }

  /* polish: 2026-05-27 - leave enough tappable area in mobile filter controls. */
  .discoverPage .typeTab,
  .discoverPage .characterGroupPill,
  .discoverPage .pill {
    min-height: 32px;
  }
}
