:root {
  --nc-primary: #ffd500;
  --nc-secondary: #ff9800;
  --nc-bg: #121212;
  --nc-surface: #1b1b1b;
  --nc-surface-raised: #242424;
  --nc-line: rgba(255, 255, 255, .11);
  --nc-text: #e0e0e0;
  --nc-muted: #a8a8a8;
  --rose: var(--nc-primary);
  --pink: var(--nc-primary);
  --gold: #ffd500;
  --ink: var(--nc-bg);
  --panel: var(--nc-surface);
  --text: var(--nc-text);
  --muted: var(--nc-muted);
}

* { letter-spacing: 0; }

html {
  background: var(--nc-bg);
  color-scheme: dark;
  scrollbar-color: var(--nc-primary) #15181d;
}

body {
  min-width: 320px;
  background: var(--nc-bg);
  color: var(--nc-text);
  font-family: "Tajawal", sans-serif;
}

body::before,
body::after { display: none !important; }

a { color: inherit; }

.site-shell { min-height: 100vh; }

.cinema-topbar {
  width: 100%;
  height: 68px;
  padding: 0 clamp(18px, 3.2vw, 54px);
  border: 0;
  border-bottom: 1px solid var(--nc-line);
  border-radius: 0;
  background: rgba(9, 11, 14, .94);
  box-shadow: none;
  backdrop-filter: blur(14px);
  grid-template-columns: 260px minmax(440px, 1fr) 220px;
  grid-template-areas: "brand nav search";
}

.nc-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--nc-text);
}
.brand-full { grid-area: brand; justify-self: end; }
.brand-mini { display: none !important; grid-area: brand; justify-self: end; }
.main-nav { grid-area: nav; }
.smart-search { grid-area: search; }

.nc-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--nc-primary) 70%, white 10%);
  border-radius: 6px;
  background: var(--nc-primary);
  color: #fff;
  font: 800 12px/1 "Tajawal", sans-serif;
}

.nc-brand-copy { display: grid; line-height: 1; }
.nc-brand-copy strong { font-size: 1rem; font-weight: 800; }
.nc-brand-copy small { margin-top: 5px; color: var(--nc-secondary); font: 700 9px/1 sans-serif; }
.brand-full img, .brand-mini img { display: none !important; }

.main-nav { height: 100%; gap: 4px; }
.main-nav .nav-link {
  min-width: auto;
  height: 100%;
  padding: 0 14px;
  border-radius: 0;
  color: var(--nc-muted);
  font-size: .87rem;
  font-weight: 700;
}
.main-nav .nav-link::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 2px;
  background: transparent;
}
.main-nav .nav-link:hover,
.main-nav .nav-link.active { color: var(--nc-text); background: transparent; }
.main-nav .nav-link:hover::after,
.main-nav .nav-link.active::after { background: var(--nc-primary); }
.nav-icon { width: 19px; height: 19px; stroke-width: 1.7; }

.smart-search {
  width: min(260px, 22vw);
  height: 38px;
  border: 1px solid var(--nc-line);
  border-radius: 6px;
  background: var(--nc-surface);
}
.smart-search:focus-within { border-color: color-mix(in srgb, var(--nc-primary) 70%, white 5%); }
.smart-search input { color: var(--nc-text); font-size: .85rem; }
.smart-search button {
  width: 34px;
  height: 32px;
  border-radius: 4px;
  background: transparent;
  color: var(--nc-secondary);
}

.cinema-main { width: 100%; padding-top: 0; }

.hero-carousel {
  width: 100%;
  max-width: none;
  min-height: clamp(440px, 62vh, 620px);
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #0d1014;
  box-shadow: none;
}

.hero-slide { min-height: inherit; border-radius: 0; }
.hero-bg { filter: none; transform: none; opacity: .68; background-position: center 22%; }
.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(9,11,14,.16) 0%, rgba(9,11,14,.68) 55%, #090b0e 100%),
              linear-gradient(0deg, #090b0e 0%, transparent 44%);
}
.hero-slide::after { display: none; }

.hero-content {
  width: min(1380px, 100%);
  min-height: inherit;
  margin: auto;
  padding: clamp(46px, 7vw, 100px) clamp(22px, 5vw, 74px) 66px;
  align-items: center;
  gap: clamp(30px, 5vw, 76px);
}
.hero-copy { max-width: 700px; }
.hero-copy h1 {
  max-width: 14ch;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.04;
  font-weight: 900;
  text-wrap: balance;
}
.hero-copy p {
  max-width: 62ch;
  color: #d3d7dd;
  font-size: clamp(.95rem, 1.2vw, 1.1rem);
  line-height: 1.9;
}
.hero-meta { gap: 8px; }
.hero-meta span,
.taxonomy-badge {
  min-height: 27px;
  padding: 5px 10px;
  border: 1px solid var(--nc-line);
  border-radius: 4px;
  background: rgba(9, 11, 14, .72);
  color: #dfe3e8;
  font-size: .76rem;
}
.hero-meta span:nth-child(2) { color: var(--gold); }

