:root {
  --font-sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Onest", -apple-system, BlinkMacSystemFont, sans-serif;
  --bg-page: #F3F7FD;
  --bg-glow: radial-gradient(1100px 440px at 14% -8%, rgba(14, 165, 233, 0.12), transparent 62%),
             radial-gradient(900px 400px at 88% 0%, rgba(29, 78, 216, 0.08), transparent 58%);
  --surface: #FFFFFF;
  --surface-soft: #EBF2FC;
  --glass-bg: rgba(247, 250, 255, 0.94);
  --glass-edge: rgba(255, 255, 255, 0.92);
  --border-subtle: rgba(15, 23, 42, 0.09);
  --border-control: rgba(15, 23, 42, 0.22);
  --text-primary: #0B1F3A;
  --text-muted: #425B7C;
  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-ink: #FFFFFF;
  --accent-soft: #DBEAFE;
  --accent-text: #1D4ED8;
  --focus-ring: #1D4ED8;
  --shadow-card: 0 2px 10px -2px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-elevated: 0 18px 38px -10px rgba(15, 23, 42, 0.14), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg-page: #0B0D12;
  --bg-glow: none;
  --surface: #161A23;
  --surface-soft: #1F2430;
  --glass-bg: rgba(11, 13, 18, 0.90);
  --glass-edge: rgba(255, 255, 255, 0.05);
  --border-subtle: rgba(148, 163, 184, 0.10);
  --border-control: rgba(148, 163, 184, 0.22);
  --text-primary: #F8FAFC;
  --text-muted: #94A3B8;
  --accent: #19D3BE;
  --accent-hover: #38E6D2;
  --accent-ink: #061412;
  --accent-soft: rgba(25, 211, 190, 0.14);
  --accent-purple: #8B5CF6;
  --accent-purple-soft: rgba(139, 92, 246, 0.16);
  --accent-text: #22D3EE;
  --focus-ring: #19D3BE;
  --shadow-card: 0 4px 14px -4px rgba(0, 0, 0, 0.55);
  --shadow-elevated: 0 20px 44px -12px rgba(0, 0, 0, 0.82);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-page);
  background-image: var(--bg-glow);
  background-repeat: no-repeat;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

input,
textarea {
  caret-color: var(--accent);
}

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

.tabular-num {
  font-variant-numeric: tabular-nums;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

input,
select,
textarea {
  font-size: 16px;
}

button,
a,
[role="button"],
.chip,
.tab-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  transition: top 140ms var(--ease-out);
}

.skip-link:focus {
  top: 16px;
}

/* Glass Chrome: solid-translucent ringan di HP RAM 2GB, blur lembut hanya di tablet/desktop */
.glass-chrome {
  background: var(--glass-bg);
}

@media (min-width: 768px) {
  .glass-chrome {
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
  }
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: inset 0 -1px 0 var(--glass-edge);
}

body[data-route="watch"] .topbar,
body[data-route="watch"] .bottom-nav,
body[data-route="watch"] .app-footer,
body[data-route="settings"] .bottom-nav,
body[data-route="profile-edit"] .bottom-nav,
body[data-route="profile-edit"] .app-footer,
body[data-route="downloads"] .bottom-nav,
body[data-route="downloads"] .app-footer,
body[data-route="auth"] .topbar,
body[data-route="auth"] .bottom-nav,
body[data-route="auth"] .app-footer {
  display: none;
}

@media (max-width: 639px) {
  .topbar {
    border-bottom: 0;
    box-shadow: none;
    background: var(--bg-page);
  }
  body[data-route="home"] .topbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(180deg, rgba(11, 13, 18, 0.78) 0%, rgba(11, 13, 18, 0.25) 68%, transparent 100%);
  }
  body[data-route="home"] .topbar .brand-text,
  body[data-route="home"] .topbar .icon-btn,
  body[data-route="home"] .topbar .theme-btn {
    color: #FFFFFF;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
  }
  body[data-route="home"] .topbar .theme-btn {
    background: rgba(11, 13, 18, 0.45);
    border-color: rgba(255, 255, 255, 0.22);
  }
  body[data-route="home"] .topbar .topbar-profile-chip {
    background: rgba(11, 13, 18, 0.54);
    border-color: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  body[data-route="home"] .app-main,
  body[data-route="detail"] .app-main,
  body[data-route="profile"] .app-main,
  body[data-route="profile-edit"] .app-main,
  body[data-route="downloads"] .app-main,
  body[data-route="settings"] .app-main {
    padding-top: 0;
  }
  body[data-route="watch"] .app-main {
    padding-top: env(safe-area-inset-top, 0px);
  }
  body[data-route="detail"] .app-main,
  body[data-route="watch"] .app-main,
  body[data-route="profile-edit"] .app-main,
  body[data-route="downloads"] .app-main,
  body[data-route="settings"] .app-main {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  body[data-route="detail"] .toast-banner,
  body[data-route="profile-edit"] .toast-banner,
  body[data-route="downloads"] .toast-banner,
  body[data-route="watch"] .toast-banner {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  body[data-route="detail"] .topbar,
  body[data-route="detail"] .bottom-nav,
  body[data-route="profile"] .topbar,
  body[data-route="profile-edit"] .topbar,
  body[data-route="downloads"] .topbar,
  body[data-route="settings"] .topbar {
    display: none;
  }
  body[data-route="schedule"] .topbar .brand-link,
  body[data-route="catalog"] .topbar .brand-link,
  body[data-route="library"] .topbar .brand-link,
  body[data-route="profile"] .topbar .brand-link {
    opacity: 0.92;
  }
}

.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-right: 4px;
  flex-shrink: 0;
}

body[data-route="home"] .brand-link {
  display: none !important;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.28);
}

.topbar-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  max-width: 56vw;
  padding: 4px 13px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 140ms ease, background-color 140ms ease;
}

.topbar-profile-chip[hidden] {
  display: none !important;
}

.topbar-profile-chip:active {
  transform: scale(0.97);
}

.topbar-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1D4ED8 0%, #0EA5E9 100%);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
}

.topbar-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-profile-name {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 138px;
}

@media (min-width: 640px) {
  .topbar-profile-chip {
    max-width: 240px;
  }
  .topbar-profile-name {
    max-width: 175px;
  }
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.brand-accent {
  color: var(--accent);
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background-color 180ms ease, color 180ms ease;
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2.5px;
  border-radius: 99px;
  background: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form {
  display: none;
  align-items: center;
  position: relative;
  width: 248px;
}

.search-form input {
  width: 100%;
  height: 44px;
  padding: 0 76px 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-control);
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-form input:focus {
  border-color: var(--accent);
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--surface-soft);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.search-clear-btn[hidden] {
  display: none;
}

.search-clear-btn:active {
  transform: translateY(-50%) scale(0.92);
}

.search-submit-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 100ms ease-out, background-color 140ms ease;
}

.icon-btn:active {
  transform: scale(0.95);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 100ms ease-out, background-color 140ms ease, border-color 140ms ease;
}

.theme-label {
  display: none;
}

.theme-btn:active {
  transform: scale(0.97);
}

.theme-icon {
  display: inline-flex;
  align-items: center;
}

.mobile-search-drawer {
  padding: 0 16px 12px;
  border-top: 1px solid var(--border-subtle);
  animation: mobileDrawerIn 180ms var(--ease-out);
}

.mobile-search-drawer[hidden] {
  display: none;
}

@keyframes mobileDrawerIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-search-form {
  display: flex;
  gap: 8px;
  padding-top: 10px;
}

.mobile-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.mobile-search-input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--surface);
  color: var(--text-primary);
}

.mobile-search-input-wrap .search-clear-btn {
  right: 8px;
}

/* Main Container */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 10px calc(84px + env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
}

@media (min-width: 640px) {
  .app-main {
    padding: 18px 20px calc(92px + env(safe-area-inset-bottom, 0px));
  }
}

