/* ---- themes: every colour on the site comes from these tokens (theme.js sets data-theme before first paint) ---- */
:root,
[data-theme="ink"] {
  --logo: url("/icons/logo-ink.png");
  --brand: #fb5b75;
  color-scheme: dark;
  --bg: #0d0d0f;
  --panel: #161619;
  --chip: #232327;
  --surface-1: #141417;
  --surface-2: #1c1c21;
  --surface-3: #232329;
  --surface-4: #2a2a31;
  --line: #26262b;
  --line-2: #33333a;
  --line-3: #4a4a52;
  --text: #f2f1ec;
  --text-hi: #fff;
  --text-2: #d8d8de;
  --text-3: #c4c3cc;
  --muted: #9d9ca6;
  --text-4: #76767f;
  --inverse: #f2f1ec;
  --inverse-hi: #fff;
  --on-inverse: #0d0d0f;
  --tint-1: rgba(255, 255, 255, 0.07);
  --tint-2: rgba(255, 255, 255, 0.13);
  --accent: #c00;
  --accent-hi: #e00;
  --blue: #3ea6ff;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-pill: 20px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
[data-theme="paper"] {
  --logo: url("/icons/logo-paper.png");
  --brand: #fb5b75;
  color-scheme: light;
  --bg: #f6f5f2;
  --panel: #fff;
  --chip: #ecebe6;
  --surface-1: #fff;
  --surface-2: #f0efeb;
  --surface-3: #e8e7e2;
  --surface-4: #dddcd6;
  --line: #e4e3de;
  --line-2: #d6d5cf;
  --line-3: #b9b8b1;
  --text: #16161a;
  --text-hi: #0d0d0f;
  --text-2: #2a2a30;
  --text-3: #46464e;
  --muted: #66666f;
  --text-4: #8a8a93;
  --inverse: #16161a;
  --inverse-hi: #000;
  --on-inverse: #f6f5f2;
  --tint-1: rgba(0, 0, 0, 0.05);
  --tint-2: rgba(0, 0, 0, 0.09);
  --accent: #d10000;
  --accent-hi: #e51b1b;
  --blue: #1673d6;
  --shadow: 0 16px 40px rgba(20, 20, 30, 0.16);
}
[data-theme="midnight"] {
  --logo: url("/icons/logo-midnight.png");
  --brand: #6d93ff;
  color-scheme: dark;
  --bg: #0b0e17;
  --panel: #121829;
  --chip: #1c2338;
  --surface-1: #111626;
  --surface-2: #161c2e;
  --surface-3: #1c2338;
  --surface-4: #232b43;
  --line: #1e2538;
  --line-2: #2a3350;
  --line-3: #3b4668;
  --text: #eef1f8;
  --text-hi: #fff;
  --text-2: #cfd6e6;
  --text-3: #b3bcd1;
  --muted: #8b95ad;
  --text-4: #6a7490;
  --inverse: #eef1f8;
  --inverse-hi: #fff;
  --on-inverse: #0b0e17;
  --tint-1: rgba(160, 180, 255, 0.07);
  --tint-2: rgba(160, 180, 255, 0.13);
  --accent: #4f7cff;
  --accent-hi: #6d93ff;
  --blue: #6bb6ff;
}
[data-theme="sakura"] {
  --logo: url("/icons/logo-sakura.png");
  --brand: #f25d91;
  color-scheme: dark;
  --bg: #120d11;
  --panel: #1c1419;
  --chip: #2a1f27;
  --surface-1: #1a1318;
  --surface-2: #22191f;
  --surface-3: #2a1f27;
  --surface-4: #33262f;
  --line: #2a1f27;
  --line-2: #3a2b35;
  --line-3: #55404d;
  --text: #f8eef3;
  --text-hi: #fff;
  --text-2: #e4d3dc;
  --text-3: #ccb6c2;
  --muted: #a68f9b;
  --text-4: #7f6a75;
  --inverse: #f8eef3;
  --inverse-hi: #fff;
  --on-inverse: #120d11;
  --tint-1: rgba(255, 200, 225, 0.07);
  --tint-2: rgba(255, 200, 225, 0.13);
  --accent: #e0457b;
  --accent-hi: #f25d91;
  --blue: #ff8fb5;
}
[data-theme="matcha"] {
  --logo: url("/icons/logo-matcha.png");
  --brand: #4bc06b;
  color-scheme: dark;
  --bg: #0c100d;
  --panel: #141a15;
  --chip: #1e2820;
  --surface-1: #121813;
  --surface-2: #182019;
  --surface-3: #1e2820;
  --surface-4: #253027;
  --line: #1e2820;
  --line-2: #2b382d;
  --line-3: #40523f;
  --text: #eef4ee;
  --text-hi: #fff;
  --text-2: #d2ddd2;
  --text-3: #b6c4b6;
  --muted: #8fa08f;
  --text-4: #6b7c6b;
  --inverse: #eef4ee;
  --inverse-hi: #fff;
  --on-inverse: #0c100d;
  --tint-1: rgba(200, 255, 210, 0.06);
  --tint-2: rgba(200, 255, 210, 0.12);
  --accent: #36a654;
  --accent-hi: #4bc06b;
  --blue: #6fd38a;
}
html {
  transition: background-color 0.25s ease;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scrollbar-color: var(--line-2) transparent;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a,
button {
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
:focus-visible {
  outline: 2px solid var(--line-3);
  outline-offset: 2px;
}
a {
  -webkit-tap-highlight-color: transparent;
}
.card-link {
  border-radius: 12px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.card-link:focus-visible {
  outline: none;
}
::selection {
  background: rgba(62, 166, 255, 0.3);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-4);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--line-2);
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    transition: none;
    animation: none;
  }
}
/* ---- motion (restrained) ---- */
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.content,
.anime-body,
.page-wrap,
.browse,
.watch-layout {
  animation: fade 0.25s ease;
}
/* reveal on scroll (al.js adds .rv, then .rv-in as each card enters view) */
.rv {
  opacity: 0;
  transform: translateY(16px);
}
.rv.rv-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rv-d, 0ms),
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rv-d, 0ms);
}
#tab-home,
#tab-episodes,
#tab-characters {
  animation: fade 0.25s ease;
}
.ep-cell,
.poster-card,
.trend-row,
.sched-card,
.wl-card {
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.15s ease;
}
.trend-row:hover {
  transform: translateY(-2px);
}
.poster-img,
.rel-thumb {
  transition: outline-color 0.18s ease;
}
.poster-img span {
  transition: transform 0.25s ease;
}
.poster-card:hover .poster-img span {
  transform: scale(1.05);
}
.btn-sub,
.btn-play,
.btn-pill,
.btn-circle,
.w-pill,
.chip,
.pg-skip,
.seg-btn,
.day-btn {
  transition:
    transform 0.1s ease,
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.btn-sub:active,
.btn-play:active,
.btn-pill:active,
.w-pill:active,
.chip:active {
  transform: scale(0.97);
}
.notif-dd,
.dd,
.f-drop {
  animation: pop 0.16s ease;
  transform-origin: top right;
}
.f-drop {
  transform-origin: top center;
}
.tab {
  transition:
    color 0.15s ease,
    border-color 0.2s ease;
}
.poster {
  transition: transform 0.25s ease;
}
.poster:hover {
  transform: scale(1.015);
}
.side-ep,
.nav-item {
  transition: background-color 0.15s ease;
}
.lm-back {
  animation: fade 0.18s ease;
}
.lm-modal {
  animation: pop 0.2s ease;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
  border-bottom: 1px solid var(--line);
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
/* the wordmark is an image per theme (--logo on each theme): lettering in the theme's text colour, accents in its accent */
.logo-img {
  display: block;
  width: 133px;
  height: 24px;
  background: var(--logo) left center/contain no-repeat;
}
.poster-img span,
.rel-thumb span,
.sched-thumb,
.wl-thumb span,
.hist-thumb span,
.side-thumb,
.poster-sm {
  font-kerning: normal;
}
.icon-btn {
  background: none;
  border: 0;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.icon-btn:hover {
  background: var(--chip);
}
.icon-btn svg {
  display: block;
}
.badge {
  position: absolute;
  top: 1px;
  right: -2px;
  background: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  border: 2px solid var(--bg);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3a3a41;
  color: #d8d8de;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.avatar:hover {
  background: #4a4a52;
}
.bell-wrap {
  position: relative;
}
.notif-dd {
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  min-width: 260px;
  z-index: 50;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 16px;
}
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.search-wrap {
  display: flex;
  width: 44%;
  min-width: 280px;
}
.search-wrap input {
  flex: 1;
  min-width: 0;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 20px 0 0 20px;
  outline: none;
  font-size: 15px;
}
.search-wrap input:focus {
  border-color: var(--line-3);
}
.search-btn {
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-left: 0;
  color: var(--text-hi);
  padding: 0 22px;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.search-btn:hover {
  background: var(--surface-4);
}
.filter-bar {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  margin-left: 236px;
  overflow-x: auto;
  position: sticky;
  top: var(--topbar-h);
  background: var(--bg);
  z-index: 9;
  scrollbar-width: none;
  align-items: center;
}
.filter-bar::-webkit-scrollbar {
  display: none;
}
.chip {
  background: var(--chip);
  border: 0;
  color: var(--text-hi);
  padding: 8px 15px;
  border-radius: 9px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
}
.chip-sep {
  flex-shrink: 0;
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--line-2);
}
.chip.active {
  background: var(--inverse);
  color: var(--on-inverse);
}
.chip:not(.active):hover {
  background: var(--surface-4);
}
.layout {
  display: flex;
  align-items: flex-start;
}
.sidebar {
  width: 236px;
  min-width: 236px;
  padding: 12px 10px;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow-y: scroll;
  position: fixed;
  left: 0;
  top: var(--topbar-h);
  bottom: 0;
  background: var(--bg);
  z-index: 5;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.sidebar:hover {
  scrollbar-color: var(--line-3) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 8px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 8px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
  background: var(--line-3);
}
.sidebar:hover::-webkit-scrollbar-thumb:hover {
  background: var(--line-3);
}
.nav-section h4 {
  padding: 8px 12px;
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  gap: 4px;
  align-items: center;
}
.chev {
  color: var(--muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}
.nav-item svg {
  flex-shrink: 0;
  color: var(--text-2);
}
.nav-item:hover {
  background: var(--chip);
}
.nav-item.active {
  background: var(--chip);
}
.nav-item.active svg {
  color: var(--text-hi);
}
.mini-thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}
.show-more {
  color: var(--muted);
}
.show-more svg {
  transition: transform var(--nav-dur, 0.28s) var(--nav-ease, ease);
}
.show-more.open svg {
  transform: rotate(180deg);
}
.nav-item[hidden] {
  display: none;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 6px;
}
.content {
  flex: 1;
  padding: 18px 20px;
  margin-left: 236px;
  min-height: calc(100vh - var(--topbar-h));
  min-height: calc(100dvh - var(--topbar-h));
}
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
@media (max-width: 900px) {
  .sidebar {
    border-right: 1px solid var(--line);
  }
  .content {
    margin-left: 0;
  }
  .filter-bar {
    margin-left: 0;
    padding-left: 16px;
  }
  .search-wrap {
    width: 82%;
  }
}
/* ---- anime page ---- */
.anime-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  filter: blur(2px);
}
.hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 25%, transparent) 0%,
    color-mix(in srgb, var(--bg) 72%, transparent) 60%,
    var(--bg) 100%
  );
}
.hero-inner {
  position: relative;
  display: flex;
  gap: 28px;
  padding: 40px 48px 28px;
  width: 100%;
}
.poster {
  width: 180px;
  min-width: 180px;
  aspect-ratio: 3/4;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  outline: 1px solid var(--line-2);
}
.hero-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.hero-info h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero-native {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.stat-pill {
  font-size: 12px;
  font-weight: 700;
  background: var(--tint-1);
  border: 1px solid var(--line-2);
  padding: 5px 11px;
  border-radius: 8px;
  color: var(--text-2);
}
.stat-pill.gold {
  color: #ffd60a;
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.fact-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
}
.fact-box span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.fact-box strong {
  font-size: 13px;
  margin-top: 4px;
  display: block;
  line-height: 1.5;
}
.hero-meta {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 8px;
}
.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.tag {
  font-size: 12px;
  font-weight: 700;
  background: var(--chip);
  padding: 5px 12px;
  border-radius: 20px;
  color: var(--text-2);
}
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-sub {
  background: var(--inverse);
  color: var(--on-inverse);
  border: 0;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 24px;
  cursor: pointer;
}
.btn-sub.on {
  background: var(--line-2);
  color: var(--text-hi);
}
.btn-play {
  background: var(--accent);
  color: #fff;
  border: 0;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-play:hover {
  background: var(--accent-hi);
}
.btn-pill {
  background: var(--chip);
  color: var(--text-hi);
  border: 0;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-pill.on {
  background: var(--line-2);
  color: var(--blue);
}
.btn-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--text-hi);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-circle:hover {
  background: var(--surface-4);
}
.anime-tabs {
  display: flex;
  gap: 26px;
  padding: 0 48px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--topbar-h);
  background: var(--bg);
  z-index: 8;
  max-width: none;
}
.tab {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  padding: 14px 2px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: var(--text-hi);
  border-bottom-color: var(--text-hi);
}
.anime-body {
  padding: 24px 48px 60px;
  width: 100%;
}
.section-block {
  margin-bottom: 38px;
  max-width: none;
}
.section-block h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}
.desc {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
  max-width: 900px;
}
.ep-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}
.ep-grid .ep-card {
  min-width: 0;
  scroll-snap-align: start;
}
@media (max-width: 700px) {
  .ep-grid {
    grid-auto-columns: minmax(240px, 280px);
  }
}
.ep-card {
  cursor: pointer;
}
.ep-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
}
.ep-thumb .time {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  color: #fff;
}
.ep-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 8px;
}
.ep-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
/* related / more like this: horizontal shelves (One Piece alone has 50+ relations) */
.rel-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 160px;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}
.rel-row > .rel-card {
  scroll-snap-align: start;
}
/* shelves (al.js): ‹ › in the heading instead of a scrollbar, soft fade where more cards wait */
.shelf {
  scrollbar-width: none;
  padding-top: 4px;
  padding-bottom: 4px;
}
.ep-grid.shelf {
  padding-bottom: 20px;
  margin-bottom: -16px;
} /* room for the hover shadow inside the scroll clip */
.shelf::-webkit-scrollbar {
  display: none;
}
.shelf.fade-r {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
}
.shelf.fade-l {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px);
  mask-image: linear-gradient(90deg, transparent, #000 56px);
}
.shelf.fade-l.fade-r {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.shelf-head h2 {
  margin-bottom: 0;
}
.shelf-nav {
  display: flex;
  gap: 8px;
}
.shelf-nav[hidden] {
  display: none;
}
.shelf-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: var(--tint-1);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease,
    transform 0.1s ease;
}
.shelf-btn:hover:not(:disabled) {
  background: var(--tint-2);
  color: var(--text-hi);
}
.shelf-btn:active:not(:disabled) {
  transform: scale(0.94);
}
.shelf-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.rel-card {
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.rel-thumb {
  position: relative;
  aspect-ratio: 3/4.2;
  transition: transform 0.18s ease;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
}
.rel-card:hover .rel-thumb {
  transform: translateY(-3px);
}
.rel-tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  padding: 3px 7px;
  border-radius: 5px;
}
.rel-title {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rel-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: 12px;
}
.ep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ep-head h2 {
  margin-bottom: 0;
}
.ep-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 8px 15px;
  min-width: 250px;
  color: var(--muted);
}
.ep-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
}
.ep-count {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
  margin: 14px 0;
}
.ep-total {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-2);
}
.pg-skip {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.pg-skip:disabled {
  opacity: 0.3;
  cursor: default;
}
.pg-skip:not(:disabled):hover {
  background: var(--surface-4);
}
.pg-range {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-hi);
  font-size: 12.5px;
}
.ep-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px 12px;
}
.ep-cell {
  cursor: pointer;
  min-width: 0;
}
.ep-cell-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.ep-cell-thumb {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ep-num {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.8);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  color: #fff;
}
/* episode thumbs: lazy screencap over a blurred show-art fallback (shown when TVDB has none) */
.ep-thumb,
.ep-cell-thumb {
  overflow: hidden;
  background: var(--surface-2);
}
.ep-fallback {
  position: absolute;
  inset: -12px;
  background: var(--surface-2) center/cover;
  filter: blur(8px) brightness(0.4) saturate(0.85);
}
.ep-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* episode hover: lift + soft shadow, dim, play button — no image zoom (zooming inside a rounded clip
   flickers a bright seam at the corners in Chrome) and no outline snapping on */
