/* Reels — Facebook-style watch + discover layout */

.reels-page .reels-layout-grid {
  align-items: stretch;
}

.reels-main {
  min-width: 0;
}

.reels-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.reels-page-header h2 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.reels-page-header p {
  margin: 0;
  font-size: 0.9rem;
}

.reels-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reels-fb-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}

/* ── Main player column ── */
.reels-player-column {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}

.reels-player-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.reels-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--jtb-black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.1s;
}

.reels-nav-btn:hover {
  background: var(--jtb-yellow-soft);
  border-color: var(--jtb-yellow);
}

.reels-nav-btn:active {
  transform: scale(0.95);
}

.reels-phone-shell {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #3a3b3c;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  height: min(calc(100vh - var(--topbar-h) - 120px), 720px);
  min-height: 480px;
  position: relative;
  isolation: isolate;
  z-index: 1;
}

#reels-inline-player {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.reels-phone-shell .reels-feed {
  height: 100% !important;
  max-height: 100%;
}

.reels-phone-shell .reel-slide {
  height: 100%;
  min-height: 100%;
}

.reels-scroll-hint {
  text-align: center;
  font-size: 0.78rem;
  margin: 10px 0 0;
}

.reel-unmute-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reel-unmute-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.reel-slide-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Discover panel ── */
.reels-discover-panel {
  min-width: 0;
}

.reels-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.reels-filter-tabs button {
  border: none;
  background: var(--bg-page);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.15s;
}

.reels-filter-tabs button:hover {
  background: #e4e6eb;
}

.reels-filter-tabs button.active {
  background: var(--jtb-yellow);
  color: var(--jtb-black);
}

.reels-discover-content {
  min-height: 200px;
}

.reels-section-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
}

.reels-featured-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.reels-featured-scroll::-webkit-scrollbar {
  height: 6px;
}

.reels-featured-scroll::-webkit-scrollbar-thumb {
  background: #ccd0d5;
  border-radius: 3px;
}

.reels-featured-scroll .reel-browse-card {
  flex: 0 0 min(160px, 42vw);
  scroll-snap-align: start;
}

#reels-browse-grid,
.reels-browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 14px;
}

.reel-browse-card {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.reel-browse-card:hover,
.reel-browse-card.active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--jtb-yellow);
}

.reel-browse-card.active {
  box-shadow: 0 0 0 2px var(--jtb-yellow);
}

.reel-browse-thumb {
  position: relative;
  aspect-ratio: 9/16;
  background: #1c1e21;
  overflow: hidden;
}

.reel-browse-thumb .reel-thumb-bg {
  position: absolute;
  inset: 0;
}

.reel-browse-thumb video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.reel-browse-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 1.75rem;
  opacity: 0.85;
  transition: opacity 0.2s;
  pointer-events: none;
}

.reel-browse-card:hover .reel-browse-play {
  opacity: 1;
  background: rgba(0, 0, 0, 0.35);
}

.reel-browse-views {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reel-browse-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.reel-browse-meta span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.reel-browse-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--jtb-yellow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.reels-empty-msg {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-page);
  border-radius: var(--radius-lg);
}

.reel-slide--shell .reel-bottom-info {
  pointer-events: none;
}

.reels-feed--shell {
  min-height: 100%;
}

/* ── Player feed ── */
.reels-feed {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  background: #000;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.reels-feed::-webkit-scrollbar {
  width: 0;
}