.hero-actions { gap: 10px; }
.hero-btn {
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--nc-line);
  border-radius: 5px;
  font-size: .87rem;
  font-weight: 800;
}
.hero-btn.primary { border-color: var(--nc-primary); background: var(--nc-primary); color: #fff; box-shadow: none; }
.hero-btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hero-btn.ghost { background: rgba(17, 20, 25, .78); color: var(--nc-text); }

.hero-poster {
  width: clamp(210px, 22vw, 320px);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  box-shadow: 0 22px 55px rgba(0,0,0,.38);
}
.hero-poster img { border-radius: 7px; }
.hero-dots { bottom: 25px; gap: 7px; }
.hero-dots button { width: 22px; height: 3px; border-radius: 0; background: rgba(255,255,255,.35); }
.hero-dots button.active { width: 42px; background: var(--nc-primary); }

.content-row,
.episode-section,
.parts-strip {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 3.2vw, 48px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.row-head { margin-bottom: 16px; }
.row-head h2 { font-size: clamp(1.2rem, 2vw, 1.65rem); font-weight: 800; }
.row-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  margin-left: 9px;
  border-radius: 1px;
  background: var(--nc-primary);
  vertical-align: -4px;
}
.row-head a { color: var(--nc-secondary); font-size: .82rem; }

.poster-rail { gap: 15px; padding: 7px 1px 15px; scroll-padding-inline: 1px; }
.poster-rail::-webkit-scrollbar,
.episode-rail::-webkit-scrollbar { height: 5px; }
.poster-rail::-webkit-scrollbar-thumb,
.episode-rail::-webkit-scrollbar-thumb { background: #4b525c; border-radius: 2px; }
.title-card { width: clamp(138px, 12vw, 184px); gap: 8px; overflow: visible; }
.title-card.large { width: 100%; }
.poster-frame {
  border: 1px solid var(--nc-line);
  border-radius: 7px;
  background: var(--nc-surface);
  overflow: hidden;
  box-shadow: none;
}
.poster-frame img { border-radius: 6px; transition: transform .22s ease, filter .22s ease; }
.title-card:hover { transform: translateY(-5px); }
.title-card:hover .poster-frame { border-color: color-mix(in srgb, var(--nc-primary) 68%, white 4%); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.title-card:hover .poster-frame img { transform: scale(1.025); filter: brightness(1.06); }
.card-glow { display: none; }
.poster-stats {
  inset: auto 0 0;
  min-height: 24px;
  padding: 5px 7px;
  border-radius: 0;
  background: rgba(5, 7, 9, .88);
  backdrop-filter: none;
  font-size: .69rem;
}
.poster-stats b:last-child { color: var(--gold); }
.title-card > strong {
  margin: 0;
  padding: 0 2px;
  color: #e9ebee;
  font-size: .88rem;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.listing-page { width: min(1460px, 100%); margin: 0 auto; padding: 30px clamp(18px, 3.2vw, 48px) 70px; }
.listing-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 16px; }
.catalog-filter-bar,
.anime-kind-toggle {
  border: 1px solid var(--nc-line);
  border-radius: 7px;
  background: var(--nc-surface);
  box-shadow: none;
}
.catalog-filter-menu { border-color: var(--nc-line); border-radius: 6px; background: #171b21; box-shadow: 0 18px 40px rgba(0,0,0,.42); }
.catalog-filter-menu button.active,
.anime-kind-option.active { background: var(--nc-primary); color: #fff; }

.title-hero {
  min-height: 520px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0c0f13;
}
.title-backdrop { opacity: .42; filter: none; transform: none; }
.title-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, transparent 0%, rgba(9,11,14,.62) 56%, #090b0e 100%), linear-gradient(0deg, #090b0e, transparent 55%);
}
.title-hero::after { display: none; }
.title-layout { width: min(1320px, 100%); min-height: 520px; margin: auto; padding: 48px clamp(20px, 5vw, 72px); gap: clamp(28px, 4vw, 58px); }
.title-poster { width: clamp(220px, 23vw, 330px); border: 1px solid var(--nc-line); border-radius: 8px; box-shadow: 0 20px 45px rgba(0,0,0,.38); }
.title-poster img { border-radius: 7px; }
.title-info h1 { max-width: 18ch; color: #fff; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.08; }
.taxonomy-badges { gap: 6px; }
.taxonomy-badge.language { border-color: color-mix(in srgb, var(--nc-secondary) 45%, transparent); color: #a9eee4; }
.title-story { max-width: 74ch; color: #c2c7ce; line-height: 1.9; }

.parts-tabs { gap: 7px; }
.content-part-tab { border: 1px solid var(--nc-line); border-radius: 5px; background: var(--nc-surface); color: var(--nc-muted); }
.content-part-tab.active { border-color: var(--nc-primary); background: var(--nc-primary); color: #fff; }
.episode-rail { gap: 13px; grid-auto-columns: 230px; }
.episode-card { border-radius: 7px; background: var(--nc-surface); }

.watch-page { width: min(1420px, 100%); padding: 28px clamp(14px, 3vw, 42px) 70px; }
.watch-head { margin-bottom: 16px; }
.watch-head h1 { font-size: clamp(1.15rem, 2vw, 1.55rem); }
.back-link { border: 1px solid var(--nc-line); border-radius: 5px; background: var(--nc-surface); }
.player-card {
  border: 1px solid var(--nc-line);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 18px 50px rgba(0,0,0,.32);
  overflow: hidden;
}
.player-card video,
.plyr,
.plyr__video-wrapper { border-radius: 7px; }
.plyr { --plyr-color-main: var(--nc-primary); }

.ahiru-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 18px clamp(18px, 4vw, 58px);
  border-top: 1px solid var(--nc-line);
  background: #080a0d;
  color: var(--nc-muted);
  font-size: .8rem;
}
.ahiru-footer strong { color: var(--nc-text); }

@media (max-width: 900px) {
  body { padding-bottom: calc(67px + env(safe-area-inset-bottom)); }
  .cinema-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 58px;
    padding: 0 13px;
    gap: 10px;
    display: flex;
    flex-direction: row;
  }
  .brand-full { display: none !important; }
  .brand-mini { display: inline-flex !important; flex: 0 0 auto; order: 0; }
  .nc-brand-mark { width: 34px; height: 34px; font-size: 10px; }
  .main-nav { display: none !important; }
  .smart-search { flex: 1 1 auto; width: auto; max-width: 330px; height: 36px; margin-inline-start: auto; order: 1; }
  .mobile-bottom-nav {
    display: grid;
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(63px + env(safe-area-inset-bottom));
    padding: 5px 4px env(safe-area-inset-bottom);
    border: 0;
    border-top: 1px solid var(--nc-line);
    border-radius: 0;
    background: rgba(9, 11, 14, .97);
    box-shadow: 0 -8px 30px rgba(0,0,0,.28);
    backdrop-filter: blur(14px);
  }
  .mobile-bottom-nav .nav-link { min-width: 0; gap: 3px; border-radius: 5px; color: var(--nc-muted); font-size: .64rem; }
  .mobile-bottom-nav .nav-link.active { background: color-mix(in srgb, var(--nc-primary) 16%, transparent); color: #fff; }
  .mobile-bottom-nav .nav-icon { width: 20px; height: 20px; }
  .hero-carousel { min-height: 480px; }
  .hero-bg { opacity: .56; background-position: center top; }
  .hero-slide::before { background: linear-gradient(0deg, #090b0e 0%, rgba(9,11,14,.2) 72%), linear-gradient(90deg, transparent, rgba(9,11,14,.38)); }
  .hero-content { min-height: 480px; padding: 150px 20px 50px; align-items: end; }
  .hero-poster { display: none; }
  .hero-copy { width: 100%; max-width: 620px; text-align: right; }
  .hero-copy h1 { max-width: 15ch; font-size: clamp(2rem, 10vw, 3.1rem); }
  .hero-copy p { max-width: 44ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-dots { bottom: 22px; }
  .content-row, .episode-section, .parts-strip { padding: 22px 14px; }
  .poster-rail { gap: 11px; }
  .title-card { width: 132px; }
  .listing-page { padding: 20px 13px 52px; }
  .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; }
  .title-layout { min-height: auto; padding: 28px 16px 44px; grid-template-columns: 1fr; justify-items: center; }
  .title-poster { width: min(54vw, 250px); }
  .title-info { width: 100%; text-align: center; }
  .title-info h1 { margin-inline: auto; font-size: clamp(1.7rem, 8vw, 2.5rem); }
  .title-meta, .taxonomy-badges, .title-info .hero-actions { justify-content: center; }
  .title-story { text-align: right; font-size: .9rem; }
  .watch-page { padding: 14px 0 44px; }
  .watch-head { padding: 0 13px; }
  .player-card { border-inline: 0; border-radius: 0; }
  .player-card video, .plyr, .plyr__video-wrapper { border-radius: 0; }
  .watch-page .parts-strip, .watch-page .episode-section { padding-inline: 13px; }
  .ahiru-footer { display: none; }
}

@media (max-width: 430px) {
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
  .title-card { width: 124px; }
  .hero-actions .hero-btn { flex: 1 1 auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Ahiru identity: warm cinema contrast and calm dark surfaces. */
:root { --ahiru-shadow: 0 16px 38px rgba(0, 0, 0, .24); --ahiru-focus: 0 0 0 3px color-mix(in srgb, var(--nc-primary) 34%, transparent); }

.cinema-topbar { height: 76px; padding-inline: clamp(16px, 4vw, 64px); grid-template-columns: 250px minmax(380px, 1fr) minmax(260px, 320px); background: rgba(18, 18, 18, .91); }
.nc-brand { gap: 11px; }
.brand-full img.ahiru-brand-logo, .brand-mini img.ahiru-brand-logo { display: block !important; width: 132px; height: 64px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(255, 152, 0, .16)); }
.nc-brand-copy { gap: 3px; }
.nc-brand-copy strong { color: var(--nc-text); font-family: "Cairo", "Tajawal", sans-serif; font-size: 1.18rem; font-weight: 900; letter-spacing: -.03em; }
.nc-brand-copy small { color: var(--nc-secondary); font-size: .56rem; letter-spacing: .16em; }
.topbar-actions { grid-area: search; display: flex; align-items: center; justify-content: flex-start; gap: 9px; }
.theme-toggle { display: grid; flex: 0 0 auto; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--nc-line); border-radius: 50%; background: var(--nc-surface); color: var(--nc-primary); cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.theme-toggle:hover { border-color: var(--nc-primary); background: color-mix(in srgb, var(--nc-primary) 12%, var(--nc-surface)); transform: rotate(12deg); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ahiru-focus); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.theme-icon-moon { display: none; }
.smart-search { width: 100%; max-width: 260px; border-radius: 999px; background: var(--nc-surface); }
.smart-search input { padding-inline: 14px 4px; }
.smart-search button { margin-inline-start: 2px; border-radius: 50%; background: color-mix(in srgb, var(--nc-primary) 16%, transparent); color: var(--nc-primary); }
.main-nav { gap: 3px; }
.main-nav .nav-link { padding-inline: 15px; }
.main-nav .nav-link:hover, .main-nav .nav-link.active { color: var(--nc-primary); }
.main-nav .nav-link:hover::after, .main-nav .nav-link.active::after { height: 3px; border-radius: 3px 3px 0 0; }
.hero-carousel { min-height: clamp(470px, 65vh, 660px); }
.hero-copy h1 { text-shadow: 0 4px 24px rgba(0,0,0,.42); }
.hero-btn { border-radius: 999px; padding-inline: 22px; }
.hero-btn.primary { border-color: var(--nc-primary); background: var(--nc-primary); color: #202020; box-shadow: 0 8px 24px color-mix(in srgb, var(--nc-primary) 22%, transparent); }
.hero-btn.ghost { border-color: rgba(255,255,255,.23); }
.hero-poster { border-radius: 16px; box-shadow: var(--ahiru-shadow); transform: rotate(-1.5deg); }
.hero-poster img { border-radius: 15px; }
.hero-dots button.active { background: var(--nc-primary); }
.content-row, .episode-section, .parts-strip { padding-block: 32px; }
.row-head h2::before { width: 5px; height: 25px; border-radius: 999px; background: linear-gradient(var(--nc-primary), var(--nc-secondary)); }
.row-head a { color: var(--nc-primary); font-weight: 800; }
.poster-rail { gap: 17px; }
.poster-frame { border-radius: 13px; background: var(--nc-surface); box-shadow: 0 7px 18px rgba(0,0,0,.13); }
.poster-frame img { border-radius: 12px; }
.title-card:hover .poster-frame { border-color: var(--nc-primary); box-shadow: 0 14px 28px rgba(0,0,0,.28); }
.poster-stats { background: linear-gradient(transparent, rgba(0,0,0,.88)); padding-top: 16px; }
.listing-grid { gap: 30px 18px; }
.catalog-filter-bar, .anime-kind-toggle { border-radius: 14px; background: var(--nc-surface); box-shadow: var(--ahiru-shadow); }
.catalog-filter-menu { border-radius: 12px; background: var(--nc-surface-raised); }
.catalog-filter-menu button.active, .anime-kind-option.active, .content-part-tab.active { background: var(--nc-primary); border-color: var(--nc-primary); color: #212121; }
.title-poster { border-radius: 16px; box-shadow: var(--ahiru-shadow); }
.title-poster img { border-radius: 15px; }
.title-info .hero-actions .hero-btn.primary { color: #212121; }
.content-part-tab, .back-link { border-radius: 999px; }
.episode-card { border: 1px solid var(--nc-line); border-radius: 13px; background: var(--nc-surface); overflow: hidden; }
.player-card { border-color: rgba(255, 213, 0, .34); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.36); }
.player-card video, .plyr, .plyr__video-wrapper { border-radius: 15px; }
.ahiru-footer { background: var(--nc-surface); }
@media (max-width: 900px) {
  .cinema-topbar { height: 64px; padding-inline: 12px; }
  .brand-full img.ahiru-brand-logo, .brand-mini img.ahiru-brand-logo { width: 98px; height: 48px; }
  .topbar-actions { flex: 1 1 auto; justify-content: flex-start; gap: 7px; }
  .theme-toggle { width: 35px; height: 35px; }
  .smart-search { flex: 1 1 auto; max-width: none; }
  .mobile-bottom-nav { background: rgba(18,18,18,.96); }
  .mobile-bottom-nav .nav-link.active { color: #202020; background: var(--nc-primary); }
  .hero-poster { transform: none; }
  .hero-btn.primary { color: #202020; }
  .poster-frame { border-radius: 11px; }
  .poster-frame img { border-radius: 10px; }
  .player-card { border-radius: 0; }
}

/* Ahiru visual refresh: one warm identity, softer surfaces, and clean edge-free controls. */
:root {
  --rose-2: var(--nc-primary);
  --violet: var(--nc-secondary);
  --soft: #ffe86f;
  --ahiru-glow: 0 12px 34px color-mix(in srgb, var(--nc-primary) 12%, transparent);
  --ahiru-ease: cubic-bezier(.2, .8, .2, 1);
}

body {
  background:
    radial-gradient(circle at 82% -12%, color-mix(in srgb, var(--nc-primary) 8%, transparent), transparent 31rem),
    var(--nc-bg);
}

.cinema-topbar,
.smart-search,
.theme-toggle,
.hero-carousel,
.hero-poster,
.title-poster,
.hero-btn,
.poster-frame,
.catalog-filter-bar,
.catalog-filter-menu,
.anime-kind-toggle,
.taxonomy-badge,
.content-part-tab,
.episode-card,
.episode-thumb,
.back-link,
.player-card,
.history-card,
.history-clear,
.empty-state,
.page-transition-card { border: 0 !important; }

.nav-link,
.theme-toggle,
.smart-search,
.smart-search button,
.hero-btn,
.title-card,
.poster-frame,
.episode-card,
.content-part-tab,
.catalog-filter-menu button,
.anime-kind-option,
.back-link {
  transition: color .22s var(--ahiru-ease), background-color .22s var(--ahiru-ease), transform .22s var(--ahiru-ease), box-shadow .22s var(--ahiru-ease), opacity .22s var(--ahiru-ease);
}

.cinema-topbar {
  height: 76px;
  background: color-mix(in srgb, var(--nc-bg) 90%, transparent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .16);
}
.brand-full { height: 76px; overflow: visible; }
.brand-full img.ahiru-brand-logo {
  width: 178px;
  height: 94px;
  max-width: none;
  filter: drop-shadow(0 7px 14px color-mix(in srgb, var(--nc-secondary) 18%, transparent));
}
.main-nav .nav-link { color: var(--nc-muted); }
.main-nav .nav-link .nav-icon { color: var(--nc-primary); opacity: .78; }
.main-nav .nav-link:hover .nav-icon,
.main-nav .nav-link.active .nav-icon { opacity: 1; transform: translateY(-1px); }
.main-nav .nav-link:hover,
.main-nav .nav-link.active { color: var(--nc-primary); }

.theme-toggle {
  background: color-mix(in srgb, var(--nc-primary) 12%, var(--nc-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nc-primary) 14%, transparent);
}
.smart-search {
  background: color-mix(in srgb, var(--nc-surface) 95%, var(--nc-primary) 5%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nc-primary) 10%, transparent);
}
.smart-search:focus-within { box-shadow: var(--ahiru-focus); }
.smart-search button { display: grid; place-items: center; background: transparent; color: var(--nc-primary); }
.smart-search button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.hero-btn.primary,
.catalog-filter-menu button.active,
.anime-kind-option.active,
.content-part-tab.active {
  background: linear-gradient(135deg, var(--nc-primary), color-mix(in srgb, var(--nc-primary) 74%, var(--nc-secondary)));
  color: #211d08;
  box-shadow: var(--ahiru-glow);
}
.hero-btn.ghost,
.content-part-tab,
.back-link { background: color-mix(in srgb, var(--nc-surface) 88%, transparent); }
.hero-btn:hover,
.content-part-tab:hover,
.back-link:hover { transform: translateY(-2px); box-shadow: var(--ahiru-glow); }

.poster-frame,
.episode-card,
.history-card {
  background: var(--nc-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .17);
}
.title-card:hover .poster-frame,
.episode-card:hover { box-shadow: 0 16px 38px rgba(0, 0, 0, .28), var(--ahiru-glow); }
.title-card > strong { color: var(--nc-text); }
.poster-stats b:last-child,
.row-head a,
.watch-head span { color: var(--nc-primary); }
.poster-rail::-webkit-scrollbar-thumb,
.episode-rail::-webkit-scrollbar-thumb { background: var(--nc-primary); }

.episode-card { overflow: hidden; border-radius: 14px; }
.episode-thumb { border-radius: 14px 14px 0 0; box-shadow: none; }
.episode-thumb::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 42% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .86));
  pointer-events: none;
}
.episode-thumb b { z-index: 2; }
.episode-number-badge {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 9px;
  min-height: 27px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--nc-primary);
  color: #211d08;
  font-size: .74rem;
  font-weight: 900;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}
.episode-line { margin: 0; padding: 10px 11px 12px; color: var(--nc-text); }
.episode-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-card.active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-primary) 82%, transparent), var(--ahiru-glow); }

.player-card { box-shadow: 0 24px 64px rgba(0, 0, 0, .38), var(--ahiru-glow); }
.cute-spinner,
.catalog-loader { border-color: color-mix(in srgb, var(--nc-primary) 22%, transparent) !important; border-top-color: var(--nc-primary) !important; }
.history-clear,
.history-continue { background: color-mix(in srgb, var(--nc-primary) 16%, var(--nc-surface)); color: var(--nc-primary); }
.progress-fill { background: linear-gradient(90deg, var(--nc-primary), var(--nc-secondary)); }


@media (max-width: 900px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .cinema-topbar {
    display: grid !important;
    grid-template-columns: 82px minmax(0, 1fr) 36px;
    grid-template-areas: "brand search theme";
    height: 64px;
    padding: 0 10px;
    gap: 8px;
    overflow: visible;
  }
  .brand-mini {
    grid-area: brand;
    width: 82px;
    height: 64px;
    justify-self: start;
    overflow: visible;
  }
  .brand-mini img.ahiru-brand-logo {
    width: 126px;
    height: 82px;
    max-width: none;
    margin-inline-start: -20px;
    filter: drop-shadow(0 5px 10px color-mix(in srgb, var(--nc-secondary) 16%, transparent));
  }
  .topbar-actions { display: contents !important; }
  .smart-search {
    grid-area: search;
    width: 100%;
    max-width: 430px;
    min-width: 0;
    height: 38px;
    margin: 0 auto;
    justify-self: center;
  }
  .smart-search input { min-width: 0; font-size: .8rem; }
  .theme-toggle { grid-area: theme; width: 36px; height: 36px; justify-self: end; }

  .mobile-bottom-nav {
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: calc(66px + env(safe-area-inset-bottom)) !important;
    padding: 6px 5px env(safe-area-inset-bottom) !important;
    gap: 3px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(105deg, var(--nc-primary), color-mix(in srgb, var(--nc-primary) 72%, var(--nc-secondary))) !important;
    box-shadow: 0 -10px 34px rgba(0, 0, 0, .24) !important;
  }
  .mobile-bottom-nav .nav-link {
    min-width: 0;
    padding: 5px 2px;
    border-radius: 15px;
    color: rgba(32, 29, 13, .72);
  }
  .mobile-bottom-nav .nav-link:hover,
  .mobile-bottom-nav .nav-link.active {
    background: rgba(28, 26, 16, .16);
    color: #18170f;
    transform: none;
  }
  .mobile-bottom-nav .nav-icon { width: 22px; height: 22px; color: currentColor; stroke-width: 1.9; }
  .mobile-bottom-nav .nav-link span:last-child { font-size: .67rem; font-weight: 900; }
  .player-card { border-radius: 0; box-shadow: 0 16px 42px rgba(0, 0, 0, .34); }
}

@media (max-width: 380px) {
  .cinema-topbar { grid-template-columns: 72px minmax(0, 1fr) 34px; gap: 5px; padding-inline: 7px; }
  .brand-mini { width: 72px; }
  .brand-mini img.ahiru-brand-logo { width: 112px; height: 76px; }
  .smart-search input { font-size: .74rem; padding-inline: 9px 2px; }
}

/* Ahiru UI4: keep every hero action inside the slide and clear of mobile chrome. */
.ahiru-footer { display: none !important; }
.hero-content { align-items: stretch; overflow: hidden; }
.hero-copy {
  align-self: stretch;
  min-height: 0;
  padding-block: clamp(34px, 5vh, 58px) 0;
  justify-content: flex-start;
}
.hero-copy h1 { flex: 0 0 auto; }
.hero-copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.hero-copy .hero-actions {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 22px;
  padding-bottom: 0;
}
.hero-poster { align-self: center; }
.hero-meta span:nth-child(2) {
  background: var(--nc-primary);
  color: #211d08 !important;
}

.brand-full { width: 250px; }
.brand-full img.ahiru-brand-logo {
  flex: 0 0 auto;
  width: 320px;
  height: 76px;
  max-width: none;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transform: translateX(60px);
}
.anime-torii-icon { stroke-width: 1.65 !important; }

.episode-number-badge {
  right: auto;
  left: 50%;
  bottom: 8px;
  min-width: 74px;
  background: rgba(255, 213, 0, .76);
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
}
.episode-duration-badge { background: rgba(18, 18, 18, .62); backdrop-filter: blur(5px); }

@media (max-width: 900px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .cinema-topbar {
    grid-template-columns: 130px minmax(0, 1fr);
    height: 64px;
  }
  .brand-mini { width: 130px; height: 64px; }
  .brand-mini img.ahiru-brand-logo {
    flex: 0 0 auto;
    width: 190px;
    height: 64px;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    transform: translateX(38px);
  }
  .hero-carousel,
  .hero-slide,
  .hero-content { min-height: 560px; }
  .hero-content {
    display: flex;
    align-items: stretch;
    padding: 122px 16px 68px;
  }
  .hero-copy {
    width: 100%;
    max-width: none;
    min-height: 370px;
    padding: 0;
    justify-content: flex-end;
    text-align: center;
  }
  .hero-copy h1 { max-width: 15ch; margin-inline: auto; text-align: center; }
  .hero-meta { justify-content: center; }
  .hero-copy p { margin-inline: auto; text-align: center; -webkit-line-clamp: 3; }
  .hero-copy .hero-actions {
    width: 100%;
    margin-top: 18px;
    padding: 0;
    justify-content: center;
  }
  .episode-duration-badge { display: none; }
  .episode-number-badge {
    bottom: 7px;
    min-width: 70px;
    padding: 4px 9px;
    background: rgba(255, 213, 0, .72);
  }
}

/* Loading feedback remains active even when the device reduces decorative motion. */
@keyframes ahiru-loader-turn { to { transform: rotate(1turn); } }
.catalog-loader {
  animation: ahiru-loader-turn .8s linear infinite !important;
  animation-play-state: running !important;
  will-change: transform;
}
.page-transition .cute-spinner {
  animation: ahiru-loader-turn 1.05s linear infinite !important;
  animation-play-state: running !important;
  will-change: transform;
}

@media (max-width: 380px) {
  .cinema-topbar { grid-template-columns: 118px minmax(0, 1fr); }
  .brand-mini { width: 118px; }
  .brand-mini img.ahiru-brand-logo { width: 180px; height: 62px; transform: translateX(35px); }
}

/* Ahiru UI6: keep hero actions visible even on short desktop viewports. */
@media (min-width: 901px) {
  .hero-content {
    position: absolute;
    inset: 0;
    height: 100%;
    min-height: 0;
    padding-block: clamp(28px, 4vh, 48px) 66px;
    grid-template-rows: minmax(0, 1fr);
  }
  .hero-copy {
    height: 100%;
    padding-block: 0;
    overflow: hidden;
  }
  .hero-copy .hero-actions {
    margin-top: auto;
    padding-top: 16px;
  }
  .hero-poster {
    width: auto;
    height: 100%;
    max-width: clamp(210px, 22vw, 320px);
    max-height: 100%;
    aspect-ratio: 2 / 3;
  }
  .hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* Ahiru 2026-09-13: dark-only shell, larger mark, predictive search and compact episodes. */
html {
  --nc-bg: #121212;
  --nc-surface: #1b1b1b;
  --nc-surface-raised: #242424;
  --nc-line: rgba(255, 255, 255, .09);
  --nc-text: #e5e5e5;
  --nc-muted: #aaa;
  color-scheme: dark;
}
.brand-full img.ahiru-brand-logo {
  width: 356px;
  height: 188px;
  transform-origin: right center;
}

.smart-search { position: relative; overflow: visible; }
.search-suggestions {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  right: 0;
  left: 0;
  min-width: min(360px, calc(100vw - 20px));
  padding: 7px;
  border-radius: 16px;
  background: rgba(27, 27, 27, .98);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .48), inset 0 0 0 1px rgba(255, 213, 0, .1);
  backdrop-filter: blur(18px);
}
.search-suggestions[hidden] { display: none !important; }
.search-suggestion {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 7px;
  border-radius: 11px;
  text-decoration: none;
}
.search-suggestion:hover,
.search-suggestion:focus-visible { background: color-mix(in srgb, var(--nc-primary) 12%, var(--nc-surface-raised)); outline: 0; }
.search-suggestion img { width: 48px; height: 68px; border-radius: 8px; object-fit: cover; background: #242424; }
.search-suggestion span { min-width: 0; display: grid; gap: 5px; }
.search-suggestion strong { overflow: hidden; color: var(--nc-text); font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion small { color: var(--nc-primary); font-size: .72rem; font-weight: 700; }
.search-suggestion-empty { padding: 16px 12px; color: var(--nc-muted); font-size: .8rem; text-align: center; }
.search-suggestion-empty.loading { color: var(--nc-primary); }

.hero-copy { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.hero-copy .hero-actions { margin-top: auto; padding-top: 22px; }

.movie-watch-bootstrap {
  display: none !important;
}
.episode-card { background: transparent; box-shadow: none; }
.episode-thumb { border-radius: 14px; }
.episode-duration-badge {
  position: absolute;
  z-index: 3;
  bottom: 9px;
  left: 10px;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(18, 18, 18, .84);
  color: #fff;
  font: 800 .72rem/1.35 "Tajawal", sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}

@media (max-width: 900px) {
  .cinema-topbar {
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-areas: "brand search";
  }
  .brand-mini { width: 104px; }
  .brand-mini img.ahiru-brand-logo {
    width: 252px;
    height: 164px;
    margin-inline-start: -44px;
    transform-origin: right center;
  }
  .mobile-bottom-nav {
    background: rgba(18, 18, 18, .97) !important;
    box-shadow: 0 -10px 34px rgba(0, 0, 0, .34) !important;
    backdrop-filter: blur(18px);
  }
  .mobile-bottom-nav .nav-link { color: var(--nc-muted); }
  .mobile-bottom-nav .nav-link:hover { background: rgba(255, 213, 0, .08); color: var(--nc-primary); }
  .mobile-bottom-nav .nav-link.active {
    background: var(--nc-primary);
    color: #18170f;
    box-shadow: 0 7px 20px rgba(255, 213, 0, .22);
  }
  .search-suggestions {
    position: fixed;
    top: calc(68px + env(safe-area-inset-top, 0px));
    right: 10px;
    left: 10px;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(68vh, 460px);
    transform: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }
  .search-suggestion { min-width: 0; }
  .search-suggestion span,
  .search-suggestion strong { max-width: 100%; }
  .hero-copy .hero-actions { margin-top: 16px; padding-top: 0; }
}

.pwa-install-prompt {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: 18px;
  width: min(440px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 24px;
  background: #202328;
  color: var(--nc-text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58), inset 0 0 0 1px rgba(255, 213, 0, .14);
  opacity: 0;
  transform: translateY(18px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}
.pwa-install-prompt[hidden] { display: none !important; }
.pwa-install-prompt.visible { opacity: 1; transform: none; }
.pwa-install-prompt img { width: 64px; height: 64px; border-radius: 17px; object-fit: cover; }
.pwa-install-copy { min-width: 0; display: grid; gap: 4px; }
.pwa-install-copy strong { color: #fff; font-size: .98rem; }
.pwa-install-copy span { color: var(--nc-muted); font-size: .79rem; line-height: 1.55; }
.pwa-ios-help { color: #ddd !important; }
.pwa-install-action {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--nc-primary);
  color: #18170f;
  font: 900 .84rem "Tajawal", sans-serif;
  cursor: pointer;
}
.pwa-install-close {
  position: absolute;
  top: 5px;
  left: 7px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--nc-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .pwa-install-prompt {
    right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 20px);
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
  }
  .pwa-install-prompt img { width: 54px; height: 54px; border-radius: 14px; }
  .pwa-install-copy strong { font-size: .88rem; }
  .pwa-install-copy span { font-size: .72rem; }
  .pwa-install-action { min-height: 38px; padding-inline: 13px; }
}

@media (max-width: 390px) {
  .pwa-install-prompt { grid-template-columns: 48px minmax(0, 1fr); }
  .pwa-install-prompt img { width: 48px; height: 48px; }
  .pwa-install-action { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 380px) {
  .cinema-topbar { grid-template-columns: 88px minmax(0, 1fr); }
  .brand-mini { width: 88px; }
  .brand-mini img.ahiru-brand-logo { width: 224px; height: 152px; margin-inline-start: -43px; }
}

/* UI6 remains last: stable header geometry and a 20% smaller logo. */
.brand-full { width: 250px; }
.brand-full img.ahiru-brand-logo {
  flex: 0 0 auto;
  width: 256px;
  height: 61px;
  max-width: none;
  object-fit: cover;
  object-position: center;
  margin: 0;
  pointer-events: none;
  transform: translateX(48px);
}

@media (max-width: 900px) {
  .cinema-topbar { grid-template-columns: 130px minmax(0, 1fr); }
  .brand-mini { width: 130px; height: 64px; }
  .brand-mini img.ahiru-brand-logo {
    flex: 0 0 auto;
    width: 152px;
    height: 51px;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    transform: translateX(30px);
  }
  .hero-copy { justify-content: flex-start; }
  .hero-copy .hero-actions { margin-top: auto; padding: 0; }
}

@media (max-width: 380px) {
  .cinema-topbar { grid-template-columns: 118px minmax(0, 1fr); }
  .brand-mini { width: 118px; }
  .brand-mini img.ahiru-brand-logo { width: 144px; height: 50px; transform: translateX(28px); }
}

/* Ahiru UI9: iOS-inspired glass surfaces with bounded paint cost. */
:root {
  --ahiru-glass: rgba(28, 30, 34, .58);
  --ahiru-glass-strong: rgba(28, 30, 34, .76);
  --ahiru-glass-highlight: rgba(255, 255, 255, .11);
  --ahiru-glass-shadow: 0 18px 48px rgba(0, 0, 0, .28), inset 0 1px 0 var(--ahiru-glass-highlight);
}

body {
  background:
    radial-gradient(circle at 88% 2%, rgba(255, 213, 0, .09), transparent 28rem),
    radial-gradient(circle at 12% 42%, rgba(255, 152, 0, .045), transparent 34rem),
    var(--nc-bg);
}

.cinema-topbar,
.smart-search,
.search-suggestions,
.catalog-filter-bar,
.catalog-filter-menu,
.anime-kind-toggle,
.title-info,
.page-transition-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .018)), var(--ahiru-glass);
  box-shadow: var(--ahiru-glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  backdrop-filter: blur(22px) saturate(155%);
}

.cinema-topbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), transparent), rgba(13, 15, 18, .66);
  transform: translateZ(0);
}

.smart-search {
  background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025)), rgba(24, 26, 30, .56);
}

.search-suggestions,
.catalog-filter-menu { background-color: rgba(22, 24, 28, .82); }

.hero-meta span,
.taxonomy-badge,
.hero-btn.ghost,
.content-part-tab,
.back-link,
.history-clear,
.history-continue {
  background: linear-gradient(145deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .025)), rgba(28, 30, 34, .56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 26px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  backdrop-filter: blur(14px) saturate(145%);
}

.poster-frame,
.episode-card,
.history-card,
.empty-state,
.route-skeleton {
  background: linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .018)), rgba(27, 29, 33, .68);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .09);
}

.title-info {
  padding: clamp(20px, 3vw, 38px);
  border-radius: 26px;
}

.player-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, .07), transparent 38%), rgba(20, 22, 25, .74);
  box-shadow: 0 28px 72px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .1), var(--ahiru-glow);
}

