/* ===== Dramova · App Styles — Spotify-inspired Design System =======
   Dark immersive theme: #0f0f0f base, #2BA641 accent, pill geometry.
   Light mode: #f5f5f7 base, clean neutral whites, solid green accent.
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables — Dark (default) ──────────────────────────── */
:root {
  --bg-base:       #0f0f0f;
  --bg-surface:    #161616;
  --bg-raised:     #1c1c1c;
  --bg-card:       #222222;
  --bg-hover:      #2a2a2a;
  --border-color:  #282828;
  --border-muted:  #3a3a3a;
  --border-subtle: #1e1e1e;
  --text-primary:  #f1f1f1;
  --text-secondary:#a0a0a0;
  --text-tertiary: #5a5a5a;
  --text-on-accent:#ffffff;
  --accent:        #2BA641;
  --accent-hover:  #32B94B;
  --accent-dark:   #238A36;
  --accent-muted:  rgba(43,166,65,0.16);
  --accent-control-bg: #2BA641;
  --accent-control-text: #ffffff;
  --accent-control-border: #2BA641;
  --control-bg:    #1f1f1f;
  --control-hover: #292929;
  --control-text:  #d6d6d6;
  --empty-icon-bg: #1f1f1f;
  --empty-icon-fg: #6f6f6f;
  --negative:      #ff6b6b;
  --warning:       #ffb347;
  --info:          #2BA641;
  --topbar-bg:     rgba(15,15,15,0.88);
  --bottomnav-bg:  rgba(15,15,15,0.95);
  --sheet-bg:      #161616;
  --skeleton-from: #1c1c1c;
  --skeleton-to:   #262626;
  --scrollbar-thumb: #2a2a2a;
  --shadow-heavy:  rgba(0,0,0,0.6) 0px 12px 32px;
  --shadow-medium: rgba(0,0,0,0.35) 0px 6px 16px;
  --shadow-soft:   rgba(0,0,0,0.2) 0px 2px 8px;
  --inset-border:  rgb(15,15,15) 0px 1px 0px, rgb(100,100,100) 0px 0px 0px 1px inset;
  --inset-border-focus: rgb(15,15,15) 0px 1px 0px, #2BA641 0px 0px 0px 2px inset;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --radius-pill:   9999px;
}

/* ── CSS Variables — Light mode ───────────────────────────────── */
html.light {
  --bg-base:       #f5f5f7;
  --bg-surface:    #ffffff;
  --bg-raised:     #ecedf0;
  --bg-card:       #ffffff;
  --bg-hover:      #e4e5e9;
  --border-color:  #d8dae0;
  --border-muted:  #c2c5cc;
  --border-subtle: #ecedf0;
  --text-primary:  #1a1c20;
  --text-secondary:#4b5060;
  --text-tertiary: #7a7f8e;
  --text-on-accent:#ffffff;
  --accent:        #2BA641;
  --accent-hover:  #238A36;
  --accent-dark:   #1D7330;
  --accent-muted:  rgba(43,166,65,0.11);
  --accent-control-bg: #2BA641;
  --accent-control-text: #ffffff;
  --accent-control-border: #238A36;
  --control-bg:    #ffffff;
  --control-hover: #f0fdf4;
  --control-text:  #1a1c20;
  --empty-icon-bg: #ecedf0;
  --empty-icon-fg: #7a7f8e;
  --negative:      #dc2626;
  --warning:       #d97706;
  --info:          #238A36;
  --topbar-bg:     rgba(245,245,247,0.88);
  --bottomnav-bg:  rgba(245,245,247,0.92);
  --sheet-bg:      #ffffff;
  --skeleton-from: #e0e1e6;
  --skeleton-to:   #cfd1d8;
  --scrollbar-thumb: #c2c5cc;
  --shadow-heavy:  rgba(0,0,0,0.08) 0px 12px 32px, rgba(0,0,0,0.04) 0px 4px 12px;
  --shadow-medium: rgba(0,0,0,0.06) 0px 4px 16px, rgba(0,0,0,0.03) 0px 2px 6px;
  --shadow-soft:   rgba(0,0,0,0.04) 0px 2px 8px;
  --inset-border:  rgba(0,0,0,0.06) 0px 1px 0px, rgba(0,0,0,0.12) 0px 0px 0px 1px inset;
  --inset-border-focus: rgba(0,0,0,0.06) 0px 1px 0px, #2BA641 0px 0px 0px 2px inset;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
html, body { overscroll-behavior-y: contain; }

/* Logo theme switching */
/* Theme toggle icon visibility — CSS-driven, no flash */
.icon-sun { display: block; }
.icon-moon { display: none; }
html.light .icon-sun { display: none; }
html.light .icon-moon { display: block; }

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.app-main {
  min-height: calc(100vh - 72px);
}
@media (min-width: 768px) {
  .app-main {
    padding-top: 24px;
    padding-bottom: 56px;
  }
}

.page-header {
  padding: 6px 0 4px;
}
.page-kicker {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  line-height: 1;
  text-transform: uppercase;
}
.page-title {
  color: var(--text-primary);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 850;
  line-height: 1.05;
  margin-top: 8px;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-top: 10px;
  max-width: 62ch;
}
.section-block {
  margin-top: 38px;
}
.section-header {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  color: var(--text-primary);
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 820;
  line-height: 1.12;
}
.section-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 5px;
}
.media-rail {
  gap: 14px;
  padding-bottom: 6px;
  padding-top: 2px;
}
.carousel-rail-wrap {
  position: relative;
}
.carousel-rail-wrap::after {
  background: linear-gradient(90deg, rgba(0,0,0,0), var(--bg-base));
  bottom: 0;
  content: "";
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  width: 36px;
  z-index: 2;
}
.carousel-panel .carousel-rail-wrap::after {
  background: linear-gradient(90deg, rgba(0,0,0,0), var(--bg-surface));
}
.content-grid {
  gap: 14px;
}
@media (min-width: 768px) {
  .section-block {
    margin-top: 48px;
  }
  .media-rail {
    gap: 18px;
  }
  .content-grid {
    gap: 18px;
  }
  .carousel-rail-wrap::after {
    width: 52px;
  }
}
.empty-state,
.load-message {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
  padding: 48px 12px;
  text-align: center;
}
.load-message {
  padding-bottom: 16px;
  padding-top: 16px;
  text-align: left;
}

/* ── Error state ──────────────────────────────────────────────── */
.error-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-column: 1 / -1;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  width: 100%;
}
.error-state--inline {
  padding: 24px 12px;
}
.media-rail .error-state,
.media-rail .error-state--inline {
  display: flex;
  min-width: 100%;
  width: 100%;
}
.media-rail:has(.error-state) {
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  overflow-x: hidden;
}
.error-state__icon {
  align-items: center;
  background: var(--empty-icon-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--negative);
  display: flex;
  height: 56px;
  justify-content: center;
  width: 56px;
}
.error-state--inline .error-state__icon {
  height: 44px;
  width: 44px;
}
.error-state--inline .error-state__icon svg {
  width: 22px;
  height: 22px;
}
.error-state__message {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.55;
  max-width: 32ch;
}
.error-state__retry {
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border-muted);
  border-radius: 9999px;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  gap: 6px;
  letter-spacing: 0.6px;
  margin-top: 4px;
  min-height: 36px;
  padding: 0 16px;
  text-transform: uppercase;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.error-state__retry:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}
.error-state__retry:active {
  transform: scale(0.96);
}

/* ── Image progressive loading ───────────────────────────────── */
.poster-card img,
.home-hero-img,
.detail-poster-img,
.detail-backdrop-img,
.shorts-feed__poster,
.detail-cast-img {
  transition: filter 0.4s ease, opacity 0.4s ease;
}
.poster-card__img {
  /* Override: poster images use separate transform transition for hover zoom */
  transition: transform 0.8s cubic-bezier(0.2, 0, 0.2, 1), filter 0.4s ease, opacity 0.4s ease;
}
.poster-card img:not(.is-loaded),
.home-hero-img:not(.is-loaded),
.detail-poster-img:not(.is-loaded),
.detail-backdrop-img:not(.is-loaded) {
  filter: blur(6px);
  opacity: 0.6;
}
.poster-card img.is-loaded,
.home-hero-img.is-loaded,
.detail-poster-img.is-loaded,
.detail-backdrop-img.is-loaded,
img.is-loaded {
  filter: none;
  opacity: 1;
}

.soft-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-medium);
}

.detail-page {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
}

/* ── Backdrop — hidden, not needed ── */
.detail-backdrop {
  display: none;
}

/* ── Main layout ── */
.detail-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 768px) {
  .detail-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
  }
  .detail-poster-col {
    position: sticky;
    top: calc(72px + env(safe-area-inset-top));
  }
}
@media (min-width: 1024px) {
  .detail-layout {
    gap: 40px;
  }
}

/* ── Poster column ── */
.detail-poster-col {
  flex-shrink: 0;
}
.detail-poster-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-heavy);
  aspect-ratio: 2 / 3;
}
.detail-poster-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-poster-wrap.skeleton {
  box-shadow: none;
}

/* Mobile: poster as wide banner */
@media (max-width: 767.98px) {
  .detail-poster-col {
    margin: -16px -16px 0;
  }
  .detail-poster-wrap {
    border-radius: 0;
    box-shadow: none;
    aspect-ratio: 16 / 10;
  }
  .detail-poster-wrap.skeleton {
    aspect-ratio: 16 / 10;
  }
  .detail-poster-img {
    object-position: center 20%;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .detail-poster-wrap {
    width: 200px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .detail-poster-wrap {
    width: 260px;
  }
}

/* ── Info column ── */
.detail-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .detail-info-col {
    padding-top: 4px;
  }
}

/* Meta row */
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1;
}
.detail-tag--muted {
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.detail-tag--ongoing {
  background: rgba(255, 179, 71, 0.15);
  border: 1px solid rgba(255, 179, 71, 0.3);
  color: var(--warning);
}
html.light .detail-tag--ongoing {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #d97706;
}

/* Title */
.detail-title {
  color: var(--text-primary);
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.15;
  margin-top: 14px;
  letter-spacing: -0.02em;
}
.detail-title-skeleton {
  margin-top: 14px;
}
.detail-tag-skeleton {
  display: inline-block;
  width: 72px;
  height: 24px;
  border-radius: 9999px;
}
.detail-tag-skeleton:nth-child(2) {
  width: 90px;
}
.detail-ep-skeleton {
  aspect-ratio: 1;
  border-radius: 10px;
}

/* Synopsis */
.detail-synopsis {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
  margin-top: 12px;
}
.detail-synopsis-skeleton {
  margin-top: 12px;
}
.detail-synopsis.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-synopsis.is-expanded {
  display: block;
}
.detail-more-btn {
  width: max-content;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.detail-more-btn:hover { text-decoration: underline; }

/* Cast section */
.detail-cast-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-muted);
}
.detail-cast-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.detail-cast-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 14px 10px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-cast-scroll.is-collapsed {
  max-height: var(--cast-2rows, 220px);
}
.detail-cast-scroll::-webkit-scrollbar { display: none; }
.detail-cast-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 0;
}
.detail-cast-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-raised);
  border: 2px solid var(--border-muted);
  flex-shrink: 0;
}
.detail-cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-cast-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.detail-cast-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}
.detail-cast-role {
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 1.1;
  text-align: center;
  word-break: break-word;
}
.detail-cast-img {
  cursor: pointer;
  transition: transform 0.15s ease;
}
.detail-cast-img:active {
  transform: scale(0.92);
}
.cast-show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.cast-show-more:hover {
  opacity: 0.8;
}
.cast-show-more svg {
  transition: transform 0.3s ease;
}
.cast-show-more.is-expanded svg {
  transform: rotate(180deg);
}
@media (min-width: 768px) {
  .detail-cast-scroll {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

/* Cast fullscreen modal */
.cast-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cast-modal-backdrop.is-visible { opacity: 1; }
.cast-modal {
  position: fixed;
  inset: 0;
  z-index: 301;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cast-modal.is-visible {
  opacity: 1;
  transform: scale(1);
}
.cast-modal-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.cast-modal-close:hover { background: rgba(255,255,255,0.2); }
.cast-modal-img {
  max-width: min(400px, 85vw);
  max-height: 70vh;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.cast-modal-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-align: center;
}
.cast-modal-role {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-align: center;
}

/* Details info pills */
.detail-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-muted);
}
.detail-info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-raised);
  border: 1px solid var(--border-muted);
  border-radius: 9999px;
}
.detail-info-chip strong {
  color: var(--text-secondary);
  font-weight: 700;
}

