.ast-player-wrapper {
	display: grid;
	gap: 20px;
}

.ast-player-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ast-player {
	background: #000;
	border-radius: 18px;
	overflow: hidden;
	position: relative;
	box-shadow: var(--shadow);
}

.ast-player-video {
	width: 100%;
	height: auto;
	display: block;
	background: #000;
}

.ast-player-locked {
	padding: 60px 20px;
	text-align: center;
	color: #fff;
}

.ast-player-controls {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
}

.ast-source-list,
.ast-subtitle-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ast-source-item,
.ast-subtitle-item {
	background: var(--surface-alt);
	border: none;
	padding: 8px 12px;
	border-radius: 12px;
	cursor: pointer;
	font-weight: 600;
}

.ast-source-item[data-locked='1'] {
	opacity: 0.6;
	cursor: not-allowed;
}

.ast-lock {
	margin-left: 6px;
	font-size: 12px;
	color: var(--muted);
}

.ast-series-header {
	background-size: cover;
	background-position: center;
	border-radius: 24px;
	overflow: hidden;
	margin-bottom: 24px;
}

.ast-series-overlay {
	background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.8));
	padding: 32px;
	display: flex;
	gap: 24px;
	align-items: flex-end;
}

.ast-series-poster {
	width: 180px;
	aspect-ratio: 2/3;
	border-radius: 16px;
	background-size: cover;
	background-position: center;
	box-shadow: var(--shadow);
}

.ast-series-meta {
	color: #fff;
}

.ast-player-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--muted);
	font-size: 14px;
}

.ast-series-meta .ast-meta-line,
.ast-series-meta .ast-meta-desc {
	color: rgba(255, 255, 255, 0.85);
}

.ast-content-meta {
	margin-top: 24px;
	background: var(--surface);
	padding: 20px;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.ast-meta-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 8px;
}

.ast-meta-label {
	font-weight: 600;
	margin-right: 6px;
}

.ast-player {
	aspect-ratio: 16 / 9;
}

.ast-player-controls h3 {
	margin: 0 0 8px;
	font-family: var(--font-heading);
	font-size: 16px;
}

.ast-source-item.is-active,
.ast-subtitle-item.is-active {
	background: var(--accent);
	color: #fff;
}

.ast-player-locked {
	background: linear-gradient(120deg, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.85));
	border-radius: 18px;
}

.ast-player-meta {
	flex-wrap: wrap;
}

.ast-player {
	display: flex;
	align-items: center;
	justify-content: center;
}


.ast-series-header {
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.ast-series-overlay {
	backdrop-filter: blur(1px);
}

.ast-series-meta .ast-page-title {
	font-size: clamp(26px, 4vw, 36px);
}

.ast-meta-desc {
	max-width: 760px;
}

.ast-player-controls {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
}

.ast-player-subtitles,
.ast-player-sources {
	display: grid;
	gap: 10px;
}

/* Anime detail layout v1.1.12 */
.ast-anime-detail-shell {
	background: #1b1b1c;
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 4px;
	padding: 14px;
	margin-bottom: 16px;
	box-shadow: none;
}

.ast-anime-detail-card {
	display: grid;
	grid-template-columns: 170px minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.ast-anime-detail-poster {
	width: 100%;
	aspect-ratio: 2 / 3;
	background-size: cover;
	background-position: center;
	border: 1px solid rgba(255,255,255,.12);
}

.ast-anime-detail-meta {
	border-top: 1px solid rgba(255,255,255,.08);
}

.ast-anime-detail-row {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(255,255,255,.08);
}

.ast-anime-detail-label {
	font-size: 14px;
	font-weight: 700;
	color: rgba(255,255,255,.78);
}

.ast-anime-detail-value {
	font-size: 15px;
	color: rgba(255,255,255,.92);
}

.ast-anime-detail-title {
	font-family: var(--font-heading);
	font-size: 30px;
	font-weight: 800;
	color: #ffb11b;
	line-height: 1.15;
}

.ast-anime-chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ast-anime-chip {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	border-radius: 4px;
	background: #4a4a4c;
	color: #f8fafc;
	font-size: 13px;
	font-weight: 700;
}

.ast-anime-episode-pill,
.ast-anime-view-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 3px;
	background: #2d8ce6;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.ast-anime-detail-statusline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ast-anime-rating-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.ast-anime-rating-stars {
	display: inline-flex;
	gap: 2px;
}

.ast-anime-rating-star {
	color: rgba(255,255,255,.45);
	font-size: 24px;
	line-height: 1;
}

.ast-anime-rating-star.is-active {
	color: #ffb11b;
}

.ast-anime-rating-text {
	font-size: 14px;
	color: rgba(255,255,255,.72);
}

.ast-anime-detail-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	margin-top: 14px;
}

