:root {
  --bg: #0b0e14;
  --surface: #131822;
  --surface-2: #1b2230;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --gold: #f59e0b;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #1e1b4b 0%, var(--bg) 60%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.login-logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.login-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.login-error { color: #f87171; font-size: 0.85rem; margin-top: 12px; }

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.btn-small:hover { background: var(--accent-hover); }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 14, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.nav-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active { color: #fff; background: var(--accent); font-weight: 600; }

.nav-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box input, .genre-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
}
.search-box input { width: 220px; }

/* Container & Grid */
.container { max-width: 1400px; margin: 0 auto; padding: 28px 24px 60px; }
.section-header { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: flex-end; }
.section-header h1 { font-size: 1.7rem; font-weight: 700; }
.muted { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #cbd5e1;
  background: linear-gradient(145deg, #1e1b4b, #0f172a);
}
.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid var(--border);
}
.card-count {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(11, 14, 20, 0.85);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #e2e8f0;
}

.card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(4px); }
.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.65);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
}
.modal-hero { display: flex; gap: 24px; margin-bottom: 24px; }
.modal-cover-wrap { flex: 0 0 190px; }
.modal-cover-wrap img { width: 100%; border-radius: 10px; aspect-ratio: 2/3; object-fit: cover; background: var(--surface-2); }
.modal-info { flex: 1; min-width: 0; }
.modal-info h2 { font-size: 1.55rem; margin-bottom: 10px; }
.modal-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.badge-pill {
  font-size: 0.76rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #cbd5e1;
}
.modal-desc { color: #cbd5e1; font-size: 0.92rem; line-height: 1.6; margin-bottom: 14px; }
.genres-list { display: flex; gap: 6px; flex-wrap: wrap; }
.genre-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
}

/* Player */
.player-container {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}
.player-bar {
  background: var(--surface-2);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}
.player-actions { display: flex; gap: 8px; }
.player-frame-wrap { aspect-ratio: 16 / 9; width: 100%; background: #000; }
.player-frame-wrap.reader-tall { aspect-ratio: auto; height: 75vh; min-height: 480px; }
.player-frame-wrap iframe, .player-frame-wrap video { width: 100%; height: 100%; border: none; }

/* Explorador dedicado de Rol D&D */
.dnd-explorer { display: flex; flex-direction: column; gap: 18px; }
.dnd-editions { display: flex; gap: 10px; flex-wrap: wrap; }
.dnd-ed-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.dnd-ed-btn:hover { border-color: var(--accent-hover); transform: translateY(-2px); }
.dnd-ed-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.28), rgba(168,85,247,0.18));
  border-color: var(--accent);
}
.dnd-ed-title { font-weight: 700; font-size: 0.95rem; }
.dnd-ed-count { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.dnd-subcats { display: flex; gap: 8px; flex-wrap: wrap; }
.dnd-sub-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}
.dnd-sub-pill:hover { color: var(--text); }
.dnd-sub-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

