:root {
  --bg: #0b0b0f;
  --surface: #14141a;
  --surface-2: #1c1c24;
  --surface-3: #252530;
  --border: #2a2a36;
  --text: #f4f4f8;
  --text-muted: #8b8b9e;
  --primary: #7c6af7;
  --primary-hover: #9486ff;
  --accent: #22d3ee;
  --success: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 106, 247, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(34, 211, 238, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ===== TOP BAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(124, 106, 247, 0.12);
}

/* ===== CONTAINER ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.container.narrow { max-width: 720px; }

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.page-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

.page-desc a {
  color: var(--primary);
  text-decoration: none;
}
.page-desc a:hover { text-decoration: underline; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 2.25rem 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(124, 106, 247, 0.08);
}

.drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 600;
}

.drop-text { font-weight: 500; margin-bottom: 0.25rem; }
.drop-or { color: var(--text-muted); font-size: 0.85rem; margin: 0.5rem 0; }
.drop-hint { margin-top: 0.85rem; font-size: 0.8rem; color: var(--text-muted); opacity: 0.8; }

.selected-files {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-files .chip {
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.selected-files .chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

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

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-full { width: 100%; margin-top: 1rem; padding: 0.85rem; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }

.btn-accent { background: rgba(34, 211, 238, 0.15); color: var(--accent); }
.btn-accent:hover { background: rgba(34, 211, 238, 0.25); }

.btn-success { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.btn-success:hover { background: rgba(52, 211, 153, 0.28); }

.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* ===== FILES SECTION ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}

.section-header h2 { font-size: 1.15rem; font-weight: 600; }

.badge {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.badge-warn { background: rgba(251, 191, 36, 0.15); color: var(--warn); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty-state.small { padding: 1.75rem; }
.empty-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.7; }
.empty-sub { font-size: 0.9rem; margin-top: 0.25rem; opacity: 0.7; }

.file-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.15s;
}

.file-card:hover { border-color: #3a3a4a; }

.file-type-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: var(--surface-2);
}

.file-type-badge.small { width: 34px; height: 34px; font-size: 0.95rem; border-radius: 8px; }

.type-video { background: rgba(124, 106, 247, 0.2); color: var(--primary); }
.type-image { background: rgba(34, 211, 238, 0.15); color: var(--accent); }
.type-audio { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.type-file  { background: var(--surface-2); color: var(--text-muted); }

.file-body { flex: 1; min-width: 0; }

.file-name {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  text-transform: capitalize;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* ===== INFO BOX ===== */
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.info-box h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.info-box ol {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-box li { margin-bottom: 0.4rem; }
.info-box strong { color: var(--text); }

/* ===== VIEW PAGE ===== */
.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--primary); }

.view-header { margin-bottom: 1.5rem; }

.view-title {
  font-size: 1.35rem;
  font-weight: 600;
  word-break: break-all;
}

.view-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  text-transform: capitalize;
}

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

.player-box { background: #000; }
.player-box.audio-box {
  background: var(--surface-2);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.audio-visual { font-size: 3rem; margin-bottom: 1.25rem; opacity: 0.6; }
.media-el { width: 100%; max-height: 70vh; display: block; }
.media-img { width: 100%; max-height: 75vh; object-fit: contain; display: block; }

.view-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  flex-wrap: wrap;
}
.view-actions .btn { margin-top: 0; }

/* ===== FLASH ===== */
.flash-messages { margin-bottom: 1.25rem; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.flash-success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--success);
}

.flash-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

/* ===== ADMIN ===== */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.15rem;
}