/* Actions */
.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.detail-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border-radius: 9999px;
  background: var(--accent-control-bg);
  color: var(--accent-control-text);
  border: none;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 14px rgba(43,166,65,0.22);
}
.detail-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(43,166,65,0.32);
}
.detail-play-btn:active { transform: scale(0.96); }
html.light .detail-play-btn {
  box-shadow: 0 4px 14px rgba(43,166,65,0.16);
}
html.light .detail-play-btn:hover {
  box-shadow: 0 6px 18px rgba(43,166,65,0.26);
}

.detail-action-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-muted);
  background: var(--bg-raised);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.detail-action-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}
.detail-action-icon:active { transform: scale(0.9); }
.detail-action-icon.is-active {
  background: var(--accent-control-bg);
  border-color: var(--accent-control-border);
  color: var(--accent-control-text);
}

/* Mobile: full-width play button */
@media (max-width: 767.98px) {
  .detail-play-btn {
    flex: 1;
  }
}

/* ── Episodes section ── */
.detail-episodes-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}
.detail-episodes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.detail-episodes-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 850;
}
.detail-episodes-count {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 700;
}
.detail-ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}
.detail-ep-btn {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.12s ease;
}
.detail-ep-btn:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.detail-ep-btn:active {
  transform: scale(0.94);
}
@media (min-width: 768px) {
  .detail-ep-grid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 10px;
  }
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Keyframes ────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes pop {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes toastSpin { to { transform: rotate(360deg); } }
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43,166,65,0.42); }
  50%       { box-shadow: 0 0 0 8px rgba(43,166,65,0); }
}
@keyframes ripple-anim { to { transform: scale(1); opacity: 0; } }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes back-to-top-in {
  from { opacity: 0; transform: translateY(12px) scale(0.85); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes back-to-top-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.85); }
}
@keyframes continue-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes theme-switch {
  0%   { opacity: 0; transform: scale(0.8) rotate(-15deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes countdown-ring {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 113; }
}

/* ── Utility animation classes ────────────────────────────────── */
.animate-fade-in   { animation: fadeIn   0.35s ease-out; }
.animate-slide-up  { animation: slideUp  0.32s cubic-bezier(.32,.72,.4,1); }
.animate-slide-down{ animation: slideDown 0.32s cubic-bezier(.32,.72,.4,1); }
.animate-pop       { animation: pop      0.25s ease-out; }
.animate-spin-slow { animation: spinSlow 1s linear infinite; }
.animate-float     { animation: float    3s ease-in-out infinite; }

/* ── Skeleton shimmer ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton-from) 0%, var(--skeleton-to) 50%, var(--skeleton-from) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-text {
  color: transparent !important;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton-from) 0%, var(--skeleton-to) 50%, var(--skeleton-from) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

/* ── Aspect ratio ─────────────────────────────────────────────── */
.aspect-vertical { aspect-ratio: 9 / 16; }

/* ── Video ────────────────────────────────────────────────────── */
video { background: #000; }
video::-webkit-media-controls-panel {
  background-image: linear-gradient(transparent, rgba(0,0,0,.5));
}

/* ── Bottom-sheet ─────────────────────────────────────────────── */
.sheet-translate {
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0.4, 1);
}
.sheet-translate.is-open { transform: translateY(0); }
.sheet-translate.is-dragging { transition: none !important; }

/* ── Platform tab active indicator ───────────────────────────── */
.tab-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-control-bg);
}

/* ── Poster card ──────────────────────────────────────────────── */
.poster-card {
  box-shadow: none;
  transition: none;
}
.poster-card:hover {
  box-shadow: none;
  transform: none;
}

/* Poster image smooth zoom on hover */
.poster-card__img {
  transform: scale(1);
  transition: transform 0.8s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
}
.poster-card:hover .poster-card__img {
  transform: scale(1.05);
}
.poster-card:active .poster-card__img {
  transform: scale(1.02);
  transition-duration: 0.2s;
}
.poster-card:active { transform: none; }
.poster-card h4 {
  font-weight: 750;
  line-height: 1.25;
}
.poster-card p {
  line-height: 1.45;
}
@media (max-width: 420px) {
  .poster-card h4 {
    font-size: 13px;
  }
}

/* ── Hero gradient overlay ────────────────────────────────────── */
.hero-gradient {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(15,15,15,0.15) 40%,
    rgba(15,15,15,0.92) 100%
  );
}
html.light .hero-gradient {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(15,15,15,0.15) 40%,
    rgba(15,15,15,0.92) 100%
  );
}
.hero-slide h2,
.hero-slide h3,
.hero-slide p {
  text-shadow: 0 2px 14px rgba(0,0,0,0.42);
}

.home-hero {
  border-radius: 0;
  box-shadow: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0;
  width: 100vw;
}
.home-hero .hero-gradient {
  background:
    linear-gradient(90deg, rgba(15,15,15,0.94) 0%, rgba(15,15,15,0.7) 30%, rgba(15,15,15,0.12) 68%, rgba(15,15,15,0.72) 100%),
    linear-gradient(180deg, rgba(15,15,15,0.24) 0%, rgba(15,15,15,0.08) 48%, rgba(15,15,15,0.96) 100%);
}
html.light .home-hero .hero-gradient {
  background:
    linear-gradient(90deg, rgba(15,15,15,0.94) 0%, rgba(15,15,15,0.7) 30%, rgba(15,15,15,0.12) 68%, rgba(15,15,15,0.72) 100%),
    linear-gradient(180deg, rgba(15,15,15,0.24) 0%, rgba(15,15,15,0.08) 48%, rgba(15,15,15,0.96) 100%);
}
.home-hero::after {
  background: linear-gradient(180deg, rgba(15,15,15,0), #0f0f0f);
  bottom: 0;
  content: "";
  height: 22%;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 1;
}
html.light .home-hero::after {
  background: linear-gradient(180deg, rgba(15,15,15,0), #0f0f0f);
}
html.light .home-hero {
  background: #0f0f0f !important;
}
.home-hero-skeleton {
  aspect-ratio: 21 / 9;
  min-height: 0;
}
.home-hero .home-hero-skeleton {
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  min-height: 620px;
}
.home-hero-img {
  object-position: center 20%;
  image-rendering: auto;
  -webkit-image-rendering: auto;
}
.home-hero-copy {
  bottom: clamp(148px, 22vh, 232px);
  left: max(24px, calc((100vw - 1280px) / 2 + 16px));
  max-width: min(620px, calc(100vw - 48px));
}
.home-hero-skeleton-bg {
  background:
    radial-gradient(circle at 72% 28%, #262626 0%, #171717 36%, #0f0f0f 72%),
    linear-gradient(110deg, #111 0%, #242424 42%, #141414 78%) !important;
  background-size: 220% 100% !important;
}
.home-hero-skeleton-shade {
  background:
    linear-gradient(90deg, rgba(15,15,15,0.9), rgba(15,15,15,0.44) 42%, rgba(15,15,15,0.18)),
    linear-gradient(180deg, rgba(15,15,15,0.04), rgba(15,15,15,0.94));
}
.home-hero-skeleton-copy {
  bottom: 24px;
  left: 20px;
  max-width: min(620px, calc(100vw - 48px));
}
.home-hero .home-hero-skeleton-copy {
  bottom: clamp(148px, 22vh, 232px);
  left: max(24px, calc((100vw - 1280px) / 2 + 16px));
}
.home-hero-skeleton-dots {
  bottom: clamp(34px, 6vh, 62px);
}
.home-hero-skeleton-dot {
  border-radius: 9999px;
  display: block;
  height: 8px;
  width: 8px;
}
.home-hero-skeleton-dot.is-active {
  width: 28px;
}
.home-hero-skeleton-badge {
  border-radius: 9999px;
  height: 30px;
  width: 124px;
}
.home-hero-skeleton-title {
  border-radius: 8px;
  height: 54px;
  margin-top: 18px;
}
.home-hero-skeleton-title-a {
  width: min(520px, 72vw);
}
.home-hero-skeleton-title-b {
  margin-top: 10px;
  width: min(420px, 58vw);
}
.home-hero-skeleton-meta {
  border-radius: 9999px;
  height: 18px;
  margin-top: 18px;
  width: min(260px, 46vw);
}
.home-hero-skeleton-line {
  border-radius: 9999px;
  height: 15px;
  margin-top: 14px;
}
.home-hero-skeleton-line-a {
  width: min(560px, 76vw);
}
.home-hero-skeleton-line-b {
  margin-top: 9px;
  width: min(430px, 62vw);
}
.home-hero-skeleton-cta {
  border-radius: 9999px;
  height: 50px;
  margin-top: 24px;
  width: 210px;
}
.home-hero .skeleton {
  --skeleton-from: #171717;
  --skeleton-to: #303030;
}
html.light .home-hero .skeleton {
  --skeleton-from: #1a1a1a;
  --skeleton-to: #333333;
}
.home-hero-title {
  font-size: clamp(28px, 4.6vw, 52px);
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: 0;
  max-width: 18ch;
}
.home-hero-meta {
  font-size: clamp(12px, 1.6vw, 15px);
  font-weight: 650;
}
.home-hero-synopsis {
  color: rgba(255,255,255,0.82);
  font-size: clamp(13px, 1.7vw, 16px);
  font-weight: 500;
  line-height: 1.55;
  max-width: min(58ch, calc(100vw - 48px));
  text-shadow: 0 2px 14px rgba(0,0,0,0.48);
}
.home-hero-info-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0.34), rgba(255,255,255,0.18));
  background-size: 220% 100%;
  display: block;
}
.home-hero-title-skeleton {
  border-radius: 8px;
  height: clamp(34px, 4.6vw, 54px);
  margin-top: 10px;
  max-width: min(520px, 72vw);
  width: 100%;
}
.home-hero-meta-skeleton {
  border-radius: 9999px;
  height: 17px;
  margin-top: 12px;
  width: min(260px, 46vw);
}
.home-hero-synopsis-skeleton {
  border-radius: 9999px;
  height: 15px;
  margin-top: 12px;
  width: min(560px, 76vw);
}
.home-hero-synopsis-skeleton + .home-hero-synopsis-skeleton {
  margin-top: 9px;
  width: min(430px, 62vw);
}
.home-hero-dots {
  bottom: clamp(34px, 6vh, 62px);
}
@media (min-width: 768px) {
  .home-hero {
    margin-top: 0;
  }
}
@media (max-width: 767.98px) {
  .home-hero {
    margin-left: -16px;
    margin-right: -16px;
    margin-top: 0;
    width: calc(100% + 32px);
  }
  .home-hero .home-hero-skeleton {
    height: calc(100vh - 104px);
    height: calc(100dvh - 104px);
    min-height: 560px;
  }
  .home-hero-copy {
    bottom: 230px;
    left: 16px;
    max-width: calc(100vw - 32px);
  }
  .home-hero .home-hero-skeleton-copy {
    bottom: 230px;
    left: 16px;
    max-width: calc(100vw - 32px);
  }
  .home-hero-skeleton-badge {
    height: 28px;
    width: 116px;
  }
  .home-hero-skeleton-title {
    height: 38px;
    margin-top: 14px;
  }
  .home-hero-skeleton-title-a {
    width: min(340px, 86vw);
  }
  .home-hero-skeleton-title-b {
    margin-top: 8px;
    width: min(270px, 70vw);
  }
  .home-hero-skeleton-meta {
    height: 16px;
    margin-top: 14px;
    width: min(220px, 62vw);
  }
  .home-hero-skeleton-line {
    height: 13px;
    margin-top: 12px;
  }
  .home-hero-skeleton-line-a {
    width: min(340px, 86vw);
  }
  .home-hero-skeleton-line-b {
    margin-top: 8px;
    width: min(300px, 76vw);
  }
  .home-hero-skeleton-cta {
    height: 42px;
    margin-top: 20px;
    width: 190px;
  }
  .home-hero-title {
    font-size: clamp(24px, 7.2vw, 36px);
    max-width: 15ch;
  }
  .home-hero-title-skeleton {
    height: 38px;
    max-width: min(340px, 86vw);
  }
  .home-hero-meta-skeleton {
    width: min(220px, 62vw);
  }
  .home-hero-synopsis-skeleton {
    width: min(340px, 86vw);
  }
  .home-hero-synopsis-skeleton + .home-hero-synopsis-skeleton {
    width: min(300px, 76vw);
  }
  .home-hero-synopsis {
    font-size: 13px;
    max-width: calc(100vw - 32px);
  }
  .home-hero-dots {
    bottom: 64px;
  }
  .home-hero-skeleton-dots {
    bottom: 64px;
  }
}

/* ── Hero Slider — Ultra-smooth cinematic transitions ─────────── */
.hero-track-stack {
  position: relative;
  width: 100%;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  min-height: 620px;
}
@media (max-width: 767.98px) {
  .hero-track-stack {
    height: calc(100vh - 104px);
    height: calc(100dvh - 104px);
    min-height: 560px;
  }
}

/* Slide base — invisible, slightly zoomed in */
.home-hero-slide {
  position: absolute !important;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  z-index: 0;
  transform: scale(1.02);
  transition:
    opacity 1.6s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 2s cubic-bezier(0.25, 0.1, 0.25, 1),
    visibility 0s 1.6s;
  will-change: opacity, transform;
}

/* Active slide — fully visible, natural scale */
.home-hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
  transform: scale(1);
  transition:
    opacity 1.6s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 2s cubic-bezier(0.25, 0.1, 0.25, 1),
    visibility 0s 0s;
}