.app-view {
  animation: viewReveal 180ms var(--ease-out);
}

@keyframes viewReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 100ms ease-out, background-color 140ms ease, border-color 140ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 6px 16px -6px rgba(2, 6, 23, 0.4);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-control);
}

.btn-soft {
  background: var(--surface-soft);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
}

/* Spotlight Hero (Mobile: Edge-to-Edge Fade Overlay / Desktop: Split Card) */
.hero-spotlight {
  position: relative;
  margin: 0 -10px 14px;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: #0B0D12;
  box-shadow: none;
}

.hero-backdrop {
  position: relative;
  min-height: 368px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 158px 16px 10px;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  filter: saturate(1.10) brightness(0.86);
  transform: scale(1.01);
  transition: transform 360ms var(--ease-out), opacity 220ms ease;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(11, 13, 18, 0.14) 0%,
      rgba(11, 13, 18, 0.24) 36%,
      rgba(11, 13, 18, 0.86) 72%,
      #0B0D12 100%
    );
}

html[data-theme="light"] .hero-spotlight {
  margin: 0 -10px 14px;
  border-radius: 0;
  box-shadow: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: #FFFFFF;
}

.hero-info-block {
  min-width: 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #FFFFFF;
}

.hero-mobile-hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  color: inherit;
}

.hero-poster-frame {
  display: none;
  position: relative;
  z-index: 2;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 26px -8px rgba(0, 0, 0, 0.85);
  background: var(--surface-soft);
  flex-shrink: 0;
}

.hero-poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 640px) {
  .hero-spotlight,
  html[data-theme="light"] .hero-spotlight {
    margin: 0 0 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevated);
  }
  .hero-backdrop {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    min-height: 340px;
    padding: 0;
  }
  .hero-bg-img {
    filter: blur(22px) saturate(1.18) brightness(0.65);
    transform: scale(1.08);
  }
  .hero-scrim {
    background:
      linear-gradient(90deg, #0B0D12 0%, rgba(11, 13, 18, 0.90) 46%, rgba(11, 13, 18, 0.52) 78%, rgba(11, 13, 18, 0.36) 100%),
      linear-gradient(to top, #0B0D12 8%, transparent 55%);
  }
  .hero-content {
    display: block;
    text-align: left;
    flex: 1;
    max-width: 600px;
    padding: 28px;
  }
  .hero-info-block,
  .hero-mobile-hit {
    max-width: none;
    align-items: flex-start;
  }
  .hero-poster-frame {
    display: block;
    width: 175px;
    margin: 24px 28px 24px 0;
    border-radius: var(--radius-md);
    box-shadow: 0 22px 44px -10px rgba(0, 0, 0, 0.85);
  }
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
  order: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #E2E8F0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-dot-sep {
  color: var(--accent);
  font-weight: 900;
}

.hero-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

.hero-title {
  order: 1;
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 5.4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: #FFFFFF;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.hero-desc {
  order: 3;
  margin: 2px 0 2px;
  max-width: 52ch;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #94A3B8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: none;
  position: relative;
  z-index: 2;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
}

.hero-actions .btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  white-space: nowrap;
}

.hero-btn-outline {
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.hero-footer-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 2px;
}

.hero-arrow-group {
  display: none;
  align-items: center;
  gap: 6px;
}

@media (min-width: 640px) {
  .hero-meta-row {
    justify-content: flex-start;
    order: 0;
    gap: 8px;
    margin-bottom: 10px;
  }
  .hero-tag {
    padding: 4px 10px;
    border-radius: 7px;
    background: rgba(25, 211, 190, 0.14);
    border: 1px solid rgba(25, 211, 190, 0.34);
    color: #67E8F9;
    font-size: 0.75rem;
  }
  .hero-dot-sep {
    display: none;
  }
  .hero-title {
    order: 0;
    margin: 0 0 8px;
    -webkit-line-clamp: unset;
    text-shadow: none;
  }
  .hero-desc {
    order: 0;
    margin: 0 0 16px;
    max-width: 58ch;
    color: #CBD5E1;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    width: auto;
    margin-top: 0;
  }
  .hero-footer-bar {
    justify-content: space-between;
    margin-top: 14px;
  }
  .hero-arrow-group {
    display: inline-flex;
  }
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}

.hero-dot-btn {
  min-width: 12px;
  min-height: 24px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-dot-bar {
  width: 6px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 220ms var(--ease-out), background-color 200ms ease;
}

.hero-dot-btn.is-active .hero-dot-bar {
  width: 16px;
  background: var(--accent);
}

.hero-arrow-btn {
  width: 34px;
  height: 34px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.65);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.hero-arrow-btn:active {
  transform: scale(0.92);
}

/* Quick Category Chips on Home */
.home-chips-section {
  margin-bottom: 16px;
}

.home-chips-heading {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
}

.home-quick-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 6px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.home-quick-chips::-webkit-scrollbar {
  display: none;
}

.home-qchip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  border: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 140ms ease, transform 120ms ease;
}

.home-qchip:active {
  transform: scale(0.96);
}

.home-qchip.is-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.sk-chips-row {
  padding-bottom: 16px;
}

.sk-chip-pill {
  flex: 0 0 auto;
  width: 82px;
  height: 36px;
  border-radius: 99px;
}

/* Section Headers */
.section-block {
  margin-bottom: 22px;
  min-width: 0;
  max-width: 100%;
  content-visibility: auto;
  contain-intrinsic-size: auto 250px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.section-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.section-creator-pill {
  display: inline-flex;
  align-items: center;
  max-width: min(56vw, 260px);
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.carousel-nav {
  display: none;
  align-items: center;
  gap: 6px;
}

.carousel-btn {
  width: 34px;
  height: 34px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 150ms ease;
}

.carousel-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.carousel-btn:active {
  transform: scale(0.92);
}

@media (min-width: 768px) {
  .home-quick-chips {
    flex-wrap: wrap;
    overflow: visible;
    gap: 8px;
    padding-bottom: 20px;
  }

  .carousel-nav {
    display: inline-flex;
  }
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 2.2vw, 1.38rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  padding: 0 4px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .section-block {
    margin-bottom: 28px;
  }
  .section-header {
    gap: 12px;
    margin-bottom: 14px;
  }
  .section-link {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 99px;
    background: var(--surface-soft);
    border: 1px solid var(--border-subtle);
    color: var(--accent-text);
    font-size: 0.875rem;
    font-weight: 700;
  }
}

/* Home Dense Poster Grid (3 cols Mobile -> 6 cols Desktop) */
.home-poster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.home-poster-grid .poster-body,
.h-poster-track .poster-body {
  padding: 6px 2px 2px;
  gap: 2px;
}

.home-poster-grid .poster-title,
.h-poster-track .poster-title {
  font-size: 0.78rem;
  line-height: 1.28;
}

.home-poster-grid .poster-sub,
.h-poster-track .poster-sub,
.poster-grid .poster-sub {
  display: none;
  font-size: 0.72rem;
}

@media (min-width: 640px) {
  .home-poster-grid {
    gap: 14px;
  }
  .home-poster-grid .poster-body,
  .h-poster-track .poster-body {
    padding: 8px 3px 4px;
    gap: 3px;
  }
  .home-poster-grid .poster-title,
  .h-poster-track .poster-title {
    font-size: 0.875rem;
    line-height: 1.32;
  }
  .home-poster-grid .poster-sub,
  .h-poster-track .poster-sub,
  .poster-grid .poster-sub {
    display: flex;
    font-size: 0.76rem;
  }
}

@media (min-width: 1024px) {
  .home-poster-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
  }
}

/* Horizontal Scroll Track (Lanjutkan & Jadwal Hari Ini) */
.h-scroll-track {
  display: flex;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.h-scroll-track::-webkit-scrollbar {
  display: none;
}

.continue-card-wrap {
  position: relative;
  flex: 0 0 248px;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease, transform 140ms var(--ease-out);
}

.continue-card {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 6px 10px 10px;
}

.continue-remove-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-right: 6px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.continue-remove-btn:active {
  background: var(--surface-soft);
  color: var(--text-primary);
}

.continue-thumb {
  width: 56px;
  height: 76px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-soft);
}

.continue-info {
  min-width: 0;
  flex: 1;
}

.continue-title {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.continue-ep {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

/* Poster Grid (3-state responsive reflow: 3 cols Mobile -> auto Desktop) */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.poster-card-shell {
  position: relative;
  display: flex;
  flex-direction: column;
}

.poster-card-shell .poster-score-pill {
  display: none;
}

.poster-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-radius: 10px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  contain: layout style;
  transition: transform 150ms var(--ease-out);
}

.poster-card:active {
  transform: scale(0.97);
}

.poster-quick-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 11, 16, 0.84);
  color: #F8FAFC;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 140ms ease, transform 120ms ease;
}

