:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail-w: 68px;
  --content-left: 92px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

:root[data-theme="dark"] {
  --bg: #06070a;
  --bg-elevated: #0e1118;
  --sidebar: rgba(10, 13, 19, 0.86);
  --glass: rgba(18, 22, 31, 0.72);
  --glass-strong: rgba(13, 16, 24, 0.94);
  --glass-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6fa;
  --muted: rgba(226, 232, 240, 0.64);
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-glow: rgba(20, 184, 166, 0.24);
  --accent-text: #041311;
  --safe: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

:root[data-theme="light"] {
  --bg: #f3f5f8;
  --bg-elevated: #ffffff;
  --sidebar: rgba(255, 255, 255, 0.86);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --glass-hover: rgba(15, 23, 42, 0.06);
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.62);
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-glow: rgba(13, 148, 136, 0.18);
  --accent-text: #ffffff;
  --safe: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.2); }

.hidden { display: none !important; }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid transparent;
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.16s var(--ease), background 0.18s ease, box-shadow 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 6px 22px var(--accent-glow);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-glass {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.btn-glass:hover:not(:disabled) {
  background: var(--glass-hover);
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.28);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.24);
  box-shadow: none;
}

input, select, textarea {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }

label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 0.32rem;
}

/* Layout & Frosted Left Rail */
.app-layout { display: flex; min-height: 100vh; }

.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 40;
  background: rgba(8, 10, 15, 0.48);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.72rem;
  gap: 0.4rem;
  transition: width 0.26s var(--ease), background 0.26s var(--ease);
  overflow: hidden;
}
:root[data-theme="light"] .rail { background: rgba(255, 255, 255, 0.55); }
.rail:hover {
  width: 210px;
  background: var(--sidebar);
  box-shadow: var(--shadow);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.45rem 0.55rem 1.1rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  flex-shrink: 0;
}

.rail-btn {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.65rem 0.72rem;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.18s ease, color 0.18s ease;
}
.rail-btn i { font-size: 1.18rem; flex-shrink: 0; width: 22px; text-align: center; }
.rail-btn span, .rail-brand span:last-child { opacity: 0; transition: opacity 0.18s ease; }
.rail:hover .rail-btn span, .rail:hover .rail-brand span:last-child { opacity: 1; }
.rail-btn:hover { color: var(--text); background: var(--glass-hover); }
.rail-btn.active { background: var(--accent); color: var(--accent-text); }
.rail-spacer { flex: 1; }

.main-area { flex: 1; margin-left: 0; min-width: 0; padding-bottom: 3rem; }
.content-pad { position: relative; z-index: 2; padding: 1.5rem 2.25rem 1.5rem var(--content-left); }

/* Auth Screen */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-radius: 24px;
  padding: 2rem;
  display: grid;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.profile-card {
  width: 136px;
  padding: 1rem 0.75rem;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}
.profile-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--glass-hover);
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  color: var(--accent);
}

/* Hero Section */
#tab-library { position: relative; overflow-x: hidden; }
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 3.5rem 4.25rem var(--content-left);
  overflow: visible;
}
.hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; height: 100vh;
  background-size: cover;
  background-position: center;
  filter: blur(8px) brightness(0.88) saturate(112%);
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 96%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 96%);
}
.hero-bg.hidden-by-video { opacity: 0 !important; }
.hero-video-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100vh;
  border: none;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  object-fit: cover;
  transform: scale(1.24);
  transform-origin: center center;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 52%, rgba(0,0,0,0) 90%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 52%, rgba(0,0,0,0) 90%);
}
.hero-video-bg.ready { opacity: 1; }
.hero-video-bg.scroll-paused { opacity: 0 !important; }

.hero-row {
  position: relative; z-index: 2; width: 100%;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.hero-content {
  position: relative; max-width: 580px; display: grid; gap: 0.72rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}
.hero-content > * { position: relative; z-index: 2; }
.hero-content::before {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
  inset: -40px -60px -40px -40px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  -webkit-mask-image: radial-gradient(ellipse 68% 68% at 44% 50%, rgba(0,0,0,1) 15%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0) 70%);
  mask-image: radial-gradient(ellipse 68% 68% at 44% 50%, rgba(0,0,0,1) 15%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0) 70%);
}
:root[data-theme="light"] .hero-content { text-shadow: none; }
:root[data-theme="light"] .hero-content::before { background: rgba(255, 255, 255, 0.35); }
:root[data-theme="light"] body.over-hero .rail:not(:hover) .rail-btn:not(.active) {
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.7));
}
.hero h1 { font-size: clamp(2rem, 3.8vw, 3.1rem); font-weight: 800; letter-spacing: -0.9px; line-height: 1.06; }
.hero-meta { font-size: 0.92rem; color: var(--muted); }
.hero-overview {
  font-size: 0.94rem; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.hero-switcher { display: flex; gap: 0.5rem; align-items: center; }
.hero-thumb {
  width: 78px; height: 46px; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: var(--glass); border: 1px solid var(--border);
  opacity: 0.65; transition: all 0.2s var(--ease);
  display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700;
}
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-thumb.active { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); transform: translateY(-2px); }