/* Previous slide — fades out, scales down gently */
.home-hero-slide.is-prev {
  opacity: 0;
  visibility: visible;
  z-index: 1;
  transform: scale(0.98);
  transition:
    opacity 1.8s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 2.2s cubic-bezier(0.25, 0.1, 0.25, 1),
    visibility 0s 1.8s;
}

/* Ken Burns — very slow, barely perceptible drift */
@keyframes heroKenBurns {
  0%   { transform: scale(1) translate3d(0, 0, 0); }
  100% { transform: scale(1.05) translate3d(-0.3%, 0.2%, 0); }
}
.home-hero-slide .home-hero-img {
  transform: scale(1) translate3d(0, 0, 0);
  transform-origin: center 20%;
}
.home-hero-slide.is-active .home-hero-img {
  animation: heroKenBurns 10s cubic-bezier(0.25, 0, 0.35, 1) forwards;
}

/* Copy container — subtle upward drift (parallax feel) */
@keyframes heroCopyFloat {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -3px, 0); }
}
.home-hero-slide.is-active .home-hero-copy {
  animation: heroCopyFloat 10s cubic-bezier(0.25, 0, 0.35, 1) forwards;
}

/* Text entrance — elegant fade with minimal blur */
@keyframes heroTextIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}
@keyframes heroTextOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
    filter: blur(1.5px);
  }
}

.home-hero-slide .home-hero-copy > * {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  filter: blur(2px);
}
.home-hero-slide.is-active .home-hero-copy > * {
  animation: heroTextIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.home-hero-slide.is-active .home-hero-copy > *:nth-child(1) { animation-delay: 0.3s; }
.home-hero-slide.is-active .home-hero-copy > *:nth-child(2) { animation-delay: 0.42s; }
.home-hero-slide.is-active .home-hero-copy > *:nth-child(3) { animation-delay: 0.54s; }
.home-hero-slide.is-active .home-hero-copy > *:nth-child(4) { animation-delay: 0.66s; }
.home-hero-slide.is-active .home-hero-copy > *:nth-child(5) { animation-delay: 0.78s; }
.home-hero-slide.is-active .home-hero-copy > *:nth-child(6) { animation-delay: 0.88s; }

.home-hero-slide.is-prev .home-hero-copy > * {
  animation: heroTextOut 0.7s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* Gradient overlay — smooth opacity during transitions */
.home-hero-slide .hero-gradient {
  transition: opacity 1.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Hero CTA button — elegant hover lift */
.hero-cta-watch {
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.5s ease;
}
.hero-cta-watch:hover {
  transform: translateY(-2px);
  box-shadow: rgba(43,166,65,0.3) 0px 14px 36px, rgba(0,0,0,0.4) 0px 6px 20px !important;
}
.hero-cta-watch:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.12s;
}

/* Hero dot — smooth width transition */
.hero-dot-btn {
  transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), background 0.4s ease;
  border-radius: 9999px;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Reduced motion: disable all animations gracefully */
@media (prefers-reduced-motion: reduce) {
  .home-hero-slide .home-hero-img {
    animation: none !important;
  }
  .home-hero-slide .home-hero-copy {
    animation: none !important;
  }
  .home-hero-slide .home-hero-copy > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .home-hero-slide {
    transform: none !important;
    transition: opacity 0.3s ease, visibility 0s !important;
  }
}

/* ── Green play button pulse ──────────────────────────────────── */
body:has(.home-hero) #mainContent {
  padding-top: 0 !important;
}

.play-btn-pulse { animation: pulse-green 2s ease-in-out infinite; }

/* ── Rank text ────────────────────────────────────────────────── */
.rank-text {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 34px;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.45));
  letter-spacing: 0;
}
html.light .rank-text {
  -webkit-text-stroke: 2px var(--accent);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}

/* ── Nav active states ────────────────────────────────────────── */
.topbar-shell {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.topbar-brand {
  color: var(--text-primary);
  min-width: 0;
  letter-spacing: -0.01em;
}
.dnav-link {
  line-height: 1;
  min-width: max-content;
}
.dnav-link:hover {
  background: color-mix(in srgb, var(--bg-hover) 78%, transparent);
  color: var(--text-primary) !important;
}
.bnav-item.is-active .nav-icon  { color: var(--accent); }
.bnav-item.is-active .nav-label { color: var(--text-primary); }
.dnav-link.is-active {
  background: var(--accent-muted);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}

/* ── Search input inset border ────────────────────────────────── */
.search-input-wrap {
  box-shadow: var(--inset-border);
}
.search-input-wrap:focus-within {
  box-shadow: var(--inset-border-focus);
}
.search-empty-icon {
  background: var(--empty-icon-bg);
  color: var(--empty-icon-fg);
}
.search-empty-title {
  color: var(--text-primary);
}
.search-empty-title span {
  color: var(--accent);
}
.search-empty-subtitle {
  color: var(--text-secondary);
}

/* ── Card shadows ─────────────────────────────────────────────── */
.card-shadow       { box-shadow: var(--shadow-medium); }
.card-shadow-heavy { box-shadow: var(--shadow-heavy); }

/* ── Subtitle styling ─────────────────────────────────────────── */
video::cue {
  color: #fff;
  background: transparent;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
  text-shadow:
    0 0 4px rgba(0,0,0,0.95),
    0 1px 2px rgba(0,0,0,0.95),
    0 0 14px rgba(0,0,0,0.55);
  white-space: pre-line;
}
.player video::cue { font-size: 16px; }
@media (min-width: 1024px) { video::cue { font-size: 20px; } }
video::-webkit-media-text-track-display { background: transparent !important; }
video::-webkit-media-text-track-container { padding-bottom: 10px; }

/* ── Countdown ring ───────────────────────────────────────────── */
.countdown-ring {
  --p: 0;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,0.18) 0);
}

/* ── Swipe hint ───────────────────────────────────────────────── */
#swipeHint { transition: opacity .4s ease; }
#swipeHint.hidden-fade { opacity: 0; pointer-events: none; }

.player-inner {
  overflow: hidden;
  transition: aspect-ratio 0.3s ease;
}
/* Prevent grid children from overflowing */
.watch-root > * {
  min-width: 0;
  max-width: 100%;
}

