:root {
  --bg-black: #000000;
  --bg-dark: #0B0E17;
  --bg-tabbar: #080A11;
  --bg-card: #111827;
  --bg-elevated: #1E293B;
  --border-color: #1E293B;
  --border-subtle: #334155;
  --accent-blue: #38BDF8;
  --accent-purple: #A855F7;
  --logo-purple: #9333EA;
  --heart-red: #FF2D55;
  --bookmark-yellow: #FACC15;
  --danger-red: #F87171;
  --text-white: #FFFFFF;
  --text-light: #E2E8F0;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --text-slate: #CBD5E1;
  --font-sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #04060B;
  color: var(--text-white);
  font-family: var(--font-sans);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

input, textarea, button {
  font-family: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ==================== WEBSITE SHELL LAYOUT ==================== */
.web-layout {
  display: flex;
  width: 100vw;
  height: 100dvh;
  background: radial-gradient(circle at 50% 20%, #111827 0%, #04060B 75%);
  overflow: hidden;
}

/* Left Desktop Sidebar Navigation */
.web-sidebar {
  width: 260px;
  height: 100%;
  background-color: rgba(8, 10, 17, 0.92);
  border-right: 1px solid #161F30;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 20px;
  flex-shrink: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.sidebar-logo-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: #090314;
  border: 1.5px solid var(--logo-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(147, 51, 234, 0.28);
}

.sidebar-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--text-white);
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
}

.sidebar-nav-btn:hover {
  background-color: rgba(30, 41, 59, 0.55);
  color: var(--text-white);
}

.sidebar-nav-btn.active {
  background-color: #131C2E;
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.sidebar-nav-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-user-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.18s ease;
}

.sidebar-user-card:hover {
  border-color: var(--accent-blue);
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-blue);
  background-color: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-handle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-shortcuts {
  padding: 10px 12px;
  border-radius: 12px;
  background-color: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(30, 41, 59, 0.7);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kbd-pill {
  background-color: var(--bg-elevated);
  color: var(--text-slate);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

/* ==================== MAIN STAGE & APP VIEWPORT ==================== */
.web-stage {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px;
  overflow: hidden;
}

/* Phone / App Viewport Container */
.app-shell {
  width: 100%;
  max-width: 440px;
  height: 100%;
  max-height: 900px;
  background-color: var(--bg-dark);
  border-radius: 28px;
  border: 1.5px solid #1E293B;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: max-width 0.25s ease, max-height 0.25s ease, border-radius 0.25s ease;
}

/* Expanded Web View Mode */
body.wide-web-mode .app-shell {
  max-width: 960px;
  max-height: 100%;
  border-radius: 20px;
}

/* Desktop Quick Feed Nav Arrows on Right of App Shell */
.desktop-feed-arrows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left: 18px;
  z-index: 20;
}

.feed-arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(30, 41, 59, 0.8);
  border: 1px solid #334155;
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}

.feed-arrow-btn:hover {
  background-color: var(--accent-blue);
  color: var(--bg-dark);
  border-color: var(--accent-blue);
  transform: scale(1.06);
}

.feed-arrow-btn svg {
  width: 20px;
  height: 20px;
}

/* ==================== PAGES CONTAINER & BOTTOM TAB BAR ==================== */
.pages-viewport {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-dark);
}

.page-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.page-view.active {
  display: flex;
}

.page-view.subpage {
  z-index: 25;
}

.page-scroll {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.page-scroll::-webkit-scrollbar {
  display: none;
}

/* Bottom TabBar (matches AppShell.xaml) */
.bottom-tabbar {
  height: 58px;
  width: 100%;
  background-color: var(--bg-tabbar);
  border-top: 1px solid #131824;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  z-index: 30;
  flex-shrink: 0;
  transition: opacity 0.24s ease;
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: #64748B;
  font-size: 11px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.tabbar-item svg {
  width: 23px;
  height: 21px;
  stroke: currentColor;
}

.tabbar-item.active {
  color: #FFFFFF;
}

/* ==================== LAUNCH SPLASH OVERLAY ==================== */
.launch-splash-overlay {
  position: absolute;
  inset: 0;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.launch-splash-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.launch-logo-card {
  width: 156px;
  height: 156px;
  border-radius: 36px;
  border: 1.5px solid #9333EA;
  background-color: #090314;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.26s ease-out;
  box-shadow: 0 0 42px rgba(147, 51, 234, 0.35);
}

.launch-logo-card.intro {
  transform: scale(1);
  opacity: 1;
}

.launch-logo-card.outro {
  transform: scale(1.12);
}

.launch-logo-card img {
  width: 156px;
  height: 156px;
  object-fit: contain;
}

/* ==================== MAIN PAGE (HOME FEED) ==================== */
.home-root {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #000000;
  overflow: hidden;
}

.feed-carousel-track-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.feed-carousel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.feed-carousel::-webkit-scrollbar {
  display: none;
}

.feed-slide {
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  background-color: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.klip-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background-color: #000000;
}

body.wide-web-mode .klip-video-element {
  object-fit: contain;
}

/* Photo Slideshow inside Feed Slide */
.photo-slideshow-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
}

.photo-carousel-track {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.photo-carousel-track::-webkit-scrollbar {
  display: none;
}

.photo-slide-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
}

.photo-slide-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Desktop Photo Slide Prev/Next Buttons */
.photo-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.55);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  opacity: 0;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.photo-slideshow-container:hover .photo-nav-btn {
  opacity: 1;
}

.photo-nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.85);
}