.ast-anime-watch-btn,
.ast-anime-monitor-btn {
	min-height: 42px;
	padding: 0 14px;
	border-radius: 4px;
	font-weight: 800;
}

.ast-anime-watch-btn {
	background: linear-gradient(180deg, #ff9f1c 0%, #ff4d00 100%);
	color: #fff;
}

.ast-anime-monitor-btn {
	background: linear-gradient(180deg, #ff9f1c 0%, #ff4d00 100%);
	color: #fff;
	border: 0;
}

.ast-anime-episodes-shell {
	background: #1b1b1c;
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 4px;
	padding: 12px;
}

html[data-theme='light'] .ast-anime-detail-shell {
	background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
	border-color: #d8e0ec;
	box-shadow: 0 14px 34px rgba(34, 58, 94, 0.08);
}

html[data-theme='light'] .ast-anime-detail-poster {
	border-color: #d5ddea;
}

html[data-theme='light'] .ast-anime-detail-meta {
	border-top-color: #e4eaf3;
}

html[data-theme='light'] .ast-anime-detail-row {
	border-bottom-color: #e6ecf5;
}

html[data-theme='light'] .ast-anime-detail-label {
	color: #52627c;
}

html[data-theme='light'] .ast-anime-detail-value {
	color: #172033;
}

html[data-theme='light'] .ast-anime-detail-title {
	color: #f08a14;
}

html[data-theme='light'] .ast-anime-chip {
	background: #e8edf6;
	color: #31415d;
	border: 1px solid #d5deea;
}

html[data-theme='light'] .ast-anime-rating-star {
	color: #c6cfdb;
}

html[data-theme='light'] .ast-anime-rating-star.is-active {
	color: #f5b301;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

html[data-theme='light'] .ast-anime-rating-text {
	color: #52627c;
}

html[data-theme='light'] .ast-anime-episodes-shell {
	background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
	border-color: #dfe6f1;
}

.ast-anime-episodes-header {
	margin-bottom: 16px;
}

.ast-anime-episodes-header .ast-block-title {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .08em;
}

.ast-anime-episode-toolbar {
	display: grid;
	grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
	gap: 12px;
	margin-bottom: 16px;
}

.ast-anime-episode-filter,
.ast-anime-episode-search {
	min-width: 0;
}

.ast-anime-episode-select,
.ast-anime-episode-search-input {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border-radius: 10px;
	border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
	background: color-mix(in srgb, var(--surface-alt) 80%, #141a2c 20%);
	color: var(--text);
	font-size: 15px;
	outline: 0;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.ast-anime-episode-select:focus,
.ast-anime-episode-search-input:focus {
	border-color: color-mix(in srgb, var(--accent) 55%, #7dd3fc 45%);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent 82%);
}

.ast-anime-episode-search-input::placeholder {
	color: var(--muted);
}

.ast-anime-episode-grid {
	display: grid;
	grid-template-columns: repeat(10, minmax(0, 1fr));
	gap: 10px;
}

.ast-anime-episode-box.is-hidden {
	display: none;
}

.ast-anime-episode-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	min-height: 48px;
	padding: 8px 10px;
	background: #15182d;
	border: 1px solid rgba(255,255,255,.03);
	border-radius: 0;
	color: #7f8fbe;
	font-size: 22px;
	font-weight: 500;
	text-align: center;
	font-variant-numeric: tabular-nums;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.ast-anime-episode-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ast-anime-episode-eq {
	position: absolute;
	left: 10px;
	bottom: 8px;
	display: inline-flex;
	align-items: flex-end;
	gap: 3px;
	height: 16px;
}

.ast-anime-episode-eq span {
	width: 3px;
	border-radius: 999px;
	background: currentColor;
	animation: astEpisodeEq 1s ease-in-out infinite;
	transform-origin: center bottom;
}

.ast-anime-episode-eq span:nth-child(1) {
	height: 8px;
	animation-delay: 0s;
}

.ast-anime-episode-eq span:nth-child(2) {
	height: 14px;
	animation-delay: .16s;
}

.ast-anime-episode-eq span:nth-child(3) {
	height: 11px;
	animation-delay: .32s;
}

@keyframes astEpisodeEq {
	0%,
	100% {
		transform: scaleY(.55);
		opacity: .72;
	}
	50% {
		transform: scaleY(1);
		opacity: 1;
	}
}

.ast-anime-episode-box:hover,
.ast-anime-episode-box:focus-visible {
	background: #1b2040;
	color: #c2d4ff;
}

@media (max-width: 1024px) {
	.ast-anime-episode-grid {
		grid-template-columns: repeat(8, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ast-anime-episode-toolbar {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.ast-anime-episode-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 8px;
	}

	.ast-anime-episode-box {
		min-height: 42px;
		font-size: 18px;
	}
}

@media (max-width: 680px) {
	.ast-watch-shell,
	.ast-watch-info-card {
		padding: 14px;
		border-radius: 16px;
	}

	.ast-watch-controls {
		gap: 12px;
	}

	.ast-watch-bottom-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.ast-watch-nav,
	.ast-watch-source-list,
	.ast-watch-action-bar {
		justify-content: stretch;
		width: 100%;
	}

	.ast-watch-nav-btn,
	.ast-watch-source-btn {
		flex: 1 1 calc(50% - 5px);
		min-width: 0;
	}

	.ast-watch-action-bar {
		justify-content: space-between;
	}

	.ast-watch-action-btn {
		font-size: 14px;
	}

	.ast-watch-meta-grid {
		grid-template-columns: 1fr;
	}

	.ast-watch-title {
		font-size: 24px;
	}
}

/* Lights off overlay v1.1.17 */
body.ast-watch-lights-off {
	background: #020409;
}

body.ast-watch-lights-off::before {
	content: '';
	position: fixed;
	inset: 0;
	background: rgba(7, 9, 14, 0.84);
	backdrop-filter: blur(3px) saturate(0.7);
	-webkit-backdrop-filter: blur(3px) saturate(0.7);
	z-index: 35;
	pointer-events: none;
}

body.ast-watch-lights-off .ast-watch-shell {
	position: relative;
}

body.ast-watch-lights-off .ast-watch-player-card {
	position: relative;
	z-index: auto;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

body.ast-watch-lights-off .ast-watch-player-stage,
body.ast-watch-lights-off .ast-embed-player,
body.ast-watch-lights-off .ast-embed-player-frame-wrap,
body.ast-watch-lights-off .ast-embed-player-frame-wrap iframe {
	position: relative;
	z-index: 38;
	opacity: 1;
}

body.ast-watch-lights-off .ast-watch-light-btn {
	position: relative;
	z-index: 39;
	opacity: 1;
	color: #ffd977;
}

/* Mobile single-row watch controls refinement v1.1.32 */
@media (max-width: 680px) {
	.ast-watch-bottom-bar {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		column-gap: 8px;
		row-gap: 0;
	}

	.ast-watch-nav {
		display: inline-flex;
		flex: 0 0 auto;
		width: auto;
		max-width: none;
	}

	.ast-watch-nav-btn {
		min-height: 34px;
		min-width: 0;
		padding: 0 10px;
		font-size: 13px;
		gap: 6px;
	}

	.ast-watch-nav-icon,
	.ast-watch-action-icon {
		width: 14px;
		height: 14px;
		flex-basis: 14px;
	}

	.ast-watch-action-bar {
		display: inline-flex;
		flex: 0 1 auto;
		width: auto;
		min-width: 0;
		justify-content: flex-end;
		align-items: center;
		gap: 8px;
		white-space: nowrap;
		overflow: hidden;
	}

	.ast-watch-action-btn {
		flex: 0 1 auto;
		min-width: 0;
		font-size: 12px;
		gap: 4px;
	}
}

/* Watch controls polish v1.1.18 */
.ast-watch-bottom-bar {
	padding-top: 8px;
	border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent 28%);
	align-items: center;
}

.ast-watch-nav {
	display: inline-flex;
	align-items: stretch;
	gap: 4px;
	flex: 0 0 auto;
	width: fit-content;
	max-width: 100%;
	padding: 0;
	border-radius: 0;
	overflow: visible;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.ast-watch-nav-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 0 0 auto;
	min-width: 0;
	min-height: 34px;
	padding: 0 10px;
	border-radius: 4px;
	background: linear-gradient(180deg, #445674 0%, #34435c 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #f4f7fb;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
	font-weight: 800;
	letter-spacing: 0.01em;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1;
}

.ast-watch-nav-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
	opacity: 0;
	transition: opacity .18s ease;
}

.ast-watch-nav-btn:hover::before,
.ast-watch-nav-btn:focus-visible::before {
	opacity: 1;
}

.ast-watch-nav-btn:hover,
.ast-watch-nav-btn:focus-visible {
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.14);
}

.ast-watch-nav-btn.is-disabled {
	opacity: 0.52;
	pointer-events: none;
	cursor: default;
}

.ast-watch-nav-text,
.ast-watch-action-text {
	position: relative;
	z-index: 1;
}

.ast-watch-nav-icon,
.ast-watch-action-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	position: relative;
	z-index: 1;
}

.ast-watch-nav-icon svg,
.ast-watch-action-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.ast-watch-action-bar {
	gap: 22px;
	flex: 0 1 auto;
	align-items: center;
}

.ast-watch-action-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0;
	border: 0;
	background: transparent;
	color: color-mix(in srgb, var(--text) 70%, transparent 30%);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	transition: color .18s ease, opacity .18s ease, transform .18s ease;
}

.ast-watch-action-btn:hover,
.ast-watch-action-btn:focus-visible,
.ast-watch-action-btn[aria-pressed='true'] {
	color: var(--text);
	transform: translateY(-1px);
}

.ast-watch-action-btn[data-ast-expand-player] {
	color: #4dd0e1;
}

.ast-watch-action-btn[data-ast-expand-player]:hover,
.ast-watch-action-btn[data-ast-expand-player]:focus-visible,
.ast-watch-action-btn[data-ast-expand-player][aria-pressed='true'] {
	color: #79e4f3;
}

.ast-watch-light-btn {
	color: #f2c24f;
}

.ast-watch-light-btn:hover,
.ast-watch-light-btn:focus-visible,
.ast-watch-light-btn[aria-pressed='true'] {
	color: #ffd977;
}

html[data-theme='light'] .ast-watch-nav {
	background: transparent;
}

html[data-theme='light'] .ast-watch-nav-btn {
	background: linear-gradient(180deg, #536887 0%, #415470 100%);
	border-color: rgba(15, 23, 42, 0.14);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
	color: #f8fbff;
}

html[data-theme='light'] .ast-watch-nav-btn:hover,
html[data-theme='light'] .ast-watch-nav-btn:focus-visible {
	color: #ffffff;
}

html[data-theme='dark'] .ast-watch-nav {
	background: transparent;
}

html[data-theme='dark'] .ast-watch-nav-btn {
	background: linear-gradient(180deg, #3b4b63 0%, #2b374a 100%);
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
	color: #eef4fb;
}

html[data-theme='light'] .ast-watch-action-btn {
	color: #526074;
}

html[data-theme='light'] .ast-watch-action-btn:hover,
html[data-theme='light'] .ast-watch-action-btn:focus-visible,
html[data-theme='light'] .ast-watch-action-btn[aria-pressed='true'] {
	color: #122033;
}

html[data-theme='light'] .ast-watch-action-btn[data-ast-expand-player] {
	color: #0ea5b7;
}

html[data-theme='light'] .ast-watch-light-btn {
	color: #c48712;
}

html[data-theme='light'] .ast-watch-loading-card,
html[data-theme='light'] .ast-watch-loading-note,
html[data-theme='light'] .ast-watch-loading-info {
	background: linear-gradient(180deg, rgba(216, 226, 239, 0.6) 0%, rgba(203, 216, 232, 0.78) 100%);
	box-shadow: 0 18px 32px rgba(42, 65, 108, 0.08);
}

html[data-theme='light'] .ast-watch-loading-layer::before {
	background: rgba(246, 249, 253, 0.58);
}

html[data-theme='light'] .ast-watch-loading-player {
	background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.04) 50%, rgba(14,25,42,.38) 100%);
}

html[data-theme='light'] .ast-watch-loading-pill,
html[data-theme='light'] .ast-watch-loading-box,
html[data-theme='light'] .ast-watch-loading-line {
	background: rgba(148, 163, 184, 0.18);
}

@media (max-width: 680px) {
	.ast-watch-bottom-bar {
		display: flex;
		flex-wrap: nowrap;
		padding-top: 0;
		border-top: 0;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
	}

	.ast-watch-nav {
		flex: 0 0 auto;
		width: fit-content;
		max-width: none;
	}

	.ast-watch-nav-btn {
		min-width: 0;
		padding: 0 12px;
		font-size: 14px;
	}

	.ast-watch-action-bar {
		display: inline-flex;
		flex: 1 1 auto;
		width: auto;
		justify-content: flex-end;
		padding-top: 0;
		border-top: 0;
		gap: 10px;
		white-space: nowrap;
		min-width: 0;
	}

	.ast-watch-action-btn {
		font-size: 13px;
		gap: 6px;
	}
}

/* Episode watch/player restructure v1.1.20 */
.ast-embed-player-frame-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

.ast-embed-player-frame-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ast-watch-shell {
	display: grid;
	gap: 16px;
	position: relative;
}

.ast-watch-shell.is-loading {
	min-height: var(--ast-watch-loading-height, auto);
}

.ast-watch-shell.is-loading > * {
	opacity: .2;
	filter: blur(1.5px) saturate(.92);
	transition: opacity .18s ease, filter .18s ease;
}

.ast-watch-loading-layer {
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
}

.ast-watch-loading-layer::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 18px;
	background: rgba(11, 17, 28, 0.36);
	backdrop-filter: blur(2px);
}

.ast-watch-loading-stage {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 16px;
}

.ast-watch-loading-card,
.ast-watch-loading-note,
.ast-watch-loading-info {
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.08) 100%);
	border: 1px solid color-mix(in srgb, var(--border) 74%, transparent 26%);
	box-shadow: var(--shadow);
}

.ast-watch-loading-card::after,
.ast-watch-loading-pill::after,
.ast-watch-loading-box::after,
.ast-watch-loading-line::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
	transform: translateX(-100%);
	animation: astWatchSkeletonShimmer 1.1s ease-in-out infinite;
}

.ast-watch-loading-card {
	padding: 16px;
}

.ast-watch-loading-player {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 14px;
	overflow: hidden;
	background: linear-gradient(180deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.02) 50%, rgba(8,12,20,.64) 100%);
}