/* Desktop: batasi tinggi player agar sidebar episode tidak terpotong */
@media (min-width: 768px) {
  .player-wrap {
    max-height: 75vh;
  }
  .player-inner {
    max-height: 75vh;
  }
  .player-inner #video {
    object-fit: contain;
  }
}
.watch-scroll-ghost {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: #000;
}
.watch-scroll-ghost video {
  width: 100%;
  height: 100%;
  object-fit: inherit;
}
.watch-scroll-next #video {
  animation: watch-current-up 340ms cubic-bezier(.2,.8,.2,1) forwards;
}
.watch-scroll-next .watch-scroll-ghost {
  animation: watch-ghost-up 340ms cubic-bezier(.2,.8,.2,1) forwards;
}
.watch-scroll-prev #video {
  animation: watch-current-down 340ms cubic-bezier(.2,.8,.2,1) forwards;
}
.watch-scroll-prev .watch-scroll-ghost {
  animation: watch-ghost-down 340ms cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes watch-current-up {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0.45; transform: translateY(-18%) scale(0.985); }
}
@keyframes watch-ghost-up {
  from { opacity: 0.45; transform: translateY(18%) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes watch-current-down {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0.45; transform: translateY(18%) scale(0.985); }
}
@keyframes watch-ghost-down {
  from { opacity: 0.45; transform: translateY(-18%) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .watch-scroll-next #video,
  .watch-scroll-next .watch-scroll-ghost,
  .watch-scroll-prev #video,
  .watch-scroll-prev .watch-scroll-ghost {
    animation: none !important;
  }
}

/* ── Mobile overlay auto-hide ─────────────────────────────────── */
#mobileOverlay {
  opacity: 1;
}
#mobileOverlay .overlay-auto-hide,
#mobileOverlay .mobile-rail-persist {
  transition: opacity 0.22s ease, transform 0.22s ease, filter 0.22s ease;
}
#mobileOverlay.is-hidden .overlay-auto-hide {
  opacity: 0;
  pointer-events: none !important;
}
#mobileOverlay.is-hidden .overlay-auto-hide * {
  pointer-events: none !important;
}
#mobileOverlay .mobile-rail-persist {
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.45));
  overflow: visible;
}
#mobileOverlay.is-hidden .mobile-rail-persist {
  opacity: 0;
  pointer-events: none !important;
  transform: translate(12px, -50%) scale(.96) !important;
}
#mobileOverlay.is-hidden .mobile-rail-persist * {
  pointer-events: none !important;
}
#mobileOverlay.is-hidden .mobile-rail-persist button {
  background-color: rgba(0,0,0,0.48);
}
#mobileOverlay.is-hidden .mobile-rail-persist #openEpSheetBtn {
  background: var(--accent-control-bg) !important;
}
.mobile-rail-persist button {
  touch-action: manipulation;
}
.episode-action-stack {
  isolation: isolate;
  overflow: visible;
}
#openEpSheetBtn {
  isolation: isolate;
}
#openEpSheetBtn [data-lucide] {
  position: relative;
  z-index: 1;
}
#epBadgeMobile {
  z-index: 60;
  transform: translateZ(0);
  box-shadow: 0 8px 22px rgba(0,0,0,0.72);
}
.sheet-drag-zone {
  touch-action: none;
}

body.watch-loading #dramaTitle,
body.watch-loading #dramaTitleMobile,
body.watch-loading #dramaSynopsis,
body.watch-loading #epLabel,
body.watch-loading #epLabelMobile,
body.watch-loading #totalLabel,
body.watch-loading #epSheetSub {
  color: transparent !important;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton-from) 0%, var(--skeleton-to) 50%, var(--skeleton-from) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
body.watch-loading #dramaTitle { min-height: 28px; max-width: 520px; }
body.watch-loading #dramaTitleMobile { min-height: 16px; max-width: 220px; }
body.watch-loading #dramaSynopsis { min-height: 58px; max-width: 680px; }
body.watch-loading #epLabel,
body.watch-loading #epLabelMobile,
body.watch-loading #totalLabel,
body.watch-loading #epSheetSub { min-width: 72px; min-height: 14px; }

/* ── Lucide icons ─────────────────────────────────────────────── */
[data-lucide] { width: 1em; height: 1em; }

/* ── Chip / badge active states ───────────────────────────────── */
.lib-chip.is-active {
  background: var(--accent-control-bg) !important;
  color: var(--accent-control-text) !important;
  border-color: var(--accent-control-border) !important;
}
.ep-btn.is-active {
  background: var(--accent-control-bg);
  color: var(--accent-control-text);
  font-weight: 700;
}
.quality-btn.is-active {
  background: var(--accent-control-bg);
  color: var(--accent-control-text);
  border-color: var(--accent-control-border);
}
.watch-control-panel {
  border-radius: 12px;
}
.watch-chip-row:empty {
  display: none;
}
.watch-chip-label {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1px;
  min-height: 30px;
  text-transform: uppercase;
}
.quality-btn,
.speed-btn {
  border: 1px solid var(--border-muted);
  border-radius: 9999px;
  background: var(--control-bg);
  color: var(--control-text);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .8px;
  line-height: 1;
  min-height: 30px;
  padding: 0 12px;
  text-transform: uppercase;
}
.quality-btn:hover,
.speed-btn:hover {
  background: var(--control-hover);
  border-color: var(--accent);
  color: var(--text-primary);
}
.quality-btn.is-active,
.speed-btn.is-active {
  background: var(--accent-control-bg);
  border-color: var(--accent-control-border);
  color: var(--accent-control-text);
}
.ep-btn {
  background: var(--control-bg);
  border: 1px solid var(--border-color);
  color: var(--control-text);
}
.ep-btn:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* ── Hero slide dots ──────────────────────────────────────────── */
.hero-dot { transition: all 0.3s ease; }
.hero-dot.is-active { background: var(--accent); width: 28px; }
.hero-dot-btn {
  display: block;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: rgba(255,255,255,0.38);
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}
.hero-dot-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ── Scrollable rail snap ─────────────────────────────────────── */
.snap-rail {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.snap-rail > * { scroll-snap-align: start; }

/* ── Gradient text ────────────────────────────────────────────── */
.text-gradient-green {
  background: linear-gradient(135deg, #2BA641, #238A36);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.light .text-gradient-green {
  background: linear-gradient(135deg, #2BA641, #1D7330);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Section divider ──────────────────────────────────────────── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
}

/* ── Toast container ──────────────────────────────────────────── */
#toastContainer {
  position: fixed;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  /* Mobile: bottom-center */
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  width: max-content;
  max-width: calc(100vw - 32px);
}
@media (min-width: 640px) {
  /* Desktop: top-right */
  #toastContainer {
    bottom: auto;
    top: 72px;
    right: 16px;
    left: auto;
    transform: none;
    align-items: flex-end;
    width: auto;
    max-width: 380px;
  }
}

/* ── Back to top button ───────────────────────────────────────── */
#backToTop {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-heavy);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  opacity: 0;
  pointer-events: none;
}
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
  animation: back-to-top-in 0.3s ease-out forwards;
}
#backToTop.hiding {
  animation: back-to-top-out 0.25s ease-in forwards;
}
#backToTop:hover {
  background: var(--accent-control-bg);
  color: var(--accent-control-text);
  border-color: var(--accent-control-border);
}
@media (min-width: 768px) {
  #backToTop { bottom: 24px; }
}

/* ── Theme toggle button animation ───────────────────────────── */
#themeToggleBtn svg {
  transition: transform 0.3s ease, opacity 0.2s ease;
}
#themeToggleBtn:active svg {
  animation: theme-switch 0.3s ease-out;
}

/* ── Continue watching banner ─────────────────────────────────── */
#continueWatchingBanner {
  animation: continue-slide-in 0.4s ease-out;
}

/* ── PWA install card ─────────────────────────────────────────── */
#pwaInstallCard {
  background: linear-gradient(135deg, var(--accent-muted), rgba(43,166,65,0.04));
  border: 1px solid rgba(43,166,65,0.22);
  border-radius: var(--radius-lg);
  padding: 20px;
  animation: fadeIn 0.4s ease-out;
}
html.light #pwaInstallCard {
  background: linear-gradient(135deg, var(--accent-muted), rgba(43,166,65,0.04));
  border: 1px solid rgba(43,166,65,0.2);
}

/* ── Offline indicator ────────────────────────────────────────── */
body.is-offline #topBar::after {
  content: 'Offline';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 0 0 8px 8px;
}

/* ── Tooltip ──────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: var(--shadow-heavy);
  z-index: 99999;
}
[data-tooltip][data-tooltip-pos="right"]::after {
  bottom: 50%;
  left: calc(100% + 8px);
  transform: translateY(50%);
}
[data-tooltip][data-tooltip-pos="left"]::after {
  bottom: 50%;
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(50%);
}
[data-tooltip][data-tooltip-pos="bottom"]::after,
.topbar-shell [data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
[data-tooltip]:hover::after { opacity: 1; }
@media (max-width: 767px) {
  [data-tooltip]::after {
    content: none !important;
    display: none !important;
  }
}

/* ── Focus ring ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Light mode overrides for topbar / bottomnav ─────────────── */
html.light #topBar {
  border-bottom-color: var(--border-color);
}
html.light #topBar .topbar-shell {
  background: var(--topbar-bg);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}
html.light #bottomNav {
  border-top-color: var(--border-color);
  background: var(--bottomnav-bg);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}

/* ── Light mode poster card ───────────────────────────────────── */