.ep-cell-thumb,
.ep-thumb {
  isolation: isolate;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.22s ease;
}
.ep-cell-thumb::before,
.ep-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(8, 8, 10, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.ep-cell-thumb::after,
.ep-thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(14, 14, 17, 0.72)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5.5v13l10.5-6.5z'/%3E%3C/svg%3E")
    55% 50%/18px no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.ep-cell-link:hover .ep-cell-thumb,
.ep-cell-link:focus-visible .ep-cell-thumb,
.card-link:hover .ep-thumb,
.card-link:focus-visible .ep-thumb {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5);
}
.ep-cell-link:hover .ep-cell-thumb::before,
.ep-cell-link:focus-visible .ep-cell-thumb::before,
.card-link:hover .ep-thumb::before,
.card-link:focus-visible .ep-thumb::before {
  opacity: 1;
}
.ep-cell-link:hover .ep-cell-thumb::after,
.ep-cell-link:focus-visible .ep-cell-thumb::after,
.card-link:hover .ep-thumb::after,
.card-link:focus-visible .ep-thumb::after {
  opacity: 1;
  transform: none;
}
.ep-cell-link:focus-visible,
.card-link:focus-visible {
  outline: none;
}
.ep-cell-title {
  transition: color 0.15s ease;
}
.ep-cell-link:hover .ep-cell-title {
  color: var(--text-hi);
}
.ep-num,
.ep-thumb .time {
  z-index: 3;
}
.ep-cell-title {
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-2);
}
.ep-empty {
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 13.5px;
  padding: 26px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}
@media (max-width: 1100px) {
  .ep-list {
    grid-template-columns: repeat(4, 1fr);
  }
  .ep-cell-title {
    font-size: 11.5px;
  }
}
@media (max-width: 700px) {
  .hero-inner {
    flex-direction: column;
    padding: 28px 20px;
  }
  .poster {
    width: 130px;
    min-width: 130px;
  }
  .anime-tabs,
  .anime-body {
    padding-left: 20px;
    padding-right: 20px;
  }
  .ep-search {
    min-width: 0;
    width: 100%;
  }
  .ep-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* character cards (animetsu layout): character on the left, voice actor mirrored on the right */
.char-card {
  display: flex;
  align-items: stretch;
  height: 80px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.char-card:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}
.char-img {
  width: 62px;
  min-width: 62px;
  height: 100%;
  object-fit: cover;
  background: var(--surface-3);
}
.char-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-4);
}
.char-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 14px;
}
.char-side.va {
  text-align: right;
  align-items: flex-end;
}
.char-name {
  max-width: 100%;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.char-role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
}
.char-card.main .char-side:not(.va) .char-role {
  color: var(--accent-hi);
}
/* ---- profile / watchlist / history ---- */
.page-wrap {
  padding: 28px 48px 60px;
  max-width: none;
  width: 100%;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}