.reel-slide {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.reel-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.reel-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, transparent 35%, transparent 70%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.reel-play-pause {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 5;
}

.reel-side-actions {
  position: absolute;
  right: 10px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 25;
  pointer-events: auto;
}

/* ⋯ sits in the side-action stack; menu anchors to this wrap */
.reel-options-menu-wrap,
.reel-owner-menu-wrap {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  z-index: 26;
  flex-shrink: 0;
}
.reel-options-menu-btn,
.reel-owner-menu-btn {
  width: auto;
  height: auto;
  min-width: 44px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.reel-options-menu-btn:hover,
.reel-owner-menu-btn:hover {
  background: transparent;
}
.reel-options-menu-btn i,
.reel-owner-menu-btn i {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-options-menu,
.reel-owner-menu {
  display: none;
  position: absolute;
  right: calc(100% + 10px);
  /* Open upward from the bottom ⋯ so the menu stays inside the reel frame */
  bottom: 0;
  top: auto;
  left: auto;
  z-index: 40;
  min-width: 200px;
  max-height: min(280px, 45vh);
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}
.reel-options-menu.open,
.reel-owner-menu.open { display: block; }
.reel-options-menu button,
.reel-owner-menu button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #050505;
}
.reel-options-menu button:hover,
.reel-owner-menu button:hover { background: #f0f2f5; }
.reel-options-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border, #dddfe2);
}
.reel-options-menu-danger,
.reel-owner-menu-danger {
  color: #e41e3f !important;
  margin-top: 0;
}

.reel-author-name {
  color: inherit;
  text-decoration: none;
}
.reel-author-name:hover { text-decoration: underline; }

.reel-comment-avatar-link {
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.reel-comment-body { flex: 1; min-width: 0; }
.reel-comment-author {
  color: inherit;
  text-decoration: none;
}
.reel-comment-author:hover { text-decoration: underline; }
.reel-comment-delete {
  border: none;
  background: transparent;
  color: #e41e3f;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
}

.reel-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  min-width: 44px;
}

.reel-action i {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: 0.15s;
}

.reel-action:hover i {
  opacity: 0.85;
}

.reel-action.active i {
  color: var(--jtb-yellow);
}

.reel-action.active i.fa-heart {
  color: #e41e3f;
}

.reel-action.pop i {
  animation: reelPop 0.4s ease;
}

@keyframes reelPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.reel-heart-burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 12;
}

.reel-heart-burst i {
  font-size: clamp(4rem, 18vw, 5.5rem);
  color: #fff;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.45));
  opacity: 0;
  transform: scale(0);
  animation: reelHeartBurst 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes reelHeartBurst {
  0% { opacity: 0; transform: scale(0); }
  18% { opacity: 1; transform: scale(1.15); }
  32% { transform: scale(0.92); }
  48% { transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1); }
}

.reel-slide--pending .reel-side-actions,
.reel-slide--pending .reel-bottom-info {
  opacity: 0.45;
  pointer-events: none;
}

.reel-bottom-info {
  position: absolute;
  left: 12px;
  right: 60px;
  bottom: 20px;
  color: #fff;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.reel-bottom-info a,
.reel-bottom-info button {
  pointer-events: auto;
}

.reel-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.reel-reposted-by {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.92;
  margin-bottom: 6px;
}

.reel-reposted-by i {
  margin-right: 6px;
}

.reel-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--jtb-yellow);
  color: var(--jtb-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
}

.reel-follow-btn {
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 4px;
}

.reel-follow-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.reel-follow-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.reel-caption {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.reel-music {
  font-size: 0.78rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

.reel-views {
  font-size: 0.72rem;
  opacity: 0.75;
}

.reel-swipe-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  z-index: 5;
  animation: reelHintBounce 2s infinite;
  pointer-events: none;
}

.reel-slide:not(:first-child) .reel-swipe-hint {
  display: none;
}

@keyframes reelHintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* ── Fullscreen watch page ── */
body.reel-watch-page {
  --reels-header-h: 56px;
  --reels-bottom-bar-h: 76px;
  background: #000;
  overflow: hidden;
}

body.reel-watch-page .app-shell {
  padding-top: 0;
}

body.reel-watch-page .reel-unmute-btn {
  display: none !important;
}

/* Injected reels top chrome (tabs only — actions stay in bottom bar) */
.reels-header-root {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  max-width: 520px;
  margin: 0 auto;
  pointer-events: none;
  display: grid;
  grid-template-columns: minmax(44px, auto) 1fr minmax(44px, auto);
  align-items: center;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top, 0px)) 12px 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent);
}

.reels-header-root * {
  pointer-events: auto !important;
}

.reel-watch-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  display: grid;
  grid-template-columns: minmax(44px, auto) 1fr minmax(44px, auto);
  align-items: center;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top, 0px)) 12px 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent);
  pointer-events: none;
  max-width: 520px;
  margin: 0 auto;
}

.reel-watch-header > * {
  pointer-events: auto;
}

.reel-watch-control {
  pointer-events: auto;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  touch-action: manipulation;
}

.reel-watch-control:hover {
  background: rgba(0, 0, 0, 0.65);
}

.reel-watch-title {
  display: none;
}

.reels-feed-tabs {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.reels-feed-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 4px;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  position: relative;
}

.reels-feed-tab.active {
  color: #fff;
}