/* ── Watch page — mobile immersive ────────────────────────────── */
@media (max-width: 767.98px) {
  body:has(#watchRoot) #topBar,
  body:has(#watchRoot) #bottomNav,
  body.is-watch #topBar,
  body.is-watch #bottomNav { display: none !important; }
  body:has(#watchRoot),
  body.is-watch { padding-bottom: 0 !important; }
  body:has(#watchRoot) main,
  body.is-watch main {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }
  body:has(#watchRoot) .watch-root,
  body.is-watch .watch-root { margin: 0 !important; gap: 0 !important; }
  body:has(#watchRoot) .meta-block,
  body.is-watch .meta-block { display: none !important; }
  body:has(#watchRoot) .player-wrap,
  body.is-watch .player-wrap {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0 !important;
    border-radius: 0 !important;
    z-index: 30;
  }
  body:has(#watchRoot) .player-inner,
  body.is-watch .player-inner {
    aspect-ratio: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100%;
  }
  body:has(#watchRoot) #video { object-fit: contain; }
  body.is-watch.is-vertical  #video { object-fit: cover; }
  body.is-watch.is-horizontal #video { object-fit: contain; }
}

/* ── Seek bar custom styling ── */
.seek-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: var(--border-muted);
  outline: none;
  cursor: pointer;
}
.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}
.seek-bar::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* ── Redesigned watch page + custom player ───────────────────── */
.watch-page-grid {
  display: grid;
  gap: 20px;
  margin-left: -1rem;
  margin-right: -1rem;
}
.watch-player-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-heavy);
}
.watch-player-inner {
  position: relative;
  width: 100%;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
}
.watch-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.watch-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255,255,255,.72);
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(2px);
}

/* ── Auth pages + account settings ───────────────────────────── */
.auth-layout { display: grid; min-height: 100vh; min-height: 100dvh; }
@media (min-width: 1024px) { .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.auth-brand-panel { position: sticky; top: 0; display: none; min-height: 100vh; overflow: hidden; flex-direction: column; justify-content: space-between; padding: 48px; background: var(--accent); color: var(--accent-control-text); }
@media (min-width: 1024px) { .auth-brand-panel { display: flex; } }
.auth-brand-panel::before,.auth-brand-panel::after { position: absolute; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.2), transparent); content: ""; }
.auth-brand-panel::before { left: -150px; top: -150px; }
.auth-brand-panel::after { right: -150px; bottom: -180px; opacity: .8; }
.auth-brand-noise { position: absolute; inset: 0; opacity: .07; background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 22px 22px; }
.auth-brand-logo,.auth-brand-copy,.auth-brand-foot { position: relative; z-index: 1; }
.auth-brand-logo img { width: auto; height: 30px; filter: none; }
.auth-brand-copy h1 { max-width: 500px; font-size: clamp(30px, 3.2vw, 44px); font-weight: 760; line-height: 1.08; letter-spacing: 0; }
.auth-brand-copy p { max-width: 440px; margin-top: 16px; color: rgba(255,255,255,.84); font-size: 14px; line-height: 1.68; }
.auth-brand-foot { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 850; letter-spacing: .18em; }
.auth-brand-foot span { width: 34px; height: 1px; background: rgba(255,255,255,.45); }
.auth-main { display: flex; min-height: 100vh; min-height: 100dvh; flex-direction: column; background: var(--bg-base); }
.auth-main-scroll { overflow-y: auto; }
.auth-top { display: flex; justify-content: space-between; padding: 24px 24px 0; }
@media (min-width: 640px) { .auth-top { padding: 32px 40px 0; } }
.auth-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 14px; transition: color .16s ease; }
.auth-back:hover { color: var(--text-primary); }
.auth-card-wrap { display: flex; flex: 1; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form-card { width: 100%; max-width: 430px; }
.auth-heading { margin-bottom: 28px; }
.auth-heading p { color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.auth-heading h2 { margin-top: 12px; color: var(--text-primary); font-size: clamp(30px, 5vw, 36px); font-weight: 760; line-height: 1.12; letter-spacing: 0; }
.auth-heading span { display: block; margin-top: 10px; color: var(--text-secondary); font-size: 14px; line-height: 1.65; }
.auth-form,.profile-form { display: grid; gap: 16px; }
.auth-form label,.profile-form label { display: grid; gap: 7px; }
.auth-form label > span,.profile-form label > span { color: var(--text-primary); font-size: 13px; font-weight: 750; }
.auth-form .auth-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.auth-check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}
.auth-check-row span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}
.auth-field { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; border: 1px solid var(--border-color); border-radius: 10px; background: color-mix(in srgb, var(--bg-raised) 82%, transparent); padding: 0 12px; color: var(--text-secondary); }
.auth-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 14px; }
.auth-field button { display: grid; place-items: center; color: var(--text-secondary); }
.auth-turnstile { display: flex; width: 100%; min-height: 65px; overflow: hidden; align-items: center; justify-content: center; }
.auth-turnstile > div,
.auth-turnstile iframe { width: 100% !important; }
.auth-submit,.profile-primary-btn,.profile-warning-btn,.profile-danger-btn,.profile-secondary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 999px; padding: 0 16px; font-size: 13px; font-weight: 850; transition: transform .16s ease, opacity .16s ease, background .16s ease; }
.auth-submit,.profile-primary-btn { width: 100%; background: var(--accent-control-bg); color: var(--accent-control-text); }
.auth-submit:disabled,.profile-primary-btn:disabled,.profile-warning-btn:disabled,.profile-danger-btn:disabled { opacity: .55; }
.auth-submit:active,.profile-primary-btn:active,.profile-warning-btn:active,.profile-danger-btn:active,.profile-secondary-btn:active { transform: scale(.98); }
.auth-switch { margin-top: 24px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.auth-switch a { color: var(--text-primary); font-weight: 850; text-decoration: underline; text-underline-offset: 4px; }
.auth-strength { display: grid; gap: 9px; margin-top: -4px; }
.auth-strength-bars { display: flex; align-items: center; gap: 4px; }
.auth-strength-bars span { height: 6px; flex: 1; border-radius: 999px; background: var(--border-color); }
.auth-strength-bars.score-1 span.is-on { background: #ef4444; }
.auth-strength-bars.score-2 span.is-on { background: #f59e0b; }
.auth-strength-bars.score-3 span.is-on { background: #eab308; }
.auth-strength-bars.score-4 span.is-on { background: #3b82f6; }
.auth-strength-bars.score-5 span.is-on { background: #16a34a; }
.auth-strength-bars b { min-width: 74px; color: var(--text-secondary); font-size: 11px; text-align: right; }
.auth-strength ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; color: var(--text-secondary); font-size: 11px; }
.auth-strength li { display: flex; align-items: center; gap: 5px; }
.auth-strength li.is-ok { color: var(--accent); }
.auth-inline-status { display: inline-flex; width: max-content; max-width: 100%; align-items: center; gap: 5px; margin-top: -6px; color: var(--text-secondary); font-size: 11px; font-weight: 750; line-height: 1.3; }
.auth-inline-status.is-ok { color: var(--accent); }
.auth-inline-status.is-error,.auth-inline-error { color: var(--negative); font-size: 11px; }
.profile-page { min-height: 100vh; }
.profile-page .page-header {
  margin-bottom: 28px;
  text-align: center;
}
.profile-page .page-subtitle { margin-left: auto; margin-right: auto; }
.profile-hero { border-bottom: 1px solid var(--border-color); background: color-mix(in srgb, var(--bg-surface) 72%, transparent); padding: 56px max(20px, calc((100vw - 900px) / 2)) 44px; }
.profile-hero p { color: var(--text-secondary); font-size: 11px; font-weight: 850; letter-spacing: .22em; text-transform: uppercase; }
.profile-hero h1 { margin-top: 12px; color: var(--text-primary); font-size: clamp(30px, 5vw, 46px); font-weight: 760; letter-spacing: 0; }
.profile-hero span { display: block; max-width: 560px; margin-top: 12px; color: var(--text-secondary); font-size: 14px; line-height: 1.65; }
.profile-shell { max-width: 920px; margin: 0 auto; padding: 0 0 60px; }
.profile-section {
  display: grid;
  gap: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.04);
}
@media (min-width: 768px) { .profile-section { grid-template-columns: 220px minmax(0, 1fr); gap: 34px; padding: 26px; } }
.profile-section h2 { color: var(--text-primary); font-size: 15px; font-weight: 850; }
.profile-section p { margin-top: 4px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.profile-avatar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile-avatar-row {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-raised) 72%, transparent);
  padding: 16px;
}
.profile-avatar { position: relative; display: grid; width: 82px; height: 82px; overflow: hidden; place-items: center; border: 2px dashed var(--border-muted); border-radius: 50%; background: var(--bg-raised); color: var(--text-primary); box-shadow: 0 12px 26px rgba(0,0,0,0.22); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar b { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; color: #fff; background: rgba(0,0,0,.48); transition: opacity .16s ease; }
.profile-avatar:hover b { opacity: 1; }
.profile-secondary-btn { border: 1px solid var(--border-muted); color: var(--text-primary); background: var(--bg-raised); }
.profile-warning-btn { width: max-content; background: rgba(245,158,11,.16); color: #f59e0b; }
.profile-danger-btn { width: max-content; background: color-mix(in srgb, var(--negative) 16%, transparent); color: var(--negative); }
.profile-danger-copy { font-size: 13px !important; }
.profile-skeleton-line { border-radius: 999px; background: linear-gradient(90deg, var(--skeleton-from), var(--skeleton-to), var(--skeleton-from)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.profile-header-skeleton { display: grid; gap: 12px; margin-bottom: 28px; }
.profile-skeleton-kicker { width: 110px; height: 12px; }
.profile-skeleton-title { width: min(360px, 70vw); height: 42px; border-radius: 10px; }
.profile-skeleton-subtitle { width: min(520px, 86vw); height: 16px; }
.profile-section-skeleton { pointer-events: none; }
.profile-skeleton-section-title { width: 120px; height: 18px; border-radius: 8px; }
.profile-skeleton-section-copy { width: 180px; height: 12px; margin-top: 12px; }
.profile-skeleton-field { width: 100%; height: 44px; border-radius: 10px; }
.profile-skeleton-button { width: 156px; height: 42px; border-radius: 999px; }
.auth-user-menu { position: relative; }
.auth-user-trigger { display: grid; width: 36px; height: 36px; overflow: hidden; place-items: center; border: 1px solid var(--border-muted); border-radius: 50%; background: var(--bg-raised); color: var(--text-primary); }
.auth-user-trigger img { width: 100%; height: 100%; object-fit: cover; }
.auth-user-dropdown { position: absolute; right: 0; top: calc(100% + 10px); z-index: 120; display: grid; min-width: 230px; gap: 4px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-card); padding: 8px; box-shadow: var(--shadow-heavy); opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .16s ease, transform .16s ease; }
.auth-user-menu.is-open .auth-user-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.auth-user-info { padding: 8px 9px 10px; border-bottom: 1px solid var(--border-color); }
.auth-user-info strong,.auth-user-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-user-info strong { color: var(--text-primary); font-size: 13px; }
.auth-user-info span { margin-top: 2px; color: var(--text-secondary); font-size: 11px; }
.auth-user-dropdown a,.auth-user-dropdown button { display: flex; align-items: center; gap: 9px; border-radius: 8px; padding: 9px; color: var(--text-secondary); font-size: 13px; text-align: left; }
.auth-user-dropdown a:hover,.auth-user-dropdown button:hover { background: var(--bg-hover); color: var(--text-primary); }

.auth-layout {
  --bg-base: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-raised: #f0f2f5;
  --bg-card: #ffffff;
  --bg-muted: #e5e7eb;
  --bg-hover: #eef1f4;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --border-color: #d8dde5;
  --border-muted: #cfd5de;
  --sheet-bg: #ffffff;
  background: var(--bg-base);
  color: var(--text-primary);
}

.auth-layout .auth-brand-panel {
  background: var(--accent);
  color: #ffffff;
}

.auth-layout .auth-brand-copy p,
.auth-layout .auth-brand-foot {
  color: rgba(17,24,39,.74);
}

.auth-layout .auth-brand-foot span {
  background: rgba(17,24,39,.28);
}

.auth-layout .auth-main {
  background: var(--bg-base);
}

.auth-layout .auth-field {
  background: #ffffff;
}

.auth-layout input::placeholder {
  color: #7a8494;
}

@media (max-width: 1023px) {
  .auth-layout {
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .auth-main {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .auth-top {
    flex: 0 0 auto;
    padding: 24px 24px 0;
  }

  .auth-card-wrap {
    min-height: 0;
    padding: 40px 24px;
  }

  .auth-main-scroll .auth-card-wrap {
    align-items: flex-start;
    padding-top: 28px;
    padding-bottom: max(104px, calc(env(safe-area-inset-bottom) + 88px));
  }

  .auth-main-scroll .auth-switch {
    margin-bottom: max(28px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 1024px) {
  .auth-layout {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  .auth-brand-panel {
    height: 100vh;
    min-height: 100vh;
    position: sticky;
    top: 0;
  }

  .auth-main {
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.watch-loading-overlay.hidden { display: none; }
.watch-loading-overlay .animate-spin-slow {
  width: 30px !important;
  height: 30px !important;
  border-width: 2px !important;
  border-color: rgba(255,255,255,.16) !important;
  border-top-color: rgba(255,255,255,.78) !important;
}
.watch-loading-overlay #playerOverlayText {
  display: none;
}
#playerOverlay.is-error #playerOverlayText {
  display: block;
}
.watch-center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 31;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.58);
  border: 1px solid rgba(255,255,255,.16);
  transform: translate(-50%, -50%) scale(.96);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(14px);
  transition: opacity .18s ease, transform .18s ease;
}
.watch-seek-feedback {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 75;
  min-width: 84px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.58);
  box-shadow: 0 18px 48px rgba(0,0,0,.5);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -50%) scale(.86);
  transition: opacity .16s ease, transform .2s cubic-bezier(.2,.9,.2,1);
  backdrop-filter: blur(16px);
}
.watch-seek-feedback.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* YouTube-like side positions */
.watch-seek-feedback.is-left {
  left: 15%;
  transform: translate(0, -50%) scale(.86);
}
.watch-seek-feedback.is-left.is-visible {
  transform: translate(0, -50%) scale(1);
}
.watch-seek-feedback.is-right {
  left: auto;
  right: 15%;
  transform: translate(0, -50%) scale(.86);
}
.watch-seek-feedback.is-right.is-visible {
  transform: translate(0, -50%) scale(1);
}
.player-inner.is-paused .watch-center-play {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.watch-controls {
  position: absolute;
  inset: auto 0 0;
  z-index: 70;
  padding: 92px 16px 14px;
  color: #fff;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .22s cubic-bezier(.2,.8,.2,1), transform .22s cubic-bezier(.2,.8,.2,1);
}
.watch-controls-gradient {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.52) 42%, rgba(0,0,0,.92) 100%);
}
.watch-seek-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 750;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.watch-seek,
.watch-volume-range {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--progress, 0%), rgba(255,255,255,.28) var(--progress, 0%));
  outline: none;
}
.watch-seek::-webkit-slider-thumb,
.watch-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.watch-seek::-moz-range-thumb,
.watch-volume-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
.watch-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-top: 8px;
}
.watch-control-group,
.watch-volume {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.watch-icon-btn,
.watch-text-btn {
  position: relative;
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  will-change: transform;
  transition: background .16s ease, transform .16s ease, color .16s ease;
}
.watch-text-btn {
  min-width: 46px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}
.watch-icon-btn:hover,
.watch-text-btn:hover,
.watch-icon-btn.is-active {
  background: rgba(255,255,255,.14);
}
.watch-icon-btn.is-active,
.watch-text-btn.is-active {
  color: var(--accent);
}
.watch-icon-btn[data-tooltip]::after,
.watch-text-btn[data-tooltip]::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 9999;
  width: max-content;
  max-width: 180px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  color: #fff;
  background: rgba(12,12,12,.96);
  box-shadow: 0 14px 34px rgba(0,0,0,.55);
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 4px);
  transition: opacity .14s ease, transform .14s ease;
  white-space: nowrap;
}
.watch-icon-btn[data-tooltip]::before,
.watch-text-btn[data-tooltip]::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  z-index: 9999;
  width: 9px;
  height: 9px;
  background: rgba(12,12,12,.96);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) rotate(45deg);
  transition: opacity .14s ease, transform .14s ease;
}
.watch-icon-btn[data-tooltip]:hover::after,
.watch-icon-btn[data-tooltip]:hover::before,
.watch-icon-btn[data-tooltip]:focus-visible::after,
.watch-icon-btn[data-tooltip]:focus-visible::before,
.watch-text-btn[data-tooltip]:hover::after,
.watch-text-btn[data-tooltip]:hover::before,
.watch-text-btn[data-tooltip]:focus-visible::after,
.watch-text-btn[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}
.watch-icon-btn[data-tooltip]:hover::before,
.watch-icon-btn[data-tooltip]:focus-visible::before,
.watch-text-btn[data-tooltip]:hover::before,
.watch-text-btn[data-tooltip]:focus-visible::before {
  transform: translate(-50%, 0) rotate(45deg);
}

/* Fix cropped tooltips at edges of the video player */
#playPauseBtn[data-tooltip]::after { left: 0; transform: translate(0, 4px); }
#playPauseBtn[data-tooltip]:hover::after,
#playPauseBtn[data-tooltip]:focus-visible::after { transform: translate(0, 0); }
#playPauseBtn[data-tooltip]::before { left: 16px; transform: translate(-50%, 4px) rotate(45deg); }
#playPauseBtn[data-tooltip]:hover::before,
#playPauseBtn[data-tooltip]:focus-visible::before { transform: translate(-50%, 0) rotate(45deg); }

#fullscreenBtn[data-tooltip]::after { left: auto; right: 0; transform: translate(0, 4px); }
#fullscreenBtn[data-tooltip]:hover::after,
#fullscreenBtn[data-tooltip]:focus-visible::after { transform: translate(0, 0); }
#fullscreenBtn[data-tooltip]::before { left: auto; right: 16px; transform: translate(50%, 4px) rotate(45deg); }
#fullscreenBtn[data-tooltip]:hover::before,
#fullscreenBtn[data-tooltip]:focus-visible::before { transform: translate(50%, 0) rotate(45deg); }

.watch-icon-btn:active,
.watch-text-btn:active {
  transform: scale(.94);
}
.watch-volume-range {
  width: 82px;
  --progress: 100%;
  cursor: pointer;
  touch-action: pan-x;
}
.watch-time-inline {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.82);
}
.watch-speed-menu {
  position: absolute;
  z-index: 9998;
  right: 78px;
  bottom: 60px;
  width: 108px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(18,18,18,.94);
  box-shadow: 0 18px 42px rgba(0,0,0,.5);
  backdrop-filter: blur(18px);
}
.watch-speed-menu button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}
.watch-speed-menu button:hover {
  background: rgba(255,255,255,.12);
}
.watch-meta-panel {
  padding: 20px 16px 32px;
}
.watch-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.watch-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-muted);
}
#dramaSynopsis {
  color: var(--text-secondary);
}
#toggleSynopsisBtn {
  color: var(--accent);
}
.watch-episode-nav {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.watch-episode-nav button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 16px;
  border: 1px solid var(--border-muted);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}
