/* ==========================================================================
   بيكا — Beika theme (Detective Conan platform)
   «Case file» identity: night-blue/black, evidence red and agency blue, dossier labels.
   RTL-first; logical properties everywhere so LTR also works.
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL — see assets/fonts/OFL.txt) ---------- */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/ibm-plex-sans-arabic-arabic-400-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: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 500 600; src: url(../fonts/ibm-plex-sans-arabic-arabic-500-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: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 700; src: url(../fonts/ibm-plex-sans-arabic-arabic-700-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: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/ibm-plex-sans-arabic-latin-400-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; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 500 600; src: url(../fonts/ibm-plex-sans-arabic-latin-500-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; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 700; src: url(../fonts/ibm-plex-sans-arabic-latin-700-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; }
@font-face { font-family: "Noto Kufi Arabic"; font-style: normal; font-display: swap; font-weight: 400 800; src: url(../fonts/noto-kufi-arabic-arabic-wght-normal.woff2) format("woff2-variations"), url(../fonts/noto-kufi-arabic-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: "Noto Kufi Arabic"; font-style: normal; font-display: swap; font-weight: 400 800; src: url(../fonts/noto-kufi-arabic-latin-wght-normal.woff2) format("woff2-variations"), url(../fonts/noto-kufi-arabic-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: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--font-head: "Noto Kufi Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
	--font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--bg: #05070d;
	--bg-rgb: 5 7 13;
	--bg-2: #0a0f1a;
	--surface: #0f1626;
	--surface-2: #152036;
	--surface-3: #1d2a44;
	--line: rgb(160 190 255 / .08);
	--line-2: rgb(160 190 255 / .14);
	--text: #eef2f8;
	--text-2: #b4bed0;
	--muted: #7a869c;
	--accent: #e0303f;
	--accent-2: #2f7cf6;
	--accent-rgb: 224 48 63;
	--accent-2-rgb: 47 124 246;
	--grad: linear-gradient(120deg, var(--accent), #b3122a);
	--grad-2: linear-gradient(120deg, var(--accent-2), #1b4fb8);
	--paper: #e9dcbf;
	--paper-ink: #2a2116;
	--gold: #f5c04a;
	--ok: #2bd38b;
	--info: #4aa8ff;
	--danger: #ff4d5e;
	--r-xs: 6px;
	--r-sm: 8px;
	--r: 12px;
	--r-lg: 18px;
	--r-pill: 999px;
	--shadow: 0 24px 60px -24px rgb(0 0 0 / .9);
	--shadow-sm: 0 8px 24px -12px rgb(0 0 0 / .85);
	--ease: cubic-bezier(.2, .8, .2, 1);
	--header-h: 64px;
	--wrap: 1440px;
	--gutter: clamp(16px, 4vw, 40px);
	--hero-h: min(78vh, 720px);
	--poster-w: clamp(132px, 15vw, 196px);
	--ep-w: clamp(240px, 26vw, 340px);
	color-scheme: dark;
}
.corners-sharp { --r-xs: 3px; --r-sm: 4px; --r: 5px; --r-lg: 7px; }

/* ---------- 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: 400;
	-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.35; margin: 0 0 .5em; font-weight: 700; letter-spacing: 0; font-family: var(--font-head); }
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); }
.notif { position: relative; }
.notif summary { list-style: none; cursor: pointer; }
.notif summary::-webkit-details-marker { display: none; }
.notif__btn { position: relative; }
.notif__badge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.notif__panel { position: absolute; inset-inline-end: -50px; top: calc(100% + 10px); width: 340px; max-height: min(70vh, 480px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; z-index: 70; animation: pop .15s var(--ease); }
.notif__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 14px; }
.notif__head a { color: var(--accent); font-size: 13px; }
.notif__item { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-sm); color: var(--text-2); position: relative; }
.notif__item:hover { background: rgb(255 255 255 / .06); color: #fff; }
.notif__item img, .notif__ph { flex: none; width: 42px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; }
.notif__txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; font-size: 13px; }
.notif__txt strong { color: var(--text); font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif__txt span { color: var(--muted); font-size: 12px; }
.notif__item.is-new::after { content: ""; position: absolute; inset-inline-end: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .25); }
.notif__empty { margin: 0; padding: 14px 10px; color: var(--muted); font-size: 13px; text-align: center; }
.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__quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 6px; margin-bottom: 14px; }
.drawer__quick a, .drawer__quick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
.drawer__quick .icon { width: 21px; height: 21px; }
.drawer__quick a:hover, .drawer__quick button:hover { background: var(--surface-2); color: #fff; }
.drawer__quick .is-active { color: #fff; border-color: rgb(var(--accent-rgb) / .55); background: rgb(var(--accent-rgb) / .14); }
.drawer__quick .is-active .icon { color: var(--accent); }
.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); }
.chip--status.is-hiatus { color: #ff9aa5; border-color: rgb(255 77 94 / .35); background: rgb(255 77 94 / .1); }
.chip--audio { color: #c9bcff; border-color: rgb(var(--accent-rgb) / .35); background: rgb(var(--accent-rgb) / .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--schedule::before { background: radial-gradient(closest-side, rgb(var(--accent-2-rgb) / .2), transparent), radial-gradient(closest-side at 15% 70%, rgb(var(--accent-rgb) / .16), transparent); }
.page-hero__links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.page-hero--cartoon::before { background: radial-gradient(closest-side, rgb(255 196 0 / .18), transparent), radial-gradient(closest-side at 15% 70%, rgb(var(--accent-rgb) / .14), 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)); }
body:not(:has(.bottom-nav)) .toasts { bottom: calc(20px + 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); } }

/* ---------- Weekly schedule ---------- */
.sched__days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.sched__days::-webkit-scrollbar { display: none; }
.sched__day { flex: 1 0 auto; min-width: 86px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 560; cursor: pointer; transition: border-color .15s, background .15s; }
.sched__day small { font-size: 12px; color: var(--muted); font-weight: 400; }
.sched__day:hover { border-color: var(--line-2); color: #fff; }
.sched__day.is-active { background: var(--grad); border-color: transparent; color: #fff; }
.sched__day.is-active small { color: rgb(255 255 255 / .85); }
.sched__day.is-today:not(.is-active) { border-color: rgb(var(--accent-rgb) / .6); }
.sched__title { font-size: 19px; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.sched.is-js .sched__panel { display: none; }
.sched.is-js .sched__panel.is-active { display: block; }
.sched.is-js .sched__title { display: none; }
.sched__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.sched-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.sched-item__time { flex: none; min-width: 58px; text-align: center; font-weight: 700; font-size: 15px; color: #fff; padding: 6px 8px; border-radius: var(--r-sm); background: rgb(var(--accent-rgb) / .14); border: 1px solid rgb(var(--accent-rgb) / .3); font-variant-numeric: tabular-nums; }
.sched-item__poster { flex: none; position: relative; width: 48px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.sched-item__poster img, .sched-item__poster .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 18px; }
.sched-item__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sched-item__title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-item__title:hover { color: #fff; }
.sched-item__meta { font-size: 13px; color: var(--muted); }
.sched-item__meta a { color: var(--text-2); }
.sched-item__meta a:hover { color: var(--accent); }
.sched-item__next { flex: none; }
.sched__empty, .sched__note { color: var(--muted); font-size: 14px; }
.sched__note { margin-top: 18px; }

/* ---------- Auto-next ---------- */
.autonext { position: absolute; z-index: 5; inset-inline-end: 14px; bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: rgb(var(--bg-rgb) / .92); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: pop .2s var(--ease); }
.autonext b { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- 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: minmax(0, 2fr) minmax(0, 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(390px, 104vw, 480px); }
	.hero__inner { padding-top: calc(var(--header-h) + 4px); padding-bottom: 40px; align-items: flex-end; }
	.hero__title { font-size: clamp(22px, 6.4vw, 32px); margin-bottom: 2px; }
	.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: none; width: 96px; margin: 0 auto 10px; 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 { object-position: center 20%; }
	.hero__actions { flex-wrap: nowrap; gap: 8px; }
	.hero__actions .btn { min-height: 44px; padding: 0 16px; font-size: 14px; white-space: nowrap; }
	.hero__actions .btn--icon { width: 44px; padding: 0; flex: none; }
	.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: 6px auto 14px; font-size: 13.5px; }
	.hero__dots { bottom: 16px; }
	.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; }
	.notif__panel { position: fixed; inset-inline: 12px; top: calc(var(--header-h) + 6px); width: auto; }
	.sched-item { gap: 10px; padding: 8px 10px; }
	.sched-item__next { display: none; }
	.manual-progress { width: 100%; justify-content: space-between; }
}
@media (min-width: 900px) {
	.filters__toggle { display: none; }
}
@media (max-width: 379px) {
	.hero__actions .btn--ghost:not(.btn--icon) { padding: 0 13px; }
	.hero__actions .btn--ghost:not(.btn--icon) > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@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; }
}

/* ==========================================================================
   Beika identity layer — «case file» components
   ========================================================================== */
body {
	background:
		radial-gradient(1200px 600px at 85% -10%, rgb(var(--accent-2-rgb) / .10), transparent 60%),
		radial-gradient(900px 500px at 0% 0%, rgb(var(--accent-rgb) / .07), transparent 55%),
		var(--bg);
	background-attachment: fixed;
}
body::before {
	content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background-image: radial-gradient(rgb(160 190 255 / .05) 1px, transparent 1px);
	background-size: 22px 22px;
	mask-image: linear-gradient(to bottom, #000, transparent 70%);
	-webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
.hero__title, .page-hero__title, .detail__title, .sec-head__title, .block-title, .watch__title { font-family: var(--font-head); }
.sec-head__title::before { width: 10px; height: 10px; border-radius: 2px; rotate: 45deg; translate: 0 -50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .16); }
.btn--primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent)); }
.btn--primary:hover { box-shadow: 0 14px 34px -10px rgb(var(--accent-rgb) / .85); }
.card__badge, .card__ep { background: var(--accent); }
.card__type .icon { color: var(--accent-2); }
.tag.is-active, .season-tabs a.is-active { background: var(--accent); }
.page-hero--file::after {
	content: "CASE FILE"; position: absolute; inset-inline-end: var(--gutter); bottom: 10px; z-index: -1;
	font: 800 clamp(40px, 9vw, 120px)/1 var(--font-mono); letter-spacing: .08em; color: rgb(255 255 255 / .03);
	pointer-events: none; direction: ltr;
}
.muted { color: var(--muted); }
.wrap--narrow { max-width: 900px; }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }

/* Block titles inside panels */
.block-title { display: flex; align-items: center; gap: 8px; font-size: clamp(16px, 1.6vw, 19px); margin: 22px 0 12px; }
.block-title .icon { color: var(--accent); }
.dossier-panel > .block-title:first-child { margin-top: 0; }

/* Stamps & labels */
.stamp {
	display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 2px solid currentColor; border-radius: 4px;
	font: 700 12px/1.4 var(--font-head); color: var(--paper); rotate: -3deg; letter-spacing: .02em; opacity: .9; text-transform: uppercase;
}
.stamp--red { color: #ff6b77; }
.stamp--blue { color: #7fb0ff; }

/* Facts (dl) */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; margin: 0 0 18px; }
.facts__item { padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent-2); }
.facts__item dt { font-size: 12.5px; color: var(--muted); }
.facts__item dd { margin: 0; font-weight: 600; }
.facts__item--canon { border-inline-start-color: var(--ok); }
.facts__item--filler { border-inline-start-color: var(--gold); }
.facts--grid { margin-top: 14px; }

/* Editor note & disclaimer */
.note-box { position: relative; margin: 0 0 18px; padding: 14px 16px 12px; border-radius: var(--r); background: linear-gradient(180deg, rgb(233 220 191 / .10), rgb(233 220 191 / .04)); border: 1px dashed rgb(233 220 191 / .35); }
.note-box__label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--paper); margin-bottom: 4px; }
.note-box p { margin: 0; color: var(--text-2); }
.disclaimer { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; margin: 0 0 22px; border-radius: var(--r); background: rgb(var(--accent-2-rgb) / .08); border: 1px solid rgb(var(--accent-2-rgb) / .3); color: var(--text-2); font-size: 14px; }
.disclaimer .icon { color: var(--accent-2); flex: none; margin-top: 3px; }
.disclaimer p { margin: 0; }

/* Spoilers */
.spoiler { margin: 0 0 18px; }
.spoiler__btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: var(--r); border: 1px dashed rgb(var(--accent-rgb) / .55); background: repeating-linear-gradient(-45deg, rgb(var(--accent-rgb) / .08) 0 12px, transparent 12px 24px); color: #ffb3ba; font-weight: 600; }
.spoiler__btn:hover { background-color: rgb(var(--accent-rgb) / .08); }
.spoiler__body { display: none; }
.spoiler.is-open .spoiler__btn { display: none; }
.spoiler.is-open .spoiler__body { display: block; animation: pop .2s var(--ease); }
.spoiler-inline { display: inline-block; padding: 1px 8px; border-radius: 6px; background: rgb(var(--accent-rgb) / .14); color: #ffb3ba; cursor: pointer; }
.is-spoiler .card__img, .is-spoiler .char-chip__img img { filter: blur(14px) grayscale(.6); transform: scale(1.1); }
.card__veil { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 10px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgb(var(--bg-rgb) / .45); }

/* User rating */
.urate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin: 0 0 18px; }
.urate__label { font-size: 13px; color: var(--muted); }
.urate__avg { font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; }
.urate__of { color: var(--muted); font-size: 13px; margin-inline-start: -6px; }
.urate__count { color: var(--muted); font-size: 13px; }
.urate__stars { display: inline-flex; direction: ltr; gap: 2px; }
[dir="rtl"] .urate__stars { direction: rtl; }
.urate__star { width: 26px; height: 26px; display: grid; place-items: center; color: rgb(255 255 255 / .25); border-radius: 6px; }
.urate__star .icon { width: 20px; height: 20px; }
.urate__star.is-on { color: var(--gold); }
.urate__star.is-on .icon { fill: currentColor; }
.urate__clear, .urate__login { font-size: 13px; color: var(--accent-2); }

/* Character chips */
.char-chips { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.char-chip a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.char-chip a:hover { border-color: rgb(var(--accent-2-rgb) / .6); }
.char-chip__img { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-3); }
.char-chip__img img, .char-chip__img .ph { width: 100%; height: 100%; object-fit: cover; font-size: 18px; }
.char-chip__text { min-width: 0; display: flex; flex-direction: column; }
.char-chip__text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-chip__text small { color: var(--muted); font-size: 12.5px; }

/* Character card */
.card--character .card__media { aspect-ratio: 3 / 4; border-radius: var(--r-lg); }
.card--character .card__title { text-align: center; }
.card--character .card__meta { text-align: center; }
.grid--chars { grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); }
.rail--chars .rail__track > * { width: clamp(120px, 13vw, 160px); }

/* Ordered steps (case parts, guides) */
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: s; }
.step { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.step:hover { border-color: rgb(var(--accent-rgb) / .5); }
.step__num { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgb(var(--accent-rgb) / .14); color: #ffb3ba; font-weight: 700; font-variant-numeric: tabular-nums; }
.steps--plain .step__num { display: none; }
.step.is-done .step__num { background: rgb(43 211 139 / .16); color: var(--ok); }
.step__link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.step__type { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent-2); }
.step__type .icon { width: 14px; height: 14px; }
.step__title { font-weight: 600; line-height: 1.45; }
.step__note { color: var(--muted); font-size: 13px; }
.step__seen { flex: none; font-size: 12px; color: var(--ok); }
.steps-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.steps-hint .icon { color: var(--ok); }
.order-hint { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.guide-mentions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.guide-mentions a { color: var(--accent-2); }

/* Dossier (case) cards */
.dossiers { display: grid; gap: 18px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.dossiers--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.dossier { position: relative; padding-top: 18px; }
.dossier__link { display: block; height: 100%; }
.dossier__tab {
	position: absolute; top: 0; inset-inline-start: 14px; z-index: 1; max-width: 75%;
	padding: 3px 14px 6px; border-radius: 8px 8px 0 0; background: var(--paper); color: var(--paper-ink);
	font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dossier__body {
	position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 14px; border-radius: var(--r);
	background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); border-top: 3px solid var(--paper);
	transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.dossier--arc .dossier__body, .dossier--story .dossier__body { border-top-color: var(--accent); }
.dossier--arc .dossier__tab, .dossier--story .dossier__tab { background: var(--accent); color: #fff; }
.dossier__link:hover .dossier__body { transform: translateY(-3px); border-color: rgb(var(--accent-rgb) / .5); box-shadow: var(--shadow-sm); }
.dossier__photo { display: block; margin: -4px -4px 4px; border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-3); }
.dossier__photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.05); }
.dossier__title { font-size: 16px; margin: 0; line-height: 1.45; }
.dossier__meta { color: var(--muted); font-size: 13px; }
.dossier__imp { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill); background: rgb(255 255 255 / .07); color: var(--text-2); }
.dossier__imp.is-main { background: rgb(var(--accent-rgb) / .16); color: #ffb3ba; }
.dossier__imp.is-major { background: rgb(var(--accent-2-rgb) / .16); color: #a9c8ff; }
.dossier .stamp { align-self: flex-start; margin-top: 4px; font-size: 11px; }
.arc { margin: 0 0 34px; }
.arc__head { margin-bottom: 14px; }
.arc__label { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 700; }
.arc__title { font-size: clamp(19px, 2vw, 24px); margin: 4px 0; }
.arc__desc { color: var(--text-2); margin: 0; max-width: 760px; }

/* Case page */
.case-file__grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.case-sheet { position: relative; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); border-top: 4px solid var(--paper); margin-bottom: 28px; }
.case-sheet__tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.case-sheet__photo { margin: 0 0 14px; border-radius: var(--r); overflow: hidden; }
.case-sheet__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.case-sheet__actions .urate { margin: 0; flex: 1; }
.case-file__side .box + .box { margin-top: 14px; }
.case-file__side .char-chips { grid-template-columns: 1fr; }
@media (min-width: 900px) { .case-file__grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .case-file__side { position: sticky; top: calc(var(--header-h) + 14px); } }

/* Character profile */
.file-card { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); margin-bottom: 28px; }
.file-card__photo { position: relative; margin: 0; width: min(60vw, 240px); justify-self: center; }
.file-card__photo img, .file-card__photo .ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); box-shadow: 0 0 0 6px var(--paper), var(--shadow); }
.file-card__photo .ph { font-size: 64px; }
.file-card__photo .stamp { position: absolute; bottom: 14px; inset-inline-end: -10px; background: var(--bg); }
.file-card__name { font-size: clamp(22px, 3vw, 32px); margin: 0 0 4px; }
.file-card__aka { color: var(--text-2); margin: 0 0 10px; }
.file-card__actions { margin-top: 10px; }
@media (min-width: 760px) { .file-card { grid-template-columns: 240px minmax(0, 1fr); } .file-card__photo { width: 100%; } }
.search-more { text-align: center; margin: 10px 0 30px; }

/* Guides */
.guide-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.guide-card__link { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.guide-card__link:hover { border-color: rgb(var(--accent-2-rgb) / .6); transform: translateY(-2px); }
.guide-card__icon { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgb(var(--accent-2-rgb) / .14); color: var(--accent-2); }
.guide-card__icon .icon { width: 26px; height: 26px; }
.guide-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.guide-card__kind { font-size: 12px; color: var(--accent-2); font-weight: 600; }
.guide-card__title { font-size: 16px; margin: 0; }
.guide-card__meta { font-size: 13px; color: var(--muted); }
.guide-card__go { color: var(--muted); }
[dir="ltr"] .guide-card__go { transform: scaleX(-1); }
.guide-page__actions { margin: 18px 0; }

/* Chapters */
.card--chapter .card__ep { background: var(--accent-2); }
.chapters-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.chapters-head .block-title { margin: 0; }
.chapters-tools { display: flex; gap: 8px; align-items: center; }
.chapters-tools input { height: 36px; width: 130px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); padding-inline: 14px; outline: none; }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.chapter-row a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.chapter-row a:hover { border-color: rgb(var(--accent-2-rgb) / .6); background: var(--surface-2); }
.chapter-row__n { flex: none; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.chapter-row__t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.chapter-row__m { flex: none; font-size: 12px; color: var(--muted); }
.chapter-row__s { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ok); }
.chapter-row__s .icon { width: 14px; height: 14px; }
.chapter-row.is-read .chapter-row__n { color: var(--muted); }
.volume-page { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); margin-bottom: 30px; }
.volume-page__cover { position: relative; margin: 0; width: min(60vw, 240px); justify-self: center; aspect-ratio: 2/3; border-radius: var(--r-lg); overflow: hidden; }
@media (min-width: 760px) { .volume-page { grid-template-columns: 240px minmax(0, 1fr); } .volume-page__cover { width: 100%; } }
.detail--manga .detail__body { margin-top: 28px; }

