/* ==========================================================================
   مدار — Madar theme
   Dark, RTL-first design system. Logical properties everywhere so LTR also works.
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
	font-family: "Readex Pro";
	font-style: normal;
	font-display: swap;
	font-weight: 160 700;
	src: url(../fonts/readex-pro-arabic-wght-normal.woff2) format("woff2-variations"), url(../fonts/readex-pro-arabic-wght-normal.woff2) format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
	font-family: "Readex Pro";
	font-style: normal;
	font-display: swap;
	font-weight: 160 700;
	src: url(../fonts/readex-pro-latin-wght-normal.woff2) format("woff2-variations"), url(../fonts/readex-pro-latin-wght-normal.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
	--font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--bg: #08090d;
	--bg-rgb: 8 9 13;
	--bg-2: #0e1016;
	--surface: #14161e;
	--surface-2: #1b1e28;
	--surface-3: #232733;
	--line: rgb(255 255 255 / .07);
	--line-2: rgb(255 255 255 / .12);
	--text: #f2f3f7;
	--text-2: #b7bbc8;
	--muted: #7e8396;
	--accent: #ff5a36;
	--accent-2: #ff2e74;
	--accent-rgb: 255 90 54;
	--accent-2-rgb: 255 46 116;
	--grad: linear-gradient(120deg, var(--accent), var(--accent-2));
	--gold: #ffc24a;
	--ok: #2bd38b;
	--info: #4aa8ff;
	--danger: #ff4d5e;
	--r-xs: 8px;
	--r-sm: 10px;
	--r: 14px;
	--r-lg: 22px;
	--r-pill: 999px;
	--shadow: 0 24px 60px -24px rgb(0 0 0 / .85);
	--shadow-sm: 0 8px 24px -12px rgb(0 0 0 / .8);
	--ease: cubic-bezier(.2, .8, .2, 1);
	--header-h: 64px;
	--wrap: 1440px;
	--gutter: clamp(16px, 4vw, 40px);
	--hero-h: min(82vh, 760px);
	--poster-w: clamp(132px, 15vw, 196px);
	--ep-w: clamp(240px, 26vw, 340px);
	color-scheme: dark;
}
.corners-sharp { --r-xs: 4px; --r-sm: 5px; --r: 6px; --r-lg: 8px; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.7;
	font-weight: 380;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	overflow-x: hidden;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 640; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgb(var(--accent-rgb) / .45); color: #fff; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 999; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); transition: top .2s; }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.site-main { display: block; min-height: 60vh; outline: none; padding-bottom: 32px; }
.dir-ltr, [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }

/* ---------- Buttons ---------- */
.btn {
	--btn-bg: var(--surface-2);
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 20px;
	border-radius: var(--r-pill);
	background: var(--btn-bg);
	border: 1px solid var(--line-2);
	color: var(--text);
	font-weight: 560; font-size: 15px; line-height: 1;
	white-space: nowrap;
	transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
	cursor: pointer;
	user-select: none;
}
.btn:hover { color: #fff; border-color: rgb(255 255 255 / .22); }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -10px rgb(var(--accent-rgb) / .7); }
.btn--primary:hover { box-shadow: 0 14px 34px -10px rgb(var(--accent-2-rgb) / .8); }
.btn--ghost { background: rgb(255 255 255 / .06); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--ghost:hover { background: rgb(255 255 255 / .12); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 44px; padding: 0; }
.btn--sm.btn--icon { width: 36px; }
.btn.is-on { border-color: rgb(var(--accent-rgb) / .6); background: rgb(var(--accent-rgb) / .14); }
.btn.is-fav { color: var(--accent-2); border-color: rgb(var(--accent-2-rgb) / .55); background: rgb(var(--accent-2-rgb) / .14); }
.btn.is-fav .icon { fill: currentColor; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn--danger { --btn-bg: rgb(255 77 94 / .12); border-color: rgb(255 77 94 / .4); color: #ff8b97; }
.link { color: var(--accent); font-weight: 520; }
.link:hover { color: #fff; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 60;
	height: var(--header-h);
	background: linear-gradient(to bottom, rgb(var(--bg-rgb) / .92), rgb(var(--bg-rgb) / .55) 70%, transparent);
	transition: background .3s, box-shadow .3s, border-color .3s;
	border-bottom: 1px solid transparent;
}
.site-header.is-scrolled, body:not(.has-hero) .site-header {
	background: rgb(var(--bg-rgb) / .82);
	backdrop-filter: saturate(150%) blur(18px);
	-webkit-backdrop-filter: saturate(150%) blur(18px);
	border-bottom-color: var(--line);
}
.has-hero .site-header { margin-bottom: calc(var(--header-h) * -1); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 18px; }
.site-header__brand { flex: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; letter-spacing: -.02em; color: #fff; }
.brand__mark { width: 36px; height: 36px; filter: drop-shadow(0 4px 14px rgb(var(--accent-rgb) / .45)); }
.custom-logo-link img { max-height: 42px; width: auto; }
.primary-nav { flex: 1; min-width: 0; display: none; }
.primary-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.primary-nav__list > li { position: relative; }
.primary-nav__list a { display: block; padding: 8px 14px; border-radius: var(--r-pill); color: var(--text-2); font-weight: 480; font-size: 15px; transition: color .2s, background .2s; }
.primary-nav__list a:hover { color: #fff; background: rgb(255 255 255 / .06); }
.primary-nav__list .current-menu-item > a, .primary-nav__list .current_page_item > a, .primary-nav__list .current-menu-ancestor > a { color: #fff; background: rgb(255 255 255 / .08); }
.primary-nav__list .current-menu-item > a::after { content: ""; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin: 2px auto -7px; }
.primary-nav .sub-menu { list-style: none; margin: 0; padding: 6px; position: absolute; top: 100%; inset-inline-start: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s var(--ease); }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { border-radius: var(--r-sm); }
.hdr-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.hdr-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text); transition: background .2s; }
.hdr-btn:hover { background: rgb(255 255 255 / .08); }
.hdr-btn--menu { margin-inline-start: -8px; }
.hdr-search { position: relative; display: none; }
.hdr-search input {
	width: clamp(220px, 22vw, 320px); height: 42px;
	padding: 0 44px 0 40px; padding-inline: 42px 40px;
	background: rgb(255 255 255 / .06); border: 1px solid var(--line-2); border-radius: var(--r-pill);
	outline: none; transition: border-color .2s, background .2s, width .3s var(--ease);
}
.hdr-search input::placeholder { color: var(--muted); }
.hdr-search input:focus { border-color: rgb(var(--accent-rgb) / .7); background: var(--surface); width: clamp(260px, 28vw, 400px); }
.hdr-search__icon { position: absolute; inset-inline-start: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.hdr-search__kbd { position: absolute; inset-inline-end: 12px; top: 50%; translate: 0 -50%; font: 12px/1 var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 7px; }
.hdr-search input:focus ~ .hdr-search__kbd { display: none; }
.hdr-search input::-webkit-search-cancel-button { display: none; }
.hdr-login .icon { width: 18px; height: 18px; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu__btn .avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; background: var(--grad) border-box; }
.user-menu__panel { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); width: 250px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; z-index: 70; animation: pop .18s var(--ease); }
.user-menu__head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu__head .avatar { border-radius: 50%; }
.user-menu__head strong { display: block; line-height: 1.3; }
.user-menu__head span { font-size: 12px; color: var(--muted); }
.user-menu__panel a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; }
.user-menu__panel a:hover { background: rgb(255 255 255 / .06); color: #fff; }
.user-menu__panel a .icon { width: 18px; height: 18px; color: var(--muted); }
.is-danger, a.is-danger { color: #ff8b97 !important; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Live search suggestions ---------- */
.suggest { position: absolute; top: calc(100% + 8px); inset-inline: 0; min-width: 340px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 80; max-height: 70vh; overflow: auto; }
.suggest__item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-sm); }
.suggest__item:hover, .suggest__item.is-active { background: rgb(255 255 255 / .06); }
.suggest__img { width: 42px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--surface-3); flex: none; }
.suggest__title { display: block; font-weight: 560; line-height: 1.35; color: #fff; }
.suggest__sub { display: block; font-size: 12.5px; color: var(--muted); }
.suggest__empty { padding: 14px; color: var(--muted); text-align: center; }
.suggest__all { display: block; text-align: center; padding: 10px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--accent); font-weight: 560; font-size: 14px; }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .6); backdrop-filter: blur(4px); animation: fade .2s; }
.drawer__panel { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(340px, 88vw); background: var(--bg-2); border-inline-end: 1px solid var(--line-2); overflow-y: auto; padding: 14px 16px 40px; animation: slide-in .28s var(--ease); }
[dir="rtl"] .drawer__panel { animation-name: slide-in-rtl; }
.drawer__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer__user { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.drawer__user .avatar { border-radius: 50%; }
.drawer__user span { display: block; font-size: 12px; color: var(--muted); }
.drawer__label { font-size: 12px; color: var(--muted); margin: 18px 6px 6px; text-transform: uppercase; letter-spacing: .04em; }
.drawer__list { list-style: none; margin: 0; padding: 0; }
.drawer__list a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 480; }
.drawer__list a:hover, .drawer__list .current-menu-item > a { background: rgb(255 255 255 / .06); color: #fff; }
.drawer__list .sub-menu { list-style: none; padding-inline-start: 14px; margin: 0; }
.drawer__list--icons .icon { color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(-100%); } }
@keyframes slide-in-rtl { from { transform: translateX(100%); } }

/* ---------- Search overlay (mobile & quick search) ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 110; background: rgb(var(--bg-rgb) / .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: fade .2s; overflow-y: auto; }
.search-overlay__box { padding-top: 18px; padding-bottom: 40px; max-width: 760px; }
.search-overlay__form { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; padding-inline: 16px 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-pill); }
.search-overlay__form > .icon { color: var(--muted); }
.search-overlay__form input { flex: 1; min-width: 0; height: 46px; background: none; border: 0; outline: none; font-size: 17px; }
.suggest--overlay { position: static; margin-top: 12px; min-width: 0; box-shadow: none; background: transparent; border: 0; padding: 0; max-height: none; }
.search-overlay__form .suggest--overlay { position: absolute; top: calc(100% + 10px); inset-inline: 0; background: var(--surface); border: 1px solid var(--line-2); padding: 6px; }
.search-overlay__label { color: var(--muted); font-size: 13px; margin: 26px 4px 10px; }

/* ---------- Hero slider ---------- */
.hero { position: relative; height: var(--hero-h); min-height: 520px; overflow: hidden; isolation: isolate; background: var(--bg-2); }
.hero__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s var(--ease), visibility .8s; }
.hero__slide.is-active { opacity: 1; visibility: visible; }
.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__bg img, .hero__bg .ph { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transform: scale(1.06); transition: transform 8s linear; }
.hero__slide.is-active .hero__bg img { transform: scale(1); }
.hero__bg::after {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(to top, var(--bg) 0%, rgb(var(--bg-rgb) / .85) 18%, rgb(var(--bg-rgb) / .1) 55%, rgb(var(--bg-rgb) / .5) 100%),
		linear-gradient(to left, rgb(var(--bg-rgb) / .92) 0%, rgb(var(--bg-rgb) / .55) 38%, transparent 70%);
}
[dir="ltr"] .hero__bg::after { background: linear-gradient(to top, var(--bg) 0%, rgb(var(--bg-rgb) / .85) 18%, rgb(var(--bg-rgb) / .1) 55%, rgb(var(--bg-rgb) / .5) 100%), linear-gradient(to right, rgb(var(--bg-rgb) / .92) 0%, rgb(var(--bg-rgb) / .55) 38%, transparent 70%); }
.hero__inner { height: 100%; display: flex; align-items: flex-end; padding-bottom: clamp(70px, 11vh, 120px); }
.hero__content { max-width: 640px; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 14px; border-radius: var(--r-pill); background: rgb(255 255 255 / .08); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); backdrop-filter: blur(8px); margin-bottom: 14px; }
.hero__eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 12px var(--accent); }
.hero__title { font-size: clamp(30px, 5.2vw, 62px); font-weight: 700; line-height: 1.12; margin: 0 0 6px; text-wrap: balance; text-shadow: 0 6px 30px rgb(0 0 0 / .5); }
.hero__en { font-size: clamp(14px, 1.4vw, 18px); color: var(--text-2); margin-bottom: 14px; font-weight: 400; }
.hero__desc { color: var(--text-2); font-size: clamp(14px, 1.15vw, 16px); max-width: 560px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 14px 0 22px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero__rail { position: absolute; inset-inline-end: var(--gutter); bottom: clamp(70px, 11vh, 120px); display: none; flex-direction: column; gap: 10px; z-index: 3; }
.hero__thumb { position: relative; display: flex; align-items: center; gap: 10px; width: 260px; padding: 8px; border-radius: var(--r); background: rgb(var(--bg-rgb) / .4); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-align: start; transition: background .25s, border-color .25s, transform .25s var(--ease); overflow: hidden; }
.hero__thumb:hover { background: rgb(var(--bg-rgb) / .6); transform: translateX(-4px); }
[dir="ltr"] .hero__thumb:hover { transform: translateX(4px); }
.hero__thumb.is-active { border-color: rgb(var(--accent-rgb) / .6); background: rgb(var(--bg-rgb) / .7); }
.hero__thumb img, .hero__thumb .ph { width: 44px; height: 62px; border-radius: 8px; object-fit: cover; flex: none; }
.hero__thumb strong { display: block; font-size: 14px; font-weight: 560; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero__thumb small { color: var(--muted); font-size: 12px; }
.hero__thumb i { position: absolute; bottom: 0; inset-inline-start: 0; height: 2px; width: 0; background: var(--grad); }
.hero__thumb.is-active i { animation: hero-progress var(--hero-interval, 7s) linear forwards; }
.hero.is-paused .hero__thumb.is-active i { animation-play-state: paused; }
@keyframes hero-progress { to { width: 100%; } }
.hero__dots { position: absolute; bottom: 34px; inset-inline-start: var(--gutter); display: flex; gap: 6px; z-index: 3; }
.hero__dot { width: 8px; height: 8px; border-radius: 99px; background: rgb(255 255 255 / .3); transition: width .3s var(--ease), background .3s; }
.hero__dot.is-active { width: 28px; background: var(--grad); }
.hero__nav { position: absolute; bottom: 24px; inset-inline-end: var(--gutter); display: flex; gap: 8px; z-index: 3; }
.hero__nav .btn { width: 40px; min-height: 40px; }
.hero--empty { display: grid; place-items: center; text-align: center; }
.hero__poster { display: none; }

/* ---------- Sections, rails & grids ---------- */
.section { padding-block: clamp(18px, 3vw, 30px); }
.section + .section { padding-top: 6px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sec-head__title { position: relative; font-size: clamp(18px, 1.9vw, 24px); margin: 0; padding-inline-start: 18px; }
.sec-head__title::before { content: ""; position: absolute; inset-inline-start: 0; top: 50%; translate: 0 -50%; width: 9px; height: 9px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .16); }
.sec-head__sub { margin: 2px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 13.5px; }
.sec-head__more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-2); padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); white-space: nowrap; transition: .2s; }
.sec-head__more:hover { border-color: rgb(var(--accent-rgb) / .6); color: #fff; }
.sec-head__more .icon { width: 16px; height: 16px; }
[dir="ltr"] .sec-head__more .icon, [dir="ltr"] .rail__btn .icon, [dir="ltr"] .pager .icon { transform: scaleX(-1); }

.rail { position: relative; margin-inline: calc(var(--gutter) * -1); }
.rail__track { display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 6px var(--gutter) 14px; scrollbar-width: none; }
.rail__track::-webkit-scrollbar { display: none; }
.rail__track > * { scroll-snap-align: start; flex: none; width: var(--poster-w); }
.rail--episodes .rail__track > * { width: var(--ep-w); }
.rail--wide .rail__track > * { width: clamp(280px, 34vw, 460px); }
.rail--top .rail__track > * { width: calc(var(--poster-w) + 46px); }
.rail__btn { position: absolute; top: calc(50% - 30px); z-index: 4; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--bg-rgb) / .8); border: 1px solid var(--line-2); backdrop-filter: blur(8px); box-shadow: var(--shadow-sm); transition: opacity .2s, transform .2s; }
.rail__btn:hover { transform: scale(1.06); border-color: rgb(var(--accent-rgb) / .6); }
.rail__btn--prev { inset-inline-start: 8px; }
.rail__btn--next { inset-inline-end: 8px; }