.ast-watch-loading-bar {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 16px;
}

.ast-watch-loading-nav,
.ast-watch-loading-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ast-watch-loading-sources {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent 28%);
}

.ast-watch-loading-pill {
	position: relative;
	overflow: hidden;
	min-width: 96px;
	height: 42px;
	border-radius: 10px;
	background: rgba(255,255,255,.08);
}

.ast-watch-loading-note {
	height: 74px;
}

.ast-watch-loading-episodes {
	display: grid;
	grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
	gap: 12px;
	margin-bottom: 14px;
}

.ast-watch-loading-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 10px;
}

.ast-watch-loading-box {
	position: relative;
	overflow: hidden;
	min-height: 48px;
	border-radius: 10px;
	background: rgba(255,255,255,.08);
}

.ast-watch-loading-info {
	padding: 18px;
}

.ast-watch-loading-lines {
	display: grid;
	gap: 10px;
}

.ast-watch-loading-line {
	position: relative;
	overflow: hidden;
	height: 14px;
	border-radius: 999px;
	background: rgba(255,255,255,.08);
}

.ast-watch-loading-line.is-long {
	width: 76%;
}

.ast-watch-loading-line.is-medium {
	width: 46%;
}

.ast-watch-loading-line.is-short {
	width: 28%;
}