/* Filters, Toolbars & Grids */
.toolbar { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.lang-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lang-pill {
  background: var(--glass); color: var(--muted); border: 1px solid var(--border);
  padding: 0.42rem 0.95rem; border-radius: 999px; font-size: 0.84rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s ease;
}
.lang-pill:hover { color: var(--text); border-color: var(--border-strong); }
.lang-pill.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.section-title { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.3px; margin: 0 0 0.95rem 0; }

.apple-shelf {
  display: flex; gap: 1.1rem; overflow-x: auto; padding-bottom: 0.75rem;
  scroll-snap-type: x proximity;
}
.apple-shelf .card { flex: 0 0 185px; scroll-snap-align: start; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.15rem;
}

.cw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
}
.cw-card { cursor: pointer; }
.cw-thumb {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius-md);
  overflow: hidden; background: var(--glass); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.cw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cw-play {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.65); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  backdrop-filter: blur(8px); transition: transform 0.2s var(--ease), background 0.2s ease;
}
.cw-card:hover .cw-play { transform: scale(1.1); background: var(--accent); color: var(--accent-text); }
.cw-track { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.22); }
.cw-fill { height: 100%; background: var(--accent); }
.cw-title { font-weight: 700; font-size: 0.92rem; margin-top: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-left { font-size: 0.78rem; color: var(--muted); margin-top: 0.12rem; }

/* Movie Cards */
.card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.22s ease, box-shadow 0.22s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.poster {
  width: 100%; aspect-ratio: 2 / 3; background: rgba(255, 255, 255, 0.03);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--muted);
  padding: 1rem; text-align: center; object-fit: cover;
}
img.poster { padding: 0; display: block; }
:root[data-theme="light"] .poster { background: rgba(15, 23, 42, 0.04); }

.card-body { padding: 0.75rem 0.85rem 0.9rem; }
.card-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.quality-badge {
  position: absolute; top: 0.55rem; left: 0.55rem; z-index: 3;
  padding: 0.2rem 0.55rem; border-radius: 6px; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.3px; backdrop-filter: blur(8px);
}
.q-hd { background: rgba(10, 14, 22, 0.75); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.14); }
.q-cam { background: rgba(251, 191, 36, 0.22); color: var(--warn); border: 1px solid rgba(251, 191, 36, 0.35); }

.fav-btn {
  position: absolute; top: 0.5rem; right: 0.5rem; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 14, 22, 0.65); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); transition: transform 0.15s ease, background 0.15s ease;
}
.fav-btn:hover { transform: scale(1.1); background: rgba(10, 14, 22, 0.9); }
.fav-btn.is-fav { color: var(--accent); border-color: var(--accent); }

.glass-panel {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-bottom: 1.1rem;
  display: grid;
  gap: 0.9rem;
}