.grid { display: grid; gap: 18px 14px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); }
.grid--episodes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* ---------- Cards ---------- */
.card { position: relative; min-width: 0; }
.card__link { display: block; color: inherit; }
.card__media { position: relative; display: block; overflow: hidden; border-radius: var(--r); background: var(--surface-2); isolation: isolate; transform: translateZ(0); }
.card--poster .card__media { aspect-ratio: 2 / 3; }
.card--episode .card__media, .card--wide .card__media { aspect-ratio: 16 / 9; }
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), filter .4s; }
.card__img.is-poster-fill { object-position: center 20%; }
.card__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .75), transparent 45%); z-index: 1; pointer-events: none; }
.card__media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); z-index: 3; pointer-events: none; transition: box-shadow .3s; }
.card__link:hover .card__img, .card__link:focus-visible .card__img { transform: scale(1.06); }
.card__link:hover .card__media::after, .card__link:focus-visible .card__media::after { box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb) / .9); }
.card__type, .card__rating, .card__badge, .card__ep, .card__flag {
	position: absolute; z-index: 2;
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 11.5px; font-weight: 560; line-height: 1;
	padding: 5px 8px; border-radius: 7px;
	background: rgb(var(--bg-rgb) / .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	color: #fff;
}
.card__type { top: 8px; inset-inline-start: 8px; }
.card__type .icon { width: 13px; height: 13px; color: var(--accent); }
.card__rating { top: 8px; inset-inline-end: 8px; color: var(--gold); }
.card__rating .icon { width: 13px; height: 13px; fill: currentColor; }
.card__badge { bottom: 8px; inset-inline-start: 8px; background: var(--grad); }
.card__ep { bottom: 10px; inset-inline-start: 10px; background: var(--grad); font-size: 12px; padding: 6px 10px; }
.card__flag { top: 10px; inset-inline-end: 10px; background: var(--ok); color: #04150d; }
.card__play { position: absolute; z-index: 2; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: 0 10px 30px rgb(var(--accent-rgb) / .5); opacity: 0; transform: scale(.7); transition: .3s var(--ease); }
.card__play .icon { width: 22px; height: 22px; fill: #fff; stroke: none; margin-inline-start: -2px; }
[dir="rtl"] .card__play .icon { transform: scaleX(-1); margin-inline-start: 0; margin-inline-end: -2px; }
.card__link:hover .card__play, .card__link:focus-visible .card__play { opacity: 1; transform: none; }
.card__progress { position: absolute; z-index: 2; inset-inline: 10px; bottom: 6px; height: 4px; border-radius: 4px; background: rgb(255 255 255 / .25); overflow: hidden; }
.card__progress i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.card--episode .card__ep { bottom: 16px; }
.card__body { display: block; padding: 10px 2px 0; }
.card__title { font-size: 14.5px; font-weight: 560; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); transition: color .2s; }
.card__link:hover .card__title { color: #fff; }
.card__meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards-hover-info .card--poster .card__body { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; padding: 12px; opacity: 0; transform: translateY(8px); transition: .3s var(--ease); }
.cards-hover-info .card--poster .card__link:hover .card__body { opacity: 1; transform: none; }
.cards-hover-info .card--poster .card__shade { background: linear-gradient(to top, rgb(0 0 0 / .9), transparent 60%); }

/* Ranked (top 10) */
.card--ranked .card__link { display: flex; align-items: flex-end; }
.card--ranked .card__rank { flex: none; width: 46px; margin-inline-end: -10px; font-size: 96px; font-weight: 700; line-height: .8; color: transparent; -webkit-text-stroke: 2px rgb(255 255 255 / .28); letter-spacing: -.06em; z-index: 0; font-variant-numeric: tabular-nums; transition: -webkit-text-stroke-color .3s; padding-bottom: 50px; text-align: center; }
.card--ranked .card__link:hover .card__rank { -webkit-text-stroke-color: var(--accent); }
.card--ranked .card__media { flex: 1; z-index: 1; }
.card--ranked .card__body { display: none; }

/* Wide card */
.card--wide .card__shade { background: linear-gradient(to top, rgb(0 0 0 / .92), rgb(0 0 0 / .1) 70%); }
.card__overlay { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.card--wide .card__title { font-size: 18px; -webkit-line-clamp: 1; }
.card--wide .card__meta { color: var(--text-2); }

/* Placeholder art */
.ph { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, hsl(var(--h) 70% 45% / .55), transparent 60%), linear-gradient(160deg, hsl(var(--h) 45% 22%), hsl(calc(var(--h) + 40) 50% 12%)); color: rgb(255 255 255 / .85); font-weight: 700; font-size: 44px; }
.ph span { text-shadow: 0 4px 20px rgb(0 0 0 / .4); }
.ph--wide { font-size: 64px; }

/* ---------- Chips, tags ---------- */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 11px; border-radius: var(--r-pill); background: rgb(255 255 255 / .07); border: 1px solid var(--line); color: var(--text-2); }
.chip a:hover { color: #fff; }
.chip .icon { width: 14px; height: 14px; }
.chip--rating { color: var(--gold); border-color: rgb(255 194 74 / .3); background: rgb(255 194 74 / .1); font-weight: 600; }
.chip--rating .icon { fill: currentColor; }
.chip--status.is-ongoing { color: #7cf0bd; border-color: rgb(43 211 139 / .35); background: rgb(43 211 139 / .1); }
.chip--status.is-completed { color: #9ccbff; border-color: rgb(74 168 255 / .35); background: rgb(74 168 255 / .1); }
.chip--status.is-upcoming { color: #ffd08a; border-color: rgb(255 194 74 / .35); background: rgb(255 194 74 / .1); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; padding: 6px 14px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); transition: .2s; }
.tag:hover { border-color: rgb(var(--accent-rgb) / .6); color: #fff; background: rgb(var(--accent-rgb) / .1); }
.tag.is-active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Countdown ---------- */
.countdown { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 560; color: var(--gold); font-variant-numeric: tabular-nums; }
.countdown .icon { width: 15px; height: 15px; }
.countdown--sm { font-size: 12.5px; }
.countdown--box { padding: 10px 14px; border-radius: var(--r); background: rgb(255 194 74 / .08); border: 1px solid rgb(255 194 74 / .25); }

/* ---------- Library (list/fav) controls ---------- */
.lib { display: inline-flex; align-items: center; gap: 8px; }
.lib__menu { position: relative; }
.lib__menu > summary { list-style: none; }
.lib__menu > summary::-webkit-details-marker { display: none; }
.lib__list { position: absolute; z-index: 30; top: calc(100% + 8px); inset-inline-start: 0; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.lib__opt { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); text-align: start; color: var(--text-2); font-size: 14px; }
.lib__opt:hover { background: rgb(255 255 255 / .06); color: #fff; }
.lib__tick { opacity: 0; color: var(--accent); width: 18px; height: 18px; }
.lib__opt.is-active { color: #fff; }
.lib__opt.is-active .lib__tick { opacity: 1; }
.lib__opt--remove { color: #ff8b97; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); margin-top: 4px; }
.lib__opt--remove .icon { width: 18px; height: 18px; }
.lib__fav-form { margin: 0; }

/* ---------- Page headers (browse, taxonomy, search) ---------- */
.page-hero { position: relative; overflow: hidden; padding: clamp(28px, 5vw, 56px) 0 clamp(18px, 3vw, 28px); isolation: isolate; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.page-hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 140%; z-index: -1; background: radial-gradient(closest-side, rgb(var(--accent-rgb) / .22), transparent), radial-gradient(closest-side at 20% 60%, rgb(var(--accent-2-rgb) / .14), transparent); filter: blur(10px); }
.page-hero__orbit { position: absolute; z-index: -1; inset-inline-end: -140px; top: -200px; width: 560px; height: 560px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .09); animation: spin 60s linear infinite; pointer-events: none; }
.page-hero__orbit::before { content: ""; position: absolute; inset: 70px; border-radius: 50%; border: 1px dashed rgb(255 255 255 / .07); }
.page-hero__orbit::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--grad); top: calc(50% - 6px); left: -6px; box-shadow: 0 0 0 5px rgb(var(--accent-rgb) / .15), 0 0 24px var(--accent); }
.page-hero__kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.page-hero__kicker .icon { width: 18px; height: 18px; }
.page-hero__title { font-size: clamp(26px, 3.6vw, 42px); font-weight: 700; margin: 0 0 6px; }
.page-hero__desc { color: var(--text-2); max-width: 720px; margin: 0; }
.page-hero__stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.page-hero--anime::before { background: radial-gradient(closest-side, rgb(var(--accent-rgb) / .26), transparent), radial-gradient(closest-side at 15% 70%, rgb(140 90 255 / .18), transparent); }
.page-hero--series::before { background: radial-gradient(closest-side, rgb(74 168 255 / .2), transparent), radial-gradient(closest-side at 15% 70%, rgb(var(--accent-rgb) / .14), transparent); }
.page-hero--movie::before { background: radial-gradient(closest-side, rgb(255 194 74 / .18), transparent), radial-gradient(closest-side at 15% 70%, rgb(var(--accent-2-rgb) / .16), transparent); }
.page-hero--upcoming::before { background: radial-gradient(closest-side, rgb(255 194 74 / .22), transparent); }
.page-hero--completed::before { background: radial-gradient(closest-side, rgb(74 168 255 / .2), transparent); }
.page-hero--ongoing::before { background: radial-gradient(closest-side, rgb(43 211 139 / .18), transparent); }

.crumbs ol { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "‹"; margin-inline-end: 6px; opacity: .6; }
[dir="ltr"] .crumbs li + li::before { content: "›"; }
.crumbs a:hover { color: #fff; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filters__group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters__types { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.filters__types a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-pill); color: var(--text-2); font-size: 14px; white-space: nowrap; }
.filters__types a .icon { width: 16px; height: 16px; }
.filters__types a.is-active { background: var(--grad); color: #fff; }
.select { position: relative; }
.select select, .field select { appearance: none; -webkit-appearance: none; }
.select select { height: 40px; padding: 0 14px; padding-inline-end: 34px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-size: 14px; cursor: pointer; }
.select::after, .field--select::after { content: ""; position: absolute; inset-inline-end: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select:focus { outline: none; border-color: rgb(var(--accent-rgb) / .7); }
.filters__toggle { display: inline-flex; }
.filters__panel { display: contents; }
.filters__count { margin-inline-start: auto; color: var(--muted); font-size: 13.5px; }
.filters__reset { color: var(--muted); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.genre-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-picker label { cursor: pointer; }
.genre-picker input { position: absolute; opacity: 0; pointer-events: none; }
.genre-picker span { display: inline-block; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); transition: .15s; }
.genre-picker input:checked + span { background: rgb(var(--accent-rgb) / .16); border-color: rgb(var(--accent-rgb) / .6); color: #fff; }
.genre-picker input:focus-visible + span { outline: 2px solid var(--accent); }
.search-head { display: flex; gap: 10px; margin-bottom: 16px; }
.search-head__field { position: relative; flex: 1; }
.search-head__field .icon { position: absolute; inset-inline-start: 16px; top: 50%; translate: 0 -50%; color: var(--muted); }
.search-head__field input { width: 100%; height: 52px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); padding-inline: 48px 18px; font-size: 16px; outline: none; }
.search-head__field input:focus { border-color: rgb(var(--accent-rgb) / .7); }
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.filter-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.filter-box h3 { font-size: 14px; color: var(--text-2); margin: 14px 0 8px; font-weight: 560; }
.filter-box h3:first-child { margin-top: 0; }
.filter-box .select select { width: 100%; }

/* ---------- Pager ---------- */
.pager { margin: 34px 0 10px; }
.pager ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pager .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pager a.page-numbers:hover { border-color: rgb(var(--accent-rgb) / .6); color: #fff; }
.pager .page-numbers.current { background: var(--grad); color: #fff; border-color: transparent; }
.pager .dots { background: none; border: 0; }

/* ---------- Detail (anime / series / movie) ---------- */
.detail { position: relative; isolation: isolate; padding-top: clamp(18px, 4vw, 40px); }
.detail__backdrop { position: absolute; inset: 0 0 auto; height: min(78vh, 640px); z-index: -1; overflow: hidden; margin-top: calc(var(--header-h) * -1); }
.detail__backdrop img, .detail__backdrop .ph { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; opacity: .55; }
.detail__backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 4%, rgb(var(--bg-rgb) / .7) 45%, rgb(var(--bg-rgb) / .35)), linear-gradient(to left, rgb(var(--bg-rgb) / .6), transparent 60%); }
.detail__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: end; }
.detail__poster { width: min(56vw, 240px); margin-inline: auto; position: relative; }
.detail__poster .card__img, .detail__poster img, .detail__poster .ph { position: static; display: block; width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--r-lg); box-shadow: 0 30px 60px -20px rgb(0 0 0 / .9), 0 0 0 1px rgb(255 255 255 / .1); }
.detail__poster .ph { font-size: 72px; }
.detail__info { min-width: 0; text-align: center; }
.detail__type { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.detail__type .icon { width: 17px; height: 17px; }
.detail__title { font-size: clamp(26px, 4vw, 46px); font-weight: 700; line-height: 1.15; margin: 0 0 4px; text-wrap: balance; }
.detail__en { color: var(--text-2); font-size: clamp(14px, 1.3vw, 17px); margin: 0 0 14px; }
.detail__info .chips, .detail__info .tags, .detail__actions { justify-content: center; }
.detail__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.detail__story { color: var(--text-2); max-width: 760px; margin: 16px auto 0; }
.detail__story p:last-child { margin: 0; }
.detail__story.is-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more-toggle { color: var(--accent); font-weight: 560; font-size: 14px; margin-top: 4px; }
.resume { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: rgb(var(--accent-rgb) / .09); border: 1px solid rgb(var(--accent-rgb) / .3); margin-top: 16px; text-align: start; }
.resume__bar { flex: 1; height: 5px; border-radius: 5px; background: rgb(255 255 255 / .12); overflow: hidden; min-width: 60px; }
.resume__bar i { display: block; height: 100%; background: var(--grad); }

.tabs { position: sticky; top: var(--header-h); z-index: 20; display: flex; gap: 4px; margin: 30px 0 20px; padding: 6px 0; background: rgb(var(--bg-rgb) / .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; padding: 10px 16px; color: var(--text-2); font-weight: 520; white-space: nowrap; border-radius: var(--r-sm); }
.tabs a:hover { color: #fff; background: rgb(255 255 255 / .05); }
.tabs a.is-active { color: #fff; }
.tabs a.is-active::after { content: ""; position: absolute; inset-inline: 14px; bottom: -7px; height: 3px; border-radius: 3px; background: var(--grad); }
.panel { scroll-margin-top: calc(var(--header-h) + 70px); margin-bottom: 36px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.info-item { padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.info-item dt { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.info-item dd { margin: 0; font-weight: 520; }
.info-item dd a { color: var(--text); border-bottom: 1px dashed var(--line-2); }
.info-item dd a:hover { color: var(--accent); }

/* Seasons & episodes on the show page */
.season-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.season-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.season-tabs a { padding: 8px 16px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; color: var(--text-2); font-size: 14px; }
.season-tabs a:hover { color: #fff; border-color: var(--line-2); }
.season-tabs a.is-active { background: var(--grad); border-color: transparent; color: #fff; }
.ep-filter { position: relative; }
.ep-filter input { height: 40px; width: 180px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); padding-inline: 38px 14px; outline: none; font-size: 14px; }
.ep-filter .icon { position: absolute; inset-inline-start: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); }
.ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.ep { position: relative; }
.ep__link { display: flex; gap: 12px; align-items: center; padding: 8px; padding-inline-end: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.ep__link:hover { border-color: rgb(var(--accent-rgb) / .5); background: var(--surface-2); }
.ep__thumb { position: relative; width: 128px; flex: none; aspect-ratio: 16/9; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); }
.ep__thumb img, .ep__thumb .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 28px; }
.ep__num { position: absolute; bottom: 5px; inset-inline-start: 5px; z-index: 1; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; background: rgb(var(--bg-rgb) / .8); }
.ep__body { min-width: 0; flex: 1; }
.ep__title { display: block; font-weight: 560; font-size: 14.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep__meta { display: block; font-size: 12.5px; color: var(--muted); }
.ep__state { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .06); color: var(--text-2); }
.ep__state .icon { width: 18px; height: 18px; }
.ep.is-watched .ep__state { background: rgb(43 211 139 / .15); color: var(--ok); }
.ep.is-watched .ep__title { color: var(--text-2); }
.ep.is-current .ep__link { border-color: rgb(var(--accent-rgb) / .7); background: rgb(var(--accent-rgb) / .08); }
.ep__bar { position: absolute; inset-inline: 8px; bottom: 8px; width: 128px; height: 3px; border-radius: 3px; overflow: hidden; background: rgb(255 255 255 / .2); z-index: 2; }
.ep__bar i { display: block; height: 100%; background: var(--grad); }
.ep-ranges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ep-ranges a { padding: 5px 12px; font-size: 13px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--text-2); }
.ep-ranges a.is-active { border-color: rgb(var(--accent-rgb) / .7); color: #fff; background: rgb(var(--accent-rgb) / .12); }

/* ---------- Watch page ---------- */
.watch { padding-top: 18px; }
.detail--movie .player, .detail--movie .watch__tools { max-width: 1120px; margin-inline: auto; }
.hero__en bdi, .detail__en bdi { unicode-bidi: isolate; }
.watch__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.watch__main { min-width: 0; }
.player { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.player__screen { position: relative; aspect-ratio: 16/9; background: #000; }
.player__screen iframe, .player__screen video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player__poster { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.player__poster img, .player__poster .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; filter: blur(1px); }
.player__poster::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent, rgb(0 0 0 / .65)); }
.player__start { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; font-weight: 560; }
.player__start .ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: 0 0 0 10px rgb(var(--accent-rgb) / .2), 0 20px 50px rgb(var(--accent-rgb) / .5); transition: transform .3s var(--ease); }
.player__poster:hover .ring { transform: scale(1.08); }
.player__start .ring .icon { width: 34px; height: 34px; fill: #fff; stroke: none; }
[dir="rtl"] .player__start .ring .icon { transform: scaleX(-1); }
.player__msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--text-2); background: radial-gradient(circle, var(--surface-2), #000); }
.player__msg .icon { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--muted); }
.player__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border-top: 1px solid var(--line); }
.player__label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.player__label .icon { width: 16px; height: 16px; }
.servers { display: flex; flex-wrap: wrap; gap: 6px; }
.server-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; transition: .15s; }
.server-btn:hover { color: #fff; border-color: var(--line-2); }
.server-btn.is-active { background: var(--grad); color: #fff; border-color: transparent; }
.server-btn.is-broken { opacity: .55; text-decoration: line-through; }
.server-btn .icon { width: 15px; height: 15px; }
.qualities { display: flex; gap: 4px; margin-inline-start: auto; }
.q-btn { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: rgb(255 255 255 / .05); border: 1px solid var(--line); color: var(--text-2); font-variant-numeric: tabular-nums; }
.q-btn.is-active { border-color: rgb(var(--accent-rgb) / .8); color: #fff; background: rgb(var(--accent-rgb) / .16); }
.watch__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 20px 0 6px; }
.watch__work { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 560; font-size: 14px; }
.watch__title { font-size: clamp(20px, 2.4vw, 28px); margin: 2px 0 0; }
.watch__nav { display: flex; gap: 8px; }
.watch__tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; align-items: center; }
.watch__tools form { margin: 0; display: inline-flex; }
.manual-progress { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 4px; padding-inline-start: 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); }
.manual-progress label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.manual-progress input { width: 84px; height: 34px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--bg-2); text-align: center; font-variant-numeric: tabular-nums; outline: none; direction: ltr; }
.manual-progress input:focus { border-color: rgb(var(--accent-rgb) / .7); }
.watch__desc { color: var(--text-2); margin-top: 12px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.box__title { font-size: 16px; margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.box__title .icon { color: var(--accent); }
.side-eps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; padding-inline-end: 4px; }
.side-eps a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid transparent; font-size: 14px; color: var(--text-2); }
.side-eps a:hover { border-color: var(--line-2); color: #fff; }
.side-eps .is-current a { border-color: rgb(var(--accent-rgb) / .7); background: rgb(var(--accent-rgb) / .1); color: #fff; }
.side-eps__n { flex: none; min-width: 34px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgb(255 255 255 / .06); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.side-eps .is-current .side-eps__n { background: var(--grad); color: #fff; }
.side-eps__t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-eps .is-watched .side-eps__n { color: var(--ok); }
.side-eps .icon { width: 16px; height: 16px; color: var(--ok); }

.downloads { display: grid; gap: 10px; }
.dl-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.dl-group__head { display: flex; align-items: center; gap: 8px; padding-inline: 6px; font-weight: 600; min-width: 74px; }
.dl-q { padding: 3px 10px; border-radius: 7px; background: var(--grad); font-size: 13px; color: #fff; font-variant-numeric: tabular-nums; }
.dl-list { flex: 1; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.dl-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; }
.dl-link:hover { border-color: rgb(var(--accent-rgb) / .55); color: #fff; }
.dl-link .icon { color: var(--accent); }
.dl-link small { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.dl-link.is-broken { opacity: .6; }
.report-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.report-link:hover { color: #ff8b97; }
.report-link .icon { width: 16px; height: 16px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .7); backdrop-filter: blur(4px); animation: fade .2s; }
.modal__box { position: relative; width: min(480px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); animation: pop .22s var(--ease); }
.modal__title { font-size: 19px; display: flex; align-items: center; gap: 10px; }
.modal__title .icon { color: var(--danger); }
.modal__close { position: absolute; top: 14px; inset-inline-end: 14px; }
.reasons { display: grid; gap: 6px; margin: 12px 0; }
.reasons label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.reasons label:has(input:checked) { border-color: rgb(var(--accent-rgb) / .7); background: rgb(var(--accent-rgb) / .08); }
.reasons input { accent-color: var(--accent); }

/* ---------- Forms ---------- */
.field, .madar-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; position: relative; }
.field > span, .madar-field > span, .field label { font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.field input, .field select, .field textarea, .madar-field input, .madar-field select, .madar-field textarea, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea, .note-input {
	width: 100%; min-height: 48px; padding: 10px 16px;
	background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
	color: var(--text); font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea, .madar-field textarea, .comment-form textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus, .madar-field input:focus, .madar-field select:focus, .madar-field textarea:focus, .comment-form textarea:focus, .comment-form input:focus, .note-input:focus { border-color: rgb(var(--accent-rgb) / .8); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .14); }
.field--select { position: relative; }
.field--select::after { top: auto; bottom: 22px; }
.field__hint { font-size: 12.5px; color: var(--muted); }
.field__pw { position: relative; }
.field__pw button { position: absolute; inset-inline-end: 8px; top: 50%; translate: 0 -50%; width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; }
.field__pw input { padding-inline-end: 48px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.madar-form-row, .form-row { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.madar-hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.madar-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px; border-radius: var(--r-pill); background: var(--grad); color: #fff; font-weight: 600; }
.alert, .madar-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.alert .icon { width: 18px; height: 18px; margin-top: 2px; }
.alert--error, .madar-alert.is-error { background: rgb(255 77 94 / .1); border-color: rgb(255 77 94 / .35); color: #ffb3bb; }
.alert--success, .madar-alert.is-success { background: rgb(43 211 139 / .1); border-color: rgb(43 211 139 / .35); color: #9df0c9; }
.alert--info { background: rgb(74 168 255 / .1); border-color: rgb(74 168 255 / .3); color: #b9dcff; }

/* ---------- Account ---------- */
.auth { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: minmax(0, 1fr); }
.auth__art { display: none; position: relative; overflow: hidden; isolation: isolate; }
.auth__mosaic { position: absolute; inset: -10%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; transform: rotate(-8deg) scale(1.1); opacity: .55; z-index: -2; }
.auth__mosaic img, .auth__mosaic .ph { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--r); }
.auth__art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to left, var(--bg), rgb(var(--bg-rgb) / .3) 50%, rgb(var(--bg-rgb) / .75)), radial-gradient(circle at 30% 70%, rgb(var(--accent-rgb) / .25), transparent 50%); }
.auth__pitch { position: absolute; bottom: 48px; inset-inline-start: 48px; inset-inline-end: 48px; }
.auth__pitch h2 { font-size: 34px; font-weight: 700; margin-bottom: 14px; }
.auth__pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--text-2); }
.auth__pitch li { display: flex; gap: 10px; align-items: center; }
.auth__pitch li .icon { color: var(--ok); }
.auth__panel { display: grid; place-items: center; padding: 32px var(--gutter) 60px; }
.auth__card { width: min(440px, 100%); }
.auth__card h1 { font-size: 28px; margin-bottom: 4px; }
.auth__sub { color: var(--muted); margin-bottom: 22px; }
.auth__alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 18px; font-size: 14px; }

.account { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 24px; }
.account__side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; height: fit-content; }
.account__me { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.account__me .avatar { width: 56px; height: 56px; border-radius: 50%; }
.account__me strong { display: block; font-size: 16px; }
.account__me span { font-size: 12.5px; color: var(--muted); }
.account__nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.account__nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text-2); white-space: nowrap; font-size: 14.5px; }
.account__nav a:hover { background: rgb(255 255 255 / .05); color: #fff; }
.account__nav a.is-active { background: rgb(var(--accent-rgb) / .12); color: #fff; }
.account__nav a.is-active .icon { color: var(--accent); }
.account__nav .count { margin-inline-start: auto; font-size: 12px; color: var(--muted); background: rgb(255 255 255 / .06); padding: 1px 8px; border-radius: var(--r-pill); }
.account__main { min-width: 0; }
.account__title { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 4px; }
.account__lead { color: var(--muted); margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 160px), 1fr)); gap: 10px; margin-bottom: 26px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.stat:hover { border-color: rgb(var(--accent-rgb) / .5); }
.stat .icon { color: var(--accent); margin-bottom: 6px; }
.stat strong { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.list-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.list-tabs a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; }
.list-tabs a.is-active { background: var(--grad); color: #fff; border-color: transparent; }
.list-tabs a small { opacity: .75; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history__item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.history__thumb { position: relative; width: 120px; aspect-ratio: 16/9; border-radius: var(--r-sm); overflow: hidden; flex: none; background: var(--surface-3); }
.history__thumb img, .history__thumb .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 26px; }
.history__body { flex: 1; min-width: 0; }
.history__body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 560; }
.history__body span { font-size: 12.5px; color: var(--muted); }
.history__item form { margin: 0; }
.settings-grid { display: grid; gap: 18px; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.settings-card h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.settings-card--danger { border-color: rgb(255 77 94 / .3); }
.settings-card--danger h2 { color: #ff8b97; }

/* ---------- Genres / years index ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 200px), 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 120px; padding: 16px; border-radius: var(--r-lg); overflow: hidden; isolation: isolate; border: 1px solid var(--line); background: linear-gradient(150deg, hsl(var(--h) 60% 30% / .9), hsl(calc(var(--h) + 50) 55% 14%)); transition: transform .3s var(--ease), border-color .3s; }
.tile:hover { transform: translateY(-3px); border-color: rgb(255 255 255 / .25); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .4; mix-blend-mode: luminosity; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(0 0 0 / .6), transparent 70%); }
.tile strong { font-size: 18px; font-weight: 650; color: #fff; }
.tile span { font-size: 12.5px; color: rgb(255 255 255 / .75); }
.tile--year { min-height: 96px; }
.tile--year strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.year-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.year-nav a { padding: 6px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 14px; }
.year-nav a.is-active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Empty / 404 ---------- */
.empty { text-align: center; padding: clamp(40px, 8vw, 90px) 16px; max-width: 560px; margin: 0 auto; }
.empty__orb { position: relative; display: inline-grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; margin-bottom: 18px; background: radial-gradient(circle at 35% 30%, rgb(var(--accent-rgb) / .35), rgb(var(--accent-2-rgb) / .12) 60%, transparent 70%); border: 1px solid rgb(255 255 255 / .1); }
.empty__orb::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px dashed rgb(255 255 255 / .14); animation: spin 30s linear infinite; }
.empty__orb .icon { width: 38px; height: 38px; color: #fff; }
.empty__title { font-size: 22px; }
.empty__text { color: var(--muted); }
.empty__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.notfound { position: relative; text-align: center; padding: clamp(40px, 10vw, 110px) 0; overflow: hidden; }
.notfound__num { font-size: clamp(110px, 22vw, 230px); font-weight: 700; line-height: .9; letter-spacing: -.06em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-flex; align-items: center; }
.notfound__o { display: inline-block; width: .72em; height: .72em; border-radius: 50%; border: .1em solid var(--accent); border-inline-end-color: transparent; transform: rotate(-30deg); margin: 0 .04em; position: relative; animation: spin 12s linear infinite; }
.notfound__o::after { content: ""; position: absolute; width: .12em; height: .12em; border-radius: 50%; background: var(--accent-2); top: -.06em; inset-inline-end: .06em; }
.notfound h1 { font-size: clamp(22px, 3vw, 32px); margin-top: 16px; }
.notfound p { color: var(--muted); }
.notfound form { max-width: 520px; margin: 22px auto 0; }

/* ---------- Content pages ---------- */
.page-wrap { max-width: 860px; }
.prose { color: var(--text-2); font-size: 16px; line-height: 1.95; }
.prose h2, .prose h3 { color: var(--text); margin-top: 1.6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--r); }
.prose blockquote { margin: 1.4em 0; padding: 4px 18px; border-inline-start: 3px solid var(--accent); color: var(--text); }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: 8px 10px; }
.post-list { display: grid; gap: 16px; }
.post-item { display: grid; gap: 14px; grid-template-columns: 1fr; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.post-item img { border-radius: var(--r); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.post-item h2 { font-size: 20px; margin: 4px 0; }
.post-item time { font-size: 13px; color: var(--muted); }

/* ---------- Comments ---------- */
.comments { margin-top: 30px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.comment-list .children { list-style: none; padding-inline-start: clamp(14px, 4vw, 44px); margin: 12px 0 0; display: grid; gap: 12px; }
.comment-body { padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.comment-author { display: flex; align-items: center; gap: 8px; }
.comment-author .avatar { border-radius: 50%; width: 32px; height: 32px; }
.comment-author .fn { color: var(--text); font-weight: 560; font-style: normal; }
.comment-author .says { display: none; }
.comment-content { color: var(--text-2); }
.comment-content p:last-child { margin: 0; }
.reply a, .comment-reply-link { font-size: 13px; color: var(--accent); }
.comment-respond { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.comment-reply-title { font-size: 18px; }
.comment-form p { margin-bottom: 12px; }
.comment-form label { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 6px; }
.comment-form .submit { min-height: 46px; padding: 0 26px; border-radius: var(--r-pill); background: var(--grad); color: #fff; font-weight: 600; border: 0; cursor: pointer; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: center; }
.comment-form-cookies-consent label { margin: 0; }
.logged-in-as, .comment-notes { font-size: 13px; color: var(--muted); }
.logged-in-as a { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: linear-gradient(to bottom, var(--bg-2), var(--bg)); padding: 40px 0 calc(24px + env(safe-area-inset-bottom)); }
.site-footer__grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
.site-footer__about p { color: var(--muted); font-size: 14px; max-width: 380px; margin: 14px 0; }
.site-footer__col h2 { font-size: 15px; color: var(--text); margin-bottom: 10px; }
.site-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer__col a { color: var(--muted); font-size: 14px; }
.site-footer__col a:hover { color: #fff; }
.social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.social a { display: inline-block; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.social a:hover { border-color: rgb(var(--accent-rgb) / .6); color: #fff; }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 18px; color: var(--muted); font-size: 13px; }
.site-footer__bottom p { margin: 0; }
.legal { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.legal a:hover { color: #fff; }
.site-footer__notice { width: 100%; font-size: 12.5px; opacity: .8; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { position: fixed; z-index: 55; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px; border-radius: 20px; background: rgb(var(--bg-rgb) / .86); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -10px rgb(0 0 0 / .8); }
.bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 500; }
.bottom-nav .icon { width: 22px; height: 22px; }
.bottom-nav .is-active { color: #fff; background: rgb(var(--accent-rgb) / .14); }
.bottom-nav .is-active .icon { color: var(--accent); }
body:has(.bottom-nav) .site-footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 130; inset-inline: 0; bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px 18px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: toast-in .3s var(--ease); }
.toast .icon { width: 18px; height: 18px; color: var(--ok); }
.toast.is-error .icon { color: var(--danger); }
.toast a { color: var(--accent); font-weight: 560; }
.toast.is-out { opacity: 0; transform: translateY(10px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ---------- Home misc ---------- */
.custom-block { padding: 22px; border-radius: var(--r-lg); background: linear-gradient(135deg, rgb(var(--accent-rgb) / .14), rgb(var(--accent-2-rgb) / .06)); border: 1px solid rgb(var(--accent-rgb) / .25); }
.custom-block > :last-child { margin-bottom: 0; }
.custom-block a { color: var(--accent); }
.genre-cloud { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 170px), 1fr)); }
.welcome-banner { margin-top: 18px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 600px) {
	.madar-form-row, .form-row { grid-template-columns: 1fr 1fr; }
	.post-item { grid-template-columns: 240px 1fr; align-items: center; }
	.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }
}
@media (min-width: 900px) {
	:root { --header-h: 72px; }
	.primary-nav { display: block; }
	.hdr-btn--menu, .hdr-btn--search { display: none; }
	.hdr-search { display: block; }
	.bottom-nav { display: none; }
	body:has(.bottom-nav) .site-footer { padding-bottom: 24px; }
	.toasts { bottom: 28px; }
	.hero__rail { display: flex; }
	.hero__dots { display: none; }
	.hero__nav { inset-inline-end: auto; inset-inline-start: var(--gutter); bottom: 30px; }
	.hero__content { max-width: min(640px, 52vw); }
	.detail__top { grid-template-columns: 250px 1fr; gap: 36px; }
	.detail__poster { width: 100%; margin: 0; }
	.detail__info { text-align: start; padding-bottom: 6px; }
	.detail__info .chips, .detail__info .tags, .detail__actions { justify-content: flex-start; }
	.detail__story { margin-inline: 0; }
	.watch__layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
	.watch__side { position: sticky; top: calc(var(--header-h) + 14px); }
	.layout-sidebar { grid-template-columns: 270px minmax(0, 1fr); align-items: start; }
	.layout-sidebar .filter-box { position: sticky; top: calc(var(--header-h) + 14px); }
	.account { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
	.account__side { position: sticky; top: calc(var(--header-h) + 14px); }
	.account__nav { flex-direction: column; }
	.auth { grid-template-columns: 1.1fr 1fr; }
	.auth__art { display: block; }
	.site-footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); }
	.settings-grid { grid-template-columns: 1fr 1fr; }
	.settings-card--wide { grid-column: 1 / -1; }
	.grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (min-width: 1200px) {
	.grid--browse { grid-template-columns: repeat(6, 1fr); }
	.layout-sidebar .grid--browse { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 899px) {
	.hero { height: auto; min-height: 0; aspect-ratio: auto; }
	.hero__slides { position: relative; height: clamp(600px, 165vw, 720px); }
	.hero__inner { padding-top: calc(var(--header-h) + 8px); padding-bottom: 50px; align-items: flex-end; }
	.hero__content { text-align: center; margin-inline: auto; }
	.hero__eyebrow { margin-bottom: 10px; }
	.hero__actions { justify-content: center; }
	.hero__nav { display: none; }
	.hero__dots { inset-inline: 0; justify-content: center; bottom: 22px; }
	.hero__poster { display: block; width: 130px; margin: 0 auto 14px; border-radius: var(--r); overflow: hidden; box-shadow: 0 20px 40px -10px rgb(0 0 0 / .9), 0 0 0 1px rgb(255 255 255 / .12); aspect-ratio: 2/3; position: relative; }
	.hero__poster img, .hero__poster .ph { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; font-size: 40px; }
	.hero__bg img { filter: blur(2px) saturate(1.2); }
	.hero__bg::after { background: linear-gradient(to top, var(--bg) 6%, rgb(var(--bg-rgb) / .75) 50%, rgb(var(--bg-rgb) / .45)); }
	.hero__desc { -webkit-line-clamp: 2; margin: 10px auto 18px; }
	.hero__en { display: none; }
	.filters__panel { display: none; width: 100%; }
	.filters.is-open .filters__panel { display: flex; flex-wrap: wrap; gap: 8px; }
	.ep__thumb { width: 104px; }
	.ep__bar { width: 104px; }
	.watch { padding-top: 0; }
	.watch .player { margin-inline: calc(var(--gutter) * -1); border-radius: 0; }
	.qualities { margin-inline-start: 0; width: 100%; }
	.tabs { top: var(--header-h); }
	.user-menu__panel { position: fixed; inset-inline: 12px; top: calc(var(--header-h) + 6px); width: auto; }
	.manual-progress { width: 100%; justify-content: space-between; }
}
@media (min-width: 900px) {
	.filters__toggle { display: none; }
}
@media (hover: none) {
	.rail__btn { display: none !important; }
	.card__play { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .site-footer, .bottom-nav, .player, .toasts { display: none !important; }
	body { background: #fff; color: #000; }
}