@keyframes astWatchSkeletonShimmer {
	100% {
		transform: translateX(100%);
	}
}

@media (max-width: 767px) {
	.ast-watch-loading-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.ast-watch-loading-actions {
		justify-content: flex-end;
	}

	.ast-watch-loading-episodes {
		grid-template-columns: 1fr;
	}

	.ast-watch-loading-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 479px) {
	.ast-watch-loading-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ast-watch-loading-pill {
		min-width: 82px;
		height: 38px;
	}
}

.ast-watch-player-card,
.ast-watch-info-card {
	background: color-mix(in srgb, var(--surface) 92%, #0b1020 8%);
	border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
	border-radius: 18px;
	padding: 16px;
	box-shadow: var(--shadow);
}

.ast-watch-bottom-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	flex-wrap: nowrap;
}

.ast-watch-nav {
	flex: 0 0 auto;
	width: fit-content;
	max-width: 100%;
}

.ast-watch-action-bar {
	flex: 0 0 auto;
	justify-content: flex-end;
	white-space: nowrap;
}

.ast-watch-source-list-below {
	margin-top: 14px;
	justify-content: center;
	display: flex;
	width: 100%;
	padding-top: 14px;
	border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent 28%);
}

.ast-watch-source-btn {
	min-height: 42px;
	padding: 0 16px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--surface-alt) 86%, #374151 14%);
	border: 1px solid color-mix(in srgb, var(--border) 85%, transparent 15%);
	color: var(--text);
	font-size: 14px;
	font-weight: 700;
}