.photo-nav-btn.prev {
  left: 12px;
}

.photo-nav-btn.next {
  right: 12px;
}

/* Top-Right 1/4 Counter Pill */
.photo-counter-pill {
  position: absolute;
  top: 62px;
  right: 16px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 4px 10px;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  z-index: 6;
}

.detail-mode .photo-counter-pill {
  top: 20px;
}

/* Middle-Bottom Slide Dots */
.photo-dots-row {
  position: absolute;
  bottom: 112px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 6;
}

.photo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.photo-dot.active {
  background-color: #FFFFFF;
  transform: scale(1.15);
}

/* Center Play Indicator when paused by user */
.center-play-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 36px;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 7;
}

.center-play-indicator svg {
  width: 28px;
  height: 28px;
  margin-left: 4px;
  fill: #FFFFFF;
}

/* Bottom Gradient Scrim */
.bottom-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 240px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(5, 7, 12, 0.8) 100%);
  pointer-events: none;
  z-index: 4;
}

/* Right Action Rail */
.right-action-rail {
  position: absolute;
  right: 12px;
  bottom: 20px;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 9;
}

.rail-avatar-wrap {
  position: relative;
  width: 46px;
  height: 52px;
  margin-bottom: 4px;
  display: flex;
  justify-content: center;
}

.rail-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1.5px solid #FFFFFF;
  background-color: #1E293B;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

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

.rail-avatar-initials {
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
}

.rail-follow-badge {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background-color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
}

.rail-follow-badge svg {
  width: 14px;
  height: 14px;
}

.rail-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.rail-action-icon {
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rail-action-icon.pop-anim {
  animation: iconSpringPop 0.29s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconSpringPop {
  0% { transform: scale(1); }
  25% { transform: scale(0.75); }
  65% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.rail-action-count {
  font-size: 11px;
  color: #FFFFFF;
  font-weight: 600;
}

.rail-audio-disc {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  border: 5px solid #334155;
  background-color: #0F172A;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 14px;
}

.rail-audio-disc.spinning {
  animation: discSpin 6s linear infinite;
}

@keyframes discSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Bottom-Left Video Info Overlay */
.bottom-info-overlay {
  position: absolute;
  left: 16px;
  right: 76px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  z-index: 8;
  pointer-events: none;
}

.photo-badge-pill {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 3px 8px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
}

.klip-creator-handle {
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.klip-creator-handle:hover {
  text-decoration: underline;
}

.klip-caption-text {
  color: #E2E8F0;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.klip-hashtags-text {
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
}

.klip-sound-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: #FFFFFF;
  font-size: 13px;
  max-width: 100%;
}

.klip-sound-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top Floating Feed Navigation Bar */
.top-feed-navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px 8px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  z-index: 15;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 100%);
}

.top-feed-tabs {
  display: grid;
  grid-template-columns: 95px 95px;
  column-gap: 8px;
  row-gap: 5px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  position: relative;
}

.feed-tab-cell {
  padding: 2px 4px;
  text-align: center;
  cursor: pointer;
}

.feed-tab-label {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  color: #94A3B8;
  transform: scale(0.9);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}

.feed-tab-label.active {
  color: #FFFFFF;
  transform: scale(1.15);
}

.feed-tab-indicator {
  grid-column: 2;
  grid-row: 2;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background-color: #FFFFFF;
  margin: 0 auto;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.feed-tab-indicator.following-active {
  transform: translateX(-103px);
}

.top-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.15s ease;
}

.top-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

/* Empty Feed State */
.empty-feed-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  width: 100%;
}

.empty-feed-title {
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
}

.empty-feed-subtitle {
  color: #94A3B8;
  font-size: 14px;
  line-height: 1.4;
}

/* Double-Tap Floating Heart Overlay */
.double-tap-heart {
  position: absolute;
  width: 90px;
  height: 90px;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.double-tap-heart svg {
  width: 72px;
  height: 72px;
  fill: var(--heart-red);
  filter: drop-shadow(0 6px 16px rgba(255, 45, 85, 0.45));
}

/* ==================== CREATE / POST PAGE ==================== */
.locked-posting-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  text-align: center;
}