.reels-feed-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.reels-bottom-divider {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--reels-bottom-bar-h) - 1px);
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.reels-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px 28px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  max-width: 520px;
  margin: 0 auto;
  pointer-events: none;
}

.reels-bar-btn {
  pointer-events: auto !important;
  z-index: auto;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.reels-bar-search {
  opacity: 0.92;
  border-radius: 12px;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.12s ease;
}

.reels-bar-search .reels-search-icon {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.reels-bar-search:hover,
.reels-bar-search:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.reels-bar-search:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.18);
}

.reels-bar-profile {
  /* aligned via flex space-between */
}

.reels-bar-create {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.95), rgba(255, 140, 0, 0.9));
  color: #050505;
  font-size: 1.15rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 12px rgba(255, 204, 0, 0.25);
  padding: 0;
  z-index: 1;
}

.reels-bar-create:hover {
  filter: brightness(1.06);
}

.reels-bar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--jtb-yellow-soft, #fff3bf);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  overflow: hidden;
}

.reels-bar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reels-profile-drawer {
  position: fixed;
  inset: 0;
  z-index: 3500;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.reels-profile-drawer.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.reels-profile-drawer:not(.open),
.reels-profile-drawer:not(.open) * {
  pointer-events: none !important;
}

.reels-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.reels-drawer-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.reels-profile-drawer.open .reels-drawer-sheet {
  transform: translateY(0);
}

.reels-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--border, #dddfe2);
}

.reels-drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reels-drawer-user h3 {
  margin: 0;
  font-size: 1rem;
}

.reels-drawer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--jtb-yellow-soft, #fff3bf);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
  overflow: hidden;
}

.reels-drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reels-drawer-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg-page, #f0f2f5);
  cursor: pointer;
}

.reels-drawer-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #dddfe2);
}

.reels-drawer-tabs button {
  flex: 1;
  border: none;
  background: var(--bg-page, #f0f2f5);
  color: var(--text-muted, #65676b);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.reels-drawer-tabs button.active {
  background: var(--jtb-yellow, #ffcc00);
  color: var(--jtb-black, #050505);
}

.reels-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.reels-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr));
  gap: 12px;
}

.reels-drawer-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 9/16;
  background: #1c1e21;
  cursor: pointer;
  border: none;
  padding: 0;
  text-align: left;
}

.reels-drawer-card video,
.reels-drawer-card .reels-drawer-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reels-drawer-card .reels-drawer-thumb img,
.reels-drawer-card .reels-drawer-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reels-drawer-card-views {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reels-create-options {
  display: grid;
  gap: 12px;
}

.reels-create-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border, #dddfe2);
  border-radius: 12px;
  background: var(--bg-page, #f0f2f5);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: left;
}

.reels-create-option i {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--jtb-yellow, #ffcc00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

#reels-fullscreen-player {
  height: calc(100vh - var(--reels-header-h) - var(--reels-bottom-bar-h));
  max-width: 520px;
  margin: var(--reels-header-h) auto 0;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

#reels-fullscreen-player .reels-feed {
  height: 100%;
}

#reels-fullscreen-player .reel-slide {
  height: 100%;
  min-height: 100%;
}

body.reel-watch-page .reel-side-actions {
  top: 58%;
  bottom: auto;
  transform: translateY(-50%);
  right: 12px;
}

body.reel-watch-page .reel-options-menu,
body.reel-watch-page .reel-owner-menu {
  z-index: 40;
  /* Use viewport units — % of the ⋯ wrap collapses the menu to one item on mobile */
  max-height: min(280px, 45vh);
}

body.reel-watch-page .reel-bottom-info {
  /* Player area already ends above the bottom bar — sit just above its inner edge */
  bottom: 10px;
  left: 14px;
  right: 72px;
  max-width: calc(100% - 86px);
  padding-right: 4px;
}

body.reel-watch-page .reel-author-row {
  margin-bottom: 6px;
}

body.reel-watch-page .reel-caption {
  margin-bottom: 6px;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.reel-watch-page .reel-music {
  margin-bottom: 2px;
  font-size: 0.76rem;
}

body.reel-watch-page .reel-views {
  font-size: 0.7rem;
}

/* Desktop only: keep mobile bottom chrome untouched.
   html overflow:hidden clips position:fixed Search/+ /Profile at the viewport
   bottom; 100vh can also let the higher-z player overlap those buttons. */
@media (min-width: 992px) {
  html:has(body.reel-watch-page) {
    overflow: visible !important;
  }

  body.reel-watch-page.app-shell {
    overflow: hidden !important;
  }

  body.reel-watch-page .reel-bottom-info {
    z-index: 30;
    bottom: 56px;
  }

  body.reel-watch-page #reels-fullscreen-player {
    height: calc(100dvh - var(--reels-header-h) - var(--reels-bottom-bar-h));
    max-height: calc(100svh - var(--reels-header-h) - var(--reels-bottom-bar-h));
  }
}