.dnd-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}
.dnd-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.dnd-item:hover { border-color: rgba(129, 140, 248, 0.4); }
.dnd-item-title { font-weight: 600; font-size: 0.92rem; line-height: 1.35; }
.dnd-item-meta { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.dnd-item-actions { display: flex; gap: 8px; }

/* Episodes */
.episodes-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.episodes-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.episode-search {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
}
.episodes-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.episode-season-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.season-tab {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.season-tab:hover { color: var(--text); border-color: rgba(129, 140, 248, 0.5); }
.season-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.season-group-header {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a5b4fc;
  margin-top: 8px;
  padding: 4px 2px;
  border-bottom: 1px solid var(--border);
}
.episode-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.episode-info { min-width: 0; }
.episode-name { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-sub { font-size: 0.76rem; color: var(--muted); }
.episode-btns { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 680px) {
  .modal-hero { flex-direction: column; }
  .modal-cover-wrap { flex: none; max-width: 160px; }
  .search-box input { width: 150px; }
}

/* Lector a Pantalla Completa (Mangas, Libros, Cómics, D&D) */
.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0b0e14;
  display: flex;
  flex-direction: column;
}
.reader-overlay.hidden { display: none; }
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: #141923;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.reader-title-wrap { min-width: 0; max-width: 280px; }
.reader-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.reader-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.reader-group.hidden { display: none; }
.r-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.r-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.r-btn.active { background: var(--accent); color: #fff; }
.r-btn.hidden { display: none; }
.reader-page-input {
  width: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 5px;
  padding: 3px 6px;
  text-align: center;
  font-size: 0.82rem;
}
.reader-page-input.hidden { display: none; }
.reader-page-total, .reader-zoom-label {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0 5px;
  white-space: nowrap;
}
.reader-actions { display: flex; align-items: center; gap: 8px; }
.reader-stage {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.reader-status {
  margin: auto;
  color: var(--muted);
  font-size: 1rem;
}
.reader-scroll-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.reader-page-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 220px;
}
.reader-page-badge {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.reader-single-wrap, .reader-double-wrap {
  margin: auto;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  gap: 14px;
  min-width: min-content;
}
.reader-canvas, .reader-img {
  display: block;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  background: #fff;
  image-rendering: high-quality;
}
.reader-nav-fab {
  position: fixed;
  top: 54%;
  transform: translateY(-50%);
  z-index: 210;
  width: 44px;
  height: 76px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, opacity 0.15s ease;
  opacity: 0.65;
}
.reader-nav-fab:hover { background: rgba(99, 102, 241, 0.85); opacity: 1; }
.reader-nav-fab.left { left: 14px; }
.reader-nav-fab.right { right: 14px; }
.reader-nav-fab.hidden { display: none; }
.reader-stage.theme-dark .reader-canvas {
  filter: invert(0.9) hue-rotate(180deg) contrast(0.95);
}
.reader-stage.theme-sepia .reader-canvas {
  filter: sepia(0.35) brightness(0.96);
}
.reader-fallback-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #111;
}
.epub-viewer {
  width: 100%;
  max-width: 960px;
  height: 100%;
  min-height: 520px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

/* Responsividad completa para celulares */
@media (max-width: 680px) {
  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .brand { font-size: 1.05rem; }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .tabs { padding: 8px 14px; }
  .main { padding: 16px 14px 48px; }
  .section-head h2 { font-size: 1.15rem; }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
  }

  .modal { padding: 10px; }
  .modal-content {
    padding: 18px 14px;
    max-height: 94vh;
    border-radius: 14px;
  }
  .modal-hero { gap: 14px; }
  .modal-cover-wrap { max-width: 140px; margin: 0 auto; }
  .modal-info h2 { font-size: 1.25rem; }

  .episode-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .episode-name { white-space: normal; }
  .episode-btns { width: 100%; }
  .episode-btns .btn-small { flex: 1; text-align: center; }

  .dnd-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .dnd-item-actions { width: 100%; }
  .dnd-item-actions .btn-small { flex: 1; text-align: center; }

  .reader-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }
  .reader-title-wrap {
    max-width: 54%;
    order: 1;
  }
  .reader-actions {
    order: 2;
    margin-left: auto;
  }
  .reader-actions .btn-small { padding: 5px 9px; font-size: 0.78rem; }
  #reader-fullscreen { display: none; }
  .reader-controls {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    gap: 6px;
  }
  .reader-group { flex-shrink: 0; }
  [data-rmode="double"] { display: none; }
  .reader-stage { padding: 10px 6px; }
  .reader-nav-fab {
    width: 34px;
    height: 56px;
    font-size: 1.5rem;
    opacity: 0.45;
  }
  .reader-nav-fab.left { left: 6px; }
  .reader-nav-fab.right { right: 6px; }
}

/* Marcapáginas y Progreso de lectura */
.r-btn.bookmarked {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.progress-pill {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  vertical-align: middle;
}
.episode-row.is-read, .dnd-item.is-read {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}
.btn-read-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-read-toggle.active {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

/* Login con usuario y contraseña */
#login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Comentarios */
.comments-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.comments-section h3 { font-size: 1.05rem; margin-bottom: 12px; }
.comment-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.comment-form textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}
.comment-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-author { font-weight: 600; font-size: 0.85rem; color: #a5b4fc; }
.comment-date { font-size: 0.75rem; color: var(--muted); }
.comment-body { font-size: 0.88rem; color: var(--text); white-space: pre-wrap; line-height: 1.45; }
.comment-del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
}
.comment-del:hover { color: #f87171; }

/* Panel Admin */
.admin-modal-content { max-width: 760px; }
.admin-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.admin-create-form input, .admin-create-form select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
}
.admin-msg { font-size: 0.84rem; margin-bottom: 10px; color: #4ade80; }
.admin-msg.error { color: #f87171; }
.admin-msg.hidden { display: none; }
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}
.admin-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.admin-user-info { font-size: 0.88rem; }
.admin-user-meta { font-size: 0.76rem; color: var(--muted); }
.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Perfil de Usuario y Avatares */
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.profile-chip:hover { border-color: var(--accent); }
.profile-chip.hidden { display: none; }
.avatar-xs { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-lg { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar-xs.hidden, .avatar-sm.hidden, .avatar-lg.hidden { display: none; }

.profile-modal-content { max-width: 480px; }
.profile-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.profile-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.profile-avatar-controls { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.profile-form input, .profile-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.88rem;
}
.field-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.profile-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.view-profile-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 12px 0; }

/* Comentarios con Imagen/GIF */
.comment-form-box { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.comment-form-box textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
}
.comment-media-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comment-media-url {
  flex: 1;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.82rem;
}
.comment-file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.comment-media-preview { display: flex; align-items: center; gap: 10px; }
.comment-media-preview.hidden { display: none; }
.comment-media-preview img { max-height: 110px; border-radius: 8px; border: 1px solid var(--border); }
.comment-author-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  color: #a5b4fc;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.comment-author-btn:hover { text-decoration: underline; }
.comment-media-img {
  display: block;
  margin-top: 8px;
  max-width: 100%;
  max-height: 280px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