.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.24rem 0.68rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.badge-safe { background: rgba(52, 211, 153, 0.15); color: var(--safe); }
.badge-warn { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.badge-danger { background: rgba(248, 113, 113, 0.16); color: var(--danger); }
.badge-neutral { background: var(--glass-hover); color: var(--text); border: 1px solid var(--border); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.85rem; }

/* Media Edit Dialog Modal */
.mv-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(3, 5, 9, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.mv-dialog {
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mv-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
}
.mv-dialog-tabs {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}
.mv-tab-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.16s ease;
}
.mv-tab-btn:hover { color: var(--text); background: var(--glass-hover); }
.mv-tab-btn.active { background: var(--accent); color: var(--accent-text); }

.mv-dialog-body {
  padding: 1.4rem 1.5rem;
  overflow-y: auto;
  display: grid;
  gap: 1.2rem;
}
.mv-edit-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 680px) {
  .mv-edit-layout { grid-template-columns: 1fr; }
}
.mv-edit-poster-preview {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.mv-edit-poster-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv-current-media-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.mv-current-trailer-player {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.mv-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--glass);
  flex-wrap: wrap;
}
.mv-switch-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.35rem;
}
.mv-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.mv-switch input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Full-Viewport Theater Player */
.modal {
  position: fixed; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 0;
}
.modal-content { background: #000; width: 100vw; height: 100vh; max-width: none; border-radius: 0; overflow: hidden; }
.player-stage {
  position: relative; width: 100%; height: 100%; background: #000;
  overflow: hidden; user-select: none; display: flex; align-items: center; justify-content: center;
}
.player-stage video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.yt-top {
  position: absolute; top: 0; left: 0; right: 0; padding: 1.25rem 1.75rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(5, 5, 6, 0.58); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.25s ease; z-index: 4;
}
.yt-controls {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0.6rem 1.75rem 1rem;
  background: rgba(5, 5, 6, 0.65); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: grid; gap: 0.55rem; transition: opacity 0.25s ease; z-index: 4;
}
.player-stage.hide-ui .yt-controls, .player-stage.hide-ui .yt-top { opacity: 0; pointer-events: none; }
.player-stage.hide-ui { cursor: none; }
.yt-seek-wrap { position: relative; height: 14px; display: flex; align-items: center; cursor: pointer; }
.yt-seek-track { width: 100%; height: 3px; background: rgba(255, 255, 255, 0.28); border-radius: 999px; position: relative; transition: height 0.12s ease; }
.yt-seek-wrap:hover .yt-seek-track { height: 5px; }
.yt-seek-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 999px; position: relative; }
.yt-seek-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); position: absolute; right: -6px; top: 50%; transform: translateY(-50%) scale(0); transition: transform 0.12s ease; }
.yt-seek-wrap:hover .yt-seek-thumb { transform: translateY(-50%) scale(1); }
.yt-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.yt-left, .yt-right { display: flex; align-items: center; gap: 0.35rem; }
.yt-btn { background: transparent; border: none; color: #ffffff; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; font-size: 0.82rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.yt-btn svg { width: 20px; height: 20px; fill: currentColor; }
.yt-btn:hover { background: rgba(255, 255, 255, 0.14); }
.yt-vol { -webkit-appearance: none; appearance: none; width: 64px; height: 3px; background: rgba(255, 255, 255, 0.3); border-radius: 999px; outline: none; cursor: pointer; border: none; padding: 0; margin: 0 0.35rem 0 0.1rem; }
.yt-vol::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #fff; cursor: pointer; }
.yt-time { font-size: 0.8rem; color: rgba(255, 255, 255, 0.9); font-variant-numeric: tabular-nums; margin-left: 0.25rem; }

/* Mobile & Tablet Responsive Layout */
.mobile-only { display: none; }

@media (max-width: 768px) {
  :root { --content-left: 1rem; }
  .mobile-only { display: inline-flex; }

  .rail {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 64px;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    border-right: none;
    border-top: 1px solid var(--border);
    background: var(--sidebar);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  }
  .rail:hover { width: 100% !important; }
  .rail-brand,
  .rail-spacer,
  .rail-hide-mobile { display: none !important; }

  .rail-btn {
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.35rem 0.25rem;
    border-radius: 10px;
    width: auto;
    min-width: 48px;
    font-size: 0.65rem;
  }
  .rail-btn i { font-size: 1.2rem; width: auto; }
  .rail-btn span { opacity: 1 !important; font-size: 0.64rem; line-height: 1; }

  .main-area { padding-bottom: 84px; }
  .content-pad { padding: 1rem 1rem 1.25rem 1rem; }

  .hero {
    min-height: 74vh;
    padding: 1.5rem 1rem 2.25rem 1rem;
  }
  .hero-bg, .hero-video-bg { height: 74vh; }
  .hero h1 { font-size: 1.75rem; }
  .hero-row { gap: 1rem; }
  .hero-thumb { width: 58px; height: 34px; }

  .apple-shelf { gap: 0.75rem; }
  .apple-shelf .card { flex: 0 0 142px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
  .cw-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.85rem; }

  #family-requests-list { grid-template-columns: 1fr !important; }
  #detail-poster-wrap { width: 155px !important; margin: 0 auto; }

  .mv-dialog-backdrop { padding: 0.5rem; }
  .mv-dialog { max-height: 94vh; border-radius: 18px; }
  .mv-dialog-head, .mv-dialog-tabs, .mv-dialog-body, .mv-dialog-foot { padding-left: 1rem; padding-right: 1rem; }

  .yt-top { padding: 0.75rem 0.9rem; }
  .yt-controls { padding: 0.45rem 0.85rem 0.85rem; }
  .yt-btn { width: 32px; height: 32px; }
  .yt-vol { display: none; }
  .yt-time { font-size: 0.72rem; }
}