body.reel-watch-page .reel-swipe-hint {
  display: none;
}

.reels-following-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 240px;
  padding: 32px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  max-width: 280px;
  margin: 0 auto;
}

/* ── Reels search overlay ── */
.reels-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 3600;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.reels-search-overlay.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.reels-search-overlay:not(.open),
.reels-search-overlay:not(.open) * {
  pointer-events: none !important;
}

.reels-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.reels-search-sheet {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
}

.reels-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border, #dddfe2);
}

.reels-search-header input {
  flex: 1;
  border: none;
  background: var(--bg-page, #f0f2f5);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.reels-search-header button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.reels-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.reels-search-hint {
  text-align: center;
  padding: 24px 12px;
}

.reels-search-result {
  display: flex;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border, #eee);
}

.reels-search-thumb {
  width: 54px;
  height: 72px;
  border-radius: 8px;
  flex-shrink: 0;
  background: #1c1e21;
  overflow: hidden;
  position: relative;
}

.reels-search-thumb img,
.reels-search-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reels-search-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.reels-search-meta span,
.reels-search-meta small {
  color: var(--text-muted, #65676b);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Share sheet ── */
.reels-share-sheet {
  position: fixed;
  inset: 0;
  z-index: 3700;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.reels-share-sheet.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.reels-share-sheet:not(.open),
.reels-share-sheet:not(.open) * {
  pointer-events: none !important;
}

.reels-share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.reels-share-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-width: 520px;
  margin: 0 auto;
}

.reels-share-sheet.open .reels-share-panel {
  transform: translateY(0);
}

.reels-share-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: #ccd0d5;
  margin: 0 auto 12px;
}

.reels-share-title {
  margin: 0 0 12px;
  font-size: 1rem;
  text-align: center;
}

.reels-share-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-page, #f0f2f5);
  border-radius: 20px;
  padding: 0 14px;
  margin-bottom: 14px;
}

.reels-share-search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.92rem;
}

.reels-share-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.reels-share-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border, #dddfe2);
  border-radius: 12px;
  background: #fff;
  padding: 14px 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.78rem;
}

.reels-share-quick-btn i {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-page, #f0f2f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.reels-share-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted, #65676b);
  margin-bottom: 8px;
}

.reels-share-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.reels-share-target {
  flex: 0 0 72px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: center;
  padding: 0;
}

.reels-share-target-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--jtb-yellow-soft, #fff3bf);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  margin: 0 auto 6px;
  overflow: hidden;
}