.poster-quick-remove:active {
  transform: scale(0.9);
}

.poster-media {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: var(--surface);
  border: 0;
  box-shadow: none;
  overflow: hidden;
  transition: box-shadow 180ms ease;
}

.poster-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.84) 0%, rgba(0, 0, 0, 0.16) 36%, transparent 62%);
  pointer-events: none;
}

.poster-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms var(--ease-out);
}

.poster-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  color: #F8FAFC;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: 0.01em;
  max-width: calc(100% - 58px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-badge.is-new,
.poster-badge.is-end {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.poster-score-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  color: #FFFFFF;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.28;
  font-variant-numeric: tabular-nums;
}

.poster-ep-overlay {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  z-index: 2;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-resume-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(14, 116, 144, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(2, 6, 16, 0.40);
  max-width: calc(100% - 62px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-body {
  padding: 6px 2px 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.poster-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poster-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .poster-media {
    border-radius: 12px;
  }
  .poster-badge,
  .poster-score-pill,
  .poster-resume-pill {
    top: 8px;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 7px;
  }
  .poster-badge,
  .poster-resume-pill {
    left: 8px;
    max-width: calc(100% - 72px);
  }
  .poster-score-pill {
    right: 8px;
  }
  .poster-ep-overlay {
    left: 9px;
    right: 9px;
    bottom: 8px;
    font-size: 0.78rem;
  }
  .poster-body {
    padding: 8px 3px 4px;
    gap: 3px;
  }
  .poster-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.32;
  }
}

/* Schedule Strip (Rhythm break on Home) */
.schedule-strip-card {
  flex: 0 0 242px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease, transform 150ms var(--ease-out);
}

.schedule-strip-card:active {
  transform: scale(0.98);
}

.schedule-strip-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.schedule-strip-img {
  width: 56px;
  height: 74px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
}

.schedule-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 18px;
}

.schedule-time {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

/* Ranked Popular Row (Rhythm break #2 on Home) */
.rank-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.rank-num {
  width: 30px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  text-align: center;
  flex-shrink: 0;
}

.rank-thumb {
  width: 52px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-soft);
}

.rank-info {
  min-width: 0;
  flex: 1;
}

.rank-title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Filter Bar (Katalog) */
.catalog-page-chips {
  margin-bottom: 12px;
}

.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

@media (max-width: 639px) {
  .catalog-toolbar.is-collapsed-mobile {
    display: none;
  }
}

@media (min-width: 640px) {
  #catalog-filter-toggle {
    display: none;
  }
}

.catalog-split-layout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.catalog-main-col {
  flex: 1;
  min-width: 0;
}

.az-index-rail {
  flex: 0 0 32px;
  position: sticky;
  top: 62px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
}

.az-index-rail::-webkit-scrollbar {
  display: none;
}

.az-index-btn {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 130ms ease, color 130ms ease, transform 100ms ease;
}

.az-index-btn:active {
  transform: scale(0.92);
}

.az-index-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (min-width: 640px) {
  .az-index-rail {
    flex: 0 0 38px;
    top: 76px;
  }
  .az-index-btn {
    width: 38px;
    height: 30px;
    font-size: 0.72rem;
  }
}

.catalog-search-row {
  display: flex;
  gap: 8px;
}

.catalog-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.catalog-search-input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--bg-page);
  color: var(--text-primary);
  transition: border-color 160ms ease;
}

.catalog-search-input-wrap input:focus {
  border-color: var(--accent);
}

.catalog-search-input-wrap .search-clear-btn {
  right: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .chip-row {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }
}

.chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 99px;
  border: 0;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.chip:active {
  transform: scale(0.97);
}

.chip.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.catalog-page-chips .chip.is-active,
.library-page-chips .chip.is-active {
  background: #F8FAFC;
  color: #0B0D12;
}

html[data-theme="light"] .catalog-page-chips .chip.is-active,
html[data-theme="light"] .library-page-chips .chip.is-active {
  background: var(--accent);
  color: #FFFFFF;
}

.chip-today-badge {
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.chip.is-active .chip-today-badge {
  background: rgba(255, 255, 255, 0.24);
  color: var(--accent-ink);
}

html[data-theme="dark"] .chip.is-active .chip-today-badge {
  background: rgba(6, 11, 25, 0.16);
  color: #060B19;
}

.chip-count {
  font-size: 0.78em;
  font-weight: 600;
  opacity: 0.78;
}

.filter-select-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 640px) {
  .filter-select-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
}

.select-field {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
}

@media (min-width: 640px) {
  .select-field {
    width: auto;
  }
}

.catalog-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Detail View */
.back-row {
  margin-bottom: 14px;
}

.detail-header {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevated);
  margin-bottom: 24px;
}

.detail-backdrop {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  object-fit: cover;
  filter: blur(24px) saturate(1.2);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

.detail-backdrop-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6, 11, 25, 0.88) 0%, rgba(12, 20, 43, 0.72) 100%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] .detail-backdrop-scrim {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.90) 0%, rgba(235, 242, 252, 0.85) 100%);
}

.detail-header > :not(.detail-backdrop):not(.detail-backdrop-scrim) {
  position: relative;
  z-index: 1;
}

/* Detail Donghive Immersive Layout */
.dh-detail-hero {
  position: relative;
  margin: -10px -10px 20px;
  background: var(--bg-page);
}

@media (max-width: 639px) {
  .dh-detail-hero {
    margin: 0 -10px 18px;
  }
}

.dh-hero-media {
  position: relative;
  width: 100%;
  height: clamp(360px, 106vw, 440px);
  overflow: hidden;
  background: #0B0D12;
}

.dh-hero-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.dh-hero-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 12%;
}

.dh-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-page) 3%,
    rgba(11, 13, 18, 0.8) 28%,
    rgba(11, 13, 18, 0.14) 64%,
    rgba(11, 13, 18, 0.28) 100%
  );
}

html[data-theme="light"] .dh-hero-scrim {
  background: linear-gradient(
    to top,
    var(--bg-page) 3%,
    rgba(243, 247, 253, 0.72) 28%,
    rgba(11, 13, 18, 0.08) 64%,
    rgba(11, 13, 18, 0.22) 100%
  );
}

@media (min-width: 640px) {
  .dh-hero-media .dw-back-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
  }
}

.dh-hero-body {
  position: relative;
  z-index: 3;
  margin-top: -78px;
  padding: 0 14px;
}

.dh-poster-side {
  display: none;
}

.dh-hero-info {
  min-width: 0;
}

.dh-schedule-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--accent-text);
  font-size: 0.88rem;
  font-weight: 700;
}

.dh-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  text-wrap: balance;
}

.dh-alt {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dh-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.dh-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.72);
  color: #F8FAFC;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