.locked-icon-circle {
  width: 76px;
  height: 76px;
  border-radius: 38px;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.locked-title {
  color: #FFFFFF;
  font-size: 21px;
  font-weight: 700;
}

.locked-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
  max-width: 340px;
}

.account-handle-badge {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--text-slate);
  font-size: 13px;
  font-weight: 700;
}

.secondary-btn {
  background-color: var(--bg-elevated);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 24px;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.secondary-btn:hover {
  opacity: 0.92;
}

.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Studio Upload Form */
.upload-form-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 16px;
  gap: 12px;
  height: 100%;
  overflow: hidden;
}

.studio-header {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  align-items: center;
}

.creator-handle-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-self: start;
  max-width: 90px;
}

.studio-title {
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.reset-media-btn {
  color: var(--danger-red);
  font-size: 13px;
  font-weight: 700;
  justify-self: end;
  cursor: pointer;
}

/* Segmented Mode Switcher */
.segmented-switcher {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  flex-shrink: 0;
}

.segment-btn {
  border-radius: 10px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.16s ease;
}

.segment-btn.active-blue {
  background-color: var(--accent-blue);
  color: var(--bg-dark);
}

.segment-btn.active-purple {
  background-color: var(--accent-purple);
  color: #FFFFFF;
}

.studio-scroll-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}

.studio-scroll-body::-webkit-scrollbar {
  display: none;
}