.reels-share-target-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reels-share-target-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reels-share-target small {
  font-size: 0.65rem;
  color: var(--text-muted, #65676b);
}

/* ── Recorder modal ── */
.reel-recorder-body {
  padding: 0 !important;
}

.reel-recorder-stage {
  position: relative;
  background: #000;
  aspect-ratio: 9/16;
  max-height: 55vh;
  margin: 0 auto;
}

.reel-recorder-preview,
.reel-recorder-playback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.reel-recorder-playback.hidden,
.reel-recorder-preview.hidden {
  display: none;
}

.reel-recorder-timer {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.reel-recorder-timer[hidden] {
  display: none !important;
}

.reel-recorder-status {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  margin: 0;
}

.reel-recorder-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px;
}

.reel-recorder-stop {
  color: #e41e3f;
}

.group-reel-card {
  display: block;
  margin: 8px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #1c1e21;
  color: #fff;
  text-decoration: none;
}

.group-reel-card video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.group-reel-card span {
  display: block;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.profile-count-sep {
  margin: 0 6px;
  color: var(--text-muted, #65676b);
}

/* ── Comments panel ── */
.reel-comments-panel {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.reel-comments-panel.open {
  pointer-events: auto;
  opacity: 1;
  z-index: 10050;
}

.reel-comments-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.reel-comments-sheet {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.reel-comments-panel.open .reel-comments-sheet {
  transform: translateX(0);
}

.reel-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.reel-comments-header h3 {
  margin: 0;
  font-size: 1rem;
}

.reel-comments-header button {
  border: none;
  background: var(--bg-page);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.reel-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.reel-comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.reel-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--jtb-yellow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.reel-comment-bubble p {
  margin: 2px 0;
  font-size: 0.9rem;
}

.reel-comment-actions {
  margin-top: 2px;
}

.reel-comment-item .comment-actions {
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 28px;
}
.reel-comment-item .comment-actions button {
  border: none;
  background: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
}
.reel-comment-item .comment-like-btn.liked,
.reel-comment-item .comment-like-btn.liked i { color: #e41e3f; }
.reel-comment-item .comment-reply-arrow { font-size: 0.85em; opacity: 0.85; }
.reel-comment-item .comment-options-wrap {
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
  opacity: 1;
}

@media (max-width: 767px) {
  .reel-comment-item .comment-options-wrap {
    display: none !important;
  }
}
.reel-comment-item .comment-options-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-comment-item .comment-options-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  min-width: 160px;
  padding: 6px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.reel-comment-item .comment-options-menu.open { display: block; }
.reel-comment-item .comment-options-menu button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text, #050505);
}
.reel-comment-item .comment-options-danger { color: #e41e3f !important; }

/* Flat vertical reply thread for reels — single rail, no staircase */
.reel-comment-item.comment-reply,
.reel-comment-item.is-reply {
  margin-left: 0 !important;
  padding-left: 0 !important;
  margin-top: 8px;
}
.reel-comment-avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 0.65rem;
}
.reel-comments-list .comment-replies {
  margin-left: 20px;
  margin-top: 6px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color, var(--border, #e0e0e0));
  width: 100%;
}
.reel-comment-item:not(.is-reply):not(.comment-reply) > .reel-comment-body > .comment-replies {
  margin-left: 0;
}
.reel-comment-item .comment-replies .comment-replies {
  margin-left: 0 !important;
  padding-left: 0 !important;
  border-left: none !important;
}
.reel-comment-item .comment-replies .reel-comment-item,
.reel-comment-item .comment-replies .comment-item {
  margin-left: 0 !important;
  padding-left: 0 !important;
}
.reel-comment-item .comment-replies-toggle,
.reel-comment-item .btn-toggle-replies {
  border: none;
  background: transparent;
  color: var(--text-muted, #65676b);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 0 2px;
  display: inline-block !important;
  visibility: visible !important;
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
  touch-action: manipulation;
}
.reel-comments-list .comment-replies.collapsed > .reel-comment-item,
.reel-comments-list .comment-replies.collapsed > .comment-item,
.reel-comments-list .comment-replies.collapsed > .comment-reply,
.reel-comments-list .comment-replies.collapsed > .is-reply {
  display: none !important;
}
.reel-reply-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}
.reel-reply-hint button {
  border: none;
  background: transparent;
  color: #1877f2;
  font-weight: 700;
  cursor: pointer;
}

.reel-comment-delete {
  display: none;
}

.reel-comments-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card, #fff);
}

.reel-comments-input-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.reel-comments-input-field {
  flex: 1;
  min-width: 0;
  border: none;
  background: var(--bg-page);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.reel-comments-emoji-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  font-size: 1.05rem;
  background: var(--bg-page);
}

.reel-comment-send-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: none;
  background: var(--jtb-yellow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1c1e21;
  font-size: 0.95rem;
}

.reel-comment-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.reel-comment-send-btn:not(:disabled):hover {
  filter: brightness(0.95);
}

@media (max-width: 992px) {
  .reels-fb-layout {
    grid-template-columns: 1fr;
  }

  .reels-player-column {
    position: relative;
    top: 0;
    max-width: 400px;
    margin: 0 auto;
  }

  .reels-phone-shell {
    height: min(65vh, 580px);
    min-height: 400px;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  }

  .reels-discover-panel {
    margin-top: 8px;
  }

  .reels-page-header h2 {
    font-size: 1.35rem;
  }
}

@media (max-width: 520px) {
  .reel-comments-sheet {
    max-width: 100%;
    top: auto;
    height: 70vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .reel-comments-panel.open .reel-comments-sheet {
    transform: translateY(0);
  }

  #reels-fullscreen-player {
    max-width: 100%;
  }
}

/* Reels watch chrome — bottom Search/+ /Profile bar stays the lowest layer */
body.reel-watch-page .reels-bottom-bar,
body.reel-watch-page .reels-bottom-divider {
  z-index: 1 !important;
}

@media (min-width: 992px) {
  body.reel-watch-page .reels-bottom-bar,
  body.reel-watch-page .reels-bottom-divider {
    z-index: 15 !important;
    overflow: visible;
  }
}

body.reel-watch-page .reels-bar-btn {
  z-index: auto !important;
}

body.reel-watch-page .reels-header-root,
body.reel-watch-page .reel-watch-header {
  z-index: 40 !important;
}

body.reel-watch-page .reel-source-sheet.open,
body.reel-watch-page .upload-reel-modal.open {
  z-index: 9999 !important;
}

body.reel-watch-page .reel-comments-panel.open {
  z-index: 10050 !important;
}

body.reel-watch-page #jtb-toast {
  z-index: 100000 !important;
}

body.reel-watch-page .reel-side-actions {
  z-index: 10020;
}

body.reel-watch-page .reels-bottom-bar {
  pointer-events: none;
}

body.reel-watch-page .reels-header-root *,
body.reel-watch-page .reel-watch-header > *,
body.reel-watch-page .reels-bottom-bar .reels-bar-btn,
body.reel-watch-page .reels-feed-tab,
body.reel-watch-page .reel-watch-control {
  pointer-events: auto !important;
}

body.reel-watch-page .reels-bar-btn svg,
body.reel-watch-page .reels-bar-btn i,
body.reel-watch-page .reels-bar-btn .reels-bar-avatar {
  pointer-events: none;
}

body.reel-watch-page #reels-fullscreen-player {
  z-index: 10;
  pointer-events: none;
}

body.reel-watch-page #reels-fullscreen-player .reels-feed {
  pointer-events: auto;
}

body.reel-watch-page #reels-fullscreen-player .reel-video,
body.reel-watch-page #reels-fullscreen-player .reel-overlay,
body.reel-watch-page #reels-fullscreen-player .reel-slide-bg {
  pointer-events: none;
}

body.reel-watch-page #reels-fullscreen-player .reel-side-actions,
body.reel-watch-page #reels-fullscreen-player .reel-bottom-info a,
body.reel-watch-page #reels-fullscreen-player .reel-bottom-info button {
  pointer-events: auto;
}

.reel-source-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999 !important;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.reel-source-sheet.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.reel-source-sheet:not(.open),
.reel-source-sheet:not(.open) * {
  pointer-events: none !important;
}

.reel-source-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.reel-source-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.reel-source-title {
  margin: 0 0 12px;
  font-size: 1rem;
  text-align: center;
}

.reel-source-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: var(--bg-page, #f0f2f5);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.reel-source-cancel {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted, #65676b);
}

body.reel-watch-page #reels-hidden-inputs {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
}

