/**
 * AnimeHeaven public theme — streaming layout (red accent)
 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root{
  --bg:#0b1220;
  --bg-2:#101a2b;
  --panel:#152033;
  --panel-2:#1a2740;
  --line:#243149;
  --text:#f1f5f9;
  --muted:#94a3b8;
  --red:#dd0021;
  --red-2:#ff1f3d;
  --radius:12px;
  --radius-sm:10px;
  --shadow:0 16px 40px rgba(0,0,0,.45);
  --max:1240px;
  --header-h:70px;
  --toolbar-h:64px;
}
.ah-ico{width:1em;height:1em;display:inline-block;vertical-align:-.15em;flex-shrink:0}
.ah-btn .ah-ico{width:16px;height:16px}
.ah-section-head h2 .ah-ico{width:22px;height:22px}
.ah-side-card h3 .ah-ico{width:18px;height:18px}
.ah-premium > .ah-ico{width:28px;height:28px;margin-bottom:8px}
.ah-star{display:inline-flex;align-items:center;gap:4px;color:#ffc107 !important}
.ah-star .ah-ico{width:13px;height:13px}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html,body{max-width:100%;overflow-x:hidden}
body.ah-body{
  margin:0;
  font-family:'Outfit',system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
  min-height:100vh;
}
a{color:inherit;text-decoration:none}
a:hover{color:var(--red-2)}
img,video,iframe{max-width:100%;display:block}
button,input,select,textarea{font:inherit}

.ah-container{
  width:min(var(--max), calc(100% - 40px));
  margin:0 auto;
}

/* ===== Header ===== */
.ah-header{
  position:sticky;top:0;z-index:50;
  background:rgba(11,13,20,.88);
  backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.ah-header-inner{
  height:var(--header-h);
  display:flex;align-items:center;gap:20px;
}
.ah-brand{
  display:flex;align-items:center;gap:10px;
  font-weight:800;font-size:1.25rem;letter-spacing:-.02em;
  flex-shrink:0;color:#fff !important;
}
.ah-brand img{width:36px;height:36px;border-radius:10px}
.ah-brand span{color:var(--red)}
.ah-nav{
  display:flex;align-items:center;gap:4px;flex:1;
}
.ah-nav a{
  padding:8px 12px;border-radius:999px;
  color:var(--muted);font-weight:500;font-size:.95rem;
}
.ah-nav a:hover{color:#fff;background:rgba(255,255,255,.04)}
.ah-nav a.is-active{
  color:#fff;
  box-shadow:inset 0 -2px 0 var(--red);
  border-radius:0;
  padding-bottom:10px;
}
.ah-header-actions{
  display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0;
}
.ah-brand-short{display:none}
.ah-icon-btn{
  position:relative;
  display:inline-flex;align-items:center;justify-content:center;
  width:42px;height:42px;border-radius:12px;
  border:1px solid var(--line);background:var(--panel);
  color:#e2e8f0;cursor:pointer;flex-shrink:0;
  transition:border-color .15s, background .15s, color .15s;
}
.ah-icon-btn:hover,.ah-icon-btn.is-active{
  border-color:rgba(221,0,33,.55);color:#fff;background:rgba(221,0,33,.12);
}
.ah-icon-btn .ah-ico{width:20px;height:20px}
.ah-badge-count{
  position:absolute;top:-4px;right:-4px;
  min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;background:var(--red);color:#fff;
  font-size:.65rem;font-weight:800;line-height:18px;text-align:center;
  box-shadow:0 2px 8px rgba(221,0,33,.45);
}
.ah-badge-count.is-empty{display:none}

/* Search + filter under header (inner pages) */
.ah-toolbar{
  position:sticky;top:var(--header-h);z-index:45;
  background:rgba(11,18,32,.94);
  backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(255,255,255,.06);
  padding:10px 0;
}
/* Home: sits above Trending, not under the nav */
.ah-toolbar-inline{
  position:relative;top:auto;z-index:1;
  background:transparent;
  backdrop-filter:none;
  border-bottom:0;
  padding:0 0 22px;
  margin:0;
}
.ah-home .ah-side{
  top:calc(var(--header-h) + 16px);
}
.ah-toolbar-inner{
  display:flex;align-items:center;gap:10px;
}
.ah-filter-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  height:44px;padding:0 16px;border-radius:999px;flex-shrink:0;
  border:1px solid var(--line);background:var(--panel);color:#fff;
  font-weight:600;font-size:.9rem;cursor:pointer;
  transition:border-color .15s, background .15s;
}
.ah-filter-btn:hover{border-color:var(--red);background:rgba(221,0,33,.12)}
.ah-filter-btn .ah-ico{width:18px;height:18px}
.ah-search,.ah-search-bar{
  display:flex;align-items:center;flex:1;min-width:0;
  background:var(--panel);border:1px solid var(--line);
  border-radius:999px;padding:2px 4px 2px 14px;
}
.ah-search input,.ah-search-bar input{
  flex:1;border:0;background:transparent;color:#fff;
  padding:10px 0;outline:none;min-width:0;width:100%;
}
.ah-search input::placeholder,.ah-search-bar input::placeholder{color:var(--muted)}
.ah-search button,.ah-search-bar button{
  border:0;background:transparent;color:var(--muted);
  width:40px;height:40px;border-radius:50%;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;
}
.ah-search button:hover,.ah-search-bar button:hover{color:#fff}

/* Genre filter sheet */
.ah-filter-sheet[hidden]{display:none !important}
.ah-filter-sheet{
  position:fixed;inset:0;z-index:80;
  display:flex;align-items:flex-end;justify-content:center;
}
.ah-filter-backdrop{
  position:absolute;inset:0;background:rgba(0,0,0,.62);
  backdrop-filter:blur(2px);
}
.ah-filter-panel{
  position:relative;z-index:1;
  width:min(560px, 100%);
  max-height:min(78vh, 640px);
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:20px 20px 0 0;
  padding:16px 16px 24px;
  box-shadow:0 -12px 40px rgba(0,0,0,.45);
  overflow:auto;
  animation:ahSheetUp .22s ease;
}
@keyframes ahSheetUp{
  from{transform:translateY(24px);opacity:.6}
  to{transform:translateY(0);opacity:1}
}
.ah-filter-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;margin-bottom:14px;padding:0 4px;
}
.ah-filter-head h2{margin:0;font-size:1.1rem;font-weight:700;color:#fff}
.ah-genres-sheet{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}
body.ah-filter-open{overflow:hidden}

.ah-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 16px;border-radius:999px;font-weight:600;font-size:.9rem;
  border:1px solid transparent;cursor:pointer;white-space:nowrap;
  transition:transform .12s, background .12s, border-color .12s;
}
.ah-btn:hover{transform:translateY(-1px);color:#fff}
.ah-btn-primary{background:var(--red);color:#fff !important}
.ah-btn-primary:hover{background:var(--red-2)}
.ah-btn-ghost{
  background:transparent;color:#fff !important;border-color:var(--line);
}
.ah-btn-ghost:hover{border-color:#fff;background:rgba(255,255,255,.04)}
.ah-menu-btn{
  display:none;border:1px solid var(--line);background:var(--panel);
  color:#fff;width:42px;height:42px;border-radius:12px;cursor:pointer;
}
.ah-mobile-nav{
  display:none;border-top:1px solid var(--line);
  background:var(--bg-2);padding:12px 20px 18px;
}
.ah-mobile-nav.open{display:block}
.ah-mobile-nav a{
  display:block;padding:12px 8px;border-bottom:1px solid var(--line);
  color:var(--text);font-weight:500;
}
.ah-mobile-nav a:last-child{border-bottom:0}

/* ===== Hero (cinematic banner card — like reference) ===== */
.ah-hero-wrap{
  padding-top:18px;
  margin-bottom:8px;
}
.ah-hero{
  position:relative;
  width:100%;
  height:clamp(340px, 48vw, 460px);
  border-radius:18px;
  overflow:hidden;
  background:#05070c;
  box-shadow:0 20px 50px rgba(0,0,0,.45);
}
.ah-hero-slide{
  position:absolute;inset:0;
  opacity:0;pointer-events:none;
  transition:opacity .55s ease;
}
.ah-hero-slide.is-active{opacity:1;pointer-events:auto;z-index:1}
.ah-hero-bg{
  position:absolute;inset:0;
  background-color:#0a0e16;
  background-size:cover;
  background-position:72% center;
  background-repeat:no-repeat;
}
.ah-hero-shade{
  position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    linear-gradient(90deg,
      #05070c 0%,
      #05070c 28%,
      rgba(5,7,12,.88) 42%,
      rgba(5,7,12,.35) 62%,
      rgba(5,7,12,.15) 78%,
      rgba(5,7,12,.45) 100%);
}
.ah-hero-content{
  position:relative;z-index:2;
  height:100%;
  max-width:min(480px, 46%);
  display:flex;flex-direction:column;justify-content:center;
  padding:36px 28px 48px 48px;
}
.ah-badge{
  display:inline-flex;align-self:flex-start;align-items:center;
  background:rgba(221,0,33,.22);color:#ffb3bf;
  border:1px solid rgba(221,0,33,.35);
  padding:6px 12px;border-radius:999px;
  font-size:.72rem;font-weight:700;letter-spacing:.03em;
  margin-bottom:14px;
}
.ah-hero h1{
  margin:0 0 10px;font-size:clamp(2rem, 4.2vw, 3.35rem);
  font-weight:800;letter-spacing:-.03em;line-height:1.05;color:#fff;
}
.ah-hero-meta-line{
  margin:0 0 14px;color:rgba(255,255,255,.88);font-size:.92rem;font-weight:500;
}
.ah-hero p{
  margin:0 0 22px;color:rgba(255,255,255,.78);font-size:.95rem;
  max-width:42ch;line-height:1.6;
}
.ah-hero-actions{display:flex;flex-wrap:wrap;gap:12px}
.ah-btn-hero{
  padding:12px 18px;border-radius:10px;font-size:.92rem;
}
.ah-btn-outline{
  background:transparent !important;color:#fff !important;
  border:1.5px solid rgba(255,255,255,.85) !important;
}
.ah-btn-outline:hover{
  background:rgba(255,255,255,.08) !important;color:#fff !important;
}
.ah-hero-arrow{
  position:absolute;top:50%;transform:translateY(-50%);
  z-index:4;border:0;background:transparent;color:#fff;
  font-size:2rem;line-height:1;cursor:pointer;padding:8px 12px;
  opacity:.85;text-shadow:0 2px 10px rgba(0,0,0,.6);
}
.ah-hero-arrow:hover{opacity:1}
.ah-hero-arrow.prev{left:8px}
.ah-hero-arrow.next{right:8px}
.ah-hero-dots{
  position:absolute;left:50%;bottom:16px;transform:translateX(-50%);
  z-index:4;display:flex;align-items:center;gap:8px;
}
.ah-hero-dots button{
  width:8px;height:8px;border:0;border-radius:50%;
  background:rgba(255,255,255,.35);cursor:pointer;padding:0;
  transition:width .2s, background .2s, border-radius .2s;
}
.ah-hero-dots button.is-active{
  width:26px;border-radius:999px;background:var(--red);
}

/* ===== Sections ===== */
.ah-main{padding:28px 0 80px}
.ah-section{margin-bottom:36px}
.ah-section-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;margin-bottom:16px;
}
.ah-section-head h2{
  margin:0;font-size:1.28rem;font-weight:700;display:flex;align-items:center;gap:10px;color:#fff;
}
.ah-view-all{color:var(--red) !important;font-size:.9rem;font-weight:600}
.ah-view-all:hover{color:var(--red-2) !important}

/* Genres — used inside filter sheet */
.ah-genre{
  background:var(--panel);
  border:1px solid transparent;
  border-radius:14px;
  padding:14px 8px 12px;
  text-align:center;
  transition:transform .15s, background .15s, border-color .15s;
}
.ah-genre:hover{
  transform:translateY(-2px);
  background:var(--panel-2);
  border-color:rgba(255,255,255,.08);
  color:#fff;
}
.ah-genre-bubble{
  width:44px;height:44px;margin:0 auto 8px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:color-mix(in srgb, var(--g) 22%, transparent);
}
.ah-genre-bubble .ah-ico{width:22px;height:22px}
.ah-genre-name{display:block;font-size:.78rem;font-weight:600;color:#e2e8f0}

/* Layout with sidebar */
.ah-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:32px;
  align-items:start;
}
.ah-side{
  display:flex;flex-direction:column;gap:18px;
  position:sticky;top:calc(var(--header-h) + var(--toolbar-h) + 12px);
}

/* Poster grid — 6 across on desktop */
.ah-poster-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:14px;
}
.ah-poster-grid-6{
  grid-template-columns:repeat(6, minmax(0, 1fr));
}
.ah-poster{
  position:relative;border-radius:12px;overflow:hidden;
  background:var(--panel);aspect-ratio:2/3;
  transition:transform .18s;
}
.ah-poster:hover{transform:translateY(-4px) scale(1.02);color:#fff}
.ah-poster img,.ah-poster .ph{
  width:100%;height:100%;object-fit:cover;
}
.ah-poster .ph{
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#152033,#2a0a12);
  color:var(--red);font-size:2.2rem;font-weight:800;
}
.ah-poster-meta{
  position:absolute;left:0;right:0;bottom:0;
  padding:40px 10px 10px;
  background:linear-gradient(transparent, rgba(0,0,0,.95) 55%);
}
.ah-poster-meta strong{
  display:block;font-size:.88rem;font-weight:700;color:#fff;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px;
}
.ah-poster-badges{display:flex;flex-wrap:wrap;gap:5px}
.ah-pill{
  display:inline-flex;align-items:center;
  background:rgba(221,0,33,.92);color:#fff;
  font-size:.68rem;font-weight:700;padding:3px 7px;border-radius:6px;
  line-height:1.2;
}
.ah-pill-new{background:var(--red);text-transform:none;font-size:.72rem}

/* Latest episode landscape cards — 4 across on desktop */
.ah-ep-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}
.ah-ep-grid-4{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}
.ah-more-wrap{margin:18px 0 0;text-align:center}
.ah-side-hint{margin:-6px 0 12px;color:var(--muted);font-size:.78rem;line-height:1.35}
.ah-progress-bar{
  position:absolute;left:0;right:0;bottom:0;height:3px;background:rgba(255,255,255,.2);
}
.ah-progress-bar i{
  display:block;height:100%;background:var(--red);
}
.ah-ep-list{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
  gap:14px;
}
.ah-ep-wide{
  background:var(--panel);border-radius:12px;overflow:hidden;
  transition:transform .15s, box-shadow .15s;
}
.ah-ep-wide:hover{transform:translateY(-3px);color:#fff;box-shadow:var(--shadow)}
.ah-ep-wide-thumb{
  position:relative;aspect-ratio:16/9;background:#000;
}
.ah-ep-wide-thumb img,.ah-ep-wide-thumb .ph{
  width:100%;height:100%;object-fit:cover;
}
.ah-ep-wide-thumb .ph{
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#152033,#2a0a12);color:var(--red);font-weight:800;font-size:1.4rem;
}
.ah-ep-play{
  position:absolute;right:10px;bottom:10px;
  width:34px;height:34px;border-radius:50%;
  background:var(--red);display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 12px rgba(221,0,33,.45);
}
.ah-ep-play .ah-ico{width:14px;height:14px;margin-left:2px}
.ah-ep-wide-body{padding:12px 14px 14px}
.ah-ep-wide-body strong{display:block;color:#fff;font-size:.98rem;margin-bottom:6px}
.ah-ep-wide-row{display:flex;align-items:center;gap:8px;margin-bottom:4px;color:#cbd5e1;font-size:.86rem}
.ah-ep-wide-body small{color:var(--muted);font-size:.78rem}
.ah-ep-card{
  display:grid;grid-template-columns:120px 1fr;gap:0;
  background:var(--panel);border:1px solid var(--line);
  border-radius:var(--radius);overflow:hidden;
  transition:border-color .15s, transform .15s;
  min-height:88px;
}
.ah-ep-card:hover{border-color:var(--red);transform:translateY(-2px);color:#fff}
.ah-ep-thumb{
  position:relative;background:#000;aspect-ratio:16/10;min-height:100%;
}
.ah-ep-thumb img,.ah-ep-thumb .ph{
  width:100%;height:100%;object-fit:cover;
}
.ah-ep-thumb .ph{
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#1a1a22,#2a0a12);color:var(--red);font-weight:800;
}
.ah-ep-new{
  position:absolute;top:8px;left:8px;
  background:var(--red);color:#fff;font-size:.68rem;font-weight:700;
  padding:3px 7px;border-radius:6px;text-transform:uppercase;
}
.ah-ep-body{padding:12px 12px 12px 14px;display:flex;flex-direction:column;justify-content:center}
.ah-ep-body strong{font-size:.95rem;color:#fff;display:block;margin-bottom:4px}
.ah-ep-body span{color:var(--muted);font-size:.8rem}

/* Sidebar cards */
.ah-side-card{
  background:var(--panel);border:1px solid var(--line);
  border-radius:var(--radius);padding:16px;
}
.ah-side-card h3{
  margin:0 0 14px;font-size:1.05rem;display:flex;align-items:center;gap:8px;
}
.ah-rank{display:flex;flex-direction:column;gap:10px}
.ah-rank a{
  display:grid;grid-template-columns:22px 48px 1fr;gap:10px;align-items:center;
  padding:6px;border-radius:10px;
}
.ah-rank a:hover{background:rgba(255,255,255,.04);color:#fff}
.ah-rank-n{font-weight:800;color:var(--muted);font-size:.95rem}
.ah-rank a:nth-child(-n+3) .ah-rank-n{color:var(--red)}
.ah-rank img,.ah-rank .ph{
  width:48px;height:48px;border-radius:8px;object-fit:cover;background:#000;
}
.ah-rank .ph{
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#1a1a22,#2a0a12);color:var(--red);font-weight:700;
}
.ah-rank-info{min-width:0}
.ah-rank strong{
  display:block;font-size:.88rem;color:#fff;line-height:1.25;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ah-rank small{color:var(--muted);font-size:.75rem}

.ah-premium{
  position:relative;overflow:hidden;border-radius:14px;
  border:1px solid rgba(221,0,33,.4);
  background:linear-gradient(145deg, #3a0a14 0%, #dd0021 55%, #7a0012 100%);
  padding:24px 18px 20px;
  text-align:center;
  color:#fff;
}
.ah-premium-glow{
  position:absolute;inset:auto -20% -40% auto;width:180px;height:180px;
  background:radial-gradient(circle, rgba(255,255,255,.25), transparent 70%);
  pointer-events:none;
}
.ah-premium h3{margin:0 0 8px;font-size:1.25rem;position:relative}
.ah-premium p{margin:0 0 14px;color:rgba(255,255,255,.88);font-size:.9rem;position:relative}
.ah-premium .ah-btn{
  width:100%;position:relative;
  background:#fff !important;color:var(--red) !important;
}
.ah-premium .ah-btn:hover{background:#ffe8ec !important;color:var(--red) !important}

/* Empty / flash */
.ah-empty{
  text-align:center;padding:48px 20px;color:var(--muted);
  border:1px dashed var(--line);border-radius:var(--radius);background:var(--panel);
}
.ah-flash{
  padding:12px 14px;border-radius:var(--radius-sm);margin-bottom:16px;font-size:.92rem;
}
.ah-flash.ok{background:rgba(62,207,142,.12);border:1px solid rgba(62,207,142,.3);color:#8ee4b8}
.ah-flash.err{background:rgba(221,0,33,.12);border:1px solid rgba(221,0,33,.35);color:#ff8e9a}

/* Detail / player pages */
.ah-page{padding:28px 0 80px}
.ah-detail{
  display:grid;grid-template-columns:220px 1fr;gap:28px;
  background:var(--panel);border:1px solid var(--line);
  border-radius:var(--radius);padding:22px;margin-bottom:28px;
}
.ah-detail-poster{
  border-radius:var(--radius-sm);overflow:hidden;aspect-ratio:2/3;background:#000;
}
.ah-detail-poster img,.ah-detail-poster .ph{width:100%;height:100%;object-fit:cover}
.ah-detail-poster .ph{
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#1a1a22,#2a0a12);color:var(--red);font-size:3rem;font-weight:800;
}
.ah-detail h1{margin:0 0 6px;font-size:clamp(1.6rem, 3vw, 2.2rem);font-weight:800}
.ah-detail .jp{color:var(--muted);margin-bottom:12px}
.ah-detail .desc{color:#c4c8d4;margin-bottom:14px}
.ah-tags{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.ah-tag{
  background:rgba(221,0,33,.12);border:1px solid rgba(221,0,33,.3);
  color:var(--red-2);padding:4px 10px;border-radius:999px;font-size:.8rem;font-weight:600;
}
.ah-detail-meta{display:flex;flex-wrap:wrap;gap:14px;color:var(--muted);font-size:.92rem;margin-bottom:16px}
.ah-detail-meta strong{color:#fff}
.ah-ep-circles{
  display:flex;flex-wrap:wrap;gap:10px;margin-bottom:28px;
}
.ah-ep-circles a{
  width:52px;height:52px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--panel);border:1px solid var(--line);
  font-weight:700;color:#fff;
}
.ah-ep-circles a:hover,.ah-ep-circles a.is-active{
  background:var(--red);border-color:var(--red);color:#fff;
}

.ah-player-wrap{
  background:#000;border-radius:var(--radius);overflow:hidden;
  border:1px solid var(--line);margin-bottom:18px;
}
.ah-player-wrap .videodiv,
.ah-player-wrap .yt-wrap{width:100%;aspect-ratio:16/9;max-height:none}
.ah-player-wrap video{width:100%;height:100%;object-fit:contain;background:#000}
.yt-wrap{position:relative;width:100%;aspect-ratio:16/9;background:#000}
.yt-frame{position:absolute;inset:0;width:100%;height:100%;border:0;max-height:none}
.paywall{
  aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;
  text-align:center;padding:24px;
  background:linear-gradient(135deg,#12151f,#2a0a12 55%,#0b0d14);
}
.ah-player-nav{
  display:flex;justify-content:center;gap:10px;margin-bottom:24px;
}
.ah-player-nav a{
  width:44px;height:44px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--panel);border:1px solid var(--line);font-size:1.2rem;
}
.ah-player-nav a:hover{border-color:var(--red);color:#fff}

/* Auth / subscribe forms */
.ah-form-card{
  max-width:480px;margin:0 auto;
  background:var(--panel);border:1px solid var(--line);
  border-radius:var(--radius);padding:28px 24px;
}
.ah-form-card.wide{max-width:960px}
.ah-form-card h1{margin:0 0 8px;font-size:1.6rem}
.ah-form-card .lead{color:var(--muted);margin:0 0 20px}
.ah-form label{
  display:block;font-size:.78rem;font-weight:600;color:var(--muted);
  text-transform:uppercase;letter-spacing:.04em;margin:14px 0 6px;
}
.ah-input{
  width:100%;padding:12px 14px;border-radius:var(--radius-sm);
  border:1px solid var(--line);background:#0a0c12;color:#fff;outline:none;
}
.ah-input:focus{border-color:var(--red)}
.ah-form .ah-btn{width:100%;margin-top:16px;padding:13px}
.ah-form-foot{text-align:center;margin-top:16px;color:var(--muted);font-size:.92rem}

/* User dashboard */
.ah-dash-hero{
  display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;
  gap:16px;margin-bottom:22px;
}
.ah-dash-kicker{margin:0 0 6px;color:var(--red);font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.ah-dash-hero h1{margin:0 0 6px;font-size:clamp(1.6rem,3vw,2.2rem)}
.ah-dash-hero .lead{margin:0}
.ah-dash-hero-actions{display:flex;flex-wrap:wrap;gap:10px}
.ah-dash-stats{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:28px;
}
.ah-dash-stat{
  background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px;
}
.ah-dash-stat.is-ok{border-color:rgba(74,222,128,.35)}
.ah-dash-stat.is-warn{border-color:rgba(221,0,33,.35)}
.ah-dash-stat .label{display:block;color:var(--muted);font-size:.72rem;font-weight:600;text-transform:uppercase;margin-bottom:6px}
.ah-dash-stat strong{display:block;font-size:1.25rem;color:#fff;margin-bottom:4px}
.ah-dash-stat small{color:var(--muted);font-size:.8rem}
.ah-dash-stat a{color:var(--red-2)}
.ah-dash-split{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.ah-history-list{list-style:none;margin:0;padding:0}
.ah-history-list li{
  display:flex;justify-content:space-between;gap:12px;align-items:center;
  padding:12px 0;border-bottom:1px solid var(--line);
}
.ah-history-list a{color:#fff;font-weight:600}
.ah-plan-strip{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;
}
.ah-plan-chip{
  display:flex;flex-direction:column;gap:4px;
  background:var(--panel);border:1px solid var(--line);border-radius:14px;
  padding:14px 16px;transition:border-color .15s, transform .15s;
}
.ah-plan-chip:hover{border-color:var(--red);transform:translateY(-2px);color:#fff}
.ah-plan-chip .name{font-weight:700;color:#fff}
.ah-plan-chip .price{color:var(--red-2);font-weight:800;font-size:1.05rem}
.ah-plan-chip .meta{color:var(--muted);font-size:.78rem}
.ah-section-plans{margin-bottom:22px}

/* Subscription expiry / renew */
.ah-sub-panel{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;
  background:var(--panel);border:1px solid var(--line);border-radius:16px;
  padding:18px 20px;margin-bottom:22px;
}
.ah-sub-panel.is-active{border-color:rgba(74,222,128,.35)}
.ah-sub-panel.is-renew{border-color:rgba(221,0,33,.55);background:rgba(221,0,33,.08)}
.ah-sub-panel.is-none{border-color:var(--line)}
.ah-sub-panel .label{display:block;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:6px}
.ah-sub-panel strong{display:block;font-size:1.2rem;color:#fff;margin-bottom:6px}
.ah-sub-expire{margin:0 0 6px;color:#e2e8f0;font-size:.95rem}
.ah-sub-panel-actions{display:flex;flex-wrap:wrap;gap:10px}
.ah-renew-quick{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;
  background:rgba(221,0,33,.1);border:1px solid rgba(221,0,33,.35);
  border-radius:14px;padding:14px 16px;margin-bottom:16px;
}
.ah-plan-tag{
  display:inline-block;margin-left:6px;padding:2px 7px;border-radius:999px;
  background:rgba(221,0,33,.25);color:#ffb3bf;font-size:.68rem;font-weight:700;vertical-align:middle;
}
.plan-card.is-renew-pick{border-color:rgba(221,0,33,.55)}
.ah-sub-banner{
  background:rgba(221,0,33,.14);border-bottom:1px solid rgba(221,0,33,.35);
  padding:10px 0;font-size:.9rem;font-weight:600;
}
.ah-sub-banner .ah-container{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.ah-sub-banner a{color:#fff;text-decoration:underline}

.plan-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin-top:8px;
}
.plan-card{
  display:flex;flex-direction:column;gap:6px;padding:16px;
  border:2px solid var(--line);border-radius:var(--radius);
  background:#0a0c12;cursor:pointer;
}
.plan-card{position:relative}
.plan-card input{position:absolute;opacity:0;pointer-events:none}
.plan-card:has(input:checked){border-color:var(--red);background:rgba(221,0,33,.08)}
.plan-card-view{cursor:default}
.plan-card-view:hover{transform:none}
.plan-name{color:#fff;font-weight:700;font-size:1.05rem}
.plan-price{color:var(--red);font-weight:800;font-size:1.25rem}
.plan-meta,.plan-desc{color:var(--muted);font-size:.82rem}
.gateway-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.gateway-card{
  display:inline-flex;align-items:center;padding:10px 16px;
  border:1px solid var(--line);border-radius:999px;background:#0a0c12;cursor:pointer;
}
.gateway-card input{position:absolute;opacity:0}
.gateway-card:has(input:checked){border-color:#fff;color:#fff}
.sub-table{width:100%;border-collapse:collapse;margin-top:12px;font-size:.9rem}
.sub-table th,.sub-table td{border-bottom:1px solid var(--line);padding:10px 8px;text-align:left}
.sub-table th{color:var(--muted);font-size:.75rem;text-transform:uppercase}
.sub-btn{
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--red);color:#fff !important;border:0;border-radius:999px;
  padding:12px 18px;font-weight:700;cursor:pointer;
}
.sub-flash{padding:12px 14px;border-radius:var(--radius-sm);margin-bottom:14px}
.sub-flash.ok{background:rgba(62,207,142,.12);border:1px solid rgba(62,207,142,.3);color:#8ee4b8}
.sub-flash.err{background:rgba(221,0,33,.12);border:1px solid rgba(221,0,33,.35);color:#ff8e9a}
.muted{color:var(--muted)}
.center{text-align:center}

/* Footer */
.ah-footer{
  border-top:1px solid var(--line);
  background:var(--bg-2);
  padding:36px 0 90px;
}
.ah-footer-inner{
  display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:space-between;
}
.ah-footer-links{display:flex;flex-wrap:wrap;gap:14px;color:var(--muted);font-size:.9rem}
.ah-footer-copy{margin-top:18px;color:var(--muted);font-size:.8rem}

/* Mobile bottom nav */
.ah-bottom-nav{
  display:none;position:fixed;left:0;right:0;bottom:0;z-index:40;
  height:calc(58px + env(safe-area-inset-bottom,0px));
  padding-bottom:env(safe-area-inset-bottom,0);
  background:rgba(18,21,31,.96);border-top:1px solid var(--line);
  backdrop-filter:blur(10px);
}
.ah-bottom-nav a{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;color:var(--muted);font-size:.65rem;font-weight:600;height:58px;
}
.ah-bottom-nav a svg{width:22px;height:22px}
.ah-bottom-nav a.is-active,.ah-bottom-nav a:hover{color:var(--red-2)}

#msg{
  position:fixed;left:50%;bottom:72px;transform:translateX(-50%);
  background:var(--red);color:#fff;padding:10px 16px;border-radius:999px;
  z-index:60;display:none;font-weight:600;font-size:.9rem;
}

/* ===== Responsive ===== */
@media (min-width:900px){
  .ah-filter-sheet{align-items:center;padding:24px}
  .ah-filter-panel{
    border-radius:18px;
    max-height:min(70vh, 560px);
    padding:20px;
  }
  .ah-genres-sheet{grid-template-columns:repeat(4, minmax(0, 1fr))}
}
@media (max-width:1200px){
  .ah-poster-grid-6{grid-template-columns:repeat(3, minmax(0, 1fr))}
  .ah-ep-grid-4{grid-template-columns:repeat(2, minmax(0, 1fr))}
}
@media (max-width:1100px){
  .ah-layout{grid-template-columns:1fr}
  .ah-side{position:static}
  .ah-nav{display:none}
  .ah-menu-btn{display:inline-flex;align-items:center;justify-content:center}
  .ah-btn-desktop{display:none}
}
@media (max-width:760px){
  :root{--header-h:60px;--toolbar-h:58px}
  .ah-container{width:min(100% - 20px, var(--max))}
  .ah-header-inner{gap:10px}
  .ah-brand{font-size:1.05rem;gap:8px}
  .ah-brand img{width:32px;height:32px;border-radius:9px}
  .ah-brand-full{display:none}
  .ah-brand-short{display:inline}
  .ah-btn-compact{padding:9px 12px;font-size:.8rem}
  .ah-icon-btn,.ah-menu-btn{width:40px;height:40px}
  .ah-toolbar{padding:8px 0}
  .ah-filter-btn{padding:0 12px;height:42px;font-size:.84rem}
  .ah-filter-btn span{display:none}
  .ah-filter-btn{width:42px;border-radius:12px;padding:0}
  .ah-hero-wrap{padding-top:12px}
  .ah-hero{
    height:auto;min-height:320px;
    border-radius:14px;
  }
  .ah-hero-content{
    max-width:100%;
    padding:28px 36px 52px 20px;
    justify-content:flex-end;
  }
  .ah-hero h1{font-size:clamp(1.55rem, 7vw, 2.2rem)}
  .ah-hero p{font-size:.88rem;margin-bottom:16px;-webkit-line-clamp:3;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}
  .ah-hero-bg{background-position:center top}
  .ah-hero-shade{
    background:
      linear-gradient(180deg, rgba(5,7,12,.25) 0%, rgba(5,7,12,.55) 40%, #05070c 78%),
      linear-gradient(90deg, #05070c 0%, rgba(5,7,12,.75) 50%, rgba(5,7,12,.2) 100%);
  }
  .ah-main,.ah-page{padding:18px 0 96px}
  .ah-section{margin-bottom:28px}
  .ah-section-head h2{font-size:1.1rem}
  .ah-detail{grid-template-columns:1fr;text-align:center}
  .ah-detail-poster{max-width:200px;margin:0 auto}
  .ah-tags,.ah-detail-meta,.ah-detail .desc{justify-content:center;text-align:left}
  .ah-poster-grid,
  .ah-poster-grid-6{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .ah-ep-grid,.ah-ep-grid-4,.ah-ep-list{grid-template-columns:1fr}
  .ah-genres-sheet{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .ah-bottom-nav{display:flex}
  .ah-footer{padding-bottom:100px}
  .ah-hero-arrow{font-size:1.6rem}
  #msg{bottom:78px}
}
@media (max-width:900px){
  .ah-dash-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ah-dash-split{grid-template-columns:1fr}
}
@media (max-width:420px){
  .ah-genres-sheet{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ah-header-actions{gap:6px}
  .ah-btn-compact{padding:8px 10px;font-size:.76rem}
  .plan-grid{grid-template-columns:1fr}
  .ah-hero-actions .ah-btn{width:100%;justify-content:center}
  .ah-dash-stats{grid-template-columns:1fr 1fr}
}