.media-stage-card {
  height: 285px;
  border-radius: 22px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-card);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.empty-picker-prompt {
  width: 100%;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.empty-picker-prompt:hover {
  background-color: rgba(30, 41, 59, 0.35);
}

.picker-icon-circle {
  width: 66px;
  height: 66px;
  border-radius: 34px;
  background-color: var(--bg-elevated);
  border: 1.5px solid var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.picker-icon-circle.purple {
  border-color: var(--accent-purple);
}

.picker-title {
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
}

.picker-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.picker-cta-pill {
  background-color: var(--accent-blue);
  color: var(--bg-dark);
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  padding: 9px 18px;
  margin-top: 2px;
}

.picker-cta-pill.purple {
  background-color: var(--accent-purple);
  color: #FFFFFF;
}

/* Live Preview Stage */
.media-preview-container {
  position: absolute;
  inset: 0;
  background-color: #000000;
}

.preview-floating-btn {
  position: absolute;
  top: 12px;
  background-color: rgba(15, 23, 42, 0.82);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 6px 12px;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  z-index: 10;
}

.preview-floating-btn.right {
  right: 12px;
}

.preview-floating-btn.left-danger {
  left: 12px;
  color: var(--danger-red);
  font-size: 11px;
}

.preview-floating-btn.purple-stroke {
  border-color: var(--accent-purple);
}

.preview-ready-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 8;
}

.ready-badge {
  background-color: var(--accent-blue);
  color: var(--bg-dark);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.ready-filename {
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Caption & Hashtags Card */
.caption-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.caption-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.caption-header-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.caption-counter {
  color: var(--text-dim);
  font-size: 11px;
}

.caption-editor {
  width: 100%;
  height: 72px;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 14px;
  resize: none;
  line-height: 1.4;
}

.caption-editor::placeholder {
  color: var(--text-dim);
}

.hashtag-chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.hashtag-chips-row::-webkit-scrollbar {
  display: none;
}

.hashtag-chip {
  background-color: var(--bg-elevated);
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.hashtag-chip:hover {
  background-color: #283548;
  transform: translateY(-1px);
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px;
  font-size: 13px;
  font-weight: 700;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(56, 189, 248, 0.25);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: discSpin 0.75s linear infinite;
}

.primary-action-btn {
  width: 100%;
  height: 52px;
  background-color: var(--accent-blue);
  color: var(--bg-dark);
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.primary-action-btn.purple {
  background-color: var(--accent-purple);
  color: #FFFFFF;
}

.primary-action-btn:hover {
  opacity: 0.94;
}

.primary-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ==================== PROFILE & AUTH PAGE ==================== */
.guest-auth-container {
  padding: 42px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
  justify-content: center;
}

.auth-brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.auth-logo-card {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background-color: #090314;
  border: 1.5px solid var(--logo-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-logo-card img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

.auth-form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.input-box {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 11px 14px;
  color: #FFFFFF;
  font-size: 15px;
  width: 100%;
  transition: border-color 0.15s ease;
}

.input-box:focus {
  border-color: var(--accent-blue);
}

.input-box::placeholder {
  color: #475569;
}

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

.gender-option {
  border-radius: 12px;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  background-color: var(--bg-dark);
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.gender-option.selected {
  background-color: #1E3A8A;
  border-color: var(--accent-blue);
  color: #FFFFFF;
}

.error-text {
  color: var(--heart-red);
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}

/* Logged-In Profile View */
.profile-content {
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-top-bar {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}

.profile-handle-header {
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.logout-link {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  justify-self: end;
  cursor: pointer;
}

.logout-link:hover {
  color: #FFFFFF;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.profile-avatar-large {
  width: 88px;
  height: 88px;
  border-radius: 44px;
  border: 2px solid var(--accent-blue);
  background-color: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.profile-avatar-initials {
  color: #FFFFFF;
  font-size: 28px;
  font-weight: 700;
}

.profile-display-name {
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
}

.profile-bio {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  max-width: 320px;
}

.profile-stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 6px;
  cursor: pointer;
}

.stat-value {
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
}

.stat-label {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-actions-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.profile-btn {
  background-color: var(--bg-elevated);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  padding: 10px 22px;
  transition: background-color 0.15s ease;
}

.profile-btn:hover {
  background-color: #283548;
}

.follow-action-btn {
  width: 140px;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  margin: 0 auto;
  background-color: var(--accent-blue);
  color: var(--bg-dark);
  transition: all 0.15s ease;
}

.follow-action-btn.following {
  background-color: var(--bg-elevated);
  color: #FFFFFF;
}

.profile-tabs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.profile-tab-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.profile-tab-text {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-tab-col.active .profile-tab-text {
  color: #FFFFFF;
  font-weight: 700;
}

.profile-tab-line {
  width: 100%;
  height: 2px;
  background-color: var(--border-color);
}

.profile-tab-col.active .profile-tab-line {
  background-color: #FFFFFF;
}

/* 3-Column Video Thumbnail Grid */
.klips-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.klip-grid-tile {
  height: 165px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  transition: filter 0.15s ease;
}

.klip-grid-tile:hover {
  filter: brightness(1.12);
}

.klip-grid-tile-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.85;
}

.klip-grid-tile-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

.klip-tile-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
}

.klip-tile-caption {
  color: #CBD5E1;
  font-size: 11px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.klip-tile-handle {
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.klip-tile-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
}

.empty-state-text {
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  margin-top: 28px;
}

/* ==================== SEARCH PAGE ==================== */
.search-page-layout {
  display: flex;
  flex-direction: column;
  padding: 18px 16px 16px;
  gap: 12px;
  height: 100%;
  overflow: hidden;
}

.search-top-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
}

.search-input-wrap {
  background-color: var(--bg-elevated);
  border-radius: 12px;
  padding: 2px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  flex: 1;
  height: 38px;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 14px;
}

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

.search-clear-btn {
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
}

.search-filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.search-filter-pill {
  border-radius: 10px;
  padding: 8px 0;
  background-color: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-filter-pill.active {
  background-color: var(--accent-blue);
  color: var(--bg-dark);
}

.search-results-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}

.search-results-scroll::-webkit-scrollbar {
  display: none;
}

.section-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.user-list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-row-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.user-row-card:hover {
  border-color: var(--accent-blue);
}

.user-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1.5px solid var(--accent-blue);
  background-color: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
}

.user-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==================== INBOX & FOLLOW LIST & EDIT PROFILE ==================== */
.subpage-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
}

.subpage-title {
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.notification-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.notification-avatar {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background-color: #1E3A8A;
  color: #FFFFFF;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Interactive Profile Picture Crop Modal */
.crop-modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(7, 10, 18, 0.96);
  z-index: 60;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.crop-viewport-touch {
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.crop-viewport-touch:active {
  cursor: grabbing;
}

.crop-circle-frame {
  width: 260px;
  height: 260px;
  border-radius: 130px;
  border: 3px solid var(--accent-blue);
  background-color: #000000;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-target-img {
  position: absolute;
  pointer-events: none;
  transform-origin: center center;
  user-select: none;
}

.crop-controls-card {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zoom-slider-row {
  display: grid;
  grid-template-columns: auto 1fr 38px;
  gap: 10px;
  align-items: center;
}

.zoom-slider {
  width: 100%;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

/* Video Detail Floating Back Button */
.detail-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background-color: rgba(11, 14, 23, 0.55);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* Sound Mute/Unmute Pill */
.sound-pill-btn {
  background-color: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Toast Notification */
.klip-toast {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #1E293B;
  border: 1px solid var(--accent-blue);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.klip-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive Mobile Rules */
@media (max-width: 820px) {
  .web-sidebar,
  .desktop-feed-arrows {
    display: none !important;
  }

  .web-stage {
    padding: 0;
  }

  .app-shell {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
}