body.reel-watch-page #reels-hidden-inputs input[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

body.reel-watch-page .reels-search-overlay,
body.reel-watch-page .reels-profile-drawer,
body.reel-watch-page .upload-reel-modal {
  z-index: 9999 !important;
}

body.reel-watch-page .reels-search-overlay.open,
body.reel-watch-page .reels-profile-drawer.open {
  z-index: 10050 !important;
}

.upload-reel-modal {
  position: fixed;
  inset: 0;
  z-index: 9999 !important;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.upload-reel-modal.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.upload-reel-modal:not(.open),
.upload-reel-modal:not(.open) * {
  pointer-events: none !important;
}

.upload-reel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.upload-reel-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 520px);
  max-height: 92vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
}

.upload-reel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e4e6eb);
}

.upload-reel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.upload-reel-close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px;
}

.upload-reel-body {
  padding: 16px;
  overflow-y: auto;
}

.reel-caption-emoji-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.reel-caption-emoji-row .form-control {
  flex: 1;
  min-width: 0;
}

.reel-caption-emoji-row .reel-caption-emoji-btn {
  margin-top: 2px;
}

.upload-reel-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed var(--border, #ccd0d5);
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  font-weight: 600;
}

.upload-reel-preview {
  width: 100%;
  max-height: 240px;
  border-radius: 12px;
  background: #000;
  margin-bottom: 12px;
}

.upload-reel-progress {
  margin: 8px 0 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted, #65676b);
}

.upload-reel-publish {
  width: 100%;
  pointer-events: auto !important;
}

body.upload-reel-open #reels-fullscreen-player .reel-video {
  pointer-events: none;
}