.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.nf {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.nf img {
  border-radius: 16px;
  margin-bottom: 6px;
}
.nf h1 {
  font-size: 24px;
  font-weight: 800;
}
.nf p {
  color: var(--muted);
  margin-bottom: 8px;
}
.nf .btn-sub {
  text-decoration: none;
}
.anime-missing .btn-row,
.anime-missing .anime-tabs,
.anime-missing #tab-home > .section-block:not(:first-child) {
  display: none;
}
.trailer {
  position: relative;
  aspect-ratio: 16/9;
  max-width: 860px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.trailer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.trailer-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.trailer-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.2s ease;
}
.trailer-cover:hover img {
  filter: brightness(0.8);
}
.trailer-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 50%;
  background: rgba(14, 14, 17, 0.72)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5.5v13l10.5-6.5z'/%3E%3C/svg%3E")
    56% 50%/28px no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 0.2s ease;
}
.trailer-cover:hover .trailer-play {
  transform: scale(1.06);
}
.btn-play:disabled {
  opacity: 0.6;
  cursor: default;
}
.inline-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.inline-link:hover {
  text-decoration: underline;
}
.link-btn {
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(62, 166, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
}
.link-btn:hover {
  background: rgba(62, 166, 255, 0.2);
}
.btn-ghost {
  background: none;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
}
.btn-ghost:hover {
  background: var(--chip);
}
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.row-head h2 {
  margin-bottom: 0;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
}
.profile-hero h1 {
  font-size: 26px;
  font-weight: 800;
}
.profile-ava {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px 14px;
}
.wl-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.wl-thumb {
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}
.wl-thumb .ep-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  color: #fff;
}
.wl-info {
  padding: 13px 14px 15px;
}
.wl-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.wl-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
.prog {
  height: 5px;
  background: var(--surface-4);
  border-radius: 4px;
  margin-top: 11px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.wl-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.wl-actions .btn-pill {
  font-size: 12.5px;
  padding: 8px 16px;
  text-decoration: none;
}
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px 10px 10px;
}
.hist-row:hover {
  border-color: var(--line-2);
}
.hist-thumb {
  position: relative;
  width: 160px;
  min-width: 160px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.32);
  text-decoration: none;
}
.hist-thumb .time {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.85);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  color: #fff;
}
.hist-info {
  flex: 1;
  min-width: 0;
}
.hist-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.hist-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
.mini-rail {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px 14px;
}
@media (max-width: 900px) {
  .page-wrap {
    padding: 20px;
  }
  .mini-rail {
    grid-template-columns: repeat(3, 1fr);
  }
}
.page-wrap.wide {
  max-width: none;
}
/* ---- trending ---- */
.seg {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 4px;
  gap: 4px;
}
.seg-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 18px;
  cursor: pointer;
}
.seg-btn.on {
  background: var(--inverse);
  color: var(--on-inverse);
}
.seg-n {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.55;
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}
/* ---- trending: rank + movement, cover, info, heat bar ---- */
.trend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trend-row {
  position: relative;
  display: grid;
  grid-template-columns: 58px 58px minmax(0, 1fr) 170px;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 18px 10px 10px;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  isolation: isolate;
}
.trend-row:hover {
  border-color: var(--line-2);
}
.trend-row.podium {
  padding-top: 14px;
  padding-bottom: 14px;
}
.trend-row.podium::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--panel) 30%, rgba(22, 22, 25, 0.82)),
    var(--bn, none) center/cover;
  opacity: 0.9;
}
.tr-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.tr-rank b {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-4);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.podium .tr-rank b {
  color: var(--text);
  font-size: 28px;
}
.trend-row:first-child .tr-rank b {
  color: var(--accent);
}
.mv {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}
.mv.up {
  color: #7ee25c;
  background: rgba(126, 226, 92, 0.1);
}
.mv.down {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}
.mv.new {
  color: #f0b429;
  background: rgba(240, 180, 41, 0.12);
}
.mv.flat {
  color: var(--muted);
}
.tr-cover {
  width: 58px;
  aspect-ratio: 3/4.2;
  border-radius: 7px;
  background: var(--surface-2) center/cover;
}
.tr-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.tr-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tr-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.tr-tags i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  padding: 2px 7px;
  border-radius: 5px;
}
.tr-air {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--blue);
  border-left: 2px solid var(--blue);
  padding: 1px 7px;
  margin-left: 3px;
}
.tr-air.done {
  color: var(--muted);
  border-left-color: var(--line-2);
}
.tr-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.tr-score {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffd60a;
}
.tr-heat {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.tr-heat span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #7a1010, var(--accent-hi));
}
.tr-heat-n {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 700px) {
  .trend-row {
    grid-template-columns: 40px 48px minmax(0, 1fr);
    gap: 12px;
  }
  .tr-cover {
    width: 48px;
  }
  .tr-stats {
    display: none;
  }
}
/* ---- schedule: week stepper, dated day strip, time-grouped slots ---- */
.wk-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wk-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.wk-btn:hover {
  border-color: var(--line-2);
}
.wk-label {
  min-width: 130px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wk-now {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  margin-left: 4px;
}
.day-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(78px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.day-btn {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.day-btn b {
  font-size: 22px;
  color: var(--text);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.day-btn span {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.day-btn:hover {
  border-color: var(--line-2);
}
.day-btn.today::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.day-btn.on {
  background: var(--inverse);
  border-color: var(--inverse);
  color: var(--text-4);
}
.day-btn.on b {
  color: var(--on-inverse);
}
.sched-list {
  display: flex;
  flex-direction: column;
}
.sched-slot {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.sched-slot:first-child {
  border-top: 0;
}
.slot-time {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
}
.slot-time strong {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.slot-time span {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
}
.sched-slot.aired .slot-time strong {
  color: var(--muted);
}
.sched-slot.aired .slot-time span {
  color: var(--text-4);
}
.sched-slot.aired .sched-card {
  opacity: 0.6;
}
.sched-slot.aired .sched-card:hover {
  opacity: 1;
}
.sched-slot.next .slot-time strong {
  color: var(--accent-hi);
}
.sched-slot.next .slot-time span {
  color: var(--accent-hi);
}
.slot-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.sched-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px;
  text-decoration: none;
  color: var(--text);
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease;
}
.sched-card:hover {
  border-color: var(--line-2);
}
.sched-thumb {
  width: 48px;
  min-width: 48px;
  aspect-ratio: 3/4.2;
  border-radius: 6px;
  background: var(--surface-2) center/cover;
}
.sched-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sched-title {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-ep {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.sched-ep i {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}
.sched-ep em {
  margin-left: 7px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f0b429;
  background: rgba(240, 180, 41, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}
.sched-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 40px 0;
  text-align: center;
}
.sched-empty a {
  color: var(--blue);
}
@media (max-width: 700px) {
  .sched-slot {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .slot-time {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .wk-label {
    min-width: 0;
  }
}
/* ---- search / browse ---- */
.browse {
  padding: 20px 26px 60px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px 12px;
  align-items: end;
}
.f-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 7px;
}
.f-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
  user-select: none;
}
.f-select:hover {
  border-color: var(--line-2);
}
.f-select.has-sel {
  border-color: var(--line-3);
}
.f-select [data-ph] {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}
.f-x {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.f-x:hover {
  color: var(--text-hi);
}
.f-chev {
  color: var(--text-2);
  font-size: 15px;
  padding: 0 2px;
  cursor: pointer;
}
.f-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  z-index: 40;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.f-drop[hidden] {
  display: none;
}
.f-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text-2);
  font-size: 13px;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.f-opt:hover {
  background: var(--surface-3);
  color: var(--text-hi);
}
.f-opt.on {
  background: var(--surface-3);
  color: var(--text-hi);
  box-shadow: inset 2px 0 0 var(--accent);
}
.browse-count {
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0 14px;
}
@media (max-width: 1100px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .browse {
    padding: 14px;
  }
}
/* ---- watch page ---- */
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 26px;
  padding: 24px 48px 60px;
  align-items: start;
}
.player {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  outline: 1px solid #2a2a31;
}
.watch-title {
  font-size: 19px;
  font-weight: 700;
  margin: 16px 0 12px;
  line-height: 1.4;
}
.watch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.w-anime {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}
.w-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-hi);
}
.w-name {
  font-size: 15px;
  font-weight: 700;
  display: block;
}
.btn-sub.light {
  background: var(--inverse);
  color: var(--on-inverse);
  border: 0;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 20px;
  cursor: pointer;
}
.btn-sub.light.on {
  background: var(--line-2);
  color: var(--text-hi);
}
.w-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.w-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--chip);
  color: var(--text-hi);
  border: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 20px;
  cursor: pointer;
}
.w-pill:hover {
  background: var(--surface-4);
}
.w-pill.sm {
  padding: 7px 13px;
  font-size: 12.5px;
}
.w-pill.on {
  color: var(--blue);
}
.dd-wrap {
  position: relative;
}
.dd {
  position: absolute;
  top: 46px;
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  min-width: 210px;
  z-index: 30;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 8px;
}
.dd.wide {
  min-width: 220px;
}
.desc-box {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 17px;
  margin-top: 16px;
}
.desc-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  flex-wrap: wrap;
}
.desc-line span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--line-3);
}
.desc-score {
  color: #ffd60a;
}
.desc-box p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  margin-top: 9px;
}
.facts {
  display: flex;
  gap: 16px;
  margin: 14px 0;
}
.poster-sm {
  width: 96px;
  min-width: 96px;
  aspect-ratio: 3/4;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
}
.fact-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
.fact span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}
.fact strong {
  font-size: 13.5px;
}
.desc-more.shut {
  display: none;
}
.show-toggle {
  background: none;
  border: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: block;
  margin: 12px 0 0 auto;
}
/* like YouTube: the episode list runs the full height of the left column (player → description).
   contain:size stops 1000+ episodes from making the row taller; the aside just stretches to it */