.watch-episode-nav button:last-child {
  background: var(--accent-control-bg);
  color: var(--accent-control-text);
  border-color: var(--accent-control-border);
}
.watch-episode-sidebar {
  display: none;
}
.watch-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-color);
}
.watch-sidebar-head h3 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 850;
}
.watch-sidebar-head span {
  color: var(--text-secondary);
  font-size: 12px;
}
.watch-sidebar-scroll {
  overflow-y: auto;
  padding: 14px;
}
.watch-episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
}
.watch-float-btn,
.watch-rail-btn,
.watch-episode-btn {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.52);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
}
.watch-float-btn { width: 40px; height: 40px; }
.watch-rail-btn { width: 44px; height: 44px; }
.watch-episode-btn {
  position: relative;
  z-index: 10;
  width: 56px;
  height: 56px;
  color: var(--accent-control-text);
  background: var(--accent-control-bg);
  box-shadow: var(--shadow-heavy);
}
#epBadgeMobile {
  position: absolute;
  right: -8px;
  top: -8px;
  z-index: 60;
  min-width: 28px;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.2);
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}
#swipeHint span {
  border-radius: 999px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.62);
  color: rgba(255,255,255,.86);
  font-size: 11px;
  font-weight: 850;
  backdrop-filter: blur(14px);
}
#epSheet {
  border-top: 1px solid var(--border-color);
  background: var(--sheet-bg);
  box-shadow: var(--shadow-heavy);
}
#epSheetBackdrop {
  backdrop-filter: blur(4px);
}
#epSheet .sheet-drag-zone:first-child {
  background: var(--border-muted);
}
#epSheet .sheet-drag-zone:nth-child(2) {
  border-bottom: 1px solid var(--border-color);
}
#epSheetCloseBtn {
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.player-inner.is-playing.controls-hidden .watch-controls,
.player-inner.is-playing.controls-hidden #mobileOverlay .overlay-auto-hide,
.player-inner.is-playing.controls-hidden #mobileOverlay .mobile-rail-persist {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}
.player-inner.is-playing.controls-hidden {
  cursor: none;
}
.player-inner.controls-visible .watch-controls,
.player-inner.is-paused .watch-controls,
.player-inner:focus-within .watch-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .watch-page-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 22px;
    margin-left: 0;
    margin-right: 0;
  }
  .watch-player-shell {
    border: 1px solid var(--border-color);
    border-radius: 8px;
  }
  .watch-meta-panel {
    padding-left: 0;
    padding-right: 0;
  }
  .watch-episode-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    max-height: calc(100vh - 96px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-medium);
  }
  .watch-time-inline {
    display: inline;
  }
}

@media (min-width: 1180px) {
  .watch-page-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
  }
}

.watch-player-shell:fullscreen,
.watch-player-shell:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000;
}
.watch-player-shell:fullscreen .watch-player-inner,
.watch-player-shell:-webkit-full-screen .watch-player-inner {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}
.watch-player-shell:fullscreen .watch-video,
.watch-player-shell:-webkit-full-screen .watch-video {
  object-fit: contain !important;
}
.watch-player-shell:fullscreen .watch-controls,
.watch-player-shell:-webkit-full-screen .watch-controls {
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
}

@media (max-width: 767.98px) {
  body.is-watch .watch-controls {
    padding: 72px max(10px, env(safe-area-inset-left)) calc(env(safe-area-inset-bottom) + 12px) max(10px, env(safe-area-inset-right));
  }
  body.is-watch .watch-control-row {
    gap: 6px;
    min-height: 44px;
  }
  body.is-watch .watch-time-inline,
  body.is-watch #desktopTimeLabel {
    display: none;
  }
  body.is-watch .watch-volume {
    display: inline-flex;
    gap: 1px;
  }
  body.is-watch .watch-volume-range {
    display: block;
    width: clamp(44px, 13vw, 64px);
    height: 4px;
  }
  body.is-watch .watch-icon-btn {
    min-width: 36px;
    width: 36px;
    height: 36px;
  }
  body.is-watch .watch-text-btn {
    min-width: 42px;
    height: 36px;
    padding: 0 8px;
  }
  body.is-watch .watch-center-play {
    width: 64px;
    height: 64px;
  }
  body.is-watch #mobileOverlay .overlay-auto-hide:first-child {
    background: linear-gradient(180deg, rgba(0,0,0,.75) 0%, transparent 100%);
  }
  body.is-watch .player-inner.is-playing.controls-hidden .watch-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
  }
  body.is-watch .player-inner.controls-visible .watch-controls,
  body.is-watch .player-inner.is-paused .watch-controls {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  body.is-watch .watch-control-group {
    gap: 2px;
  }
  body.is-watch .watch-control-group:first-child {
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
  }
  body.is-watch .watch-control-group:last-child {
    flex: 0 0 auto;
    justify-content: flex-end;
  }
  body.is-watch .watch-seek-row {
    gap: 8px;
    font-size: 11px;
  }
  body.is-watch .watch-seek {
    height: 5px;
    touch-action: pan-x;
  }
  body.is-watch .watch-seek::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
  }
  body.is-watch .watch-seek::-moz-range-thumb {
    width: 18px;
    height: 18px;
  }
  body.is-watch #mobileOverlay .mobile-rail-persist {
    right: max(12px, env(safe-area-inset-right));
    gap: 12px;
  }
  body.is-watch .watch-rail-btn {
    width: 42px;
    height: 42px;
  }
  body.is-watch .watch-episode-btn {
    width: 54px;
    height: 54px;
  }
  body.is-watch .watch-speed-menu {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(env(safe-area-inset-bottom) + 64px);
  }
}

@media (max-width: 767.98px) and (orientation: landscape) {
  body.is-watch .watch-controls {
    padding: 50px calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 10px) calc(env(safe-area-inset-left) + 12px);
  }
  body.is-watch #mobileOverlay .overlay-auto-hide:first-child {
    padding-top: calc(env(safe-area-inset-top) + 8px);
    padding-left: calc(env(safe-area-inset-left) + 12px);
    padding-right: calc(env(safe-area-inset-right) + 12px);
  }
  body.is-watch #mobileOverlay .mobile-rail-persist {
    right: calc(env(safe-area-inset-right) + 10px);
    transform: translateY(-50%) scale(.92);
  }
  body.is-watch .watch-center-play {
    width: 58px;
    height: 58px;
  }
}

