/* Reels shelf: always one horizontal, swipeable row of 9:16 tiles (Shorts-style).
 * :is(.cvr-wrap, #cvr-wrap) scores like an ID selector so the resets below beat
 * aggressive theme button/link rules without !important.
 * Tiles are <button>s, so theme button styles are reset explicitly below. */
.cvr-wrap { margin: 0 0 1.5rem; max-width: 100%; }
.cvr-heading { margin: 0 0 .6rem; font-size: 1.15rem; }

/* Category chips */
.cvr-filter { display: flex; gap: .4rem; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 .75rem; scrollbar-width: none; }
.cvr-filter::-webkit-scrollbar { display: none; }
:is(.cvr-wrap, #cvr-wrap) .cvr-filter .cvr-chip {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	margin: 0;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	opacity: .6;
	border-radius: 999px;
	padding: .35rem .85rem;
	font: inherit;
	font-size: .85rem;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	width: auto;
	min-width: 0;
	height: auto;
	min-height: 0;
	transform: none;
	cursor: pointer;
	white-space: nowrap;
}
:is(.cvr-wrap, #cvr-wrap) .cvr-filter .cvr-chip:hover { background: transparent; color: inherit; opacity: .9; transform: none; box-shadow: none; }
:is(.cvr-wrap, #cvr-wrap) .cvr-filter .cvr-chip.is-active,
:is(.cvr-wrap, #cvr-wrap) .cvr-filter .cvr-chip.is-active:hover { opacity: 1; background: #e23; border-color: #e23; color: #fff; }

/* Shelf + row */
.cvr-shelf { position: relative; }
.cvr-grid {
	display: flex;
	flex-wrap: nowrap;
	gap: .6rem;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	padding: 0 0 2px;
	margin: 0;
	list-style: none;
}
.cvr-grid::-webkit-scrollbar { display: none; }

/* Tiles (reset theme button styles) */
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: 0 0 auto;
	width: clamp(130px, 38vw, 190px);
	min-width: 0;
	max-width: none;
	height: auto;
	min-height: 0;
	aspect-ratio: 9 / 16;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 12px;
	box-shadow: none;
	background: #111;
	color: #fff;
	font: inherit;
	line-height: normal;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	overflow: hidden;
	cursor: pointer;
	display: block;
	scroll-snap-align: start;
	transform: none;
}
/* Tiles are links: neutralise theme link colours/underlines too. */
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile,
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile:visited { text-decoration: none; color: #fff; }
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile:hover,
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile:focus { background: #111; color: #fff; box-shadow: none; transform: none; text-decoration: none; }
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile:focus-visible { outline: 2px solid #e23; outline-offset: 2px; }

:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	box-shadow: none;
	object-fit: cover;
	display: block;
	border-radius: 0;
}
.cvr-tile-grad {
	position: absolute;
	inset: 0;
	background: linear-gradient( to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,0) 45% );
	pointer-events: none;
}
.cvr-tile-meta {
	position: absolute;
	left: .5rem;
	right: .5rem;
	bottom: .5rem;
	color: #fff;
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 2px;
	pointer-events: none;
}
.cvr-tile-title {
	font-size: .82rem;
	font-weight: 600;
	line-height: 1.2;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	white-space: normal;
}
.cvr-tile-views { font-size: .72rem; opacity: .85; }
.cvr-tile-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(0,0,0,.45);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 1rem;
	opacity: 0;
	transition: opacity .15s ease;
	pointer-events: none;
}
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile:hover .cvr-tile-play,
:is(.cvr-wrap, #cvr-wrap) .cvr-grid .cvr-tile:focus-visible .cvr-tile-play { opacity: 1; }

/* Desktop scroll arrows (hidden on touch screens, and at the ends of the row) */
:is(.cvr-wrap, #cvr-wrap) .cvr-shelf .cvr-nav {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 38px;
	height: 38px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(20,20,20,.85);
	color: #fff;
	font-size: 20px;
	line-height: 38px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0,0,0,.35);
	cursor: pointer;
	display: none;
}
:is(.cvr-wrap, #cvr-wrap) .cvr-shelf .cvr-nav:hover { background: rgba(0,0,0,.95); color: #fff; transform: translateY(-50%); }
:is(.cvr-wrap, #cvr-wrap) .cvr-shelf .cvr-nav-prev { left: 6px; }
:is(.cvr-wrap, #cvr-wrap) .cvr-shelf .cvr-nav-next { right: 6px; }
@media (hover: hover) and (pointer: fine) {
	:is(.cvr-wrap, #cvr-wrap) .cvr-shelf .cvr-nav.is-visible { display: block; }
}