html[data-theme="light"] .dh-pill {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.dh-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.dh-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 140ms ease, background-color 160ms ease, border-color 160ms ease;
}

.dh-cta-btn:active {
  transform: scale(0.97);
}

.dh-cta-dark {
  background: #F1F5F9;
  color: #0B0D12;
  border-color: transparent;
}

html[data-theme="light"] .dh-cta-dark {
  background: var(--accent);
  color: #FFFFFF;
}

.dh-cta-light {
  background: #171B24;
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] .dh-cta-light {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-control);
}

.dh-cta-light[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.dh-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.dh-quick-link {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dh-genre-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dh-genre-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.62);
  color: #E2E8F0;
  font-size: 0.82rem;
  font-weight: 700;
  transition: border-color 180ms ease, background-color 180ms ease;
}

html[data-theme="light"] .dh-genre-box {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.dh-synopsis-block {
  margin-bottom: 24px;
}

.dh-section-heading {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.dh-synopsis-wrap {
  position: relative;
  max-height: 76px;
  overflow: hidden;
  transition: max-height 260ms ease;
}

.dh-synopsis-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(to bottom, transparent, var(--bg-page));
  pointer-events: none;
}

.dh-synopsis-wrap.is-expanded {
  max-height: 1200px;
}

.dh-synopsis-wrap.is-expanded::after {
  display: none;
}

.dh-synopsis-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--text-muted);
}

.dh-synopsis-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  margin-top: 2px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.dh-synopsis-toggle svg {
  transition: transform 220ms ease;
}

.dh-synopsis-toggle.is-expanded svg {
  transform: rotate(180deg);
}

@media (min-width: 768px) {
  .dh-detail-hero {
    margin: 0 0 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    padding-bottom: 24px;
  }

  .dh-hero-media {
    height: 340px;
  }

  .dh-hero-body {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: -120px;
    padding: 0 26px;
  }

  .dh-poster-side {
    display: block;
    width: 195px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid rgba(34, 211, 238, 0.35);
    box-shadow: var(--shadow-elevated);
    flex-shrink: 0;
    background: var(--surface-soft);
  }

  .dh-poster-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .dh-cta-row {
    max-width: 440px;
  }
}

.detail-cover-wrap {
  width: 170px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-soft);
  flex-shrink: 0;
}

.detail-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
}

.detail-alt {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.meta-grid strong {
  color: var(--text-primary);
}

.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.genre-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border-subtle);
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-synopsis {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.episode-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.episode-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.episode-filter-input {
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--bg-page);
  color: var(--text-primary);
  width: 100%;
  max-width: 240px;
}

.ep-range-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ep-range-row::-webkit-scrollbar {
  display: none;
}

.ep-range-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.ep-range-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.episode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: none;
  overflow-y: visible;
  padding-right: 0;
}

.ep-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 0;
  background: var(--surface);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 150ms ease;
}

.ep-btn-top {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 640px) {
  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    max-height: 440px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }
  .ep-btn {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    padding: 9px 13px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-soft);
  }
  .ep-btn-top {
    width: 100%;
    justify-content: space-between;
  }
}

.ep-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  flex-shrink: 0;
}

.ep-playing-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ep-btn.is-watched {
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(16, 185, 129, 0.10);
}

.ep-btn.is-watched .ep-num {
  color: var(--text-muted);
}

.ep-progress-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34D399;
  font-size: 0.75rem;
  font-weight: 700;
}

.ep-btn.is-current {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.ep-num {
  font-size: 0.875rem;
  font-weight: 800;
}

.ep-date {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Watch View */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.player-stage {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #071324;
  box-shadow: var(--shadow-elevated);
}

.player-aspect {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #071324;
}

.player-aspect iframe,
.player-aspect .dw-native-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000000;
}

.player-aspect iframe[hidden],
.player-aspect .dw-native-video[hidden] {
  display: none;
}

.player-dock {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-top: 14px;
}

.watch-title {
  margin: 0 0 12px;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 800;
}

.watch-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.mirror-section-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mirror-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mirror-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-control);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.mirror-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.mirror-lang {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--text-muted);
}

