.tcosi-catalog {
	--tcosi-bg: #0d1016;
	--tcosi-surface: #161b24;
	--tcosi-surface-raised: #1f2632;
	--tcosi-border: rgba(210, 225, 255, 0.08);
	--tcosi-border-strong: rgba(210, 225, 255, 0.16);
	--tcosi-text: #eef1fb;
	--tcosi-text-dim: rgba(238, 241, 251, 0.62);
	--tcosi-text-faint: rgba(238, 241, 251, 0.36);
	--tcosi-accent: #8fa4e6;
	--tcosi-accent-2: #425084;
	--tcosi-free: #6fcf97;
	font-family: inherit;
	color: var(--tcosi-text);
	max-width: 1200px;
	margin: 0 auto;
}

.tcosi-catalog__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-bottom: 20px;
}

.tcosi-catalog__search,
.tcosi-catalog__type-select,
.tcosi-catalog__access-select {
	background: var(--tcosi-surface);
	border: 1px solid var(--tcosi-border);
	color: var(--tcosi-text);
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 14px;
}

.tcosi-catalog__search {
	flex: 1 1 220px;
	min-width: 180px;
}

.tcosi-catalog__access-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}
.tcosi-catalog__access-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--tcosi-accent);
	white-space: nowrap;
}
.tcosi-catalog__access-select {
	/* A transparent/borderless select nested in a colored wrapper left the native
	   options popup's own light/dark rendering ambiguous to the browser, producing
	   washed-out unselected options - a solid background + explicit color-scheme
	   here (matching the other controls) renders consistently instead. */
	border-color: var(--tcosi-accent);
	color-scheme: dark;
}

/* ---------- multi-facet filter popout ---------- */
.tcosi-filter {
	position: relative;
}

.tcosi-filter__btn {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--tcosi-surface);
	border: 1px solid var(--tcosi-border);
	color: var(--tcosi-text);
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 14px;
	cursor: pointer;
	transition: border-color 0.15s;
}

.tcosi-filter__btn:hover,
.tcosi-filter__btn[aria-expanded="true"] {
	border-color: var(--tcosi-accent);
}

.tcosi-filter__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--tcosi-accent);
	color: #0d1016;
	font-size: 11px;
	font-weight: 700;
}

.tcosi-filter__popout {
	/* display:none is the real default state - this used to be display:flex
	   unconditionally, which silently beat the "hidden" attribute JS was toggling
	   (a plain HTML attribute loses to any class-based CSS display rule), so the
	   panel was permanently visible no matter what JS did. .is-open is the only
	   thing that should ever make this visible now. */
	display: none;
	flex-direction: column;
	gap: 14px;
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 40;
	width: min(480px, 86vw);
	max-height: 70vh;
	overflow-y: auto;
	background: var(--tcosi-surface);
	border: 1px solid var(--tcosi-border-strong);
	border-radius: 12px;
	box-shadow: 0 20px 48px -16px rgba(0, 0, 0, 0.6);
	padding: 16px;
}

.tcosi-filter__popout.is-open {
	display: flex;
}

.tcosi-filter__clear {
	text-align: left;
	background: transparent;
	border: none;
	color: var(--tcosi-accent);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}

.tcosi-filter__clear:hover:not(:disabled) {
	text-decoration: underline;
}

.tcosi-filter__clear:disabled {
	color: var(--tcosi-text-faint);
	cursor: default;
}

.tcosi-filter__apply {
	position: sticky;
	bottom: -16px;
	margin: 4px -16px -16px;
	padding: 12px 16px;
	width: calc(100% + 32px);
	background: var(--tcosi-accent);
	color: #0d1016;
	border: none;
	border-radius: 0 0 12px 12px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.tcosi-filter__apply:hover {
	filter: brightness(1.08);
}

.tcosi-filter__groups {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 14px;
}

.tcosi-filter__group {
	border: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.tcosi-filter__group legend {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--tcosi-text-faint);
	margin-bottom: 8px;
	padding: 0;
}

.tcosi-filter__option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 2px;
	font-size: 13.5px;
	color: var(--tcosi-text-dim);
	cursor: pointer;
}

.tcosi-filter__option:hover {
	color: var(--tcosi-text);
}