.ast-watch-source-btn.is-active {
	background: linear-gradient(180deg, #3c94ff 0%, #2377e2 100%);
	color: #fff;
	border-color: rgba(255,255,255,.16);
}

.ast-watch-info-top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 18px;
	align-items: start;
}

.ast-watch-info-titlebox {
	min-width: 0;
}

.ast-watch-title {
	margin: 0;
	font-size: clamp(22px, 2.5vw, 30px);
	line-height: 1.16;
}

.ast-watch-subtitle {
	margin: 8px 0 0;
	font-size: 15px;
	color: var(--muted);
}

.ast-watch-series-link {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--accent) 48%, transparent 52%);
	text-underline-offset: 3px;
	transition: color .18s ease, text-decoration-color .18s ease;
}

.ast-watch-series-link:hover,
.ast-watch-series-link:focus-visible {
	color: var(--accent);
	text-decoration-color: currentColor;
}

.ast-watch-info-side {
	display: grid;
	justify-items: end;
	gap: 12px;
}

.ast-watch-bookmark-btn {
	min-height: 42px;
	padding: 0 14px;
	border-radius: 12px;
	font-weight: 800;
	gap: 8px;
}

.ast-watch-rating {
	display: grid;
	justify-items: end;
	gap: 6px;
	text-align: right;
}

.ast-watch-schedule-note {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent 30%);
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	color: var(--muted);
}