.mirror-btn.is-active .mirror-lang {
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.download-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.download-row:last-child {
  border-bottom: 0;
}

.download-quality {
  min-width: 72px;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Donghive Watch View */
.dw-back-btn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 90;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #F8FAFC;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}

html[data-theme="light"] .dw-back-btn {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0F172A;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dw-back-btn:active {
  transform: scale(0.92);
}

.dw-watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.dw-watch-main {
  min-width: 0;
}

.dw-player-stage {
  margin: 0 -10px 0;
  border-radius: 0;
  border: 0;
  background: #000000;
  box-shadow: none;
  overflow: hidden;
}

.dw-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 2px 10px;
}

.dw-avatar-link {
  display: block;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-soft);
}

.dw-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dw-info-meta {
  min-width: 0;
  flex: 1;
}

.dw-watch-title {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dw-watch-sub {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dw-action-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.dw-action-strip::-webkit-scrollbar {
  display: none;
}

.dw-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #1A2234;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}

html[data-theme="light"] .dw-action-pill {
  background: var(--surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.dw-action-pill svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.dw-play-cutout {
  fill: #1A2234;
}

html[data-theme="light"] .dw-play-cutout {
  fill: #FFFFFF;
}

.dw-action-pill:active {
  transform: scale(0.97);
}

.dw-action-pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.dw-action-pill.dw-pill-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.dw-action-pill.is-disabled,
.dw-action-pill[disabled],
.dw-action-pill[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Donghive Quality / Mirror Bottom Sheet Modal */
.dw-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 165;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2, 6, 23, 0.72);
}

.dw-sheet-backdrop[hidden] {
  display: none;
}

.dw-sheet-card {
  width: 100%;
  max-width: 520px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: #0F172A;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(2, 6, 23, 0.65);
  animation: dwSheetUp 180ms var(--ease-out);
}

html[data-theme="light"] .dw-sheet-card {
  background: var(--surface);
  border-top-color: var(--border-subtle);
  box-shadow: var(--shadow-elevated);
}

@keyframes dwSheetUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dw-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.42);
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.dw-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

.dw-sheet-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dw-auto-toggle {
  min-width: 52px;
  height: 30px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.dw-auto-toggle.is-on {
  background: #22D3EE;
  border-color: #22D3EE;
  color: #060B19;
}

html[data-theme="light"] .dw-auto-toggle.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.dw-sheet-title {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.dw-sheet-desc {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dw-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.dw-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dw-sheet-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #172033;
  border: 1.5px solid rgba(148, 163, 184, 0.14);
  color: #F8FAFC;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}

html[data-theme="light"] .dw-sheet-option {
  background: var(--surface-soft);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.dw-sheet-option:active {
  transform: scale(0.985);
}

.dw-sheet-option.is-active {
  border-color: #22D3EE;
  background: rgba(34, 211, 238, 0.10);
}

html[data-theme="light"] .dw-sheet-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dw-option-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dw-option-radio {
  width: 24px;
  height: 24px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.28);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dw-option-radio svg {
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 140ms ease, transform 140ms ease;
}

.dw-sheet-option.is-active .dw-option-radio {
  background: #3B82F6;
  color: #FFFFFF;
}

.dw-sheet-option.is-active .dw-option-radio svg {
  opacity: 1;
  transform: scale(1);
}

html[data-theme="light"] .dw-sheet-option.is-active .dw-option-radio {
  background: var(--accent);
}

.dw-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dw-option-name {
  font-size: 0.96875rem;
  font-weight: 800;
  line-height: 1.25;
}

.dw-sheet-option.is-active .dw-option-name {
  color: #22D3EE;
}

html[data-theme="light"] .dw-sheet-option.is-active .dw-option-name {
  color: var(--accent-text);
}

.dw-option-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dw-sheet-option.is-active .dw-option-sub {
  color: #38BDF8;
}

html[data-theme="light"] .dw-sheet-option.is-active .dw-option-sub {
  color: var(--accent-text);
}

.dw-tier-badge,
.dw-option-badge {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

.dw-tier-badge.tone-uhd {
  background: #6D28D9;
  color: #EDE9FE;
}

.dw-tier-badge.tone-fhd {
  background: rgba(234, 179, 8, 0.20);
  color: #EAB308;
}

.dw-tier-badge.tone-hd {
  background: rgba(249, 115, 22, 0.20);
  color: #FB923C;
}

.dw-tier-badge.tone-sd {
  background: rgba(236, 72, 153, 0.20);
  color: #F472B6;
}

.dw-tier-badge.tone-low {
  background: rgba(168, 85, 247, 0.22);
  color: #C084FC;
}

html[data-theme="light"] .dw-tier-badge.tone-uhd {
  background: rgba(109, 40, 217, 0.14);
  color: #5B21B6;
}

html[data-theme="light"] .dw-tier-badge.tone-fhd {
  background: rgba(202, 138, 4, 0.16);
  color: #854D0E;
}

html[data-theme="light"] .dw-tier-badge.tone-hd {
  background: rgba(234, 88, 12, 0.15);
  color: #9A3412;
}

html[data-theme="light"] .dw-tier-badge.tone-sd {
  background: rgba(219, 39, 119, 0.14);
  color: #9D174D;
}

html[data-theme="light"] .dw-tier-badge.tone-low {
  background: rgba(147, 51, 234, 0.14);
  color: #6B21A8;
}

.dw-sheet-option.is-active .dw-option-badge {
  background: #22D3EE;
  color: #060B19;
}

html[data-theme="light"] .dw-sheet-option.is-active .dw-option-badge {
  background: var(--accent);
  color: var(--accent-ink);
}

.dw-sheet-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

.dw-sheet-alt-btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .dw-sheet-alt-btn:hover {
    color: var(--text-primary);
    background: var(--surface-soft);
    border-color: var(--border-subtle);
  }
}

@media (min-width: 640px) {
  .dw-sheet-backdrop {
    align-items: center;
    padding: 20px;
  }

  .dw-sheet-card {
    max-width: 440px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    padding: 18px 20px 20px;
    box-shadow: var(--shadow-elevated);
  }

  .dw-sheet-handle {
    display: none;
  }
}

.dw-ep-section {
  margin-top: 6px;
  min-width: 0;
}

.dw-ep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dw-ep-heading {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
}

.dw-ep-see-all {
  font-size: 0.9rem;
  font-weight: 700;
  color: #22D3EE;
  text-decoration: none;
  white-space: nowrap;
}

html[data-theme="light"] .dw-ep-see-all {
  color: var(--accent-text);
}

.dw-ep-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.dw-ep-strip::-webkit-scrollbar {
  display: none;
}

.ep-btn.dw-ep-chip {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 68px;
  min-height: 48px;
  padding: 0 15px;
  border-radius: 14px;
  background: #1A2234;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  text-decoration: none;
}

html[data-theme="light"] .ep-btn.dw-ep-chip {
  background: var(--surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.ep-btn.dw-ep-chip.is-watched {
  border: 1.8px solid #22D3EE;
  background: transparent;
  color: var(--text-primary);
}

html[data-theme="light"] .ep-btn.dw-ep-chip.is-watched {
  border: 1.8px solid #0284C7;
  background: rgba(2, 132, 199, 0.08);
  color: var(--text-primary);
}

.ep-btn.dw-ep-chip.is-current {
  background: #FFFFFF;
  color: #060B19;
  border-color: #FFFFFF;
}

html[data-theme="light"] .ep-btn.dw-ep-chip.is-current {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.dw-ep-num {
  font-size: 0.92rem;
  font-weight: 800;
}

/* Schedule & Library */
.schedule-header-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.schedule-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-page-title {
  color: var(--accent);
  font-size: clamp(1.22rem, 4.5vw, 1.55rem);
}

.schedule-live-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.schedule-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

.schedule-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.schedule-refresh-btn:active {
  transform: scale(0.95);
}

.schedule-day-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.schedule-day-heading {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.schedule-subcount {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
}

.schedule-split-layout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.schedule-day-list {
  flex: 1;
  min-width: 0;
}

.schedule-poster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-day-rail {
  flex: 0 0 80px;
  position: sticky;
  top: 66px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.schedule-day-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 0;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.schedule-day-btn:active {
  transform: scale(0.96);
}

.schedule-day-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.schedule-day-btn.is-today:not(.is-active) {
  color: var(--accent);
}

@media (min-width: 640px) {
  .schedule-split-layout {
    gap: 18px;
  }
  .schedule-poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }
  .schedule-day-rail {
    flex: 0 0 128px;
    top: 80px;
    gap: 8px;
  }
  .schedule-day-btn {
    padding: 10px 14px;
    font-size: 0.88rem;
    min-height: 46px;
  }
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.schedule-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 98px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease, transform 150ms var(--ease-out);
}

.schedule-card:active {
  transform: scale(0.985);
}

.schedule-card img {
  width: 58px;
  height: 78px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
}

.schedule-card-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.schedule-card-info h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.32;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.library-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.library-card-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.library-card-link img {
  width: 56px;
  height: 76px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-soft);
}

.library-card-info {
  min-width: 0;
  flex: 1;
}

.library-card-info h3 {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* States: Loading, Empty, Error (R-27) */
.state-panel {
  padding: 32px 20px;
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.state-panel h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
}

.state-panel p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sk-shimmer {
  position: relative;
  overflow: hidden;
  background-color: var(--surface-soft);
  background-image: linear-gradient(
    110deg,
    transparent 20%,
    rgba(34, 211, 238, 0.08) 45%,
    rgba(139, 92, 246, 0.07) 55%,
    transparent 80%
  );
  background-size: 220% 100%;
  animation: skShimmer 1.45s ease-in-out infinite;
}

@keyframes skShimmer {
  0% {
    background-position: 180% 0;
  }
  100% {
    background-position: -80% 0;
  }
}

.sk-hero {
  width: 100%;
  height: clamp(208px, 44vw, 370px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.sk-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sk-title-bar {
  width: 165px;
  height: 22px;
  border-radius: 8px;
}

.sk-link-bar {
  width: 82px;
  height: 16px;
  border-radius: 6px;
}

.sk-poster-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.h-poster-track .sk-poster-card {
  flex: 0 0 120px;
}

@media (min-width: 640px) {
  .h-poster-track .sk-poster-card {
    flex: 0 0 168px;
  }
}

.sk-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: calc(var(--radius-md) - 4px);
}

.sk-line {
  width: 88%;
  height: 14px;
  border-radius: 6px;
}

.sk-line-sm {
  width: 56%;
  height: 12px;
  border-radius: 6px;
}

.sk-detail-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 22px;
}

.sk-detail-poster {
  width: 160px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  margin: 0 auto;
}

.sk-detail-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sk-player-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.sk-ep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sk-ep-pill {
  height: 44px;
  border-radius: var(--radius-sm);
}

@media (min-width: 640px) {
  .sk-detail-head {
    flex-direction: row;
    align-items: flex-start;
  }
  .sk-detail-poster {
    width: 190px;
    margin: 0;
  }
}

.skeleton-card {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border-subtle);
}

.loading-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--border-subtle);
  border-top-color: var(--accent);
  animation: spin 750ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Pagination */
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.page-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Footer */
.app-footer {
  display: none;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface);
}

.footer-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-brand strong {
  color: var(--text-primary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* W3C View Transition Circular Reveal (Komiku Standard) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

.theme-transitioning,
.theme-transitioning * {
  transition: none !important;
}

/* Mobile Bottom Nav - Liquid Glass */
.bottom-nav {
  --nav-idx: 0;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 5px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  contain: layout style;
}

html[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.76);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.bottom-nav-indicator {
  position: absolute;
  top: 5px;
  left: 8px;
  width: calc((100% - 16px) / 5);
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(25, 211, 190, 0.22), rgba(56, 189, 248, 0.14));
  border: 1px solid rgba(25, 211, 190, 0.34);
  box-shadow:
    0 4px 16px rgba(25, 211, 190, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 0;
  backface-visibility: hidden;
  transform: translate3d(calc(var(--nav-idx, 0) * 100%), 0, 0);
  transition: transform 440ms cubic-bezier(0.22, 1.18, 0.36, 1), opacity 220ms ease;
  will-change: transform;
}

html[data-theme="light"] .bottom-nav-indicator {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.16), rgba(14, 165, 233, 0.12));
  border-color: rgba(13, 148, 136, 0.3);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.bottom-nav.no-active .bottom-nav-indicator {
  opacity: 0;
}

.bottom-nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  padding: 0 2px;
  border-radius: 14px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 220ms ease, transform 160ms var(--ease-out);
}

.bottom-nav-item svg {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  transition: transform 280ms cubic-bezier(0.22, 1.18, 0.36, 1), filter 220ms ease;
}

.bottom-nav-item span {
  position: relative;
  z-index: 1;
  line-height: 1.1;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item.is-active {
  color: var(--accent);
}

.bottom-nav-item.is-active svg {
  transform: translateY(-1px) scale(1.06);
  filter: drop-shadow(0 2px 6px rgba(25, 211, 190, 0.3));
}

.h-poster-track {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.h-poster-track .poster-card {
  flex: 0 0 calc((100% - 22px) / 3.18);
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .h-poster-track .poster-card {
    flex: 0 0 168px;
  }
}

/* Toast & Modal */
.toast-banner {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: #0B1F3A;
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--shadow-elevated);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 19, 36, 0.62);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevated);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-desc {
  margin: 0 0 18px;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.custom-name-form {
  display: grid;
  gap: 10px;
}

.custom-name-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.custom-name-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 600;
}

.custom-name-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.custom-name-footer {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.custom-name-footer .modal-actions {
  margin-left: auto;
}

/* Breakpoint 2: Tablet & Small Laptop (>= 640px) */
@media (min-width: 640px) {
  .mobile-only-btn,
  .mobile-search-drawer,
  .bottom-nav {
    display: none;
  }

  .desktop-nav {
    display: flex;
  }

  .search-form {
    display: flex;
  }

  .theme-btn {
    width: auto;
    min-height: 44px;
    padding: 0 12px;
  }

  .theme-label {
    display: inline;
  }

  .app-main {
    padding: 22px 24px 40px;
  }

  body[data-route="watch"] .app-main {
    padding-top: 68px;
  }

  .dw-back-btn {
    top: 14px;
    left: 16px;
  }

  .app-footer {
    display: block;
  }

  .toast-banner {
    bottom: 24px;
  }

  .sk-hero {
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
  }

  .poster-grid,
  .skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
    gap: 16px;
  }

  .rank-list,
  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-header {
    flex-direction: row;
    align-items: flex-start;
    padding: 22px;
  }

  .detail-cover-wrap {
    width: 200px;
    margin: 0;
  }

  .dw-player-stage {
    margin: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elevated);
  }

  .dw-info-bar {
    padding: 16px 0 12px;
  }

  .dw-watch-title {
    font-size: 1.25rem;
  }
}

/* Breakpoint 3: Desktop (>= 1024px) */
@media (min-width: 1024px) {
  .topbar-inner {
    padding: 12px 24px;
  }

  .search-form {
    width: 300px;
  }

  .hero-backdrop {
    min-height: 400px;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
  }

  .hero-bg-img {
    filter: blur(22px) saturate(1.18) brightness(0.65);
    transform: scale(1.08);
  }

  .hero-scrim {
    background:
      linear-gradient(90deg, #080B10 0%, rgba(8, 11, 16, 0.90) 44%, rgba(8, 11, 16, 0.52) 78%, rgba(8, 11, 16, 0.36) 100%),
      linear-gradient(to top, #080B10 8%, transparent 55%);
  }

  .hero-content {
    flex: 1;
    max-width: 600px;
    padding: 36px 0 32px 36px;
  }

  .hero-poster-frame {
    position: relative;
    z-index: 2;
    display: block;
    width: 210px;
    aspect-ratio: 3 / 4;
    margin: 28px 36px 28px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 22px 44px -10px rgba(2, 6, 23, 0.85);
    background: var(--surface-soft);
    flex-shrink: 0;
  }

  .hero-poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .poster-grid,
  .skeleton-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .rank-list,
  .schedule-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .watch-layout,
  .dw-watch-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 24px;
  }

  .watch-layout .episode-panel {
    max-height: 560px;
    overflow-y: auto;
  }

  .dw-ep-section {
    margin-top: 0;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
  }

  .dw-ep-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-height: 460px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    touch-action: pan-y;
  }

  .ep-btn.dw-ep-chip {
    min-width: 0;
    width: 100%;
    padding: 0 8px;
  }
}

/* Hover only when pointer supports fine hover (mobile-native) */
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover,
  .icon-btn:hover,
  .theme-btn:hover,
  .btn-secondary:hover,
  .btn-soft:hover,
  .chip:hover,
  .home-qchip:hover,
  .genre-btn:hover,
  .mirror-btn:hover,
  .ep-btn:hover,
  .ep-range-btn:hover,
  .dw-action-pill:hover,
  .dw-sheet-option:hover,
  .dw-sheet-close:hover,
  .dw-ep-chip:hover,
  .continue-card-wrap:hover,
  .schedule-card:hover,
  .library-card:hover,
  .rank-item:hover,
  .prof-feat-item:hover,
  .prof-menu-row:hover,
  .prof-edit-row:hover,
  .set-row:hover,
  .set-logout-card:hover {
    border-color: var(--accent);
  }

  .hero-arrow-btn:hover,
  .hero-btn-outline:hover {
    background: rgba(15, 23, 42, 0.85);
    border-color: #FFFFFF;
  }

  .search-clear-btn:hover,
  .continue-remove-btn:hover {
    background: var(--surface-soft);
    color: var(--text-primary);
  }

  .poster-quick-remove:hover {
    background: #DC2626;
    border-color: rgba(255, 255, 255, 0.45);
  }

  .btn-primary:hover {
    background: var(--accent-hover);
  }

  .poster-card:hover {
    transform: translateY(-3px);
  }

  .poster-card:hover .poster-media {
    border-color: var(--accent);
    box-shadow: var(--shadow-elevated);
  }

  .poster-card:hover .poster-media img {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .app-view,
  .dw-sheet-card,
  .mobile-search-drawer {
    animation: none;
  }

  .poster-card,
  .btn,
  .icon-btn,
  .theme-btn,
  .dw-sheet-option,
  .hero-bg-img {
    transition: none;
  }

  .dc-stream-col {
    animation: none !important;
  }
}

/* ==================== PROFIL (SESUAI SS) ==================== */
.prof-page,
.set-page {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prof-hero {
  position: relative;
  margin: 0 -10px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 8px;
  overflow: hidden;
}

@media (min-width: 640px) {
  .prof-hero {
    margin: 0;
    padding-top: 22px;
    border-radius: var(--radius-lg);
  }
}

.prof-hero-backdrop {
  position: absolute;
  inset: 0 0 auto 0;
  height: 196px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background: var(--surface-soft);
}

@media (min-width: 640px) {
  .prof-hero-backdrop {
    height: 224px;
  }
}

.prof-hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.prof-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 13, 18, 0.16) 0%,
    rgba(11, 13, 18, 0.08) 48%,
    rgba(11, 13, 18, 0.72) 86%,
    var(--bg-page) 100%
  );
}

html[data-theme="light"] .prof-hero-fade {
  background: linear-gradient(
    180deg,
    rgba(11, 13, 18, 0.12) 0%,
    rgba(243, 247, 253, 0.05) 48%,
    rgba(243, 247, 253, 0.72) 86%,
    var(--bg-page) 100%
  );
}

.prof-hero-top-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 58px;
}

.prof-media-hint {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.prof-top-pill {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(11, 13, 18, 0.56);
  backdrop-filter: blur(12px);
  color: #F8FAFC;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.prof-top-pill.is-accent {
  border-color: rgba(25, 211, 190, 0.45);
  background: rgba(25, 211, 190, 0.18);
  color: #A7F3D0;
}

html[data-theme="light"] .prof-top-pill {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

html[data-theme="light"] .prof-top-pill.is-accent {
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(13, 148, 136, 0.35);
  color: #0F766E;
}

.prof-hero-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.prof-avatar-wrap {
  position: relative;
  margin-bottom: 10px;
}

.prof-avatar-ring {
  width: 96px;
  height: 96px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(25, 211, 190, 0.52), rgba(255, 255, 255, 0.16));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.prof-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-soft);
  border: 2px solid var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
}

.prof-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prof-avatar-initials {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.prof-account-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(25, 211, 190, 0.14);
  border: 1px solid rgba(25, 211, 190, 0.34);
  color: var(--accent-soft, #5EEAD4);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.prof-account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #19D3BE);
  box-shadow: 0 0 8px rgba(25, 211, 190, 0.65);
  flex-shrink: 0;
}

.prof-account-badge.is-guest,
.prof-account-badge.is-loading {
  background: var(--surface-soft);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

html[data-theme="light"] .prof-account-badge:not(.is-guest):not(.is-loading) {
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.3);
  color: #0F766E;
}

.prof-name-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.prof-display-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.prof-name-edit-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.prof-badges-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.prof-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.prof-guest-signin-cta {
  margin-top: 14px;
  max-width: 280px;
}

.prof-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.prof-menu-card {
  overflow: hidden;
  padding: 4px 0;
}

.prof-menu-row {
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.prof-menu-row:last-child {
  border-bottom: 0;
}

.prof-menu-row:active {
  background: var(--surface-soft);
}

.prof-menu-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.prof-menu-left strong {
  font-size: 0.94rem;
  font-weight: 700;
}

.prof-menu-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.prof-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==================== PENGATURAN (SESUAI SS) ==================== */
.set-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 6px;
}

.set-back-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.set-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.set-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.set-section-heading {
  margin: 4px 2px 0;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
}

.set-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.set-row {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.set-row:last-child {
  border-bottom: 0;
}

.set-row:active {
  background: var(--surface-soft);
}

.set-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.set-row-left strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.set-row-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.set-row-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.set-row-value {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.set-sub-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border-subtle);
}

.set-sub-picker[hidden] {
  display: none;
}

.set-logout-card {
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.set-logout-card:active {
  background: var(--surface-soft);
}

.set-logout-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #EF4444;
  font-size: 0.95rem;
}

.set-logout-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
}

/* ==================== LAYAR LOGIN (GAYA KOMIKU - DONGHUA 3D) ==================== */
body.auth-gate-open .topbar,
body.auth-gate-open .bottom-nav,
body.auth-gate-open .mobile-search-bar {
  display: none !important;
}

.dc-auth-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 120;
  overflow: hidden;
  background: var(--bg-page);
  display: none;
  flex-direction: column;
  justify-content: space-between;
}

.dc-auth-screen[hidden] {
  display: none;
}

.dc-auth-screen.is-open {
  display: flex;
}

.dc-auth-backdrop {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  overflow: hidden;
  z-index: 1;
  filter: blur(2.5px) brightness(0.72) saturate(1.18);
  -webkit-filter: blur(2.5px) brightness(0.72) saturate(1.18);
  transform: scale(1.04);
  pointer-events: none;
}

html[data-theme="light"] .dc-auth-backdrop {
  filter: blur(2.5px) brightness(0.92) saturate(1.1);
  -webkit-filter: blur(2.5px) brightness(0.92) saturate(1.1);
}

.dc-auth-columns {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
}

.dc-stream-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(50% - 8px);
  max-width: 220px;
  height: max-content;
  flex-shrink: 0;
  will-change: transform;
}

.dc-stream-col.stream-up {
  animation: dcScrollUp 34s linear infinite;
}

.dc-stream-col.stream-down {
  animation: dcScrollDown 38s linear infinite;
}

.dc-stream-col.stream-up-extra {
  display: none;
  animation: dcScrollUp 30s linear infinite;
}

@media (min-width: 640px) {
  .dc-stream-col.stream-up-extra {
    display: flex;
  }
  .dc-stream-col {
    width: calc(33.333% - 10px);
  }
}

@keyframes dcScrollUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@keyframes dcScrollDown {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

.dc-poster-tile {
  width: 100%;
  aspect-ratio: 1 / 1.48;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
  flex-shrink: 0;
}

.dc-poster-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dc-auth-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(11, 13, 18, 0.45) 0%,
    rgba(11, 13, 18, 0.58) 34%,
    rgba(11, 13, 18, 0.92) 68%,
    #0B0D12 100%
  );
  pointer-events: none;
}

html[data-theme="light"] .dc-auth-vignette {
  background: linear-gradient(
    180deg,
    rgba(243, 247, 253, 0.42) 0%,
    rgba(243, 247, 253, 0.58) 34%,
    rgba(243, 247, 253, 0.92) 68%,
    #F3F7FD 100%
  );
}

.dc-auth-brand-top {
  position: relative;
  z-index: 5;
  padding-top: calc(22px + env(safe-area-inset-top, 0px));
  display: flex;
  justify-content: center;
}

.dc-auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #F8FAFC;
  background: rgba(11, 13, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
}

.dc-auth-brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

html[data-theme="light"] .dc-auth-brand-badge {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.dc-auth-badge-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(25, 211, 190, 0.16);
  color: var(--accent);
  border: 1px solid rgba(25, 211, 190, 0.34);
}

.dc-auth-bottom-panel {
  position: relative;
  z-index: 6;
  margin-top: auto;
  padding: 48px 20px calc(26px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent 0%, rgba(11, 13, 18, 0.88) 22%, #0B0D12 52%);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

html[data-theme="light"] .dc-auth-bottom-panel {
  background: linear-gradient(180deg, transparent 0%, rgba(243, 247, 253, 0.88) 22%, #F3F7FD 52%);
}

.dc-auth-content {
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.dc-auth-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.dc-auth-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 28%, #5EEAD4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-primary);
}

html[data-theme="light"] .dc-auth-title {
  background: linear-gradient(135deg, #0F172A 20%, #0D9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dc-auth-desc {
  margin: 0 0 20px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.btn-google-official {
  width: 100%;
  height: 54px;
  background: #FFFFFF;
  color: #0F172A;
  border: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 8px;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.btn-google-official:active {
  transform: scale(0.98);
  background: #F8FAFC;
}

.btn-google-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-google-text-box {
  flex: 1;
  text-align: center;
}

.btn-google-arrow {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dc-google-cta-wrap {
  position: relative;
  width: 100%;
  border-radius: 18px;
}

.dc-gis-slot {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}

.dc-gis-slot.is-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  min-height: 0;
  padding: 0;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0.01;
}

.dc-gis-slot.is-overlay iframe,
.dc-gis-slot.is-overlay > div {
  width: 100% !important;
  min-width: 100% !important;
  transform: scaleY(1.36);
  transform-origin: center;
}

.dc-gis-slot[hidden] {
  display: none !important;
}

.dc-gis-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
  color: var(--accent-soft, #5EEAD4);
}

.dc-gis-hint[hidden] {
  display: none !important;
}

.btn-guest-official {
  width: 100%;
  height: 54px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  border: 1px solid rgba(25, 211, 190, 0.36);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 8px;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

html[data-theme="light"] .btn-guest-official {
  background: rgba(255, 255, 255, 0.94);
  color: #0F172A;
  border-color: rgba(13, 148, 136, 0.28);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.btn-guest-official:active {
  transform: scale(0.98);
}

.btn-guest-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(25, 211, 190, 0.16);
  color: #2DD4BF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

html[data-theme="light"] .btn-guest-icon-wrapper {
  background: rgba(13, 148, 136, 0.12);
  color: #0D9488;
}

.btn-guest-text-box {
  flex: 1;
  text-align: center;
}

.btn-guest-arrow {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
}

html[data-theme="light"] .btn-guest-arrow {
  background: rgba(15, 23, 42, 0.06);
  color: #64748B;
}

.dc-auth-trust-note {
  margin: 14px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.dc-auth-trust-note svg {
  flex-shrink: 0;
  color: var(--accent);
}

@media (max-height: 670px) {
  .dc-auth-brand-top {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }
  .dc-auth-bottom-panel {
    padding: 30px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .dc-auth-title {
    font-size: 1.42rem;
  }
  .dc-auth-desc {
    margin-bottom: 14px;
    font-size: 0.8rem;
  }
  .btn-google-official,
  .btn-guest-official {
    height: 48px;
  }
}

/* ==================== SUPABASE PROFILE, STATUS & HISTORY ==================== */
.dh-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dh-status-chip {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.78rem;
}

.dh-status-remove {
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.35);
}

.prof-avatar-cam-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--bg-page);
  background: var(--accent);
  color: #062825;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.prof-avatar-panel {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prof-avatar-panel[hidden] {
  display: none;
}

.prof-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prof-avatar-url-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.prof-avatar-url-form input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 0 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
  color: var(--text-primary);
  font-size: 0.84rem;
}

.prof-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prof-stat-card {
  padding: 12px 10px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.prof-stat-card strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.prof-stat-card span {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.prof-edit-page,
.downloads-page {
  max-width: 560px;
  margin: 0 auto;
}

.downloads-page.has-items {
  max-width: 960px;
}

.downloads-page {
  min-height: 78dvh;
  display: flex;
  flex-direction: column;
}

.dl-page-header {
  justify-content: space-between;
  gap: 12px;
}

.dl-header-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dl-active-wrap {
  margin-top: 8px;
}

.dl-history-list {
  margin-top: 12px;
  padding-bottom: 18px;
}

.dw-dl-live-bar {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 8px;
}

.dw-dl-live-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dw-dl-live-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.dw-dl-live-info strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-dl-live-pct {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.dw-dl-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.dw-dl-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms linear;
}

.dw-dl-live-bar[hidden] {
  display: none;
}

.dw-dl-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dw-dl-live-hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.subpage-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 8px;
}

.downloads-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 8px;
}

.downloads-empty h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.downloads-empty p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.prof-edit-banner {
  position: relative;
  height: 184px;
  margin: 0 -10px;
  overflow: hidden;
  background: var(--surface-soft);
}

@media (min-width: 640px) {
  .prof-edit-banner {
    margin: 10px 0 0;
    border-radius: var(--radius-lg);
  }
}

.prof-edit-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prof-edit-banner-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 13, 18, 0.25) 0%,
    rgba(11, 13, 18, 0.15) 45%,
    var(--bg-page) 100%
  );
  pointer-events: none;
}

html[data-theme="light"] .prof-edit-banner-fade {
  background: linear-gradient(
    180deg,
    rgba(243, 247, 253, 0.18) 0%,
    rgba(243, 247, 253, 0.15) 45%,
    var(--bg-page) 100%
  );
}

.prof-edit-icon-circle {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(11, 13, 18, 0.62);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.prof-edit-icon-circle.is-top-left {
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 14px;
}

.prof-edit-icon-circle.is-bottom-right {
  right: 14px;
  bottom: 18px;
}

.prof-edit-body {
  position: relative;
  z-index: 3;
  margin-top: -50px;
  padding: 0 4px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.prof-edit-avatar-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 12px;
}

.prof-edit-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-soft);
  border: 3px solid var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
}

.prof-edit-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prof-edit-avatar-cam {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-page);
  background: var(--accent);
  color: #062825;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.prof-edit-preview-name {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
}

.prof-edit-body .prof-avatar-panel {
  width: 100%;
  margin-top: 0;
  margin-bottom: 16px;
}

.prof-edit-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prof-edit-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.prof-edit-row {
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.prof-edit-row:last-child {
  border-bottom: 0;
}

.prof-edit-row:focus-within {
  background: var(--surface-soft);
}

.prof-edit-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.prof-edit-row-left strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.prof-edit-row-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.prof-edit-row-val {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.prof-edit-inline-input {
  width: 100%;
  max-width: 210px;
  min-width: 90px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: right;
  outline: none;
}

.prof-edit-save-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: #062825;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), opacity 140ms ease;
}

.prof-edit-save-btn:active {
  transform: scale(0.985);
}

.lib-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.lib-hist-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.lib-hist-thumb {
  position: relative;
  width: 72px;
  height: 98px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-soft);
  flex-shrink: 0;
}

.lib-hist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lib-hist-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(15, 23, 42, 0.72);
}

.lib-hist-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.lib-hist-body {
  flex: 1;
  min-width: 0;
  padding-right: 26px;
}

.lib-hist-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 6px;
}