.tcosi-filter__option input[type="checkbox"] {
	accent-color: var(--tcosi-accent);
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

/* "More filters" disclosure (Series/Character/Language) - a native <details> element,
   no JS needed for the open/close behaviour itself. */
.tcosi-filter__more {
	border-top: 1px solid var(--tcosi-border);
	padding-top: 12px;
}

.tcosi-filter__more summary {
	cursor: pointer;
	list-style: none;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--tcosi-accent);
	display: flex;
	align-items: center;
	gap: 6px;
}

.tcosi-filter__more summary::-webkit-details-marker {
	display: none;
}

.tcosi-filter__more summary::before {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.15s ease;
}

.tcosi-filter__more[open] summary::before {
	transform: rotate(45deg);
}

.tcosi-filter__more .tcosi-filter__groups {
	margin-top: 14px;
}

@media (max-width: 640px) {
	.tcosi-filter__popout {
		position: fixed;
		top: 50%;
		left: 50%;
		bottom: auto;
		right: auto;
		transform: translate(-50%, -50%);
		width: min(360px, 88vw);
		max-height: 80vh;
		border-radius: 14px;
	}

	.tcosi-filter__groups {
		grid-template-columns: 1fr 1fr;
		gap: 14px 10px;
	}
}

.tcosi-catalog__status {
	color: var(--tcosi-text-dim);
	font-size: 13px;
	margin-bottom: 12px;
}

.tcosi-catalog__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 18px;
}

/* ---------- shelf layout: compact horizontal row, no controls/pagination ---------- */
.tcosi-shelf {
	margin-bottom: 44px;
}

.tcosi-shelf:last-child {
	margin-bottom: 0;
}

.tcosi-shelf__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px 14px;
	margin-bottom: 14px;
}

.tcosi-shelf__head-left,
.tcosi-shelf__head-right {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}

.tcosi-shelf__title {
	font-size: 19px;
	font-weight: 700;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.tcosi-shelf__swatch {
	width: 9px;
	height: 9px;
	border-radius: 2px;
	display: inline-block;
	flex-shrink: 0;
}

.tcosi-shelf__ea-badge {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--tcosi-accent-2);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--tcosi-border);
	border-radius: 999px;
	padding: 3px 10px;
	white-space: nowrap;
}

.tcosi-shelf__view-all {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--tcosi-accent);
	text-decoration: none;
	white-space: nowrap;
}

.tcosi-shelf__view-all:hover {
	text-decoration: underline;
}

.tcosi-shelf__cadence {
	font-size: 11.5px;
	color: var(--tcosi-text-faint);
	letter-spacing: 0.03em;
	white-space: nowrap;
}

.tcosi-catalog[data-layout="shelf"] .tcosi-catalog__grid {
	grid-auto-flow: column;
	grid-auto-columns: 200px;
	grid-template-columns: none;
	grid-template-rows: 1fr;
	overflow-x: auto;
	padding-bottom: 6px;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.tcosi-catalog[data-layout="shelf"] .tcosi-catalog__grid::-webkit-scrollbar {
	display: none;
	height: 0;
}

.tcosi-catalog[data-layout="shelf"][data-fixed-type="possession_animation"] .tcosi-catalog__grid,
.tcosi-catalog[data-layout="shelf"][data-fixed-type="found_footage"] .tcosi-catalog__grid {
	grid-auto-columns: 280px;
}

.tcosi-shelf-track {
	position: relative;
}

.tcosi-shelf-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--tcosi-border-strong);
	background: var(--tcosi-bg);
	color: var(--tcosi-text);
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0.9;
	box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.6);
	transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tcosi-shelf-arrow:hover {
	opacity: 1;
	border-color: var(--tcosi-accent);
}

.tcosi-shelf-arrow:focus-visible {
	outline: 2px solid var(--tcosi-accent);
	outline-offset: 2px;
}

.tcosi-shelf-arrow--prev {
	left: -14px;
}

.tcosi-shelf-arrow--next {
	right: -14px;
}

@media (max-width: 640px) {
	.tcosi-shelf-arrow {
		display: none;
	}
}

.tcosi-shelf-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}

