:root {
  --bg: #050508;
  --bg-elevated: #0e0e14;
  --surface: #16161f;
  --surface-glass: rgba(22, 22, 31, 0.72);
  --border: rgba(255, 255, 255, 0.07);
  --text: #f8f8fc;
  --text-muted: #8b8b9e;
  --accent: #ff2d6a;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(255, 45, 106, 0.35);
  --gradient: linear-gradient(135deg, #ff2d6a 0%, #ff6b35 45%, #8b5cf6 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(255, 51, 102, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  background: linear-gradient(180deg, rgba(10,10,15,0.9) 0%, transparent 100%);
  pointer-events: none;
}
.app-header > * { pointer-events: auto; }

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.logo-center { display: block; text-align: center; margin-bottom: 24px; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  text-decoration: none;
}
.user-pill:hover {
  color: var(--text);
  text-decoration: none;
}
.feed-author-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.feed-author-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Feed — TikTok style */
.feed-page { overflow: hidden; }

.feed {
  position: fixed;
  inset: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  overflow-anchor: none;
  scrollbar-width: none;
  touch-action: pan-y;
}
.feed::-webkit-scrollbar { display: none; }

.feed-slide {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout style paint;
  content-visibility: auto;
  contain-intrinsic-size: 100dvh 100vw;
  transform: translateZ(0);
}

.feed-slide video,
.v1im-protected {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.feed-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(0,0,0,0.15) 70%,
    rgba(0,0,0,0.75) 100%
  );
}

.feed-meta {
  position: absolute;
  left: 16px;
  right: 72px;
  bottom: calc(24px + var(--safe-bottom));
  pointer-events: none;
  z-index: 2;
}
.feed-author {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}
.feed-author span { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }
.feed-caption {
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-stats {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.feed-actions {
  position: absolute;
  right: 12px;
  bottom: calc(80px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  z-index: 3;
  pointer-events: auto;
}
.feed-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.feed-action-btn:active { transform: scale(0.9); }
.feed-action-btn svg { width: 22px; height: 22px; }
.feed-action-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -12px;
}
.feed-action-delete:hover,
.feed-action-delete:active {
  background: rgba(255, 51, 102, 0.35);
}

.feed-loading, .feed-empty {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  z-index: 50;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.feed-hint {
  position: fixed;
  bottom: calc(100px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  animation: hint-pulse 2s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.5s;
}
.feed-hint.hidden { opacity: 0; }
@keyframes hint-pulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.9; transform: translateX(-50%) translateY(-6px); }
}

/* Auth */
.auth-page, .upload-page {
  overflow: auto;
  min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 92, 255, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 51, 102, 0.15), transparent),
    var(--bg);
}
.auth-card, .upload-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.auth-card h1, .upload-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.auth-sub, .upload-sub {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
}
.auth-form label, .upload-form label {
  display: block;
  margin-bottom: 16px;
}
.auth-form label span, .upload-form label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.auth-form input,
.auth-form textarea,
.upload-form input,
.upload-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form input:focus,
.upload-form textarea:focus {
  border-color: rgba(255, 51, 102, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.15);
}
.auth-form button { margin-top: 8px; }
.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.alert-error {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.35);
  color: #ff8fab;
}
.alert-success {
  background: rgba(76, 175, 130, 0.15);
  border: 1px solid rgba(76, 175, 130, 0.35);
  color: #8fd4b0;
}

/* Upload */
.upload-page { overflow: auto; }
.has-bottom-nav .upload-wrap {
  padding-bottom: calc(56px + var(--safe-bottom) + 16px);
}
.upload-wrap {
  padding: calc(var(--header-h) + var(--safe-top) + 24px) 16px 48px;
  max-width: 480px;
  margin: 0 auto;
}
.upload-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 22px;
}
.drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  min-height: 200px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: rgba(255, 51, 102, 0.5);
  background: rgba(255, 51, 102, 0.05);
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
}
.drop-title { font-weight: 600; color: var(--text); margin-top: 12px; }
.drop-meta { font-size: 0.8rem; margin-top: 6px; }
.upload-preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #000;
}
.upload-form textarea {
  resize: vertical;
  min-height: 72px;
}