.admin-nav { display: flex; gap: 0.5rem; }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-num { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.pending-num { color: var(--warn); }
.approved-num { color: var(--success); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

.admin-section { margin-bottom: 2.5rem; }

.admin-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-row:last-child { border-bottom: none; }

.admin-file-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.admin-filename {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.admin-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ===== LOGIN ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.35rem; }
.login-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.login-form { text-align: left; }

.form-group { margin-bottom: 1.15rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus { border-color: var(--primary); }

.back-to-site {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.back-to-site:hover { color: var(--primary); }

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .file-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-actions { width: 100%; }
  .file-actions .btn { flex: 1; }
  .admin-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-actions { width: 100%; }
  .stats-row { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0.75rem 1rem; }
}

/* ===== SEARCH + CATEGORY TABS ===== */
.filter-bar {
  margin-bottom: 1.75rem;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cat-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.cat-tab:hover {
  color: var(--text);
  border-color: #3a3a4a;
}
.cat-tab.active {
  background: rgba(124, 106, 247, 0.15);
  color: var(--primary);
  border-color: rgba(124, 106, 247, 0.4);
}

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 0.5rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(11, 11, 15, 0.95);
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu .nav-link {
  padding: 0.7rem 0.9rem;
}

.video-hint {
  padding: 0.75rem 1.25rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .desktop-nav { display: none; }
  .hamburger { display: flex; }
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg: #f4f4f8;
  --surface: #ffffff;
  --surface-2: #f0f0f5;
  --surface-3: #e4e4ec;
  --border: #d0d0dc;
  --text: #1a1a22;
  --text-muted: #6b6b7b;
  --shadow: 0 8px 32px rgba(0,0,0,0.08);
}
[data-theme="light"] .bg-glow {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124,106,247,0.1), transparent);
}
[data-theme="light"] .topbar {
  background: rgba(244,244,248,0.9);
}
[data-theme="light"] .player-box { background: #111; }

.theme-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 1rem;
}
.theme-btn:hover { background: var(--surface-3); }
.mobile-theme { width: 100%; margin-top: 0.5rem; text-align: left; padding: 0.7rem 0.9rem; }

/* ===== FORM OPTIONS ===== */
.form-options { margin-top: 1.25rem; }
.form-options .form-group { margin-bottom: 1rem; }
.form-options label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.4rem; }
.form-options input[type="text"] {
  width: 100%; padding: 0.65rem 1rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 0.95rem; outline: none;
}
.form-options input[type="text"]:focus { border-color: var(--primary); }

.radio-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.radio-label {
  flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.75rem 1rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.15s;
}
.radio-label:has(input:checked) { border-color: var(--primary); background: rgba(124,106,247,0.08); }
.radio-label input { margin-right: 0.4rem; }
.radio-label span { font-weight: 600; font-size: 0.9rem; }
.radio-label small { color: var(--text-muted); font-size: 0.75rem; }

/* ===== PROGRESS ===== */
.progress-wrap { margin-top: 1rem; }
.progress-bar {
  height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px; transition: width 0.15s;
}
.progress-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; text-align: center; }

/* ===== PRIVATE LINKS BOX ===== */
.private-links-box {
  background: rgba(124,106,247,0.1); border: 1px solid rgba(124,106,247,0.35);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.private-links-box h3 { margin-bottom: 0.35rem; }
.private-links-box .hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.private-link-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem;
}
.plink-name { font-weight: 600; font-size: 0.9rem; min-width: 100px; }
.plink-input {
  flex: 1; min-width: 180px; padding: 0.45rem 0.75rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.8rem; font-family: monospace;
}

.private-badge {
  display: inline-block; background: rgba(124,106,247,0.2); color: var(--primary);
  font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; margin-bottom: 0.5rem;
}
.view-desc { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.95rem; }