.watch-side {
  align-self: stretch;
  contain: size;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.side-head h2 {
  font-size: 16px;
}
.side-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 8px 14px;
  color: var(--muted);
  margin-bottom: 10px;
  flex-shrink: 0;
}
.side-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 13px;
}
.side-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.side-list:hover {
  scrollbar-color: var(--line-3) transparent;
}
.side-next {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.side-next[hidden] {
  display: none;
}
.sn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tint-1);
  color: var(--blue);
  flex-shrink: 0;
}
.sn-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sn-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-hi);
}
.sn-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sn-sub b {
  color: var(--blue);
  font-weight: 700;
}
.side-ep {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  padding: 6px;
  border-radius: 10px;
}
.side-ep:hover {
  background: var(--chip);
}
.side-ep.cur {
  background: var(--chip);
  outline: 1px solid var(--line-2);
}
.side-num {
  flex-shrink: 0;
  min-width: 34px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.side-thumb {
  width: 130px;
  min-width: 130px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
}
.side-meta {
  flex: 1;
  min-width: 0;
}
.side-t {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
/* episode list tools: sort order + layout (watch.js) */
.side-tools {
  display: flex;
  gap: 8px;
}
.side-tool {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: var(--tint-1);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}
.side-tool:hover {
  background: var(--tint-2);
  color: var(--text-hi);
}
.side-tool:active {
  transform: scale(0.94);
}
.side-tool svg {
  display: block;
}
/* compact layout: numbered text rows, striped like animetsu */
.side-list.compact {
  gap: 0;
  border-radius: 10px;
  overflow-y: auto;
}
.side-list.compact .side-ep {
  gap: 8px;
  padding: 0 12px;
  min-height: 44px;
  border-radius: 0;
  font-size: 13px;
  color: var(--text-2);
}
.side-list.compact .side-ep:nth-child(even) {
  background: var(--tint-1);
}
.side-list.compact .side-ep:hover {
  background: var(--tint-2);
  color: var(--text-hi);
}
.side-list.compact .side-ep.cur {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  outline: 0;
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--text-hi);
}
.side-list.compact .side-num {
  width: auto;
  min-width: 0;
  flex-shrink: 0;
  text-align: left;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.side-list.compact .side-t {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
/* ---- navigation: docked sidebar (home) + slide-over drawer (everything else, narrow screens) ---- */
:root {
  --topbar-h: 56px; /* the sticky top bar; menus, sticky rows and the nav drawer sit right under it */
  --nav-dur: 0.28s;
  --nav-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}
.sidebar {
  overscroll-behavior: contain;
  will-change: transform;
}
/* hidden states; visibility keeps closed links out of tab order */
body.nav-overlay .sidebar {
  transform: translateX(-100%);
  visibility: hidden;
}
body.nav-overlay .sidebar,
body.nav-open .sidebar {
  z-index: 60;
  border-right: 1px solid var(--line);
}
body.nav-open .sidebar {
  transform: none;
  visibility: visible;
  box-shadow: 28px 0 60px rgba(0, 0, 0, 0.55);
}
/* transitions start after first paint (nav-ready) so a saved collapsed state never animates on load.
   hiding waits for the slide to finish; showing flips visibility immediately */
body.nav-ready .sidebar {
  transition:
    transform var(--nav-dur) var(--nav-ease),
    box-shadow var(--nav-dur) ease,
    visibility 0s linear var(--nav-dur);
}
body.nav-ready.nav-open .sidebar {
  transition:
    transform var(--nav-dur) var(--nav-ease),
    box-shadow var(--nav-dur) ease,
    visibility 0s;
}
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    z-index: 60;
    border-right: 1px solid var(--line);
  }
  body.nav-open .sidebar {
    transform: none;
    visibility: visible;
  }
}
.nav-scrim {
  position: fixed;
  inset: var(--topbar-h) 0 0;
  z-index: 55;
  background: rgba(6, 6, 8, 0.55);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--nav-dur) ease,
    visibility 0s linear var(--nav-dur);
}
body.nav-open .nav-scrim {
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--nav-dur) ease,
    visibility 0s;
}
.menu-btn svg line {
  transition:
    transform var(--nav-dur) var(--nav-ease),
    opacity 0.18s ease;
  transform-origin: center;
  transform-box: fill-box;
}
.menu-btn[aria-expanded="true"] svg line:nth-child(2) {
  transform: scaleX(0.6) translateX(-20%);
}
.menu-btn:active {
  transform: scale(0.92);
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-scrim,
  .menu-btn svg line {
    transition: none !important;
  }
}
/* ---- poster cards like animetsu: tall, large, score badge ---- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px 16px;
}
.poster-card {
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.poster-img {
  position: relative;
  aspect-ratio: 3/4.2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
  overflow: hidden;
  background: var(--surface-2);
  transform: translateZ(0);
  backface-visibility: hidden;
  isolation: isolate;
  will-change: transform;
  box-shadow: 0 0 0 1px transparent;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.poster-card:hover .poster-img {
  transform: translate3d(0, -3px, 0);
  box-shadow:
    0 0 0 1px var(--line-2),
    0 10px 22px rgba(0, 0, 0, 0.35);
}
.poster-img {
  background-size: cover;
  background-position: center;
}
.poster-title {
  display: -webkit-box;
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 10px;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  min-height: 38px;
}
/* card detail: EP flag top-left, score + runtime on a shaded foot, then studio / aired / next-ep */
.pc-ep {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 4px 9px 4px 8px;
  border-bottom-right-radius: 9px;
}
.pc-ep i {
  font-style: normal;
  font-weight: 600;
  opacity: 0.7;
}
.pc-foot {
  position: absolute;
  inset: auto -1px -1px -1px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 26px 8px 7px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  font-size: 11px;
  font-weight: 700;
}
.pc-score {
  color: #ffd60a;
}
.pc-dur {
  color: #e6e6ea;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 4px;
}
.pc-line {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-dim {
  color: var(--muted);
}
.pc-next {
  display: inline-block;
  max-width: 100%;
  margin-top: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(62, 166, 255, 0.1);
  border-left: 2px solid var(--blue);
  padding: 3px 7px;
  border-radius: 0 5px 5px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-next b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pc-soon {
  color: #f0b429;
  background: rgba(240, 180, 41, 0.1);
  border-left-color: #f0b429;
}
.pc-done {
  color: var(--muted);
  background: var(--surface-2);
  border-left-color: var(--line-2);
}
/* home uses same poster cards now */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px 16px;
}
.home-more {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 26px;
}
@media (max-width: 1100px) {
  .watch-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 20px;
  }
  .watch-side {
    contain: none;
    min-height: 0;
  }
  .side-list {
    max-height: 60vh;
  }
}
/* ---- player control bar ---- */
/* ---- topbar quick search (topbar.js) ---- */
.qs-wrap {
  position: relative;
}
.qs-wrap input {
  padding-right: 44px;
}
.qs-clear,
.qs-kbd {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.qs-clear {
  right: 74px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}
.qs-clear:hover {
  color: var(--text);
}
.qs-kbd {
  right: 76px;
  font:
    600 11px/1 ui-monospace,
    Consolas,
    monospace;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 3px 6px;
  pointer-events: none;
}
.qs-clear:not([hidden]) + .qs-kbd,
.qs-wrap.open .qs-kbd {
  display: none;
}
.qs-wrap.open input {
  border-color: var(--line-3);
  border-bottom-left-radius: 0;
}
@media (max-width: 700px) {
  .topbar {
    padding: 0 10px;
    gap: 8px;
  }
  .topbar-center {
    min-width: 0;
    flex: 1;
  }
  .search-wrap {
    min-width: 0;
    width: 100%;
  }
  .search-btn {
    padding: 0 14px;
  }
  .qs-wrap input {
    padding-left: 14px;
  }
  .topbar-left {
    gap: 6px;
  }
  .logo-img {
    width: 111px;
    height: 20px;
  }
  .topbar-right {
    gap: 6px;
  }
}
/* the drawer shows the logo only when the top bar has no room for it (narrow phones) */
.nav-logo {
  display: none;
}
@media (max-width: 480px) {
  .logo {
    display: none;
  }
  .nav-logo {
    display: block;
    padding: 6px 12px 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }
  .nav-logo .logo-img {
    width: 133px;
    height: 24px;
  }
}
.qs-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 400px;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  z-index: 120;
  overflow: hidden;
  animation: pop 0.14s ease;
  transform-origin: top center;
}
.qs-body {
  max-height: min(66vh, 560px);
  overflow-y: auto;
  padding: 6px;
}
.qs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.qs-link {
  background: none;
  border: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
}
.qs-hint {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.qs-row,
.qs-recent,
.qs-all {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.qs-row[aria-selected="true"],
.qs-recent[aria-selected="true"],
.qs-all[aria-selected="true"],
.qs-jump a[aria-selected="true"] {
  background: var(--surface-3);
}
.qs-row[aria-selected="true"] {
  box-shadow: inset 2px 0 0 var(--accent);
}
.qs-cv {
  width: 40px;
  min-width: 40px;
  aspect-ratio: 3/4.2;
  border-radius: 6px;
  background: var(--c, var(--surface-2)) center/cover;
}
.qs-tx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qs-t {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-t mark {
  background: none;
  color: var(--accent-hi);
}
.qs-alt {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.qs-st {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}
.qs-st.live {
  color: #7ee25c;
}
.qs-st.soon {
  color: #f0b429;
}
.qs-sc {
  font-size: 12px;
  font-weight: 800;
  color: #ffd60a;
  white-space: nowrap;
}
.qs-skel .qs-cv,
.qs-skel i {
  background: var(--surface-2);
  animation: skel 1.1s ease-in-out infinite alternate;
}
.qs-skel i {
  display: block;
  height: 10px;
  border-radius: 4px;
  width: 70%;
}
.qs-skel i + i {
  width: 40%;
  margin-top: 6px;
}
.qs-recent {
  font-size: 13px;
}
.qs-ico {
  color: var(--muted);
  width: 18px;
  text-align: center;
}
.qs-rt {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qs-x {
  background: none;
  border: 0;
  color: var(--text-4);
  cursor: pointer;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 5px;
}
.qs-x:hover {
  color: var(--text);
  background: var(--surface-4);
}
.qs-jump {
  display: flex;
  gap: 6px;
  padding: 8px 6px 4px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.qs-jump a {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.qs-all {
  position: sticky;
  bottom: -6px;
  background: var(--surface-1);
  justify-content: space-between;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue);
}
.qs-all span {
  color: var(--muted);
  font-weight: 600;
}
.qs-foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
}
.qs-foot kbd,
.qs-kbd {
  font-family: ui-monospace, Consolas, monospace;
}
.qs-foot kbd {
  font-size: 10px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 3px;
  color: var(--text-3);
}
@keyframes skel {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 700px) {
  .qs-panel {
    position: fixed;
    top: 58px;
    left: 8px;
    right: 8px;
    min-width: 0;
  }
  .qs-foot,
  .qs-kbd {
    display: none;
  }
}
/* ---- browse page (search.js) ---- */
.browse-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.browse-head h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.browse-head .browse-count {
  margin: 5px 0 0;
}
.sort-select {
  min-width: 220px;
}
.f-lbl {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.f-drop {
  max-height: 320px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.f-find {
  margin: 6px 6px 0;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 12.5px;
  outline: none;
}
.f-find:focus {
  border-color: var(--line-3);
}
.f-list {
  overflow-y: auto;
  padding: 6px;
}
.f-group {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 10px 11px 4px;
}
.f-none {
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 11px;
}
.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
  min-height: 4px;
}
.a-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px 6px 12px;
  border-radius: 20px;
  cursor: pointer;
}
.a-chip span {
  color: var(--muted);
  font-size: 10px;
}
.a-chip:hover {
  border-color: var(--accent);
}
.a-chip:hover span {
  color: var(--accent-hi);
}
.a-reset {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.a-reset:hover {
  color: var(--text);
}
.browse .poster-grid {
  margin-top: 16px;
}
.poster-card.skel .poster-img {
  animation: skel 1.1s ease-in-out infinite alternate;
}
.sk-line {
  display: block;
  height: 11px;
  border-radius: 4px;
  background: var(--surface-2);
  margin-top: 10px;
  width: 85%;
  animation: skel 1.1s ease-in-out infinite alternate;
}
.sk-line.short {
  width: 50%;
  margin-top: 7px;
}
.browse-empty {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.browse-empty strong {
  color: var(--text);
  font-size: 15px;
}
.browse-empty a,
.browse-more a {
  color: var(--blue);
}
.browse-more {
  display: flex;
  justify-content: center;
  padding: 28px;
  color: var(--muted);
  font-size: 13px;
  min-height: 20px;
}
.more-dots {
  display: flex;
  gap: 6px;
}
.more-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-3);
  animation: skel 0.6s ease-in-out infinite alternate;
}
.more-dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.more-dots i:nth-child(3) {
  animation-delay: 0.4s;
}
/* ---- notifications (topbar.js) ---- */
.badge[hidden] {
  display: none;
}
.badge {
  min-width: 18px;
  text-align: center;
  line-height: 13px;
  font-variant-numeric: tabular-nums;
}
.badge.bump {
  animation: bump 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes bump {
  0% {
    transform: scale(0.4);
  }
  60% {
    transform: scale(1.18);
  }
  100% {
    transform: none;
  }
}
.bell.on {
  background: var(--chip);
}
.notif-dd.nt-panel {
  width: 372px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(76vh, 600px);
  background: var(--surface-1);
  border-color: var(--line-2);
  border-radius: 16px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--tint-1) inset;
  animation: ntIn 0.2s var(--nav-ease, ease);
  transform-origin: top right;
}
.notif-dd[hidden],
.notif-dd.nt-panel[hidden] {
  display: none;
}
@keyframes ntIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.nt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 4px 16px;
}
.nt-head strong {
  font-size: 15px;
  letter-spacing: -0.1px;
}
.nt-head-acts {
  display: flex;
  gap: 2px;
}
.nt-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.nt-icon:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
}
.nt-icon:disabled {
  color: var(--line-3);
  cursor: default;
}
.nt-icon.spin svg {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.nt-tabs {
  display: flex;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.nt-tab {
  position: relative;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}
.nt-tab:hover {
  color: var(--text-2);
}
.nt-tab.on {
  color: var(--text);
}
.nt-tab.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.nt-tab b {
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  padding: 1px 6px;
  border-radius: 9px;
  line-height: 14px;
}
.nt-list {
  overflow-y: auto;
  padding: 4px 6px 8px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.nt-group {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-4);
  padding: 12px 10px 6px;
}
.nt-item {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 12px;
  transition: background-color 0.15s ease;
}
.nt-item:hover {
  background: var(--surface-2);
}
.nt-main {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 4px 8px 10px;
  text-decoration: none;
  color: var(--text);
}
.nt-cv {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 60px;
  border-radius: 7px;
  background: var(--c) center/cover;
  overflow: hidden;
}
.nt-cv b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  padding: 9px 0 3px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  letter-spacing: 0.2px;
}
.nt-tx {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.nt-t {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nt-sub {
  font-size: 12.5px;
  color: var(--text-3);
}
.nt-time {
  font-size: 11.5px;
  color: var(--text-4);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nt-time em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f0b429;
  border: 1px solid rgba(240, 180, 41, 0.35);
  padding: 0 5px;
  border-radius: 4px;
}
.nt-item:not(.unread) .nt-t {
  font-weight: 600;
  color: var(--text-3);
}
.nt-item:not(.unread) .nt-sub {
  color: var(--muted);
}
.nt-item:not(.unread) .nt-cv {
  filter: saturate(0.55) brightness(0.8);
}
.nt-side {
  position: relative;
  width: 60px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}
.nt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  transition: opacity 0.15s ease;
}
.nt-item:not(.unread) .nt-dot {
  opacity: 0;
}
.nt-acts {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.nt-item:hover .nt-acts,
.nt-item:focus-within .nt-acts {
  opacity: 1;
  pointer-events: auto;
}
.nt-item:hover .nt-dot,
.nt-item:focus-within .nt-dot {
  opacity: 0;
}
.nt-act {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-4);
  border: 0;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nt-act:hover {
  background: var(--line-2);
  color: var(--text-hi);
}
.nt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 36px 28px 32px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.nt-empty strong {
  color: var(--text);
  font-size: 14px;
  margin-top: 4px;
}
.nt-empty-ico {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  margin-bottom: 4px;
}
.nt-cta {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.nt-cta:hover {
  border-color: var(--line-3);
  background: var(--surface-2);
}
.nt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
  border-top: 1px solid var(--line);
}
.nt-foot-acts {
  display: flex;
  gap: 2px;
}
.nt-link {
  background: none;
  border: 0;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 9px;
  border-radius: 7px;
}
.nt-link:hover {
  background: var(--surface-3);
  color: var(--text-hi);
}
.nt-link.dim {
  color: var(--muted);
}
.nt-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
}
.nt-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.nt-switch span {
  position: relative;
  width: 30px;
  height: 17px;
  border-radius: 10px;
  background: var(--surface-4);
  transition: background-color 0.2s ease;
}
.nt-switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition:
    transform 0.2s var(--nav-ease, ease),
    background-color 0.2s ease;
}
.nt-switch input:checked + span {
  background: var(--accent);
}
.nt-switch input:checked + span::after {
  transform: translateX(13px);
  background: var(--inverse-hi);
}
.nt-switch input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
/* ---- toast (al.js) ---- */
.al-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: min(520px, calc(100vw - 32px));
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  padding: 11px 16px;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s var(--nav-ease, ease);
}
.al-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.al-toast[data-kind="error"] {
  border-color: rgba(255, 107, 107, 0.45);
}
.al-toast b {
  font-weight: 700;
}
.al-toast code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-4);
  padding: 1px 5px;
  border-radius: 4px;
}
/* ---- sidebar subscriptions (nav.js) ---- */
.subs-section[hidden] {
  display: none;
}
.subs-section {
  animation: fade 0.25s ease;
}
.sub-cv {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.sub-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: dotIn 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.sub-item.has-new .sub-name {
  font-weight: 700;
}
@keyframes dotIn {
  from {
    transform: scale(0);
  }
  to {
    transform: none;
  }
}
/* ---- subscribe button (anime page) ---- */
.btn-sub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-sub:disabled {
  cursor: progress;
}
.btn-sub.pop svg {
  animation: ring 0.6s ease;
}
@keyframes ring {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: rotate(16deg);
  }
  40% {
    transform: rotate(-14deg);
  }
  60% {
    transform: rotate(9deg);
  }
  80% {
    transform: rotate(-5deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .badge.bump,
  .btn-sub.pop svg,
  .sub-dot,
  .nt-icon.spin {
    animation: none;
  }
}
/* ---- watch controls: sub/server pills (watch.html) ---- */
/* sub / server pills + menus */
.w-pill {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.w-pill:hover {
  background: var(--surface-3);
  border-color: var(--line-2);
}
.w-pill[aria-expanded="true"] {
  background: var(--surface-3);
  border-color: var(--line-3);
}
.w-pill svg {
  opacity: 0.85;
}
.dd {
  top: 44px;
  border-color: var(--line-2);
  border-radius: 14px;
  padding: 6px;
  animation: ntIn 0.18s cubic-bezier(0.22, 0.8, 0.24, 1);
  transform-origin: top right;
}
/* subscribe on the watch page matches the info page */
.w-sub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.w-sub.on {
  background: var(--surface-4);
  color: var(--text-hi);
}
.w-sub.on svg {
  color: var(--accent-hi);
}
.w-sub:disabled {
  cursor: progress;
}
/* audio / server menus: one quiet style — icon, label (+ note), single check on the active row */
.dd-head {
  padding: 8px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-4);
}
.dd-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 9px;
  padding: 9px 34px 9px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-3);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}
.dd-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.dd-text small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-4);
  white-space: nowrap;
}
.dd-ico {
  flex-shrink: 0;
  color: var(--muted);
}
.dd-item:hover {
  background: var(--surface-3);
  color: var(--text-hi);
}
.dd-item.on,
.dd-item.on .dd-ico {
  color: var(--text-hi);
}
.dd-item.on::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 10px;
  height: 5px;
  margin-top: -4px;
  border-left: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: rotate(-45deg);
}
.dd-item:disabled,
.dd-item.off {
  opacity: 0.35;
  cursor: default;
}
.dd-item:disabled:hover,
.dd-item.off:hover {
  background: none;
  color: var(--text-3);
}
/* embed fallback lives inside the player box, seamless with the custom player */
.embed-wrap {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #000;
}
.embed-wrap[hidden] {
  display: none;
}
.embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.src-empty {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0a0a0d;
  color: var(--text-3);
  font-size: 13.5px;
  text-align: center;
  padding: 20px;
}
.src-empty[hidden] {
  display: none;
}
/* ---- player (player.js) ---- */
.ap {
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  color: #fff;
}
.ap:focus-visible {
  box-shadow: 0 0 0 2px #4a4a52;
}
.ap-video,
.ap-freeze,
.ap-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ap-video {
  object-fit: contain;
  background: #000;
}
.ap-freeze {
  object-fit: contain;
  z-index: 1;
}
.ap-poster {
  z-index: 1;
  background: #0a0a0d center/cover;
  transition: opacity 0.35s ease;
}
.ap-poster.gone {
  opacity: 0;
  pointer-events: none;
}
.ap-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.ap-big {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  border: 0;
  background: rgba(14, 14, 17, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
}
.ap-big svg {
  width: 30px;
  height: 30px;
}
.ap-big:hover {
  transform: scale(1.07);
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}
.ap.paused:not(.busy) .ap-big {
  display: flex;
}
.ap-msg {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  background: rgba(14, 14, 17, 0.85);
  border: 1px solid #2c2c33;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13px;
  color: #d8d8de;
  text-align: center;
}
/* controls */
.ap-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 28px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  pointer-events: none;
}
.ap.ui-on .ap-ui,
.ap.paused .ap-ui,
.ap:focus-within .ap-ui {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.ap:not(.ui-on):not(.paused) .ap-video {
  cursor: none;
}
.ap-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ap-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 0;
  background: none;
  color: #e8e8ec;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}
.ap-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.ap-btn.on {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.ap-time {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.ap-time i {
  font-style: normal;
  color: rgba(255, 255, 255, 0.6);
}
.ap-gap {
  flex: 1;
}
.ap-vol {
  display: flex;
  align-items: center;
}
.ap-volume {
  width: 0;
  opacity: 0;
  transition:
    width 0.2s ease,
    opacity 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255, 255, 255, 0.25) var(--v, 100%));
  cursor: pointer;
}
.ap-vol:hover .ap-volume,
.ap-volume:focus {
  width: 76px;
  opacity: 1;
  margin: 0 8px 0 2px;
}
.ap-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}
.ap-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
/* seek bar */
.ap-seek {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 4px;
  touch-action: none;
}
.ap-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition: height 0.15s ease;
}
.ap-seek:hover .ap-track,
.ap.seeking .ap-track {
  height: 6px;
}
.ap-buf,
.ap-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}
.ap-buf {
  right: 0;
  background: rgba(255, 255, 255, 0.32);
  transform-origin: left;
  transform: scaleX(0);
}
.ap-played {
  right: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear;
}
.ap-marks span {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.28);
}
.ap-thumb {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: var(--accent-hi);
  transform: scale(0);
  transition: transform 0.12s ease;
}
.ap-seek:hover .ap-thumb,
.ap.seeking .ap-thumb,
.ap-seek:focus-visible .ap-thumb {
  transform: scale(1);
}
.ap-tip {
  position: absolute;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(14, 14, 17, 0.9);
  border: 1px solid #2c2c33;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
/* skip + up next */
.ap-skip {
  position: absolute;
  right: 18px;
  bottom: 84px;
  z-index: 6;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 14, 17, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  animation: ntIn 0.2s ease;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.ap-skip:hover {
  background: #fff;
  color: #0d0d0f;
  border-color: #fff;
}
.ap-next {
  position: absolute;
  right: 18px;
  bottom: 84px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(14, 14, 17, 0.9);
  border: 1px solid #2c2c33;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #d8d8de;
  animation: ntIn 0.2s ease;
}
.ap-next b {
  color: #fff;
}
.ap-next-acts {
  display: flex;
  gap: 8px;
}
.ap-next-go,
.ap-next-cancel {
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.ap-next-go {
  background: #f2f1ec;
  color: #0d0d0f;
}
.ap-next-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
/* subtitles menu + cue styling */
.ap-video::cue {
  background: var(--cue-bg, rgba(0, 0, 0, 0.55));
  color: #fff;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--cue-size, 1.05em);
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.ap.full {
  border-radius: 0;
  outline: 0;
}
@media (max-width: 700px) {
  .ap-skip,
  .ap-next {
    bottom: 70px;
    right: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ap-ui,
  .ap-poster,
  .ap-track {
    transition: none;
  }
}
/* player v2: episode buttons, cc, settings panel, bubble, ambient */
.ap-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: none;
}
.ap-btn svg {
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ap-btn:active:not(:disabled) svg {
  transform: scale(0.9);
}
.ap-play svg {
  width: 26px;
  height: 26px;
}
.ap-cc.on {
  box-shadow: none;
  color: #fff;
}
.ap-cc.on::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-hi);
}
.ap-cc {
  position: relative;
}
.ap-gear svg {
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ap-gear.spin-on svg {
  transform: rotate(60deg);
}
.ap-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  min-width: 56px;
  margin-top: -28px;
  padding: 0 16px;
  border-radius: 28px;
  background: rgba(14, 14, 17, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  opacity: 0;
  transform: translateX(-50%) scale(0.85);
  pointer-events: none;
}
.ap-bubble svg {
  width: 26px;
  height: 26px;
}
.ap-bubble.show {
  animation: apBubble 0.6s ease forwards;
}
@keyframes apBubble {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.85);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.06);
  }
}
.ap.paused:not(.busy) .ap-bubble {
  display: none;
}
.ap-settings {
  position: absolute;
  right: 12px;
  bottom: 66px;
  z-index: 7;
  width: 290px;
  max-height: calc(100% - 90px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(18, 18, 21, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
  animation: ntIn 0.18s cubic-bezier(0.22, 0.8, 0.24, 1);
  transform-origin: bottom right;
  scrollbar-width: thin;
}
.ap-settings[hidden] {
  display: none;
}
.ap-spage {
  animation: apPage 0.18s ease;
}
.ap-spage.main {
  animation: none;
}
@keyframes apPage {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.ap-srow,
.ap-opt,
.ap-shead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #e8e8ec;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.ap-srow:hover,
.ap-opt:hover,
.ap-shead:hover {
  background: rgba(255, 255, 255, 0.07);
}
.ap-sval {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9d9ca6;
  font-weight: 500;
  font-size: 13px;
}
.ap-sval svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.ap-shead {
  justify-content: flex-start;
  gap: 6px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px 9px 0 0;
  margin-bottom: 4px;
}
.ap-shead svg {
  width: 18px;
  height: 18px;
}
.ap-opt {
  position: relative;
  padding-left: 34px;
  justify-content: flex-start;
  font-weight: 500;
  color: #c4c3cc;
}
.ap-opt.on {
  color: #fff;
  font-weight: 600;
}
.ap-opt.on::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 10px;
  height: 5px;
  margin-top: -4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}
.ap-opt small {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: #9d9ca6;
}
.ap-switch {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: #3a3a42;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.ap-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #c4c3cc;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 0.2s ease;
}
.ap-switch.on {
  background: var(--accent);
}
.ap-switch.on::after {
  transform: translateX(15px);
  background: #fff;
}
.ap-ssep {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 6px;
}
.ap-slabel {
  padding: 8px 12px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #76767f;
}
.ap-snote {
  padding: 6px 12px 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #76767f;
}
.ap.menu-open .ap-ui {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
/* ambient mode: a soft glow of the video's colours behind the player */
.ap-ambient {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 16/9;
  z-index: 0;
  filter: blur(70px) saturate(1.6);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.ap-ambient.on {
  opacity: 0.55;
}
.ap {
  z-index: 1;
}
.ap.full ~ .ap-ambient,
.ap.full + .ap-ambient {
  display: none;
}
@media (max-width: 700px) {
  .ap-settings {
    right: 8px;
    left: 8px;
    width: auto;
  }
  .ap-prev,
  .ap-nextep {
    display: none;
  }
}
/* hidden must win over the flex layouts above */
.ap-next[hidden],
.ap-msg[hidden],
.ap-spin[hidden],
.ap-skip[hidden],
.ap-tip[hidden] {
  display: none;
}
/* lift captions above the controls while they're showing (Chromium/WebKit caption container) */
.ap-video::-webkit-media-text-track-container {
  transition: transform 0.22s ease;
}
.ap.ui-on .ap-video::-webkit-media-text-track-container,
.ap.paused .ap-video::-webkit-media-text-track-container {
  transform: translateY(-58px);
}
/* ---- display settings (classes set on <html> by theme.js / AL.settings) ---- */
/* spoiler mode: only the areas chosen in Settings blur; hover or keyboard focus reveals */
.spoil-recent #epGrid .ep-img,
.spoil-recent #epGrid .ep-fallback,
.spoil-infoEps #epList .ep-img,
.spoil-infoEps #epList .ep-fallback,
.spoil-watchList #sideList .side-thumb {
  filter: blur(16px) brightness(0.7);
  transition: filter 0.25s ease;
}
.spoil-recent #epGrid .ep-title,
.spoil-recent #epGrid .ep-sub,
.spoil-infoEps #epList .ep-cell-title,
.spoil-watchList #sideList .side-t,
.spoil-watchDesc #descShort,
.spoil-watchDesc #descLong {
  filter: blur(5px);
  transition: filter 0.25s ease;
}
/* larger cards */
.cards-large .home-grid,
.cards-large .poster-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
/* reduce motion: same as the OS setting, but chosen in Settings */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
/* ---- profile menu (topbar.js) ---- */
.pm-wrap {
  position: relative;
}
.pm {
  position: absolute;
  top: 46px;
  right: 0;
  z-index: 130;
  width: 300px;
  max-height: calc(100vh - 70px);
  max-height: calc(100dvh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 6px;
  box-shadow: var(--shadow);
  animation: ntIn 0.18s cubic-bezier(0.22, 0.8, 0.24, 1);
  transform-origin: top right;
}
.pm[hidden] {
  display: none;
}
.pm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 10px;
}
.pm-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}
.pm-av-guest {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.pm-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pm-who b {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-who span {
  font-size: 12.5px;
  color: var(--muted);
}
.pm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin: 2px 6px 6px;
  padding: 8px 4px;
  border-radius: 10px;
  background: var(--surface-2);
}
.pm-stats span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
}
.pm-stats b {
  font-size: 14px;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}
.pm-link,
.pm-cta {
  display: block;
  margin: 0 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
.pm-link:hover {
  text-decoration: underline;
}
.pm-cta {
  margin: 2px 8px 8px;
  text-align: center;
  padding: 9px;
  border-radius: 10px;
  background: var(--inverse);
  color: var(--on-inverse);
}
.pm-cta:hover {
  background: var(--inverse-hi);
}
.pm-sep {
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}
.pm-item,
.pm-opt,
.pm-back {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.pm-item:hover,
.pm-opt:hover,
.pm-back:hover {
  background: var(--tint-1);
}
a.pm-item {
  text-decoration: none;
}
.pm-item > span:first-of-type {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-item svg,
.pm-back svg {
  flex-shrink: 0;
  color: var(--text-3);
}
.pm-item > svg:last-child {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.pm-item kbd {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 6px;
}
.pm-back {
  font-weight: 700;
  color: var(--text-hi);
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  margin-bottom: 4px;
}
.pm-note {
  padding: 8px 12px 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.pm-opt {
  position: relative;
  padding-left: 38px;
}
.pm-opt > span:last-child {
  display: flex;
  flex-direction: column;
}
.pm-opt small {
  font-size: 11.5px;
  color: var(--muted);
}
.pm-opt.on {
  color: var(--text-hi);
  font-weight: 600;
}
.pm-opt.on::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 10px;
  height: 5px;
  margin-top: -4px;
  border-left: 2px solid var(--text-hi);
  border-bottom: 2px solid var(--text-hi);
  transform: rotate(-45deg);
}
.pm-sw {
  display: flex;
  margin-left: -2px;
}
.pm-sw i {
  width: 14px;
  height: 22px;
  border: 1px solid var(--line-2);
}
.pm-sw i:first-child {
  border-radius: 5px 0 0 5px;
}
.pm-sw i:last-child {
  border-radius: 0 5px 5px 0;
}
.pm-switch {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: var(--line-3);
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.pm-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--inverse);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pm-switch.on {
  background: var(--accent);
}
.pm-switch.on::after {
  transform: translateX(15px);
  background: #fff;
}
/* ---- keyboard shortcuts sheet ---- */
.kb-back {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade 0.18s ease;
}
.kb-back[hidden] {
  display: none;
}
.kb {
  width: 520px;
  max-width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 8px 20px 18px;
  box-shadow: var(--shadow);
  animation: pop 0.2s ease;
}
.kb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 6px;
}
.kb-head strong {
  font-size: 17px;
}
.kb-x {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.kb-x:hover {
  background: var(--tint-1);
  color: var(--text-hi);
}
.kb-group {
  margin: 14px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.kb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-2);
}
.kb-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.kb-keys i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin: 0 3px;
}
.kb kbd,
.st-kbd {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-hi);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 7px;
}
.kb-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
/* ---- settings page (settings.js) ---- */
.st-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 32px 80px;
  animation: fade 0.25s ease;
}
.st-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.st-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.st-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}
.st-find {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--muted);
  min-width: 240px;
}
.st-find:focus-within {
  border-color: var(--line-3);
}
.st-find input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 13.5px;
  color: var(--text);
}
.st-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.st-nav {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-3);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}
.st-nav a:hover {
  background: var(--tint-1);
  color: var(--text-hi);
}
.st-nav a.on {
  background: var(--surface-3);
  color: var(--text-hi);
  font-weight: 600;
}
.st-nav a.on svg {
  color: var(--accent-hi);
}
.st-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.st-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 20px 8px;
  scroll-margin-top: 76px;
}
.st-card[hidden] {
  display: none;
}
.st-card header {
  padding: 16px 0 10px;
  border-bottom: 1px solid var(--line);
}
.st-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16.5px;
  font-weight: 700;
}
.st-card h2 svg {
  color: var(--accent-hi);
}
.st-card header p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.st-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.st-row:last-child {
  border-bottom: 0;
}
.st-row[hidden] {
  display: none;
}
.st-block {
  display: block;
}
.st-text {
  min-width: 0;
  flex: 1;
}
.st-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-hi);
}
.st-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}
.st-ctrl {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.st-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  border: 0;
  background: var(--line-3);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.st-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--inverse);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.st-switch.on {
  background: var(--accent);
}
.st-switch.on::after {
  transform: translateX(18px);
  background: #fff;
}
.st-switch:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.st-seg {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.st-seg button {
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.st-seg button:hover {
  color: var(--text-hi);
}
.st-seg button.on {
  background: var(--surface-4);
  color: var(--text-hi);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.st-slider {
  display: flex;
  align-items: center;
  gap: 12px;
}
.st-slider input {
  width: 160px;
  accent-color: var(--accent);
}
.st-slider output {
  min-width: 42px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}
.st-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-hi);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.st-btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--line-3);
}
.st-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.st-btn.primary {
  background: var(--inverse);
  color: var(--on-inverse);
  border-color: transparent;
}
.st-btn.primary:hover {
  background: var(--inverse-hi);
}
.st-btn.danger {
  color: var(--text-2);
}
.st-btn.danger:hover:not(:disabled),
.st-btn.confirm {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.st-themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.st-theme {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: none;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.st-theme:hover {
  border-color: var(--line-3);
  transform: translateY(-2px);
}
.st-theme.on {
  border-color: var(--accent);
}
.st-tprev {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.25);
}
.st-tprev span {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 18%;
  border-radius: 4px;
}
.st-tprev span:first-child {
  top: 12%;
  right: 40%;
}
.st-tprev span:nth-child(2) {
  top: 40%;
  height: 40%;
}
.st-tprev i {
  position: absolute;
  left: 8%;
  bottom: 12%;
  width: 24%;
  height: 10%;
  border-radius: 4px;
}
.st-tprev b {
  position: absolute;
  right: 8%;
  top: 15%;
  width: 16%;
  height: 6%;
  border-radius: 3px;
  opacity: 0.85;
}
.st-tname {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-hi);
  padding: 0 2px;
}
.st-tnote {
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 2px 2px;
}
.st-ccprev {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 110px;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #2b3a55, #5c3b4d 60%, #7a5a3a);
}
.st-ccprev span {
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}
.st-acct {
  display: flex;
  align-items: center;
  gap: 12px;
}
.st-acct img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
}
.st-kgroup {
  margin: 6px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.st-krow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--text-2);
}
.st-krow i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin: 0 4px;
}
.st-support p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 62ch;
}
.st-sacts {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.st-saved {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 150;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.st-saved.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 860px) {
  .st-layout {
    grid-template-columns: 1fr;
  }
  .st-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
  }
  .st-nav a {
    white-space: nowrap;
  }
  .st-page {
    padding: 20px 16px 60px;
  }
  .st-row {
    flex-wrap: wrap;
  }
  .st-ctrl {
    width: 100%;
    justify-content: flex-start;
  }
}
/* settings dropdowns reuse the site's f-select; just give them a steady width */
.st-fsel {
  min-width: 200px;
  padding: 9px 13px;
}
.st-fsel:focus-visible {
  outline: none;
  border-color: var(--line-3);
}
.st-fsel .f-drop {
  left: auto;
  min-width: 100%;
}
/* spoiler areas checklist (settings) */
.st-areas.off .st-checks {
  opacity: 0.5;
}
.st-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.st-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.st-check:hover {
  border-color: var(--line-3);
}
.st-check.on {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.st-check b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hi);
}
.st-check small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.st-box {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 5px;
  border: 2px solid var(--line-3);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.st-check.on .st-box {
  background: var(--accent);
  border-color: var(--accent);
}
.st-check.on .st-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
/* the sidebar is always a slide-over drawer now, so Home's content uses the full width */
body.nav-overlay .content,
body.nav-overlay .filter-bar {
  margin-left: 0;
}
/* =====================================================================================
   MOBILE & TOUCH — phones first, then small tablets. Desktop styles above stay untouched.
   ===================================================================================== */
/* touch everywhere: no 300ms tap delay, no grey tap flash, no hover effects stuck after a tap */
a,
button,
[role="button"],
input,
select,
label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shelf.dragging,
.filter-bar.dragging,
.day-bar.dragging,
.tag-row.dragging,
.hero-stats.dragging,
.st-nav.dragging,
.seg.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.shelf.dragging * {
  pointer-events: none;
}
@media (hover: none) {
  .poster-card:hover .poster-img,
  .rel-card:hover .rel-thumb,
  .st-theme:hover,
  .trend-row:hover {
    transform: none;
  }
  .ep-cell-link:hover .ep-cell-thumb,
  .card-link:hover .ep-thumb {
    transform: none;
    box-shadow: none;
  }
  .ep-cell-link:hover .ep-cell-thumb::before,
  .ep-cell-link:hover .ep-cell-thumb::after,
  .card-link:hover .ep-thumb::before,
  .card-link:hover .ep-thumb::after {
    opacity: 0;
  }
  .shelf-nav {
    display: none;
  } /* swipe instead of arrows on touch screens */
  .ap-vol:hover .ap-volume {
    width: 0;
    opacity: 0;
    margin: 0;
  }
}
@media (pointer: coarse) {
  .icon-btn {
    width: 42px;
    height: 42px;
  }
  .ap-btn {
    width: 42px;
    height: 42px;
  }
  .nav-item {
    padding: 11px 12px;
  }
}
/* notched phones: keep content inside the safe area */
.topbar {
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}
.al-toast,
.st-saved {
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
}
@media (max-width: 700px) {
  /* iOS zooms into any text field under 16px — keep them at 16px on phones */
  input[type="text"],
  input[type="search"],
  input:not([type]),
  textarea,
  .st-find input,
  .side-search input,
  .f-find {
    font-size: 16px !important;
  }
  /* top bar: compact */
  :root {
    --topbar-h: 54px; /* compact top bar on phones; everything below it follows */
  }
  .topbar {
    gap: 6px;
  }
  .search-wrap input {
    padding: 8px 12px;
  }
  .qs-kbd {
    display: none;
  }
  /* page gutters */
  .content {
    padding: 12px 12px 32px;
  }
  .filter-bar {
    padding: 10px 12px;
    gap: 8px;
    top: var(--topbar-h);
  }
  .chip {
    padding: 7px 13px;
    font-size: 13px;
  }
  .page-wrap,
  .browse {
    padding: 16px 12px 40px;
  }
  /* home + browse: two cards per row so more anime fit, tighter card text */
  .home-grid,
  .poster-grid,
  .cards-large .home-grid,
  .cards-large .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 10px;
  }
  .poster-img {
    border-radius: 9px;
  }
  .poster-title {
    font-size: 13px;
    min-height: 36px;
    margin-top: 8px;
  }
  .pc-line {
    font-size: 11px;
  }
  .pc-next {
    font-size: 10px;
    padding: 3px 6px;
    margin-top: 6px;
  }
  .pc-ep {
    font-size: 10px;
    padding: 3px 8px 3px 7px;
  }
  .pc-foot {
    padding: 22px 7px 6px;
    font-size: 10.5px;
  }
  /* info page: compact header — small poster beside the title, buttons in two tidy rows */
  .hero-inner {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 4px 14px;
    padding: 18px 14px 16px;
    align-items: start;
  }
  .hero-inner .poster {
    width: 104px;
    min-width: 0;
    grid-row: 1 / span 4;
    border-radius: 10px;
  }
  .hero-info {
    display: contents;
  }
  .hero-info h1 {
    font-size: 21px;
    line-height: 1.2;
    grid-column: 2;
    align-self: end;
  }
  .hero-native,
  .hero-meta {
    grid-column: 2;
    font-size: 12px;
  }
  .hero-meta {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-stats,
  .tag-row {
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: 10px;
    padding-bottom: 2px;
  }
  .hero-stats::-webkit-scrollbar,
  .tag-row::-webkit-scrollbar {
    display: none;
  }
  .hero-stats > *,
  .tag-row > * {
    flex-shrink: 0;
  }
  .btn-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
    gap: 8px;
    margin-top: 14px;
  }
  .btn-row #playBtn {
    grid-column: 1 / -1;
    order: -1;
    justify-content: center;
    padding: 12px;
  }
  .btn-row .btn-sub,
  .btn-row .btn-pill {
    justify-content: center;
    padding: 10px 12px;
    font-size: 13.5px;
    min-width: 0;
  }
  .btn-row .btn-pill span,
  .btn-row .btn-sub span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .btn-row .btn-circle {
    width: 44px;
    height: 44px;
  }
  .anime-tabs {
    padding: 0 14px;
    gap: 22px;
    top: var(--topbar-h);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .anime-body {
    padding: 18px 14px 48px;
  }
  .section-block {
    margin-bottom: 28px;
  }
  .section-block h2 {
    font-size: 16.5px;
  }
  .ep-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .ep-head {
    gap: 10px;
  }
  .rel-row {
    grid-auto-columns: 128px;
    gap: 10px;
  }
  .ep-grid {
    grid-auto-columns: minmax(220px, 78vw);
  }
  .fact-box {
    padding: 10px 12px;
  }
  /* watch page: edge-to-edge player at the top of the page; it scrolls away normally */
  .watch-layout {
    padding: 0 0 40px;
    gap: 0;
  }
  .watch-main > .player {
    border-radius: 0;
    outline: 0;
    margin: 0;
  }
  .watch-main > .ap-ambient {
    display: none;
  }
  .watch-main > :not(.player):not(.ap-ambient) {
    margin-left: 14px;
    margin-right: 14px;
  }
  .watch-title {
    font-size: 16px;
    margin: 12px 14px 10px;
  }
  .watch-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .w-actions {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .w-actions::-webkit-scrollbar {
    display: none;
  }
  .w-actions > * {
    flex-shrink: 0;
  }
  .watch-side {
    margin: 18px 14px 0;
  }
  .dd {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 0;
    transform-origin: bottom center;
  }
  /* player on phones: centre controls, roomy bottom row, settings as a bottom sheet */
  .ap-row {
    gap: 2px;
  }
  .ap-time {
    font-size: 12px;
    margin-left: 4px;
  }
  .ap-skip,
  .ap-next {
    bottom: 64px;
    right: 10px;
  }
  .ap:not(.full) .ap-settings {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    max-height: 68vh;
    max-height: 68dvh;
    border-radius: 18px 18px 0 0;
    padding: 8px 8px max(10px, env(safe-area-inset-bottom));
    z-index: 150;
    animation: apSheet 0.24s cubic-bezier(0.22, 0.8, 0.24, 1);
  }
  .ap:not(.full) .ap-settings::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    margin: 2px auto 8px;
  }
  @keyframes apSheet {
    from {
      transform: translateY(100%);
    }
    to {
      transform: none;
    }
  }
  /* lists */
  .trend-row {
    padding: 10px 12px 10px 8px;
    gap: 10px;
  }
  .slot-items {
    grid-template-columns: 1fr;
  }
  .wl-grid {
    grid-template-columns: 1fr !important;
  }
}
/* larger phones / small tablets: three cards per row */
@media (min-width: 520px) and (max-width: 700px) {
  .home-grid,
  .poster-grid,
  .cards-large .home-grid,
  .cards-large .poster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ep-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .home-grid,
  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 22px 14px;
  }
  .cards-large .home-grid,
  .cards-large .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}
