body {
  background: #000; min-height: 100vh;
}
.nav {
  border-bottom: 1px solid #1a1a1a;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 18px 24px;
}
.nav-left { display: flex; align-items: center; gap: 18px; }
.logo {
  font-size: 1.2rem; font-weight: 800; text-decoration: none;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-link {
  font-size: 0.9rem; color: #aaa; text-decoration: none;
  padding: 8px 14px; border-radius: 10px; transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.upload-cta {
  padding: 9px 16px; border-radius: 10px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  color: #fff; text-decoration: none; font-size: 0.88rem; font-weight: 600;
}
.upload-cta:hover { filter: brightness(1.08); }
.logout-btn {
  background: none; border: 1px solid #2c2c2e; color: #aaa;
  padding: 8px 14px; border-radius: 10px; font-size: 0.85rem;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.logout-btn:hover { color: #fff; border-color: #3a3a3c; }

main { max-width: 960px; margin: 0 auto; padding: 32px 24px 80px; }
.header-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 1.6rem; font-weight: 700; }
.header-sub { color: #888; font-size: 0.9rem; margin-bottom: 26px; }
.email-pill { font-size: 0.85rem; color: #888; }
.email-pill strong { color: #ddd; font-weight: 600; }
.paid-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  background: linear-gradient(135deg, rgba(78,205,196,0.15), rgba(255,107,107,0.15));
  color: #4ecdc4; border: 1px solid rgba(78,205,196,0.25);
  margin-left: 8px; vertical-align: middle;
}

.empty {
  padding: 50px 30px; text-align: center;
  background: #0d0d0d; border: 1px dashed #1c1c1e; border-radius: 16px;
}
.empty-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.empty-sub { color: #959595; font-size: 0.9rem; margin-bottom: 18px; }

.video-list { display: flex; flex-direction: column; gap: 12px; }
.video-card {
  background: #0d0d0d; border: 1px solid #1c1c1e; border-radius: 14px;
  padding: 16px 18px; display: flex; align-items: center; gap: 16px;
}
.vc-thumb {
  position: relative; flex-shrink: 0;
  width: 120px; aspect-ratio: 16 / 9;
  border-radius: 8px; overflow: hidden;
  background: #1c1c1e;
  display: flex; align-items: center; justify-content: center;
}
.vc-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.vc-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #959595;
}
.vc-thumb-placeholder svg { width: 30px; height: 30px; }
.vc-main { flex: 1; min-width: 0; }
.vc-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; white-space: nowrap; display: flex; align-items: center; min-width: 0; }
.vc-title-text { overflow: hidden; text-overflow: ellipsis; }
.vc-meta { font-size: 0.8rem; color: #888; display: flex; gap: 14px; flex-wrap: wrap; }
.vc-meta .lock { color: #4ecdc4; }
.vc-meta .exp { color: #ffb86b; }
.vc-meta .no-expiry { color: #4ecdc4; }
.vc-unavailable {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 0.72rem;
  font-weight: 600; letter-spacing: 0.01em;
  background: rgba(255,107,107,0.12); color: #ff8e8e;
  border: 1px solid rgba(255,107,107,0.25);
  margin-left: 8px; flex-shrink: 0; white-space: nowrap;
  text-decoration: none; cursor: default;
}
a.vc-unavailable { cursor: pointer; }
a.vc-unavailable:hover { background: rgba(255,107,107,0.2); border-color: rgba(255,107,107,0.4); }
.vc-unavailable svg { width: 12px; height: 12px; flex-shrink: 0; }
.vc-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.vc-btn {
  padding: 8px 14px; border-radius: 9px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid #2c2c2e; background: #1c1c1e; color: #fff;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
  text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center;
}
.vc-btn:hover { background: #2c2c2e; border-color: #3a3a3c; }
.vc-btn.danger:hover { background: rgba(255,107,107,0.12); border-color: rgba(255,107,107,0.4); color: #ff8e8e; }
.vc-btn.copied { background: #30d158; border-color: #30d158; color: #fff; }

.tp-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tp-overlay.show { display: flex; }
.tp-dialog {
  background: #0d0d0d; border: 1px solid #1c1c1e; border-radius: 16px;
  max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto;
  padding: 22px 22px 18px;
}
.tp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 16px; }
.tp-title { font-size: 1.1rem; font-weight: 700; }
.tp-close {
  background: none; border: none; color: #959595; font-size: 1.6rem;
  cursor: pointer; line-height: 1; padding: 0 4px; font-family: inherit;
}
.tp-close:hover { color: #fff; }
.tp-sub { color: #959595; font-size: 0.85rem; margin-bottom: 16px; }
.tp-section-title { font-size: 0.85rem; font-weight: 600; color: #ccc; margin: 14px 0 10px; }
.tp-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.tp-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px;
  overflow: hidden; cursor: pointer; background: #1c1c1e;
  border: 2px solid transparent; transition: border-color 0.15s;
}
.tp-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-frame:hover { border-color: #3a3a3c; }
.tp-frame.selected { border-color: #4ecdc4; }
.tp-frame.loading {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, #1c1c1e 25%, #2a2a2e 50%, #1c1c1e 75%);
  background-size: 200% 100%;
  animation: tp-shimmer 1.5s ease-in-out infinite;
}
@keyframes tp-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-frame.loading { animation: none; background: #252528; }
}
.tp-frame.empty {
  display: flex; align-items: center; justify-content: center;
  color: #959595; font-size: 0.75rem; cursor: default;
}
.tp-frame.empty:hover { border-color: transparent; }
.tp-upload-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px; border: 1px dashed #2c2c2e; border-radius: 10px;
  background: #111;
}
.tp-upload-preview {
  width: 80px; aspect-ratio: 16 / 9; border-radius: 6px;
  background: #1c1c1e; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #959595; font-size: 0.7rem;
}
.tp-upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-upload-preview.selected { outline: 2px solid #4ecdc4; outline-offset: -2px; }
.tp-file-btn {
  padding: 8px 14px; border-radius: 9px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid #2c2c2e; background: #1c1c1e; color: #fff; cursor: pointer;
  font-family: inherit;
}
.tp-file-btn:hover { background: #2c2c2e; }
.tp-file-hint { color: #959595; font-size: 0.78rem; flex: 1; min-width: 140px; }
.tp-error {
  color: #ff6b6b; font-size: 0.82rem; margin-top: 10px; min-height: 1em;
}
.tp-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}
.tp-btn {
  padding: 9px 18px; border-radius: 10px; font-size: 0.88rem; font-weight: 600;
  border: 1px solid #2c2c2e; background: #1c1c1e; color: #fff; cursor: pointer;
  font-family: inherit;
}
.tp-btn:hover:not(:disabled) { background: #2c2c2e; }
.tp-btn.primary {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4); border-color: transparent;
}
.tp-btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.tp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 600px) {
  .tp-grid { grid-template-columns: repeat(2, 1fr); }
}

.edit-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.edit-overlay.show { display: flex; }
.edit-dialog {
  background: #0d0d0d; border: 1px solid #1c1c1e; border-radius: 16px;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
  padding: 22px 22px 18px;
}
.edit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 16px; }
.edit-title { font-size: 1.1rem; font-weight: 700; }
.edit-close {
  background: none; border: none; color: #959595; font-size: 1.6rem;
  cursor: pointer; line-height: 1; padding: 0 4px; font-family: inherit;
}
.edit-close:hover { color: #fff; }
.edit-field { margin-bottom: 16px; }
.edit-field label {
  display: block; font-size: 0.85rem; font-weight: 600; color: #ccc;
  margin-bottom: 6px;
}
.edit-field input,
.edit-field select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #2c2c2e; background: #1c1c1e; color: #fff;
  font-size: 0.9rem; font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.edit-field input:focus,
.edit-field select:focus { border-color: #4ecdc4; }
.edit-field .field-hint { font-size: 0.78rem; color: #959595; margin-top: 4px; }
.edit-error {
  color: #ff6b6b; font-size: 0.82rem; margin-bottom: 12px; min-height: 1em;
}
.edit-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}
.edit-modal-btn {
  padding: 9px 18px; border-radius: 10px; font-size: 0.88rem; font-weight: 600;
  border: 1px solid #2c2c2e; background: #1c1c1e; color: #fff; cursor: pointer;
  font-family: inherit;
}
.edit-modal-btn:hover:not(:disabled) { background: #2c2c2e; }
.edit-modal-btn.primary {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4); border-color: transparent;
}
.edit-modal-btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.edit-modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.edit-remove-pw {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.edit-remove-pw input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #4ecdc4; cursor: pointer;
}
.edit-remove-pw label {
  font-size: 0.82rem; color: #ccc; cursor: pointer; font-weight: 400;
}

.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255,255,255,0.15); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); color: #fff;
  padding: 12px 24px; border-radius: 999px; font-size: 0.88rem;
  font-weight: 600; opacity: 0; transition: all 0.3s ease;
  pointer-events: none; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 60px auto;
}
@media (max-width: 600px) {
  .nav-inner { padding: 12px 14px; gap: 8px; flex-wrap: wrap; }
  .nav-left { gap: 8px; }
  .nav-link { display: none; }
  .upload-cta, .logout-btn { padding: 9px 12px; font-size: 0.82rem; }
  main { padding: 20px 14px 80px; }
  h1 { font-size: 1.35rem; }
  .video-list { gap: 10px; }
  .video-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 0; overflow: hidden; }
  .vc-thumb { width: 100%; border-radius: 0; }
  .vc-main { padding: 0 14px; }
  .vc-title { white-space: normal; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .vc-meta { margin-top: 4px; }
  .vc-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 14px 14px; }
  .vc-actions .vc-btn { min-width: 0; padding: 10px 8px; text-align: center; }
  .vc-actions .vc-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .vc-meta { gap: 6px 10px; font-size: 0.75rem; }
  .vc-actions .vc-btn { flex: 1 1 45%; }
  .tp-file-hint { min-width: 100px; }
}