/* ── Volume slider ── */
.volume-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 80px; height: 3px;
  border-radius: 9999px;
  background: var(--border-muted);
  outline: none;
  cursor: pointer;
}
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
}

/* ── Autoplay countdown ring ── */
.autoplay-ring circle {
  animation: countdown-ring 5s linear forwards;
}

/* ── Keyboard shortcut hint ── */
.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.shortcut-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border-muted);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: 'Inter', monospace;
}

/* Pull-to-refresh indicator */
#pullRefreshIndicator {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  z-index: 9997;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  color: var(--accent);
  box-shadow: var(--shadow-heavy);
  opacity: 0;
  transform: translate(-50%, -18px) scale(0.9) rotate(0deg);
  pointer-events: none;
}
#pullRefreshIndicator.is-visible { opacity: 1; }
#pullRefreshIndicator.is-ready {
  color: var(--accent-control-text);
  background: var(--accent-control-bg);
  border-color: var(--accent-control-border);
}
#pullRefreshIndicator.is-refreshing svg { animation: spinSlow 0.8s linear infinite; }

#playerOverlay.is-error .animate-spin-slow {
  display: none;
}
#playerOverlay.is-error #playerOverlayText {
  max-width: min(82vw, 420px);
  color: var(--text-primary) !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

#desktopFooter {
  border-top: 1px solid var(--border-color);
  background:
    linear-gradient(180deg, var(--bg-base) 0%, var(--bg-surface) 100%);
}
html.light #desktopFooter {
  background:
    linear-gradient(180deg, var(--bg-base) 0%, var(--bg-surface) 100%);
  box-shadow: 0 -1px 0 var(--border-color);
}
.footer-heading {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}
.footer-link {
  width: max-content;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}
.footer-link:hover { color: var(--accent); }
.footer-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
}
.footer-feature svg {
  flex: 0 0 auto;
  color: var(--accent);
}
.footer-tech {
  display: none;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid var(--border-muted);
  background: var(--bg-raised);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

/* ── Genre/tag chips ── */
.genre-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.genre-chip:hover, .genre-chip.active {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Watch page meta block — light mode ── */
html.light .meta-block h1,
html.light .meta-block #dramaTitle { color: var(--text-primary); }
html.light .meta-block #dramaSynopsis { color: var(--text-secondary); }
html.light #prevEpBtn {
  background: var(--bg-raised);
  border-color: var(--border-muted);
  color: var(--text-primary);
}
html.light #nextEpBtn { background: var(--accent-control-bg); color: var(--accent-control-text); border: 1px solid var(--accent-control-border); }
html.light .ep-btn {
  background: var(--control-bg);
  border-color: var(--border-color);
  color: var(--control-text);
}
html.light .ep-btn:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}
html.light .ep-btn.is-active { background: var(--accent-control-bg); color: var(--accent-control-text); border-color: var(--accent-control-border); }
html.light #favoriteBtn {
  background: var(--bg-raised);
  border-color: var(--border-muted);
  color: var(--text-secondary);
}

/* ── Light mode card & surface enhancements ── */
html.light .soft-panel {
  box-shadow: var(--shadow-medium);
  border-color: var(--border-color);
}
html.light .detail-poster-wrap {
  box-shadow: var(--shadow-heavy);
}
html.light .detail-ep-btn {
  background: var(--control-bg);
  border-color: var(--border-color);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
html.light .detail-ep-btn:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}
html.light .error-state__retry {
  background: var(--control-bg);
  border-color: var(--border-color);
  box-shadow: var(--shadow-soft);
}
html.light .genre-chip {
  background: var(--control-bg);
  border-color: var(--border-color);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
html.light .genre-chip:hover,
html.light .genre-chip.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}
html.light #backToTop {
  background: var(--control-bg);
  border-color: var(--border-color);
  box-shadow: var(--shadow-heavy);
}
html.light #backToTop:hover {
  background: var(--accent-control-bg);
  color: var(--accent-control-text);
  border-color: var(--accent-control-border);
}
html.light .quality-btn,
html.light .speed-btn {
  background: var(--control-bg);
  border-color: var(--border-color);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
html.light .quality-btn:hover,
html.light .speed-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}
html.light .shortcut-hint kbd {
  background: var(--control-bg);
  border-color: var(--border-color);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
html.light #pullRefreshIndicator {
  background: var(--control-bg);
  border-color: var(--border-color);
  box-shadow: var(--shadow-heavy);
}