/* very small phones (≤360px) */
@media (max-width: 360px) {
  .home-grid,
  .poster-grid {
    gap: 16px 8px;
  }
  .poster-title {
    font-size: 12.5px;
  }
  .hero-inner {
    grid-template-columns: 88px minmax(0, 1fr);
  }
  .hero-inner .poster {
    width: 88px;
  }
  .btn-row {
    grid-template-columns: 1fr 1fr 42px;
  }
}
/* touch: centre controls replace the single big play button (player.js adds .touch) */
.ap-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: none;
  align-items: center;
  gap: 30px;
  transform: translate(-50%, -50%);
}
.ap-cbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(14, 14, 17, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ap-cbtn svg {
  width: 24px;
  height: 24px;
}
.ap-cplay {
  width: 64px;
  height: 64px;
}
.ap-cplay svg {
  width: 30px;
  height: 30px;
}
.ap-cbtn:disabled {
  opacity: 0.3;
}
.ap.touch .ap-big {
  display: none !important;
}
.ap.touch.ui-on:not(.busy) .ap-center,
.ap.touch.paused:not(.busy) .ap-center {
  display: flex;
  animation: fade 0.18s ease;
}
.ap.touch .ap-ui {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}
.ap.touch.ui-on::before,
.ap.touch.paused::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
/* phones: long synopses start clamped; tap to read the rest */
@media (max-width: 700px) {
  #animeDesc {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    position: relative;
  }
  #animeDesc.open {
    display: block;
    -webkit-line-clamp: unset;
  }
  #animeDesc:not(.open)::after {
    content: "more";
    position: absolute;
    right: 0;
    bottom: 0;
    padding-left: 28px;
    background: linear-gradient(90deg, transparent, var(--bg) 40%);
    color: var(--text-hi);
    font-weight: 700;
  }
}
/* single-column watch layout: let the episode list shrink to the screen instead of widening the page */
.watch-main,
.watch-side {
  min-width: 0;
}
/* schedule: long titles truncate instead of widening the time slots */
@media (max-width: 700px) {
  .sched-slot {
    grid-template-columns: minmax(0, 1fr);
  }
  .slot-items {
    grid-template-columns: minmax(0, 1fr);
  }
}
.sched-card,
.sched-info {
  min-width: 0;
}
/* top bar stays usable above the nav drawer + its scrim (profile, bell, search keep working) */
.topbar {
  z-index: 70;
}
/* phones: profile + notification panels drop down right under their buttons, not across the screen */
@media (max-width: 700px) {
  .pm,
  .notif-dd.nt-panel {
    position: fixed;
    top: 58px;
    left: auto;
    right: max(8px, env(safe-area-inset-right));
    width: min(320px, calc(100vw - 16px));
    max-height: calc(100dvh - 72px);
  }
}