.ast-watch-note {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-radius: 14px;
	background: color-mix(in srgb, #5b1f24 18%, var(--surface) 82%);
	border: 1px solid color-mix(in srgb, #a44955 34%, transparent 66%);
	color: color-mix(in srgb, var(--text) 84%, #fca5a5 16%);
}

.ast-watch-note-icon,
.ast-watch-schedule-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}

.ast-watch-note-icon svg,
.ast-watch-schedule-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.ast-watch-note-icon {
	color: #ffb347;
}

.ast-watch-schedule-icon {
	color: color-mix(in srgb, var(--accent) 72%, #f8b84e 28%);
}

.ast-anime-episodes-shell {
	background: color-mix(in srgb, var(--surface) 94%, #0b1020 6%);
	border-color: color-mix(in srgb, var(--border) 84%, transparent 16%);
	border-radius: 18px;
}

.ast-anime-episode-box {
	background: color-mix(in srgb, var(--surface-alt) 72%, #111629 28%);
	border-color: transparent;
	color: color-mix(in srgb, var(--muted) 78%, #8ea4da 22%);
}

.ast-anime-episode-box:hover,
.ast-anime-episode-box:focus-visible {
	background: color-mix(in srgb, var(--surface-alt) 58%, #1a2140 42%);
	color: color-mix(in srgb, var(--text) 72%, #b8ceff 28%);
}

.ast-anime-episode-box.is-active {
	background: #13172b;
	border-color: transparent;
	color: #11c8ff;
	box-shadow: inset 3px 0 0 #11c8ff;
}

html[data-theme='dark'] .ast-watch-player-card,
html[data-theme='dark'] .ast-watch-info-card,
html[data-theme='dark'] .ast-anime-episodes-shell {
	background: #171b24;
}

html[data-theme='dark'] .ast-watch-note {
	background: rgba(84, 28, 36, 0.34);
	border-color: rgba(220, 88, 104, 0.18);
	color: #f3c0c6;
}

@media (max-width: 680px) {
	.ast-watch-bottom-bar {
		gap: 10px;
	}

	.ast-watch-source-list-below {
		gap: 10px;
	}

	.ast-watch-source-btn {
		flex: 1 1 calc(50% - 5px);
		min-width: 0;
	}

	.ast-watch-info-top {
		grid-template-columns: 1fr;
	}

	.ast-watch-info-side {
		justify-items: start;
		text-align: left;
	}

	.ast-watch-rating {
		justify-items: start;
		text-align: left;
	}
}

/* Watch controls no-wrap mobile refinement v1.1.20b */
@media (max-width: 680px) {
	.ast-watch-bottom-bar {
		flex-wrap: nowrap;
		align-items: center;
	}

	.ast-watch-nav {
		flex: 0 0 auto;
		width: fit-content;
	}

	.ast-watch-action-bar {
		flex: 1 1 auto;
		width: auto;
		padding-top: 0;
		border-top: 0;
		gap: 10px;
	}

	.ast-watch-action-btn {
		font-size: 13px;
	}
}

/* Episode page width + theme polish v1.1.21 */
.ast-section-watch {
	padding-top: 24px;
}

.ast-watch-shell-wide {
	--ast-watch-inline-space: clamp(16px, 1.8vw, 18px);
	width: 100%;
}

.ast-container-watch {
	width: min(var(--ast-shell-max, 1280px), 94%);
}

.ast-watch-shell-wide {
	gap: 18px;
}

.ast-watch-player-card,
.ast-watch-info-card,
.ast-anime-episodes-shell {
	width: 100%;
	border-radius: 20px;
}

.ast-watch-player-card {
	padding: 0 0 16px;
}

.ast-watch-bottom-bar,
.ast-watch-source-list-below {
	padding-left: var(--ast-watch-inline-space);
	padding-right: var(--ast-watch-inline-space);
}

.ast-watch-note {
	padding-left: var(--ast-watch-inline-space);
	padding-right: var(--ast-watch-inline-space);
}

#episodes.ast-anime-episodes-shell {
	padding-left: 0;
	padding-right: 0;
}

#episodes.ast-anime-episodes-shell > * {
	padding-left: var(--ast-watch-inline-space);
	padding-right: var(--ast-watch-inline-space);
}

.ast-watch-info-card {
	padding-left: 0;
	padding-right: 0;
}

.ast-watch-info-card > * {
	padding-left: var(--ast-watch-inline-space);
	padding-right: var(--ast-watch-inline-space);
}

.ast-watch-info-card {
	background: color-mix(in srgb, var(--surface) 95%, #0d1424 5%);
}

.ast-watch-note {
	order: 2;
}

.ast-watch-info-card {
	order: 4;
}

#episodes.ast-anime-episodes-shell {
	order: 3;
}

.ast-watch-player-card {
	order: 1;
}

html[data-theme='light'] .ast-watch-player-card,
html[data-theme='light'] .ast-watch-info-card,
html[data-theme='light'] .ast-anime-episodes-shell {
	background: #ffffff;
	border-color: #e4e8f0;
}

html[data-theme='light'] .ast-anime-episode-box {
	background: #edf1f7;
	border-color: #d9dfeb;
	color: #1f2937;
}

html[data-theme='light'] .ast-anime-episode-box:hover,
html[data-theme='light'] .ast-anime-episode-box:focus-visible {
	background: #dbeafe;
	color: #0f172a;
}

html[data-theme='light'] .ast-anime-episode-box.is-active {
	background: linear-gradient(180deg, #ff8e4d 0%, #ff5a1f 100%);
	color: #fff;
	border-color: rgba(255,255,255,.16);
}

html[data-theme='dark'] .ast-anime-episode-box {
	background: #2a313d;
	border-color: rgba(255,255,255,.08);
	color: #edf2f7;
}

html[data-theme='dark'] .ast-anime-episode-box:hover,
html[data-theme='dark'] .ast-anime-episode-box:focus-visible {
	background: #364154;
}

@media (max-width: 767px) {
	.ast-container-watch {
		width: calc(100% - 12px);
	}

	.ast-section-watch {
		padding-top: 12px;
	}
}

/* Episode page edge-to-edge mobile v1.1.23 */
@media (max-width: 767px) {
	.ast-container-watch {
		width: 100%;
		max-width: 100%;
		margin: 0;
		padding-left: 0;
		padding-right: 0;
	}

	.ast-section-watch {
		padding-top: 0;
		padding-bottom: 0;
	}

	.ast-watch-shell-wide {
		gap: 0;
	}

	.ast-watch-player-card,
	.ast-watch-info-card,
	#episodes.ast-anime-episodes-shell,
	.ast-watch-note {
		width: 100%;
		max-width: 100%;
		margin: 0;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
		box-shadow: none;
	}

	.ast-watch-player-card {
		border-top: 0;
	}

	.ast-watch-note,
		#episodes.ast-anime-episodes-shell,
	.ast-watch-info-card {
		padding-left: 14px;
		padding-right: 14px;
	}

	.ast-watch-note {
		padding-top: 16px;
		padding-bottom: 16px;
	}

	#episodes.ast-anime-episodes-shell,
	.ast-watch-info-card {
		padding-top: 18px;
		padding-bottom: 18px;
	}
}
/* Episode page remove remaining inset mobile v1.1.25 */
@media (max-width: 767px) {
	.ast-watch-shell-wide {
		padding: 0;
	}

	.ast-watch-player-card {
		padding: 0;
	}

	.ast-watch-player-stage,
	.ast-embed-player,
	.ast-embed-player-frame-wrap {
		border-radius: 0;
	}

	.ast-watch-bottom-bar,
	.ast-watch-source-list-below {
		padding-left: 14px;
		padding-right: 14px;
	}

	.ast-watch-note,
		#episodes.ast-anime-episodes-shell,
	.ast-watch-info-card {
		padding-left: 0;
		padding-right: 0;
	}

	.ast-watch-note > *,
	#episodes.ast-anime-episodes-shell > *,
	.ast-watch-info-card > * {
		padding-left: 14px;
		padding-right: 14px;
	}
}

/* Final mobile lock for prev/next + actions single row v1.1.33 */
@media (max-width: 767px) {
	.ast-watch-player-card .ast-watch-bottom-bar {
		display: grid !important;
		grid-template-columns: max-content minmax(0, 1fr) !important;
		align-items: center !important;
		column-gap: 8px !important;
		row-gap: 0 !important;
		flex-wrap: nowrap !important;
		justify-content: initial !important;
	}

	.ast-watch-player-card .ast-watch-nav {
		display: inline-flex !important;
		align-items: stretch !important;
		flex: 0 0 auto !important;
		width: max-content !important;
		max-width: none !important;
		gap: 4px !important;
		padding: 0 !important;
		border-radius: 0 !important;
	}

	.ast-watch-player-card .ast-watch-nav-btn {
		min-height: 30px !important;
		min-width: 0 !important;
		padding: 0 8px !important;
		font-size: 12px !important;
		gap: 4px !important;
		border-radius: 4px !important;
	}

	.ast-watch-player-card .ast-watch-action-bar {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: flex-end !important;
		flex: 0 1 auto !important;
		width: auto !important;
		min-width: 0 !important;
		gap: 8px !important;
		padding-top: 0 !important;
		border-top: 0 !important;
		white-space: nowrap !important;
		overflow: hidden !important;
		justify-self: end !important;
	}

	.ast-watch-player-card .ast-watch-action-btn {
		flex: 0 1 auto !important;
		min-width: 0 !important;
		font-size: 10px !important;
		gap: 3px !important;
	}

	.ast-watch-player-card .ast-watch-nav-icon,
	.ast-watch-player-card .ast-watch-action-icon {
		width: 12px !important;
		height: 12px !important;
		flex: 0 0 12px !important;
	}

	.ast-watch-player-card .ast-watch-bottom-bar {
		margin-top: 8px !important;
	}
}

/* Mobile watch polish v1.1.51 */
@media (max-width: 767px) {
	.ast-anime-episode-toolbar {
		grid-template-columns: minmax(132px, 30%) minmax(0, 1fr) !important;
		gap: 10px !important;
		align-items: stretch !important;
	}

	.ast-anime-episode-filter,
	.ast-anime-episode-search {
		min-width: 0 !important;
	}

	.ast-anime-episode-select,
	.ast-anime-episode-search-input {
		min-height: 46px !important;
		padding-left: 12px !important;
		padding-right: 12px !important;
		font-size: 14px !important;
	}

	.ast-watch-player-card .ast-watch-source-list-below {
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		flex-wrap: wrap !important;
		gap: 12px !important;
		margin-top: 8px !important;
		padding-top: 12px !important;
		padding-bottom: 6px !important;
	}

	.ast-watch-player-card .ast-watch-source-btn {
		flex: 0 0 auto !important;
		min-width: 104px !important;
	}

	.ast-watch-note {
		display: flex !important;
		align-items: flex-start !important;
		gap: 10px !important;
		margin-top: 10px !important;
		padding-left: 14px !important;
		padding-right: 14px !important;
	}

	.ast-watch-note > * {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.ast-watch-note-icon {
		width: 18px !important;
		height: 18px !important;
		margin-top: 2px;
		flex: 0 0 18px !important;
	}

	.ast-watch-note span:last-child {
		flex: 1 1 auto;
		min-width: 0;
	}
}

@media (max-width: 680px) {
	.ast-watch-player-card .ast-watch-source-list-below {
		gap: 10px !important;
	}

	.ast-watch-player-card .ast-watch-source-btn {
		min-width: 96px !important;
	}

	.ast-anime-episode-toolbar {
		grid-template-columns: minmax(112px, 32%) minmax(0, 1fr) !important;
	}

	.ast-anime-episode-filter,
	.ast-anime-episode-search {
		min-width: 0 !important;
	}

	.ast-anime-episode-select,
	.ast-anime-episode-search-input {
		min-height: 44px !important;
		padding-left: 10px !important;
		padding-right: 10px !important;
		font-size: 13px !important;
	}
}

@media (max-width: 360px) {
	.ast-watch-player-card .ast-watch-source-list-below {
		gap: 8px !important;
		padding-top: 10px !important;
		padding-bottom: 4px !important;
	}

	.ast-watch-player-card .ast-watch-source-btn {
		min-width: 0 !important;
		padding: 0 14px !important;
		min-height: 38px !important;
		font-size: 12px !important;
		border-radius: 9px !important;
	}

	.ast-watch-note {
		gap: 8px !important;
		padding-top: 12px !important;
		padding-bottom: 12px !important;
		font-size: 12px !important;
		line-height: 1.55 !important;
	}

	.ast-watch-note-icon {
		width: 16px !important;
		height: 16px !important;
		flex: 0 0 16px !important;
	}

	.ast-anime-episode-toolbar {
		grid-template-columns: minmax(108px, 38%) minmax(0, 1fr) !important;
		gap: 8px !important;
	}

	.ast-anime-episode-select,
	.ast-anime-episode-search-input {
		min-height: 42px !important;
		padding-left: 10px !important;
		padding-right: 10px !important;
		font-size: 12px !important;
		border-radius: 9px !important;
	}

	.ast-anime-episode-box {
		min-height: 40px !important;
		padding: 6px 8px !important;
		font-size: 15px !important;
	}

	.ast-anime-episode-eq {
		left: 7px !important;
		bottom: 6px !important;
		gap: 2px !important;
		height: 13px !important;
	}

	.ast-anime-episode-eq span {
		width: 2px !important;
	}
}

.ast-watch-schedule-note {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	padding: 12px 14px;
	border-top: 0;
	border-radius: 12px;
	background: color-mix(in srgb, var(--surface-alt) 76%, #1a2337 24%);
	border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
	box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.ast-watch-schedule-icon {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	color: color-mix(in srgb, var(--accent) 82%, #f8b84e 18%);
}

.ast-watch-schedule-note span:last-child {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 500;
}

html[data-theme='light'] .ast-watch-schedule-note {
	background: linear-gradient(180deg, #f8fbff 0%, #f3f7fd 100%);
	border-color: #dce5f1;
	color: #4f6281;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

html[data-theme='light'] .ast-watch-schedule-icon {
	color: #5f84ff;
}

html[data-theme='dark'] .ast-watch-schedule-icon {
	color: color-mix(in srgb, #9bb6ff 80%, #f6c56b 20%);
}

html[data-theme='dark'] .ast-watch-schedule-note {
	background: linear-gradient(180deg, rgba(31, 39, 56, 0.98) 0%, rgba(25, 32, 47, 0.96) 100%);
	border-color: rgba(148, 163, 184, 0.16);
	color: rgba(226, 232, 240, 0.92);
}