.page-transition { background: rgba(7, 8, 10, .68); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.page-transition-card { padding: 26px; border-radius: 26px; }

.listing-grid { contain: layout style; }
.listing-grid .title-card,
.poster-rail .title-card,
.episode-rail .episode-card {
  content-visibility: auto;
  contain-intrinsic-size: 190px 330px;
}
.poster-frame img,
.episode-thumb img { backface-visibility: hidden; }

/* Ten percent smaller than UI7, without changing either header height. */
.brand-full img.ahiru-brand-logo {
  width: 230px;
  height: 55px;
  transform: translateX(43px);
}

@media (max-width: 900px) {
  .mobile-bottom-nav {
    background: linear-gradient(180deg, rgba(255, 255, 255, .075), transparent), rgba(15, 17, 20, .74) !important;
    box-shadow: 0 -16px 44px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .1) !important;
    -webkit-backdrop-filter: blur(20px) saturate(155%);
    backdrop-filter: blur(20px) saturate(155%);
    transform: translateZ(0);
  }
  .title-info { padding: 18px; border-radius: 22px; }
  .brand-mini img.ahiru-brand-logo {
    width: 137px;
    height: 46px;
    transform: translateX(27px);
  }
}

@media (max-width: 380px) {
  .brand-mini img.ahiru-brand-logo {
    width: 130px;
    height: 45px;
    transform: translateX(25px);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .cinema-topbar,
  .mobile-bottom-nav,
  .smart-search,
  .search-suggestions,
  .catalog-filter-bar,
  .catalog-filter-menu,
  .anime-kind-toggle,
  .title-info,
  .page-transition,
  .page-transition-card { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: #1b1d21; }
}

/* Ahiru UI10: lightweight glass and stable horizontal episode cards. */
:root {
  --ahiru-glass: rgba(25, 27, 31, .94);
  --ahiru-glass-strong: rgba(25, 27, 31, .98);
  --ahiru-glass-shadow: 0 10px 28px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .07);
}

body { background: var(--nc-bg); }

.cinema-topbar,
.mobile-bottom-nav,
.smart-search,
.search-suggestions,
.catalog-filter-bar,
.catalog-filter-menu,
.anime-kind-toggle,
.title-info,
.hero-meta span,
.taxonomy-badge,
.hero-btn.ghost,
.content-part-tab,
.back-link,
.history-clear,
.history-continue,
.page-transition,
.page-transition-card,
.episode-number-badge,
.episode-duration-badge {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.cinema-topbar {
  background: rgba(13, 15, 18, .97);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
  transform: none;
}

.smart-search,
.search-suggestions,
.catalog-filter-bar,
.catalog-filter-menu,
.anime-kind-toggle,
.title-info {
  background: #1b1d21;
  box-shadow: var(--ahiru-glass-shadow);
}

.hero-meta span,
.taxonomy-badge,
.hero-btn.ghost,
.content-part-tab,
.back-link,
.history-clear,
.history-continue { background: #23262b; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }

.poster-frame,
.history-card,
.empty-state,
.route-skeleton {
  background: #1b1e22;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.page-transition { background: rgba(7, 8, 10, .9); }
.page-transition-card { background: #1b1d21; }
.brand-full img.ahiru-brand-logo,
.brand-mini img.ahiru-brand-logo { filter: none; }

.listing-grid .title-card {
  content-visibility: auto;
  contain-intrinsic-size: 180px 300px;
}
.poster-rail .title-card,
.episode-rail .episode-card {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

.episode-rail {
  grid-template-rows: max-content;
  align-items: start;
  overflow-y: hidden;
}
.episode-rail .episode-card {
  display: block;
  align-self: start;
  min-height: 0;
  height: auto;
  border: 0 !important;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.episode-rail .episode-card:hover,
.episode-rail .episode-card.active { box-shadow: none; }
.episode-rail .episode-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #202328;
}
.episode-rail .episode-card.active .episode-thumb {
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(255, 213, 0, .72), 0 9px 22px rgba(0, 0, 0, .28);
}

@media (max-width: 900px) {
  .mobile-bottom-nav {
    background: #111317 !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .07) !important;
    transform: none;
  }
  .episode-rail,
  .episode-section .episode-rail,
  .watch-episodes .episode-rail {
    grid-auto-columns: min(42vw, 156px);
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 14px;
  }
  .episode-rail .episode-thumb { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