/* ===== THUMBNAILS ===== */
.file-thumb {
  width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.thumb-img { width: 100%; height: 100%; object-fit: cover; }
.file-desc {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== ADMIN EXTRAS ===== */
.stats-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .stats-4 { grid-template-columns: 1fr 1fr; } }
.admin-note { font-size: 0.85rem; color: var(--text-muted); margin: -1rem 0 1.5rem; }
.bulk-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin-bottom: 0.75rem; padding: 0.75rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.bulk-bar label { font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; margin-right: auto; }
.check-wrap { display: flex; align-items: center; margin-right: 0.5rem; }
.info-box ul { padding-left: 1.25rem; color: var(--text-muted); font-size: 0.9rem; }
.info-box li { margin-bottom: 0.4rem; }
.info-box strong { color: var(--text); }

/* ===== PRIVATE ON HOME ===== */
.mark-private {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
  border-radius: 999px;
  background: rgba(124, 106, 247, 0.2);
  color: var(--primary);
  letter-spacing: 0.02em;
}
.file-card-private {
  border-color: rgba(124, 106, 247, 0.35);
  background: rgba(124, 106, 247, 0.04);
}
.private-note {
  color: var(--primary);
  font-weight: 500;
}
[data-theme="light"] .file-card-private {
  background: rgba(124, 106, 247, 0.06);
}

.select-input {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
.empty-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }

.mark-pin { margin-right: 0.25rem; }
.file-card-pinned { border-color: rgba(251, 191, 36, 0.4); }

.share-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 200; padding: 1rem;
}
.share-overlay[hidden] { display: none !important; }
.share-sheet {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem; width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
@media (min-width: 600px) {
  .share-overlay { align-items: center; }
  .share-sheet { border-radius: var(--radius); }
}
.share-sheet h3 { margin-bottom: 0.35rem; }
.share-name { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.share-close { width: 100%; }

.qr-box { text-align: center; padding: 1.25rem; border-top: 1px solid var(--border); }
.qr-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.qr-box img { border-radius: 8px; background: #fff; padding: 8px; }

.admin-note-text { font-size: 0.8rem; color: var(--warn); margin-top: 0.2rem; }
.admin-note-row { padding: 0 1rem 0.75rem; border-bottom: 1px solid var(--border); }
.note-form { display: flex; gap: 0.5rem; }
.note-form input {
  flex: 1; padding: 0.4rem 0.75rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.85rem;
}
.report-count { color: var(--danger); font-weight: 600; }

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* NSFW */
.nsfw-blur { filter: blur(8px); position: relative; }
.nsfw-tag {
  position: absolute; bottom: 2px; left: 2px; right: 2px;
  font-size: 0.6rem; font-weight: 700; text-align: center;
  background: rgba(0,0,0,0.7); color: #f87171; border-radius: 4px;
  filter: none;
}
.file-thumb { position: relative; }
.mark-nsfw {
  display: inline-block; margin-left: 0.35rem; padding: 0.12rem 0.4rem;
  font-size: 0.65rem; font-weight: 700; border-radius: 999px;
  background: rgba(248,113,113,0.2); color: var(--danger);
}
.media-wrap { position: relative; min-height: 120px; }
.media-wrap.is-nsfw .player-box,
.media-wrap.is-nsfw .media-el,
.media-wrap.is-nsfw .media-img,
.media-wrap.is-nsfw .video-hint {
  filter: blur(28px) !important;
  pointer-events: none !important;
  user-select: none !important;
}
.nsfw-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}
.nsfw-overlay .btn {
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 21;
}
.media-wrap:not(.is-nsfw) .nsfw-overlay {
  display: none !important;
}
.check-nsfw {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.check-nsfw input { width: auto; }
.check-nsfw span { font-weight: 600; }
.check-nsfw small { width: 100%; color: var(--text-muted); font-size: 0.78rem; }
.nav-user {
  font-size: 0.85rem; color: var(--text-muted); padding: 0.45rem 0.5rem;
}
.expiry-label { color: var(--warn); font-weight: 500; }

/* ===== HOME REDESIGN ===== */
.home-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.home-hero-text h1 {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.home-hero-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.home-upload-btn {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.home-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.home-search {
  position: relative;
  display: flex;
  align-items: center;
}
.home-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.home-search-input:focus {
  border-color: var(--primary);
}
.home-search-clear {
  position: absolute;
  right: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
}
.home-search-clear:hover { color: var(--text); }

.home-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.home-tab {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.home-tab:hover {
  color: var(--text);
  border-color: #3a3a4a;
}
.home-tab.active {
  background: rgba(124, 106, 247, 0.15);
  color: var(--primary);
  border-color: rgba(124, 106, 247, 0.4);
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 560px) {
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-card:hover {
  border-color: #3a3a4a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.home-card.is-private {
  border-color: rgba(124, 106, 247, 0.3);
}
.home-card.is-pinned {
  border-color: rgba(251, 191, 36, 0.35);
}

.home-card-media {
  position: relative;
  display: block;
  height: 120px;
  background: var(--surface-2);
  text-decoration: none;
  overflow: hidden;
}
.home-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-card-media.is-nsfw img {
  filter: blur(12px);
}
.home-card-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}
.home-card-icon.type-video { color: var(--primary); background: rgba(124,106,247,0.12); }
.home-card-icon.type-audio { color: var(--success); background: rgba(52,211,153,0.1); }
.home-card-icon.type-document { color: var(--accent); background: rgba(34,211,238,0.08); }

.home-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.home-badge.nsfw {
  background: rgba(248,113,113,0.9);
  color: #fff;
}
.home-badge.private {
  background: rgba(124,106,247,0.9);
  color: #fff;
  left: auto;
  right: 0.5rem;
}
.home-badge.pin {
  background: rgba(251,191,36,0.95);
  color: #1a1a22;
  top: auto;
  bottom: 0.5rem;
  left: 0.5rem;
}
.home-card-media.is-nsfw .home-badge.private {
  top: 0.5rem;
}

.home-card-body {
  padding: 0.85rem 1rem 0.35rem;
  flex: 1;
}
.home-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.home-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.home-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 1rem 1rem;
}
.home-card-actions form {
  display: inline;
  margin: 0;
}

.home-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 16px;
}
.home-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}
.home-empty h2 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.home-empty p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto;
}
.home-empty-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

@media (max-width: 500px) {
  .home-hero {
    flex-direction: column;
  }
  .home-upload-btn {
    width: 100%;
  }
  .home-card-media {
    height: 100px;
  }
}

/* ===== VIEW TOGGLE (grid / list) ===== */
.home-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.2rem;
}
.view-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 36px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.view-btn:hover { color: var(--text); background: var(--surface-2); }
.view-btn.active {
  background: rgba(124, 106, 247, 0.2);
  color: var(--primary);
}

.home-grid.is-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 560px) {
  .home-grid.is-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.home-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.home-grid.is-list .home-card {
  flex-direction: row;
  align-items: stretch;
}
.home-grid.is-list .home-card-media {
  width: 88px;
  min-width: 88px;
  height: auto;
  min-height: 72px;
  flex-shrink: 0;
}
.home-grid.is-list .home-card-body {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.5rem 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-grid.is-list .home-card-title {
  -webkit-line-clamp: 1;
  margin-bottom: 0.15rem;
}
.home-grid.is-list .home-card-actions {
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-left: 1px solid var(--border);
}
@media (max-width: 520px) {
  .home-grid.is-list .home-card {
    flex-wrap: wrap;
  }
  .home-grid.is-list .home-card-media {
    width: 64px;
    min-width: 64px;
  }
  .home-grid.is-list .home-card-actions {
    flex-direction: row;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

.html-host { margin: 0.5rem 0 1rem; }
.html-host-note { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.html-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

/* ===== STREAMING HOME ===== */
.stream-page { margin: 0 -0.25rem 2rem; }
.stream-hero {
  position: relative;
  display: block;
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.75rem;
  text-decoration: none;
  color: #fff;
  background: #12121a;
}
.stream-hero-bg {
  position: absolute; inset: 0;
}
.stream-hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.75);
}
.stream-hero.is-nsfw .stream-hero-bg img { filter: blur(18px) brightness(0.5); }
.stream-hero-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #2a1f4e, #1a1a28 50%, #0d2a2e);
}
.stream-hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 55%, transparent 100%),
              linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 50%);
}
.stream-hero-body {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem 1.75rem;
  max-width: 34rem;
}
.stream-hero-empty .stream-hero-body { padding: 3rem 1.5rem; }
.stream-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.stream-hero-body h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.stream-hero-body p {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.stream-play-btn { pointer-events: none; }

.stream-row { margin-bottom: 1.75rem; }
.stream-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.65rem; padding: 0 0.15rem;
}
.stream-row-head h2 {
  font-size: 1.15rem; font-weight: 700;
}
.stream-see-all {
  font-size: 0.85rem; color: var(--text-muted); text-decoration: none;
}
.stream-see-all:hover { color: var(--primary); }

.stream-rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.stream-rail::-webkit-scrollbar { height: 6px; }
.stream-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.stream-tile {
  flex: 0 0 auto;
  width: 160px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}
@media (min-width: 600px) {
  .stream-tile { width: 200px; }
  .stream-hero { min-height: 340px; }
}
.stream-tile-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}
.stream-tile-media img {
  width: 100%; height: 100%; object-fit: cover;
}
.stream-tile.is-nsfw .stream-tile-media img { filter: blur(10px); }
.stream-tile-icon {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: var(--text-muted);
}
.stream-tile-icon.type-video { background: rgba(124,106,247,0.15); color: var(--primary); }
.stream-tile-icon.type-audio { background: rgba(52,211,153,0.12); color: var(--success); }
.stream-tile-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  font-size: 1.5rem; color: #fff;
  opacity: 0; transition: opacity 0.15s;
}
.stream-tile:hover .stream-tile-play { opacity: 1; }
.stream-tile-title {
  font-size: 0.88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stream-tile-meta { font-size: 0.75rem; color: var(--text-muted); }
.stream-empty-note {
  color: var(--text-muted); font-size: 0.95rem; padding: 0.5rem 0;
}
.stream-empty-note a { color: var(--primary); }