/* Reader */
.reader-head { padding-top: 10px; }
.reader-head__title { display: flex; flex-direction: column; gap: 2px; font-size: clamp(20px, 2.6vw, 30px); margin: 4px 0 8px; }
.reader-head__title a { font-size: .6em; color: var(--accent-2); }
.reader { position: relative; margin: 16px 0 30px; background: #000; }
.reader__bar { position: sticky; top: var(--header-h); z-index: 30; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 8px var(--gutter); background: rgb(var(--bg-rgb) / .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-block: 1px solid var(--line); }
.reader__group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reader__select { height: 36px; max-width: 46vw; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); padding-inline: 12px; }
.reader__count { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 14px; }
.reader__progress { position: sticky; top: calc(var(--header-h) + 53px); z-index: 29; height: 3px; background: rgb(255 255 255 / .08); }
.reader__progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.reader__resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 12px; background: rgb(var(--accent-2-rgb) / .12); border-bottom: 1px solid rgb(var(--accent-2-rgb) / .3); }
.reader__pages { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; outline: none; --zoom: 1; }
.reader__page { position: relative; margin: 0; width: min(100%, calc(900px * var(--zoom))); background: #111; }
.reader__page img { display: block; width: 100%; height: auto; }
.reader__num { position: absolute; bottom: 6px; inset-inline-end: 8px; padding: 2px 8px; border-radius: 6px; background: rgb(0 0 0 / .6); font-size: 12px; color: rgb(255 255 255 / .7); opacity: 0; transition: opacity .2s; }
.reader__page:hover .reader__num { opacity: 1; }
.reader__page.is-broken { min-height: 260px; display: grid; place-items: center; }
.reader__page.is-broken img { opacity: 0; }
.reader__retry { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; }
.reader[data-mode="paged"] .reader__page { display: none; }
.reader[data-mode="paged"] .reader__page.is-current { display: block; }
.reader[data-mode="paged"] .reader__pages { min-height: calc(100vh - var(--header-h) - 60px); justify-content: center; }
.reader[data-mode="paged"][data-fit="height"] .reader__page.is-current { width: auto; }
.reader[data-mode="paged"][data-fit="height"] .reader__page img { width: auto; max-width: 100%; max-height: calc((100vh - var(--header-h) - 70px) * var(--zoom)); margin-inline: auto; }
.reader[data-mode="vertical"][data-fit="height"] .reader__page img { width: auto; max-width: 100%; max-height: calc(100vh - var(--header-h) - 70px); margin-inline: auto; }
.reader__zone { position: absolute; top: 0; bottom: 0; width: 22%; z-index: 2; background: transparent; }
.reader__zone--prev { inset-inline-start: 0; cursor: w-resize; }
.reader__zone--next { inset-inline-end: 0; cursor: e-resize; }
.reader[data-dir="rtl"] .reader__zone--next { inset-inline-end: auto; inset-inline-start: 0; }
.reader[data-dir="rtl"] .reader__zone--prev { inset-inline-start: auto; inset-inline-end: 0; }
.reader__end { padding: 26px var(--gutter) 30px; text-align: center; background: var(--bg-2); border-top: 1px solid var(--line); }
.reader__end-title { font: 700 18px var(--font-head); margin-bottom: 12px; }
.reader__end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.reader__keys { color: var(--muted); font-size: 12.5px; margin: 16px 0 0; }
.reader:fullscreen { overflow-y: auto; background: #000; }
.reader:fullscreen .reader__bar { top: 0; }
.reader:fullscreen .reader__progress { top: 53px; }
[data-reader-dir] .icon { transition: transform .2s; }
.reader[data-dir="ltr"] [data-reader-dir] .icon { transform: scaleX(-1); }

/* Timeline (latest additions) */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.timeline__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.timeline__icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgb(var(--accent-2-rgb) / .12); color: var(--accent-2); }
.timeline__link { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.timeline__link strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline__type { font-size: 12px; color: var(--muted); }
.timeline__time { flex: none; font-size: 12px; color: var(--muted); }

/* Quick links & big search */
.quicklinks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.quicklink { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-weight: 600; transition: border-color .2s, transform .2s var(--ease); }
.quicklink:hover { border-color: rgb(var(--accent-rgb) / .6); transform: translateY(-2px); }
.quicklink .icon { color: var(--paper); }
.bigsearch { padding: clamp(16px, 3vw, 26px); border-radius: var(--r-lg); background: linear-gradient(135deg, rgb(var(--accent-2-rgb) / .14), rgb(var(--accent-rgb) / .08)), var(--surface); border: 1px solid var(--line-2); }
.bigsearch__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bigsearch__icon { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: rgb(var(--accent-2-rgb) / .2); color: #a9c8ff; }
.bigsearch__icon .icon { width: 28px; height: 28px; }
.bigsearch__title { font-size: clamp(18px, 2vw, 22px); margin: 0; }
.bigsearch__sub { margin: 0; color: var(--text-2); font-size: 14px; }
.bigsearch__row { display: flex; flex-wrap: wrap; gap: 8px; }
.bigsearch__row input { flex: 1 1 260px; height: 50px; border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--line-2); padding-inline: 18px; outline: none; font-size: 16px; }
.bigsearch__row input:focus { border-color: rgb(var(--accent-2-rgb) / .7); }
.bigsearch__row select { height: 50px; border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--line-2); padding-inline: 14px; }
.bigsearch__row .btn { height: 50px; }

/* Unified search */
.type-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 18px; padding-bottom: 2px; }
.type-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; color: var(--text-2); font-size: 14px; }
.type-tab span { font-size: 12px; padding: 1px 7px; border-radius: 99px; background: rgb(255 255 255 / .08); }
.type-tab.is-active { background: var(--accent); color: #fff; border-color: transparent; }
.filter-input { width: 100%; height: 42px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line-2); padding-inline: 12px; outline: none; }
.filter-actions { display: flex; gap: 10px; align-items: center; margin: 16px 0 0; }
.filters__count { margin: 0 0 12px; color: var(--muted); }
.grid--mixed .grid__wide, .grid .grid__wide { grid-column: 1 / -1; }
.grid__wide .card--episode { max-width: 560px; }
.grid__wide .card--episode .card__link { display: flex; gap: 12px; align-items: center; }
.grid__wide .card--episode .card__media { width: 180px; flex: none; }
.grid__wide .card--news .card__link { display: flex; gap: 12px; align-items: center; }
.grid__wide .card--news .card__media { width: 180px; flex: none; aspect-ratio: 16 / 9; }

/* News */
.card--news .card__media { aspect-ratio: 16 / 9; }
.filter-tags { margin: 0 0 18px; }
.filter-tags small { opacity: .6; }

/* Profile & privacy */
.profile-hero__inner { display: flex; align-items: center; gap: 18px; }
.profile-hero__avatar { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 0 0 4px var(--paper); }
.rated-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rated-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.privacy-box { margin: 16px 0; padding: 14px; border-radius: var(--r); border: 1px solid var(--line-2); }
.privacy-box legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: 600; }
.privacy-box .check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 14px; color: var(--text-2); }
.privacy-box .check input { margin-top: 5px; }
.history__thumb--poster { aspect-ratio: 2 / 3 !important; width: 64px !important; }
