html:has(.body-swipe-discovery) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  scroll-padding: 0;
}
html:has(.body-swipe-discovery) body.body-swipe-discovery {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
.body-swipe-discovery #sb_global_player { display: none; }
.discover {
  position: relative;
  box-sizing: border-box;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: max(12px, env(safe-area-inset-top)) 18px calc(80px + env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  isolation: isolate;
  background: var(--page-bg);
  color: var(--text-color);
}
.discover [hidden] { display: none !important; }
.discover-backdrop, .discover-backdrop img { position: absolute; inset: 0; width: 100%; height: 100%; }
.discover-backdrop { z-index: -1; overflow: hidden; pointer-events: none; }
.discover-backdrop img { object-fit: cover; filter: blur(34px) saturate(1.35); transform: scale(1.16); }
.discover-backdrop img + img { opacity: 0; }
.discover-backdrop:after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--page-bg);
}
.discover-intro, .discover-content {
  width: min(100%, 460px);
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
}
.discover-content {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.discover-intro {
  padding: 20px;
  background: var(--bg2);
  border: 1px solid var(--border-color);
  border-radius: 22px;
}
.discover-intro h1 { margin: 0 0 20px; font-size: clamp(1.42rem, 4vw, 2rem); text-align: center; }
.discover-intro .hero-survey-buttons { width: 100%; margin: 0; }
.discover-intro .hero-survey-button:focus-visible, .discover-action:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.discover:has(.discover-content:not([hidden])) {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.discover:has(.discover-content:not([hidden])):active { cursor: grabbing; }
.discover-stack {
  --discover-stack-h: min(40svh, 330px);
  --discover-ar: 1.7778;
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  width: 100%;
  --discover-fit: 1;
  max-width: min(100%, calc(var(--discover-stack-h) * var(--discover-fit) * var(--discover-ar)));
  aspect-ratio: var(--discover-ar);
  touch-action: none;
  user-select: none;
}
.discover-card {
  position: absolute;
  inset: 0;
  display: block;
  background: transparent;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.discover-card-img,
.discover-card-shadow {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: 18px;
  pointer-events: none;
}
.discover-card-img { z-index: 2; }
.discover-card-shadow {
  top: 4px;
  z-index: 1;
  filter: blur(6px);
  opacity: 0.35;
  transform: scale(1.03);
}
.theme-dark .discover-card-shadow {
  opacity: 0.28;
  filter: blur(10px);
  transform: scale(1.06);
}
.discover-front { cursor: grab; }
.discover-front:active { cursor: grabbing; }
.discover-peek {
  inset: auto;
  top: 50%;
  left: 50%;
  --discover-fit: 1;
  width: min(100cqw, calc(var(--discover-stack-h) * var(--discover-fit) * var(--discover-ar)));
  aspect-ratio: var(--discover-ar);
  translate: -50% -50%;
  transform: scale(.92);
  opacity: 0;
}
/* Portrait covers would otherwise fill the full height cap, far taller than wide images. */
.discover-stack[data-tall], .discover-peek[data-tall] { --discover-fit: .68; }
.discover-stamp {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 3;
  font-weight: 600;
  color: white;
  background: #17171a;
  border: 2px solid currentColor;
  border-radius: 8px;
  padding: 6px 10px;
  opacity: 0;
}
.discover-info {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-width: 0;
  padding-top: 4px;
  min-height: 0;
  flex: 0 1 auto;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}
.discover-info:hover,
.discover-info:focus,
.discover-info:active {
  color: inherit;
  text-decoration: none;
}
.discover-hook {
	margin: 0;
	padding: 14px 8px 0px;
	font-family: var(--font-serif, Georgia, serif);
	font-size: 20px;
	font-style: italic;
	font-weight: 400;
	line-height: 24px;
	text-align: center;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.discover-themes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 10px 0;
  max-height: calc(2 * (17px + 12px) + 7px);
  overflow: hidden;
}
.discover-theme {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px 9px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  border: none;
  border-radius: 100px;
  background: var(--bg7);
  text-transform: capitalize;
  white-space: nowrap;
}
.discover-theme-emoji {
  font-size: 17px;
  line-height: 1;
  text-transform: none;
}
.discover-book {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: none;
  border-radius: 16px;
  background: var(--bg7);
}
.discover-original { width: 44px; height: 64px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.discover-book > div { min-width: 0; flex: 1; overflow: hidden; }
.discover-title {
  display: block;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.discover-title:hover,
.discover-title:focus,
.discover-title:active {
  color: inherit;
  text-decoration: none;
}
.discover-byline {
  font-size: 14px;
  margin: 5px 0 0;
  color: var(--text-color2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.discover-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0;
}
.discover-rating .rating-stars {
  display: flex;
  gap: 1px;
}
.discover-rating .rating-star,
.discover-rating .rating-star-half,
.discover-rating .rating-star-off {
  width: 14px;
  height: 14px;
  margin: 0;
  background-size: 14px;
}
.discover-rating-value {
  font-size: 13px;
  font-weight: 600;
}
.discover-rating-count {
  font-size: 12px;
  color: var(--text-color2);
}
.discover-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  gap: 16px;
  margin: 16px 0 0;
}
.discover-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
}
.discover-action:active,
.discover-action.is-pressed {
  transform: scale(1.25);
  transition: transform 0.1s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.1s ease;
}
.discover-action svg { width: 30px; height: 30px; display: block; }
.discover-skip { background: rgba(255, 68, 88, 0.2); }
.discover-skip svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #ff4458;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.discover-like { background: rgba(0, 224, 142, 0.2); }
.discover-like svg {
  fill: #00e08e;
  stroke: none;
  position: relative;
  top: 1px;
}
.discover-action:disabled { opacity: .55; }
.discover-status { width: min(100%, 460px); text-align: center; }
.discover-placeholder { width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: var(--bg2); }
.discover-status:has(button:not([hidden])) .discover-placeholder { display: none; }
.discover-status button { margin-top: 8px; cursor: pointer; }
@media (max-height: 690px) {
  .discover-stack { --discover-stack-h: min(31svh, 260px); }
  .discover-themes { margin: 8px 0; max-height: calc(17px + 12px); }
}
@media (max-height: 620px) {
  .discover-stack { --discover-stack-h: min(26svh, 200px); }
  .discover-themes { gap: 5px; margin: 6px 0; }
  .discover-book { padding: 8px 10px; gap: 10px; }
  .discover-original { width: 36px; height: 52px; }
  .discover-title { font-size: 15px; }
  .discover-byline { font-size: 13px; margin-top: 3px; }
  .discover-rating { margin-top: 4px; }
  .discover-actions { gap: 14px; margin-top: 10px; }
  .discover-action { width: 52px; height: 52px; }
  .discover-action svg { width: 26px; height: 26px; }
  .discover-skip svg { width: 30px; height: 30px; }
}
@media (max-height: 520px) {
  .discover { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .discover-stack { --discover-stack-h: min(22svh, 150px); }
  .discover-themes { margin: 4px 0; }
  .discover-actions { gap: 12px; margin-top: 8px; }
  .discover-action { width: 48px; height: 48px; }
  .discover-action svg { width: 24px; height: 24px; }
  .discover-skip svg { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .discover-action { transition: none; }
  .discover-action:active,
  .discover-action.is-pressed { transform: none; }
}