.processing-panel {
  text-align: center;
  padding: 32px 16px;
}
.processing-panel .spinner {
  margin: 0 auto 20px;
}
.processing-panel p {
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}
.processing-sub {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  font-size: 0.9rem !important;
  margin-top: 8px;
}
.processing-panel.processing-failed .spinner {
  display: none;
}
.processing-panel.processing-failed p {
  color: #ff8fab;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface-glass);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 16px;
  transition: color 0.15s;
}
.bottom-nav-item svg {
  width: 24px;
  height: 24px;
}
.bottom-nav-item.is-active,
.bottom-nav-item:hover {
  color: var(--text);
  text-decoration: none;
}
.bottom-nav-item.is-active svg {
  stroke: var(--accent);
}

.feed-header {
  pointer-events: auto;
  flex-wrap: wrap;
  gap: 8px;
}
.feed-header .logo { flex-shrink: 0; }
.feed-header-auth {
  margin-left: auto;
  flex-shrink: 0;
}
.feed-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 3px;
}
.feed-tab {
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.feed-tab.is-active {
  background: rgba(255,255,255,0.12);
  color: var(--text);
  box-shadow: 0 0 20px var(--accent-glow);
}
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text);
  text-decoration: none;
}
.feed-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feed-follow-pill {
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,51,102,0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.feed-caption .hashtag {
  color: #7eb8ff;
  font-weight: 600;
  text-decoration: none;
}
.feed-caption .hashtag:hover { text-decoration: underline; }
.feed-action-btn.is-liked { color: var(--accent); }
.feed-action-btn.is-liked svg { fill: var(--accent); stroke: var(--accent); }
.like-burst {
  position: fixed;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 5rem;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
}
.like-burst.is-animate {
  animation: like-pop 0.7s ease-out forwards;
}
@keyframes like-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.sheet-panel {
  position: relative;
  width: 100%;
  max-height: 70vh;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  z-index: 1;
  animation: sheet-up 0.35s var(--ease-out);
}
@keyframes sheet-up {
  from { transform: translateY(100%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.sheet-header h2 { font-size: 1rem; font-weight: 700; }
.sheet-close {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  min-height: 120px;
  max-height: 45vh;
}
.comment-item {
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.comment-user {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-right: 8px;
}
.comment-time { font-size: 0.75rem; color: var(--text-muted); }
.comment-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border);
}
.comment-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.comment-login-hint {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
body.sheet-open { overflow: hidden; }
.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.page-scroll {
  overflow: auto;
  min-height: 100%;
  padding-bottom: calc(56px + var(--safe-bottom));
}
.page-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--safe-top) 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-topbar h1 {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}
.search-bar { flex: 1; }
.search-bar input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 16px 16px 8px;
}
.discover-section { margin-bottom: 8px; }
.discover-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px 16px;
  scroll-snap-type: x mandatory;
}
.discover-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  text-decoration: none;
}
.discover-card video {
  width: 140px;
  height: 200px;
  object-fit: cover;
  display: block;
}
.discover-card-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 6px 8px;
}
.creator-list { padding: 0 8px; }
.creator-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
}
.creator-row:hover { background: rgba(255,255,255,0.04); text-decoration: none; }
.creator-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
.creator-info { display: flex; flex-direction: column; gap: 2px; }
.creator-info span { font-size: 0.82rem; color: var(--text-muted); }
.profile-bio {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}
.profile-actions { flex-wrap: wrap; }
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}
.tag-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(124,92,255,0.2);
  color: #b8a0ff;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}