.tcosi-shelf-dot {
	width: 7px;
	height: 7px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: var(--tcosi-border-strong);
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.tcosi-shelf-dot:hover {
	background: var(--tcosi-text-faint);
}

.tcosi-shelf-dot.is-active {
	background: var(--tcosi-accent);
	transform: scale(1.35);
}

.tcosi-shelf-dot:focus-visible {
	outline: 2px solid var(--tcosi-accent);
	outline-offset: 2px;
}

.tcosi-card {
	position: relative;
	background: var(--tcosi-surface);
	border: 1px solid var(--tcosi-border);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.15s ease, border-color 0.15s ease;
	scroll-snap-align: start;
}

.tcosi-card:hover {
	transform: translateY(-3px);
	border-color: var(--tcosi-accent);
}

.tcosi-card__media {
	position: relative;
	aspect-ratio: 3 / 4;
	background: #0a0c11;
	overflow: hidden;
}

.tcosi-card__media--landscape {
	aspect-ratio: 16 / 9;
}

.tcosi-card__blur {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	/* scaled up so the blur's own soft edge doesn't reveal the card's background
	   color in a thin ring around the outside */
	transform: scale(1.15);
	filter: blur(18px);
}

.tcosi-card__img {
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: 1;
	transition: opacity 0.35s ease;
}
/* Opt-in: only images with a blur layer behind them start hidden and fade in on
   load - applied directly in markup/JS, not by default, so an image with no blur
   placeholder (or if JS never runs) is never stuck invisible. */
.tcosi-card__img--pending {
	opacity: 0;
}

.tcosi-card__no-image {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tcosi-text-dim);
	font-size: 13px;
	text-align: center;
	padding: 10px;
}

.tcosi-card__badges {
	position: absolute;
	top: 8px;
	left: 8px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.tcosi-card__release {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 6px 8px;
	/* Darker/more saturated than the lighter --tcosi-accent (#8fa4e6 was too pale for
	   white text to stay legible over busy cover art) - matches the Early Access badge's
	   own --tcosi-accent-2, so the overlay and badge read as the same feature. */
	background: rgba(66, 80, 132, 0.85);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tcosi-badge {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--tcosi-accent);
	color: #0d1016;
}

.tcosi-badge--graduating-soon,
.tcosi-badge--coming-soon,
.tcosi-badge--early-access {
	background: var(--tcosi-accent-2);
	color: #fff;
}

.tcosi-badge--free {
	background: var(--tcosi-free);
	color: #0d1016;
}

.tcosi-badge--end {
	background: #444;
	color: #fff;
}

.tcosi-card__body {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.tcosi-card__type {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tcosi-accent);
	font-weight: 700;
}

.tcosi-card__title {
	font-size: 15px;
	line-height: 1.3;
	margin: 0;
	font-weight: 600;
}

.tcosi-card__meta {
	font-size: 12px;
	color: var(--tcosi-text-dim);
}

.tcosi-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 4px;
}

.tcosi-tag-chip {
	font-size: 10px;
	color: var(--tcosi-text-dim);
	border: 1px solid var(--tcosi-border);
	border-radius: 999px;
	padding: 2px 8px;
}

.tcosi-card__link {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.tcosi-catalog__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 24px;
}

.tcosi-page-btn {
	background: var(--tcosi-surface);
	border: 1px solid var(--tcosi-border);
	color: var(--tcosi-text);
	border-radius: 8px;
	padding: 8px 16px;
	cursor: pointer;
}

.tcosi-page-btn:hover {
	border-color: var(--tcosi-accent);
}

.tcosi-page-indicator {
	color: var(--tcosi-text-dim);
	font-size: 13px;
}

/* ---------- schedule feed ---------- */
.tcosi-schedule {
	max-width: 720px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.tcosi-schedule__empty {
	text-align: center;
	color: var(--tcosi-text-dim);
}

.tcosi-schedule__day {
	background: var(--tcosi-surface);
	border: 1px solid var(--tcosi-border);
	border-radius: 12px;
	padding: 16px 20px;
}

.tcosi-schedule__date {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 15px;
	margin-bottom: 10px;
	color: var(--tcosi-text);
}

.tcosi-schedule__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tcosi-schedule__item {
	display: flex;
	align-items: baseline;
	gap: 10px;
	font-size: 14px;
}

.tcosi-schedule__type {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tcosi-accent);
	font-weight: 700;
	flex-shrink: 0;
}

.tcosi-schedule__title {
	color: var(--tcosi-text);
	text-decoration: none;
}

a.tcosi-schedule__title:hover {
	color: var(--tcosi-accent);
	text-decoration: underline;
}