.lib-hist-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.lib-hist-ep-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(25, 211, 190, 0.14);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

.lib-hist-clock {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}

.lib-hist-time {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.lib-hist-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dl-active-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dl-active-actions .lib-hist-remove {
  position: static;
}

/* Auth Google Login Blur + Centered Loading Animation */
.dc-auth-screen .dc-auth-brand-top,
.dc-auth-screen .dc-auth-bottom-panel {
  transition: filter 260ms ease, transform 260ms ease, opacity 260ms ease;
}

.dc-auth-screen.is-authenticating .dc-auth-backdrop {
  filter: blur(14px) brightness(0.45) saturate(1.1);
  -webkit-filter: blur(14px) brightness(0.45) saturate(1.1);
  transform: scale(1.06);
  transition: filter 280ms ease, transform 280ms ease;
}

.dc-auth-screen.is-authenticating .dc-auth-brand-top,
.dc-auth-screen.is-authenticating .dc-auth-bottom-panel {
  filter: blur(10px);
  -webkit-filter: blur(10px);
  transform: scale(0.985);
  opacity: 0.45;
  pointer-events: none;
}

.dc-auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 10, 16, 0.46);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: dcAuthBlurIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

html[data-theme="light"] .dc-auth-loading-overlay {
  background: rgba(241, 245, 249, 0.56);
}

.dc-auth-loading-overlay[hidden] {
  display: none !important;
}

.dc-auth-loading-card {
  min-width: 220px;
  max-width: 300px;
  padding: 24px 26px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.46);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: dcAuthCardPop 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

html[data-theme="light"] .dc-auth-loading-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.14);
}

.dc-auth-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3.5px solid rgba(25, 211, 190, 0.18);
  border-top-color: var(--accent);
  border-right-color: #38BDF8;
  animation: dcAuthSpin 0.78s linear infinite;
}

.dc-auth-loading-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #F8FAFC;
}

html[data-theme="light"] .dc-auth-loading-text {
  color: var(--text-primary);
}

@keyframes dcAuthSpin {
  to { transform: rotate(360deg); }
}

@keyframes dcAuthBlurIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}

@keyframes dcAuthCardPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dc-auth-loading-overlay,
  .dc-auth-loading-card {
    animation: none;
  }
  .dc-auth-spinner {
    animation-duration: 1.5s;
  }
}