.search-hint, .muted {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 20px;
  font-size: 0.92rem;
}
.notif-list { list-style: none; }
.notif-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.notif-item.is-unread a { background: rgba(255,51,102,0.08); }
.notif-msg { display: block; font-size: 0.92rem; }
.notif-time { font-size: 0.78rem; color: var(--text-muted); }
.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav-icon-wrap { position: relative; display: inline-flex; }
.bottom-nav-upload .bottom-nav-upload-ring {
  width: 44px;
  height: 32px;
  border-radius: 8px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.bottom-nav-upload span:last-child { margin-top: 2px; }
.settings-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 16px;
}
.settings-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.settings-links {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-link {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.settings-link-danger { color: #ff8fab; }

.feed-page .feed-meta {
  bottom: calc(80px + var(--safe-bottom));
  right: 72px;
}
.feed-page .feed-actions {
  bottom: calc(90px + var(--safe-bottom));
}
.feed-page .feed-hint {
  bottom: calc(150px + var(--safe-bottom));
}

/* Profile page */
.profile-page,
.watch-page {
  overflow: auto;
  min-height: 100%;
  padding-bottom: calc(56px + var(--safe-bottom));
}
.profile-topbar,
.watch-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 12px 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.profile-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text);
  text-decoration: none;
}
.profile-back:hover { text-decoration: none; }
.profile-topbar-title {
  font-weight: 600;
  font-size: 1rem;
}
.profile-topbar-spacer { width: 40px; }
.profile-main {
  max-width: 480px;
  margin: 0 auto;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 20px 16px;
}
.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 8px 32px rgba(255, 51, 102, 0.3);
}
.profile-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.profile-handle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 8px 16px 20px;
  flex-wrap: wrap;
}
.profile-stat {
  text-align: center;
  min-width: 64px;
}
.profile-stat strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}
.profile-stat span {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.profile-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 20px 20px;
}
.profile-follow-btn {
  min-width: 140px;
  opacity: 0.6;
  cursor: not-allowed;
}
.profile-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
  cursor: default;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.profile-grid-item--pending {
  background: var(--surface);
  min-height: 120px;
}
.profile-grid-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 9/16;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
}

.profile-grid-item {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
  display: block;
  text-decoration: none;
}
.profile-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.profile-grid-views {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.profile-grid-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}
.profile-grid-item:hover .profile-grid-delete,
.profile-grid-delete:focus {
  opacity: 1;
}
.profile-empty,
.profile-not-found {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.profile-empty p { margin-bottom: 16px; }

/* Watch single video */
.watch-page {
  overflow: hidden;
  padding-bottom: 0;
}
.watch-topbar-user {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.watch-player {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.watch-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 100dvh;
}
.watch-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.7) 100%);
}
.watch-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 2;
}
.watch-author {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.watch-caption {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.9);
}
.watch-stats {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.watch-delete {
  position: absolute;
  top: calc(var(--header-h) + var(--safe-top) + 8px);
  right: 12px;
  z-index: 3;
}
.watch-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  border: none;
}

/* Upload progress */
.upload-progress {
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
}
.upload-progress-bar {
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s linear;
  margin-bottom: 8px;
}
#upload-progress-text { font-size: 0.85rem; color: var(--text-muted); }

/* Feed playback progress */
.feed-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(56px + var(--safe-bottom));
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 5;
  pointer-events: none;
}
.feed-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* Feed more menu */
.feed-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.feed-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.feed-more-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 0 calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border);
}
.feed-more-item {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
}
.feed-more-item[data-report] { color: #ff8fab; }
.feed-more-cancel { color: var(--text-muted); }

.btn-danger-outline { color: #ff8fab; border-color: rgba(255, 143, 171, 0.35); }
.profile-avatar {
  background: hsl(var(--avatar-hue, 280), 55%, 42%);
}
.profile-tab:not(.is-active) {
  border-bottom-color: transparent;
  color: var(--text-muted);
  text-decoration: none;
}
.profile-tab.is-active { text-decoration: none; color: var(--text); }
.watch-actions {
  position: absolute;
  top: calc(var(--header-h) + var(--safe-top) + 8px);
  right: 12px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.watch-rail {
  position: absolute;
  right: 10px;
  bottom: calc(100px + var(--safe-bottom));
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.watch-rail .feed-action-btn {
  width: 48px;
  height: 48px;
}

.profile-stat {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}
.profile-stat:hover { opacity: 0.85; text-decoration: none; }
.profile-blocked-msg {
  margin: 0 20px 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.connections-sub {
  padding: 0 20px 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.connections-list { padding-bottom: 16px; }

.comment-delete {
  border: none;
  background: none;
  color: #ff8fab;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 6px;
}

.settings-section-title {
  margin: 28px 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.search-suggest {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 52px);
  left: 12px;
  right: 12px;
  z-index: 90;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 50vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.search-suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.search-suggest-item:last-child { border-bottom: none; }
.search-suggest-item span {
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .feed-slide video {
    max-width: 420px;
    margin: 0 auto;
    border-radius: 12px;
  }
  .feed-slide {
    background: var(--bg);
  }
  .profile-grid {
    gap: 4px;
    padding: 4px;
  }
}