/* ── Responsive grid improvements ── */
@media (max-width: 359px) {
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .lg\:grid-cols-6 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (min-width: 1536px) {
  .lg\:grid-cols-6 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* ── Tablet layout improvements ── */
@media (min-width: 640px) and (max-width: 767px) {
  .auto-cols-\[140px\] { grid-auto-columns: 150px; }
}

/* ── Desktop sidebar watch page ── */
@media (min-width: 1024px) {
  #watchRoot { grid-template-columns: 1fr 380px; }
}
@media (min-width: 1280px) {
  #watchRoot { grid-template-columns: 1fr 420px; }
}

/* ── Smooth theme transition for all elements ── */
*, *::before, *::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
/* But NOT for animations/transforms */
.poster-card, .sheet-translate, video, img, [class*="animate-"] {
  transition-property: transform, opacity, box-shadow;
}

#serialSearchInput::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

#serialSearchInput::-ms-clear,
input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

/* ── Shorts Feed (TikTok-style mobile) ────────────────────────── */
.shorts-feed {
  background: #000;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.shorts-feed::-webkit-scrollbar { display: none; }

.shorts-feed__item {
  position: relative;
  height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}
.shorts-feed__item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
.shorts-feed__item .shorts-feed__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  transition: opacity 0.4s ease;
}
.shorts-feed__item.is-playing .shorts-feed__poster {
  opacity: 0;
  pointer-events: none;
}
.shorts-feed__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 15%, transparent 60%, rgba(0,0,0,0.8) 100%);
}
.shorts-feed__info {
  margin-top: auto;
  padding: 0 96px 0 28px;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  pointer-events: auto;
  max-height: 55vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.shorts-feed__title {
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  margin-top: 10px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shorts-feed__ep {
  margin-top: 5px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 650;
}
.shorts-feed__synopsis {
  margin-top: 8px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  max-height: 2.9em;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: max-height 0.3s ease;
}
.shorts-feed__synopsis.is-expanded {
  max-height: none;
  overflow: visible;
}
.shorts-feed__synopsis-toggle {
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.shorts-feed__meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 600;
}
.shorts-feed__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(0,0,0,0.5);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.shorts-feed__actions {
  position: absolute;
  right: 24px;
  bottom: calc(120px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  pointer-events: auto;
}
.shorts-feed__action-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  transition: transform 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.shorts-feed__action-btn:active { transform: scale(0.88); }
.shorts-feed__action-btn.is-liked {
  color: var(--accent);
}
.shorts-feed__action-btn--primary {
  width: 52px;
  height: 52px;
  background: #2BA641;
  border: none;
  color: #06110a;
  box-shadow: 0 4px 16px rgba(43,166,65,0.36);
}
.shorts-feed__action-btn--primary:active {
  background: #238A36;
}
.shorts-feed__action-btn--primary svg {
  fill: #06110a;
  stroke: none;
}
.shorts-feed__play-btn {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.shorts-feed__item.is-paused .shorts-feed__play-btn {
  opacity: 1;
  pointer-events: auto;
}
.shorts-feed__spinner {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.shorts-feed__item.is-loading .shorts-feed__spinner {
  opacity: 1;
}
.shorts-feed__play-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: grid;
  place-items: center;
}
/* Hide main content padding and bottom nav when shorts feed is active on mobile */
@media (max-width: 767.98px) {
  body:has(#shortsMobile) {
    padding-bottom: 0 !important;
    background-color: #000 !important;
  }
  body:has(#shortsMobile) .app-main {
    padding: 0 !important;
    max-width: none !important;
    min-height: 100dvh !important;
    overflow: hidden;
  }
  body:has(#shortsMobile) #topBar,
  body:has(#shortsMobile) #topBar .topbar-shell {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%) !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }
  body:has(#shortsMobile) #topBar .topbar-brand span,
  body:has(#shortsMobile) #topBar a,
  body:has(#shortsMobile) #topBar button {
    color: #fff !important;
  }
  body:has(#shortsMobile) #topBar button {
    border-color: rgba(255,255,255,0.15) !important;
    background: rgba(0,0,0,0.35) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body:has(#shortsMobile) #topBar a[href="/search"] {
    border-color: rgba(255,255,255,0.15) !important;
    background: rgba(0,0,0,0.35) !important;
  }
  body:has(#shortsMobile) #bottomNav {
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85)) !important;
    border: none !important;
    border-top: none !important;
    border-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    outline: none !important;
  }
  body:has(#shortsMobile) #bottomNav::before,
  body:has(#shortsMobile) #bottomNav::after {
    display: none !important;
  }
  body:has(#shortsMobile) #bottomNav .nav-icon {
    color: rgba(255,255,255,0.65) !important;
  }
  body:has(#shortsMobile) #bottomNav .nav-label {
    color: rgba(255,255,255,0.65) !important;
  }
  body:has(#shortsMobile) #bottomNav .bnav-item.is-active .nav-icon {
    color: var(--accent) !important;
  }
  body:has(#shortsMobile) #bottomNav .bnav-item.is-active .nav-label {
    color: #fff !important;
  }
}
@media (min-width: 768px) {
  #shortsMobile { display: none !important; }
}

/* ===== Dramova Modern Streaming Refresh (shadcn-custom layer) ===== */
:root {
  --bg-base: #090a0c;
  --bg-surface: #101216;
  --bg-raised: #171a20;
  --bg-card: #1d2129;
  --bg-hover: #252b35;
  --border-color: rgba(255,255,255,0.09);
  --border-muted: rgba(255,255,255,0.14);
  --text-primary: #f7f8fb;
  --text-secondary: #aeb6c4;
  --text-tertiary: #717b8d;
  --accent: #2BA641;
  --accent-hover: #32B94B;
  --accent-dark: #238A36;
  --accent-muted: rgba(43,166,65,0.16);
  --accent-control-bg: #2BA641;
  --accent-control-text: #ffffff;
  --accent-control-border: #2BA641;
  --topbar-bg: rgba(9,10,12,0.74);
  --bottomnav-bg: rgba(11,12,15,0.88);
  --sheet-bg: #12151b;
  --shadow-heavy: 0 28px 70px rgba(0,0,0,0.58);
  --shadow-medium: 0 18px 38px rgba(0,0,0,0.36);
  --shadow-soft: 0 10px 28px rgba(0,0,0,0.22);
}

html.light {
  --bg-base: #f4f6f8;
  --bg-surface: #ffffff;
  --bg-raised: #eef1f5;
  --bg-card: #ffffff;
  --bg-hover: #e7ebf0;
  --border-color: rgba(26,31,40,0.1);
  --border-muted: rgba(26,31,40,0.16);
  --text-primary: #111722;
  --text-secondary: #4d5a6e;
  --text-tertiary: #7d8797;
  --accent: #2BA641;
  --accent-hover: #238A36;
  --accent-dark: #1D7330;
  --accent-muted: rgba(43,166,65,0.11);
  --accent-control-bg: #2BA641;
  --accent-control-text: #ffffff;
  --accent-control-border: #238A36;
  --topbar-bg: rgba(244,246,248,0.78);
  --bottomnav-bg: rgba(255,255,255,0.9);
  --sheet-bg: #ffffff;
}

body {
  background:
    radial-gradient(circle at 10% -10%, rgba(43,166,65,0.1), transparent 30%),
    linear-gradient(180deg, var(--bg-base), #07080a 55%, var(--bg-base));
}

html.light body {
  background:
    radial-gradient(circle at 8% -10%, rgba(43,166,65,0.12), transparent 28%),
    linear-gradient(180deg, #f8fafc, var(--bg-base));
}

.app-main {
  max-width: 1440px !important;
  padding-left: clamp(16px, 3vw, 40px) !important;
  padding-right: clamp(16px, 3vw, 40px) !important;
}

.topbar-shell {
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.topbar-shell,
#bottomNav {
  backdrop-filter: blur(24px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.35) !important;
}

.dnav-link.is-active,
.dnav-link:hover {
  background: var(--accent-muted) !important;
  color: var(--text-primary) !important;
}

.bnav-item {
  position: relative;
}

.bnav-item.is-active::before {
  display: none;
}

.bnav-item.is-active .nav-icon,
.bnav-item.is-active .nav-label {
  color: var(--accent) !important;
}

.page-header {
  padding: 20px 0 8px;
}

.page-kicker {
  color: var(--accent);
}

.page-title,
.section-title,
.detail-title {
  letter-spacing: 0;
}

.section-block {
  margin-top: clamp(34px, 5vw, 58px);
}

.section-header {
  align-items: end;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(22px, 2.5vw, 34px);
}

.section-subtitle {
  color: var(--text-secondary);
  max-width: 62ch;
}

.carousel-rail-wrap {
  margin-left: calc(clamp(16px, 3vw, 40px) * -1);
  margin-right: calc(clamp(16px, 3vw, 40px) * -1);
  padding-left: clamp(16px, 3vw, 40px);
  padding-right: clamp(16px, 3vw, 40px);
}

.media-rail,
.content-grid {
  gap: clamp(12px, 1.8vw, 22px);
}

.poster-card {
  border-radius: 12px;
  color: var(--text-primary);
  isolation: isolate;
  overflow: visible;
}

.poster-card::before {
  display: none;
}

.poster-card:hover::before {
  opacity: 0;
}

.poster-card__img {
  border-radius: 8px !important;
  box-shadow: 0 16px 30px rgba(0,0,0,0.32);
  transform: scale(1);
  transition: transform 0.75s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.75s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
}

.poster-card:hover .poster-card__img {
  box-shadow: 0 16px 30px rgba(0,0,0,0.32);
  transform: scale(1.045);
}

.poster-card h4 {
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: 0;
  margin-top: 10px;
}

.poster-card p {
  color: var(--text-secondary);
  font-weight: 650;
}

.serial-category-tabs {
  background: color-mix(in srgb, var(--bg-surface) 76%, transparent);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
}

.serial-search-controls form,
.search-input-wrap {
  background: color-mix(in srgb, var(--bg-surface) 84%, transparent) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-soft) !important;
}

.serial-search-controls form:focus-within,
.search-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-muted)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-soft) !important;
}

.serial-search-controls input,
.search-input-wrap input {
  outline: none !important;
  box-shadow: none !important;
}

.home-hero {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.home-hero::after {
  border-radius: 0;
}

.hero-dot-btn,
.hero-dot {
  background: rgba(255,255,255,0.38);
  border-radius: 9999px;
  height: 8px;
  box-shadow: none;
}

.hero-dot-btn.is-active,
.hero-dot.is-active {
  background: var(--accent);
  box-shadow: none;
  width: 28px;
}

.detail-page {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.detail-backdrop {
  opacity: .46;
}

.detail-poster-wrap {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  box-shadow: 0 26px 54px rgba(0,0,0,0.48);
}

.detail-tag,
.detail-info-chip,
.detail-ep-btn {
  border-color: var(--border-color);
  background: color-mix(in srgb, var(--bg-raised) 84%, transparent);
}

.detail-play-btn {
  background: var(--accent-control-bg) !important;
  color: var(--accent-control-text) !important;
  border: 1px solid var(--accent-control-border) !important;
  box-shadow: 0 12px 28px rgba(43,166,65,0.22) !important;
  transition: transform 0.16s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.detail-play-btn:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  box-shadow: 0 12px 28px rgba(43,166,65,0.22) !important;
  transform: translateY(-1px);
}

.detail-action-icon,
#sheetCloseBtn,
#backToTop {
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent) !important;
  border: 1px solid var(--border-color) !important;
}

.detail-action-icon.is-active {
  background: var(--accent-control-bg) !important;
  border-color: var(--accent-control-border) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(43,166,65,0.24);
}

.detail-action-icon.is-active:hover {
  background: var(--accent-hover) !important;
  color: #ffffff !important;
}

.sheet-translate {
  border-radius: 24px 24px 0 0 !important;
  box-shadow: 0 -28px 70px rgba(0,0,0,0.46) !important;
}

#sheetBackdrop {
  background: rgba(0,0,0,0.68) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

#desktopFooter {
  border-top: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-base) 78%, transparent);
}

.footer-link:hover,
.footer-feature i {
  color: var(--accent) !important;
}

@media (max-width: 767px) {
  .home-hero {
    border-radius: 0;
  }

  .section-header {
    align-items: flex-start;
  }

  .detail-page {
    border-radius: 0;
  }

  .detail-poster-col {
    margin-left: -16px;
    margin-right: -16px;
  }

  .detail-poster-wrap {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .detail-poster-img {
    border-radius: 0 !important;
  }
}

.shadcn-toast-viewport {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 1000;
  display: flex;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  outline: none;
}

.shadcn-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-height: 64px;
  padding: 14px 14px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
  color: var(--text-primary);
  box-shadow: 0 18px 48px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.shadcn-toast[data-state="open"] {
  animation: shadcnToastIn 180ms cubic-bezier(.2,.8,.2,1);
}

.shadcn-toast[data-state="closed"] {
  animation: shadcnToastOut 160ms ease-in forwards;
}

.shadcn-toast[data-swipe="move"] {
  transform: translateX(var(--radix-toast-swipe-move-x));
}

.shadcn-toast[data-swipe="cancel"] {
  transform: translateX(0);
  transition: transform 180ms ease-out;
}

.shadcn-toast[data-swipe="end"] {
  animation: shadcnToastSwipeOut 160ms ease-out forwards;
}

.shadcn-toast:has(.shadcn-toast__description) {
  align-items: flex-start;
}

.shadcn-toast__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.shadcn-toast--success .shadcn-toast__icon {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.shadcn-toast--warning {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--border-color));
}
.shadcn-toast--warning .shadcn-toast__icon {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
}

.shadcn-toast--error {
  border-color: color-mix(in srgb, #ff5c5c 34%, var(--border-color));
}

.shadcn-toast--error .shadcn-toast__icon {
  background: rgba(255,92,92,0.14);
  color: #ff6b6b;
}

.shadcn-toast--loading .shadcn-toast__icon,
.shadcn-toast--default .shadcn-toast__icon {
  background: color-mix(in srgb, var(--text-secondary) 12%, transparent);
  color: var(--text-secondary);
}

.shadcn-toast__body {
  min-width: 0;
  padding-top: 1px;
}

.shadcn-toast__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
}

.shadcn-toast__description {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.shadcn-toast__close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.shadcn-toast__close:hover {
  background: color-mix(in srgb, var(--bg-muted) 70%, transparent);
  color: var(--text-primary);
}

.shadcn-toast__close:active {
  transform: scale(.94);
}

@keyframes shadcnToastIn {
  from { opacity: 0; transform: translate3d(0,-8px,0) scale(.98); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}

@keyframes shadcnToastOut {
  to { opacity: 0; transform: translate3d(0,-8px,0) scale(.98); }
}

@keyframes shadcnToastSwipeOut {
  to { transform: translateX(calc(var(--radix-toast-swipe-end-x) + 80px)); opacity: 0; }
}

@media (max-width: 767px) {
  .shadcn-toast-viewport {
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    width: auto;
  }

  .shadcn-toast {
    border-radius: 14px;
    padding: 12px;
  }
}

html.light .topbar-shell,
html.light #topBar,
html.light #topBar .topbar-shell {
  box-shadow: none !important;
}

.profile-page .page-header {
  text-align: center;
}

.profile-page .page-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.auth-user-menu:not(.is-open) .auth-user-dropdown {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-4px) !important;
}

.auth-user-menu.is-open .auth-user-dropdown {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.detail-action-icon.is-active,
#favoriteBtn.is-active,
#detailFavoriteBtn.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.watch-float-btn.is-active,
#favoriteBtnMobile.is-active,
.shorts-feed__action-btn.is-liked {
  color: var(--accent) !important;
}

.profile-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 60px;
}

.profile-section {
  margin-bottom: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 30px 0 !important;
}

@media (min-width: 768px) {
  .profile-section {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 34px;
  }
}

.profile-avatar-row {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}

.profile-avatar {
  box-shadow: none !important;
}

.auth-layout .auth-brand-panel {
  background:
    radial-gradient(circle at 18% 16%, rgba(43,166,65,.22), transparent 30%),
    radial-gradient(circle at 86% 78%, rgba(43,166,65,.14), transparent 34%),
    #0f1412;
  color: #f8fafc;
}

.auth-layout .auth-brand-copy h1 {
  color: #f8fafc;
}

.auth-layout .auth-brand-copy p,
.auth-layout .auth-brand-foot {
  color: rgba(248,250,252,.68);
}

.auth-layout .auth-brand-foot span {
  background: rgba(43,166,65,.55);
}

.auth-layout .auth-brand-noise {
  opacity: .08;
}

.shadcn-toast {
  border-color: rgba(255,255,255,.08) !important;
  background: rgba(18,20,19,.94) !important;
  color: #f8fafc !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.06) !important;
}

.shadcn-toast__icon {
  background: var(--accent) !important;
  color: #ffffff !important;
}

.shadcn-toast--error {
  border-color: rgba(255,255,255,.08) !important;
}

.shadcn-toast--error .shadcn-toast__icon {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.shadcn-toast--loading .shadcn-toast__icon,
.shadcn-toast--default .shadcn-toast__icon {
  background: rgba(255,255,255,.12) !important;
  color: #f8fafc !important;
}

.shadcn-toast__title {
  color: #f8fafc !important;
}

.shadcn-toast__description {
  color: rgba(248,250,252,.68) !important;
}

.shadcn-toast__close {
  color: rgba(248,250,252,.68) !important;
}

.shadcn-toast__close:hover {
  background: rgba(255,255,255,.08) !important;
  color: #ffffff !important;
}