/* ---- intro (theme.js): icon pops in with a ring pulse, the wordmark wipes in under it, a thin bar fills ---- */
.al-intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  cursor: pointer;
  transition:
    opacity 0.55s ease,
    visibility 0.55s;
}
html.intro-on,
html.intro-on body {
  overflow: hidden;
}
.ai-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  transition:
    transform 0.6s cubic-bezier(0.6, 0, 0.4, 1),
    filter 0.6s ease;
}
.ai-icon {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  animation: aiPop 0.75s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.ai-glow {
  position: absolute;
  top: 48px;
  left: 50%;
  z-index: 0;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 38%, transparent), transparent 65%);
  filter: blur(10px);
  animation: aiGlow 2.4s ease-in-out 0.2s infinite both;
}
.ai-ring {
  position: absolute;
  top: 48px;
  left: 50%;
  z-index: 1;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 30px;
  border: 2px solid var(--brand);
  opacity: 0;
  animation: aiRing 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s both;
}
.ai-word {
  display: block;
  width: 210px;
  height: 38px;
  background: var(--logo) center/contain no-repeat;
  clip-path: inset(0 100% 0 0);
  animation: aiWipe 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.45s forwards;
}
.ai-bar {
  display: block;
  width: 120px;
  height: 3px;
  border-radius: 2px;
  background: var(--tint-2);
  overflow: hidden;
  opacity: 0;
  animation: fade 0.3s ease 0.9s forwards;
}
.ai-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: var(--brand);
  animation: aiBar 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.9s infinite;
}
.al-intro.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.al-intro.out .ai-stage {
  transform: scale(1.08);
  filter: blur(6px);
}
@keyframes aiPop {
  0% {
    opacity: 0;
    transform: scale(0.4) rotate(-12deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes aiRing {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}
@keyframes aiGlow {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}
@keyframes aiWipe {
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes aiBar {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}
.al-intro.calm * {
  animation: none !important;
  clip-path: none !important;
}
.al-intro.calm .ai-bar,
.al-intro.calm .ai-ring,
.al-intro.calm .ai-glow {
  display: none;
}
@media (max-width: 700px) {
  .ai-icon,
  .ai-ring {
    width: 80px;
    height: 80px;
  }
  .ai-icon {
    border-radius: 20px;
  }
  .ai-ring {
    margin: -40px 0 0 -40px;
    top: 40px;
  }
  .ai-glow {
    top: 40px;
  }
  .ai-word {
    width: 180px;
    height: 32px;
  }
}
