/* =====================================================================
   Comunidad · Culto de Papel — estilos de login, registro, feed,
   editor y panel de admin. Reutiliza los tokens de :root de styles.css.
   ===================================================================== */

/* Garantiza que [hidden] siempre oculte aunque el autor CSS tenga display:flex */
[hidden] { display: none !important; }
/* Reserva espacio para el scrollbar: evita el layout shift al expandir secciones */
html { scrollbar-gutter: stable; }

/* ── Foco visible (WCAG 2.4.7): anillo de acento al navegar con teclado.
   :where() deja la especificidad en cero, así cualquier estilo de foco
   propio de un componente (inputs con borde+glow, etc.) puede pisarlo. ── */
:where(a, button, select, [role="button"], [tabindex="0"]):focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────
   Tema CLARO con acento NARANJA para la Biblioteca y los perfiles.
   Esta hoja SOLO la cargan las páginas de comunidad/cuenta/admin/perfil,
   así que redefinir aquí los tokens NO afecta a la home ni a "Voces"
   (esas páginas no cargan este archivo y siguen en modo oscuro violeta).
   ───────────────────────────────────────────────────────────────────── */
:root {
  /* Base CLARA (tema "panel" índigo/morado, según Figma) */
  --c-bg: #FAF8F5;        /* fondo de página */
  --c-bg-deep: #FFFFFF;   /* superficies elevadas (tarjetas) */
  --c-cream: #1a1a1a;     /* TEXTO principal (casi negro) */
  --c-muted: rgba(0, 0, 0, 0.55);
  /* Acentos morados */
  --c-accent: #615FFF;            /* acento principal (índigo): labels, links, focus */
  --c-gold: var(--c-accent);      /* alias — mantiene compatibilidad con var(--c-gold) de styles.css */
  --c-head: #3A0063;      /* títulos (morado oscuro) */
  --on-accent: #ffffff;   /* texto sobre el acento */
  --grad-accent: linear-gradient(90deg, #615FFF 0%, #AD46FF 100%);  /* botones primarios */
  /* Bordes */
  --border-subtle:      rgba(0, 0, 0, 0.10);
  --border-default:     rgba(0, 0, 0, 0.15);
  --border-strong:      rgba(58, 0, 99, 0.10);
  --border-accent-hover: rgba(97, 95, 255, 0.55);
  /* Radios de esquina — sobreescriben styles.css para páginas de comunidad */
  --radius-sm: 8px;   /* botones, alertas, elementos pequeños */
  --radius-md: 10px;  /* inputs, filas de editor */
  --radius-lg: 16px;  /* tarjetas de panel, banner */
}

.cmn-main {
  min-height: 70vh;
  padding: 6rem var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Cabecera slim de las páginas de comunidad */
.cmn-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: rgba(250, 244, 236, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}
.cmn-topbar a.cmn-logo {
  font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.5px; color: var(--c-cream);
}
.cmn-topbar a.cmn-logo em { color: var(--c-accent); font-style: italic; margin-left: 0.25em; }
.cmn-topbar nav { display: flex; gap: var(--space-sm); align-items: center; font-size: 0.9rem; }
.cmn-topbar nav a { color: var(--c-cream); opacity: 0.9; }
.cmn-topbar nav a:hover { color: var(--c-accent); }

/* ============ Navegación de miembros (barra lateral estilo panel + ☰ móvil) ============ */
.side-nav {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 300;
  width: 260px;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, rgba(97,95,255,0.05) 0%, rgba(0,0,0,0) 50%, rgba(173,70,255,0.05) 100%),
    #ffffff;
  transform: translateX(-100%);
  transition: transform 240ms ease;
  overflow-y: auto;
}
/* Cabecera de marca + campana (estilo Figma: campana arriba a la derecha) */
.side-nav__head {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 16px 22px 20px; color: inherit; flex-shrink: 0;
}
.side-nav__head-link {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0; color: inherit; text-decoration: none;
}
.side-nav__logo-icon { width: 40px; height: auto; flex-shrink: 0; }
.side-nav__brand { display: flex; flex-direction: column; min-width: 0; }
.side-nav__brand-name { font-family: var(--font-body); font-size: 16px; font-weight: 600; color: #000; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav__brand-name .accent { color: #3A0063; }
.side-nav__brand-sub { font-size: 12px; font-weight: 400; color: rgba(0, 0, 0, 0.70); line-height: 18px; }
/* Sección de navegación */
.side-nav__nav {
  flex: 1; display: flex; flex-direction: column;
  padding: 16px 12px 0;
  border-top: 1px solid rgba(58, 0, 99, 0.15);
}
.side-nav__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.55px; color: rgba(0, 0, 0, 0.40);
  padding: 0 12px 8px;
}
.side-nav__links { flex: 1; display: flex; flex-direction: column; }
/* Categoría "Mi cuenta" del sidebar: separada visualmente de Navegación */
.side-nav__label--group {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
/* Ítems */
.snav-link {
  position: relative; margin-top: 4px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 14px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: #000;
  text-align: left; width: 100%;
  background: none; border: none; cursor: pointer;
}
.snav-link:first-child { margin-top: 0; }
.snav-ico {
  width: 18px; height: 18px; flex-shrink: 0; color: rgba(0, 0, 0, 0.60);
  display: inline-flex; align-items: center; justify-content: center;
}
.snav-link__label { flex: 1; }
.snav-link:hover { background: rgba(97, 95, 255, 0.08); }
.snav-link.is-active {
  background: linear-gradient(90deg, rgba(97, 95, 255, 0.20) 0%, rgba(173, 70, 255, 0.10) 100%);
  font-weight: 700;
}
.snav-link.is-active .snav-ico { color: #3A0063; }
.snav-link.is-active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 24px; background: #7C86FF; border-radius: 0 4px 4px 0;
}
/* Botón "Monetizar" (función futura): tooltip "Próximamente" al hacer clic */
.snav-soon {
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  padding: 0.32rem 0.7rem; border-radius: 9px;
  background: linear-gradient(90deg, #615FFF 0%, #AD46FF 100%);
  color: #fff; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2px; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(20, 14, 30, 0.28);
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 400;
  transition: opacity 160ms ease, transform 160ms ease;
}
.snav-soon::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #AD46FF;
}
.snav-monetizar.is-soon-open .snav-soon {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
/* Badge de conteo */
.snav-badge {
  flex-shrink: 0; min-width: 22px; height: 20px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, #615FFF 0%, #AD46FF 100%);
  color: #fff; font-size: 11px; font-weight: 600; line-height: 1; border-radius: var(--radius-pill);
}
/* Salir, al fondo */
.side-nav__spacer { flex: 1; min-height: 16px; }
.snav-logout { color: rgba(0, 0, 0, 0.55); margin-bottom: 16px; }
.snav-logout .snav-ico { color: rgba(0, 0, 0, 0.45); }
.snav-logout:hover { color: #000; }

/* Barra superior móvil con el botón ☰ */
.snav-mobilebar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 280;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem var(--space-sm);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(58, 0, 99, 0.12);
}
.snav-mobilebar__logo { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; color: #000; flex: 1; }
.snav-mobilebar__logo em { color: #3A0063; font-style: normal; margin-left: 0.25em; }
.snav-toggle {
  width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0;
  background: none; border: 1px solid rgba(58, 0, 99, 0.15);
  color: #3A0063; font-size: 1.25rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.snav-overlay {
  position: fixed; inset: 0; z-index: 290;
  background: rgba(20, 14, 30, 0.4); opacity: 0; pointer-events: none;
  transition: opacity 240ms ease;
}
body.snav-open .side-nav { transform: translateX(0); }

/* Campana de notificaciones (comentarios/respuestas/likes en publicaciones propias) */
.snav-bell {
  position: relative; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: 1px solid rgba(58, 0, 99, 0.15);
  color: #3A0063; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 160ms, border-color 160ms;
}
.snav-bell:hover { background: rgba(97, 95, 255, 0.08); border-color: rgba(58, 0, 99, 0.3); }
/* Campana en la cabecera del sidebar: solo escritorio (en móvil va en la barra superior) */
@media (max-width: 879px) { .snav-bell--head { display: none; } }
.snav-bell__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #615FFF 0%, #AD46FF 100%);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
}
/* En escritorio la campana no compite con el lockup de marca del sidebar:
   flota arriba a la derecha del contenido, mismo patrón que .owner-return. */
.snav-bell--floating { display: none; }
@media (min-width: 880px) {
  .snav-bell--floating:not([hidden]) {
    display: inline-flex; position: fixed; top: 20px; right: 28px; z-index: 320;
    background: #fff; box-shadow: 0 4px 16px rgba(20, 14, 30, 0.16);
  }
}
.snav-bell__panel {
  position: fixed; top: 70px; right: 16px; z-index: 350;
  width: 320px; max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto;
  background: #fff; border-radius: 14px; border: 1px solid rgba(58, 0, 99, 0.12);
  box-shadow: 0 12px 40px rgba(20, 14, 30, 0.2);
}
.snav-bell__panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.9rem 1rem 0.6rem; font-weight: 700; font-size: 0.95rem; color: #000; }
.snav-bell__readall { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; font-weight: 500; font-size: 0.76rem; color: var(--c-accent); }
.snav-bell__readall:hover { text-decoration: underline; }
.snav-bell__list { display: flex; flex-direction: column; }
.snav-notif {
  display: block; padding: 0.7rem 1rem; text-decoration: none; color: inherit;
  border-top: 1px solid rgba(58, 0, 99, 0.08);
}
.snav-notif:hover { background: rgba(97, 95, 255, 0.06); }
.snav-notif.is-unread { background: rgba(97, 95, 255, 0.08); }
.snav-notif__msg { font-size: 0.85rem; color: #1a1a1a; line-height: 1.4; }
.snav-notif__date { font-size: 0.72rem; color: rgba(0,0,0,0.5); margin-top: 0.2rem; display: inline-block; }
.snav-notif__empty { padding: 1.2rem 1rem; font-size: 0.85rem; color: rgba(0,0,0,0.5); text-align: center; }
@media (min-width: 880px) {
  /* Desde la campana de la cabecera (arriba-izquierda, dentro del sidebar) */
  .snav-bell__panel { top: 72px; left: 16px; right: auto; }
}
body.snav-open .snav-overlay { opacity: 1; pointer-events: auto; }

/* ESCRITORIO (≥880px): barra lateral siempre visible; se oculta la barra vieja y la móvil */
@media (min-width: 880px) {
  .side-nav { transform: translateX(0); }
  .snav-mobilebar, .snav-overlay { display: none; }
  body.has-sidenav .cmn-topbar { display: none; }
  body.has-sidenav .cmn-main { padding-left: calc(260px + var(--space-md)); padding-top: var(--space-lg); }
}
/* MÓVIL (<880px): la barra móvil con ☰ reemplaza a la barra vieja */
@media (max-width: 879px) {
  body.has-sidenav .cmn-topbar { display: none; }
  .side-nav { width: 280px; max-width: 85vw; box-shadow: 0 0 40px rgba(20, 14, 30, 0.2); }
}

/* ---- Tarjeta central (auth) ---- */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-bg-deep);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.10);
}
.auth-card__title {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-head);
  text-align: center;
  margin-bottom: 0.3rem;
}
.auth-card__subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--c-cream);
  opacity: 0.75;
  margin-bottom: var(--space-md);
}

/* ---- Formularios ---- */
.field { margin-bottom: var(--space-sm); }
.field label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--c-accent);
  margin-bottom: 0.4rem;
}
.field input,
.field textarea,
.field select,
.link-row input,
.book-row__fields input,
.book-row__fields textarea,
.book-row__fields select,
.art-row input[type=text],
.social-editor-row input[type=url],
#pfPaypal, #pfPatreon {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: #000;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.625rem 0.75rem;
  transition: border-color 200ms, box-shadow 200ms;
}
.field textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
.book-row__fields textarea { min-height: 52px; resize: vertical; line-height: 1.45; }
.field input:focus,
.field textarea:focus,
.field select:focus,
.link-row input:focus,
.book-row__fields input:focus,
.book-row__fields textarea:focus,
.book-row__fields select:focus,
.art-row input[type=text]:focus,
.social-editor-row input[type=url]:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(97, 95, 255, 0.12);
}
/* Chevron custom: oculta la flecha nativa y pone una SVG alineada */
.field select,
.book-row__fields select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem 1rem;
  cursor: pointer;
}
/* Opciones del desplegable: fondo oscuro + texto claro (legible al abrirlo) */
.field select option {
  background: #ffffff;
  color: var(--c-cream);
}
.field select option:checked,
.field select option:hover {
  background: var(--c-accent);
  color: var(--on-accent);
}
.field__hint { font-size: 0.78rem; color: var(--c-muted); margin-top: 0.3rem; }

/* ---- Botones ---- */
.btn-cmn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: auto;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font-body); transition: opacity 200ms;
  border: 2px solid transparent; min-width: 170px;
  transition: filter 180ms, opacity 200ms;
}
.btn-cmn:hover { filter: brightness(1.07); }
.btn-cmn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cmn--block { width: 100%; }
.btn-cmn--ghost {
  background: #fff;
  color: var(--c-accent);
  border: 1px solid var(--c-accent);
}
.btn-cmn--ghost:hover { background: rgba(97, 95, 255, 0.08); filter: none; }

/* ---- Mensajes ---- */
.alert {
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
  margin-bottom: var(--space-sm);
  border: 1px solid transparent;
}
.alert--error { background: rgba(190, 60, 90, 0.12); border-color: rgba(190, 60, 90, 0.45); color: #8c1d33; }
.alert--ok    { background: rgba(120, 190, 130, 0.16); border-color: rgba(120, 190, 130, 0.5); color: #1f6b2e; }
.alert--info  { background: rgba(97, 95, 255, 0.10); border-color: rgba(97, 95, 255, 0.40); color: #3A0063; }
.alert[hidden] { display: none; }

/* ---- Enlaces auxiliares ---- */
.auth-foot {
  text-align: center;
  font-size: 0.85rem;
  margin-top: var(--space-md);
  opacity: 0.85;
}
.auth-foot a { color: var(--c-accent); }
/* Aviso de privacidad en formularios */
.privacy-notice { font-size: 0.78rem; color: var(--c-muted); margin-top: 0.75rem; text-align: center; }
.privacy-notice a { color: var(--c-accent); text-decoration: underline; }
/* Página política de privacidad */
.privacy-doc { width: 100%; max-width: 720px; line-height: 1.8; }
.privacy-doc h1 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 0.25rem; }
.privacy-doc__meta { font-size: 0.85rem; opacity: 0.65; margin-bottom: var(--space-lg); }
.privacy-doc h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 2rem 0 0.5rem; color: var(--c-head); }
.privacy-doc p, .privacy-doc li { font-size: 0.95rem; }
.privacy-doc ul { padding-left: 1.4rem; margin: 0.5rem 0; }
.privacy-doc li { margin-bottom: 0.3rem; }
.privacy-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 0.75rem 0; }
.privacy-table th, .privacy-table td { border: 1px solid var(--border-default); padding: 0.55rem 0.8rem; text-align: left; }
.privacy-table th { background: rgba(97,95,255,0.08); font-weight: 600; }
/* Zona de peligro (eliminar cuenta) */
.danger-zone {
  width: 100%; max-width: 1100px;
  margin-top: var(--space-lg); padding: 1.25rem 1.5rem;
  border: 1px solid rgba(190,60,90,0.35); border-radius: var(--radius-lg);
}
.danger-zone__label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; color: #b3294e; margin-bottom: 0.75rem; font-weight: 700; }
.danger-zone__btn {
  background: none; border: 1px solid rgba(190,60,90,0.6); border-radius: var(--radius-sm);
  color: #b3294e; padding: 0.45rem 1rem; cursor: pointer; font-size: 0.88rem;
  font-family: var(--font-body); transition: background 150ms;
}
.danger-zone__btn:hover { background: rgba(190,60,90,0.08); }
.danger-zone__hint { font-size: 0.78rem; color: var(--c-muted); margin-top: 0.6rem; line-height: 1.5; }
.danger-zone__hint a { color: var(--c-muted); text-decoration: underline; }
/* Botones de OAuth (Google, Discord…) */
.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1.25rem 0; color: var(--c-muted); font-size: 0.82rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border-default); }
.auth-providers { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.5rem; }
.auth-provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 0.7rem 1rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: #fff; color: var(--c-cream);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: box-shadow 200ms, border-color 200ms;
}
.auth-provider-btn:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.10); border-color: var(--border-accent-hover); }
.auth-provider-btn:disabled { opacity: 0.6; cursor: default; }
/* Botón "Iniciar sesión con correo": mismo lenguaje pill, en el color de marca */
.auth-email-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 0.7rem 1rem; border-radius: var(--radius-pill);
  border: none; background: var(--grad-accent); color: var(--on-accent);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: filter 150ms;
}
.auth-email-toggle:hover { filter: brightness(1.07); }
#loginForm .btn-cmn--block { border-radius: var(--radius-pill); }

/* ---- Cabecera de sección comunidad ---- */
.cmn-head {
  width: 100%;
  max-width: 1000px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.cmn-head h1 { font-family: var(--font-body); font-size: 1.6rem; font-weight: 700; color: var(--c-head); }

/* ---- Chip de usuario / rol ---- */
.role-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--c-accent);
  color: #fff;
  font-family: var(--font-body); transition: opacity 200ms;
  border: 2px solid transparent;
}
/* Chip "cuenta de Discord vinculada" en la tabla de usuarios del admin */
.discord-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
  background: rgba(88, 101, 242, 0.12); color: #5865F2;
  font-size: 0.78rem; font-weight: 600;
}

/* ---- Layout de panel (perfil/admin, según Figma) ---- */
.cmn-main h2 { color: var(--c-head); }
.panel { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 24px; }
.panel-banner {
  padding: 24px 20px; border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(97, 95, 255, 0.12), rgba(173, 70, 255, 0.12));
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.panel-banner__actions { display: flex; align-items: center; gap: 8px; }
/* Popover de compartir perfil (Instagram / X / Facebook / copiar URL) */
.share-profile { position: relative; display: inline-flex; }
.share-profile__pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  display: flex; gap: 0.5rem; padding: 0.55rem 0.65rem;
  background: #fff; border-radius: var(--radius-pill);
  border: 1px solid rgba(58, 0, 99, 0.12);
  box-shadow: 0 8px 28px rgba(20, 14, 30, 0.18);
}
.btn-icon { padding: 0; min-width: 0; width: 44px; height: 44px; flex-shrink: 0; }
.btn-icon.is-copied { color: #2e9e5b; border-color: #2e9e5b; }
.panel-banner__title { color: var(--c-head); font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
.panel-banner__sub { margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.875rem; color: var(--c-muted); }
.panel-card {
  background: var(--c-bg-deep); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 24px;
  box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.10);
}
.panel-card__title { color: var(--c-head); font-size: 1.25rem; font-weight: 700; margin-bottom: 0; display: flex; align-items: center; gap: 0.55rem; user-select: none; }
.panel-card__chevron { flex-shrink: 0; line-height: 0; color: var(--c-muted); margin-left: 0.4rem; transition: transform 250ms ease; }
.panel-card.is-open .panel-card__chevron { transform: rotate(180deg); }
.panel-card__body { margin-top: 1rem; }
/* Handle de arrastre en el título de la sección */
.panel-card__title .panel-card__handle {
  cursor: grab; touch-action: none; flex-shrink: 0;
  color: var(--c-muted); opacity: 0.4; line-height: 0; margin-right: 0.25rem;
}
.panel-card__title .panel-card__handle:hover { opacity: 0.85; }
/* Cards sin handle (Mi perfil, Redes): indent equivalente para alinear títulos */
.panel-card--no-handle .panel-card__title { padding-left: 1.5rem; }
/* Lista de publicaciones propias en el panel */
.my-posts-list { font-size: 0.9rem; color: var(--c-muted); }
.my-posts-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); }
.my-posts-row:last-child { border-bottom: none; }
.my-posts-row__title { flex: 1; color: var(--c-cream); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-posts-row__title:hover { color: var(--c-accent); }
.my-posts-row__badge { font-size: 0.72rem; color: var(--c-muted); flex-shrink: 0; }
.my-posts-row__stats { font-size: 0.75rem; color: var(--c-muted); flex-shrink: 0; white-space: nowrap; }
.my-posts-row__edit { color: var(--c-accent); font-size: 0.82rem; text-decoration: none; flex-shrink: 0; }
.my-posts-row__edit:hover { text-decoration: underline; }

#sections { display: flex; flex-direction: column; gap: 24px; }
.panel-card__sub { color: var(--c-muted); font-size: 0.85rem; margin: 0 0 1rem; line-height: 1.5; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
/* Evita que los hijos de la rejilla fuercen el ancho (desbordamiento de grid) */
.profile-grid > * { min-width: 0; }

/* ---- Selector de color de fondo del perfil público ---- */
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  border: 2px solid transparent; outline: 1.5px solid rgba(0,0,0,0.12);
  transition: outline 150ms, border 150ms, transform 100ms;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.is-selected { border-color: var(--c-accent); outline: 2.5px solid var(--c-accent); outline-offset: 2px; }
.color-swatch--custom {
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9); position: relative; overflow: hidden;
}
.color-swatch--custom input[type=color] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: none; padding: 0;
}

/* ---- Editor: estilo de los botones de enlaces ---- */
.link-style { margin-top: 0.4rem; padding-top: 0.9rem; border-top: 1px solid var(--border-subtle); }
.link-style__row { margin-bottom: 0.7rem; }
.link-style__lbl { display: block; font-size: 0.75rem; font-weight: 600; color: var(--c-accent); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.shape-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.shape-opt {
  padding: 0.4rem 0.85rem; font-size: 0.82rem; cursor: pointer;
  border: 1px solid var(--border-default); background: transparent; color: var(--c-cream);
  transition: border-color 150ms, background 150ms, color 150ms;
}
.shape-opt[data-shape=rounded] { border-radius: var(--radius-pill); }
.shape-opt[data-shape=soft]    { border-radius: var(--radius-md); }
.shape-opt[data-shape=square]  { border-radius: 2px; }
.shape-opt:hover { border-color: var(--c-accent); }
.shape-opt.is-on { background: var(--c-accent); border-color: var(--c-accent); color: var(--on-accent); }
.link-style__preview { margin-top: 0.3rem; }
.link-style__preview .profile-links { max-width: 280px; }

/* Formas de los botones del perfil público */
/* Forma de los botones (enlaces y "Comprar") — especificidad mayor que las
   variables por defecto de .profile-links / .books para que gane la elección */
.profile-links.links--rounded, .books.links--rounded { --lk-radius: 999px; }
.profile-links.links--soft,    .books.links--soft    { --lk-radius: 10px; }
.profile-links.links--square,  .books.links--square  { --lk-radius: 2px; }

/* ---- Fondo oscuro en el perfil público (cuando el autor elige un color oscuro) ---- */
.is-dark-bg .profile-name,
.is-dark-bg .profile-bio,
.is-dark-bg .profile-brand { color: rgba(255,255,255,0.85); opacity: 1; }
.is-dark-bg .profile-brand em { color: rgba(255,255,255,0.7); }
.is-dark-bg .profile-avatar--placeholder { color: rgba(255,255,255,0.8); }
/* En fondo oscuro, solo cambian los valores por defecto; si el autor
   define colores propios, sus variables (inline) ganan a estas. */
.is-dark-bg .profile-links {
  --lk-color: rgba(255,255,255,0.25);
  --lk-text: rgba(255,255,255,0.88);
  --lk-tint: rgba(255,255,255,0.08);
  --lk-hover-text: #fff;
}

.is-dark-bg .books__arrow,
.is-dark-bg .gallery__arrow { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.15); }
/* Forma de la tarjeta de libro */
.books.cards--rounded { --card-radius: 22px; }
.books.cards--soft    { --card-radius: 10px; }
.books.cards--square  { --card-radius: 4px; }
/* Tarjeta de libro sobre fondo oscuro: superficie translúcida y texto claro */
.is-dark-bg .book-card {
  --card-text: rgba(255, 255, 255, 0.95);
  --card-muted: rgba(255, 255, 255, 0.62);
  --card-border: rgba(255, 255, 255, 0.18);
}

.is-dark-bg .gallery__heading { color: rgba(255,255,255,0.92); }
.is-dark-bg .gallery__cap { color: rgba(255,255,255,0.6); }

/* ---- Spinner sencillo ---- */
.cmn-loading { opacity: 0.7; font-size: 0.9rem; padding: var(--space-md); }

/* ---- Panel admin: código de invitación ---- */
.invite-code {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  border: 1px dashed var(--c-accent);
  border-radius: var(--radius-sm);
  background: rgba(97, 95, 255, 0.06);
}
.invite-code__label { font-size: 0.85rem; opacity: 0.85; }
.invite-code__row { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0; }
.invite-code code, .adm-table code {
  font-family: ui-monospace, 'Courier New', monospace;
  letter-spacing: 2px;
  font-size: 1.1rem;
  color: var(--c-cream);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}
.adm-table code { font-size: 0.9rem; letter-spacing: 1px; }

/* ---- Tabla admin ---- */
/* En móvil las tablas son más anchas que la pantalla: scroll horizontal */
#invList, #userList, #postList { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.adm-table th, .adm-table td {
  text-align: left; padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}
.adm-table th { color: var(--c-accent); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 1px; }
.tag-used { color: #6b6f7d; }
.tag-pending { color: var(--c-accent); }
/* Paginación de las tablas del panel admin */
.adm-paginator {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; margin-top: 0.9rem;
}
.adm-pag-info { font-size: 0.8rem; color: var(--c-muted); }
.adm-pag-btn {
  background: none; border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  color: var(--c-cream); padding: 0.35rem 0.8rem; cursor: pointer;
  font-family: var(--font-body); font-size: 0.82rem; transition: border-color 150ms, background 150ms;
}
.adm-pag-btn:hover:not(:disabled) { border-color: var(--c-accent); background: rgba(97,95,255,0.08); }
.adm-pag-btn:disabled { opacity: 0.4; cursor: default; }

/* ---- Feed de publicaciones ---- */
.feed-search {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; max-width: 1000px;
  background: var(--c-bg-deep); border: 1px solid var(--border-default);
  border-radius: var(--radius-pill); padding: 0.5rem 1rem;
  margin-bottom: 0.75rem; color: var(--c-muted);
}
.feed-search input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font-body); font-size: 0.9rem; color: var(--c-cream);
}
.feed-search input::placeholder { color: var(--c-muted); }
.active-filter {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: var(--c-muted); margin-bottom: 0.75rem;
  width: 100%; max-width: 1000px;
}
.active-filter strong { color: var(--c-accent); }
#clearFilter {
  background: none; border: none; cursor: pointer; color: var(--c-muted);
  font-size: 1rem; line-height: 1; padding: 0 0.2rem; transition: color 150ms;
}
#clearFilter:hover { color: var(--c-cream); }
/* Barra de controles: tipo + selects */
.feed-controls { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: var(--space-md); width: 100%; max-width: 1000px; }
.feed-selects { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.feed-ctrl-select {
  padding: 0.38rem 0.9rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: transparent; color: var(--c-cream);
  font-family: var(--font-body); font-size: 0.85rem; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 0.85rem;
  padding-right: 2rem;
}
.feed-ctrl-select:focus { outline: none; border-color: var(--c-accent); }
.feed-ctrl-select option { background: var(--c-bg); color: var(--c-cream); }
.feed-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0; }
.feed-filters button {
  padding: 0.4rem 1rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: transparent; color: var(--c-cream);
  cursor: pointer; font-size: 0.85rem; transition: all 200ms;
}
.feed-filters button.is-active, .feed-filters button:hover { background: var(--c-accent); color: var(--on-accent); border-color: var(--c-accent); }
.feed-grid { width: 100%; max-width: 1040px; display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 0.9rem; }
@media (max-width: 520px) { .feed-grid { grid-template-columns: 1fr; } }
/* Paginador */
.paginator { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-top: var(--space-lg); flex-wrap: wrap; }
.pag-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-default);
  background: none; color: var(--c-cream); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; transition: border-color 150ms;
}
.pag-btn:hover:not(:disabled) { border-color: var(--c-accent); }
.pag-btn:disabled { opacity: 0.3; cursor: default; }
.pag-pages { display: flex; align-items: center; gap: 0.3rem; }
.pag-num {
  min-width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: none; color: var(--c-cream); cursor: pointer; font-size: 0.9rem;
  font-family: var(--font-body); transition: background 150ms, border-color 150ms;
}
.pag-num:hover { background: rgba(97,95,255,0.1); }
.pag-num.is-active { background: var(--c-accent); color: var(--on-accent); border-color: var(--c-accent); }
.pag-ellipsis { color: var(--c-muted); padding: 0 0.2rem; }
/* Tarjeta compacta horizontal (estilo WebNovel/Buenovela): portada chica a la
   izquierda + texto a la derecha, alto fijo y sinopsis recortada. */
.post-card {
  background: var(--c-bg-deep); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  overflow: hidden; display: flex; flex-direction: column; transition: transform 250ms, border-color 250ms;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--c-accent); }
.post-card a { color: inherit; display: flex; width: 100%; height: 150px; }
.post-card__cover { width: 100px; height: 100%; object-fit: cover; background: var(--c-bg); flex-shrink: 0; }
.post-card__body { padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.28rem; flex: 1; min-width: 0; overflow: hidden; }
.post-card__type {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--c-accent);
  align-self: flex-start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.post-card__title {
  font-family: var(--font-display); font-size: 1rem; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__excerpt {
  font-size: 0.8rem; opacity: 0.75; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__meta { font-size: 0.72rem; opacity: 0.6; margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Cards sin portada: el texto ocupa todo el ancho */
.post-card a:not(:has(.post-card__cover)) .post-card__body { padding-left: 1rem; }

/* ---- Perfil público (link-in-bio) ---- */
.profile-page { justify-content: flex-start; padding-top: var(--space-lg); }
/* Mobile (por defecto): una sola columna centrada */
.profile-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-aside { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0; }
.profile-main { width: 100%; margin-top: var(--space-md); }

/* Desktop: dos columnas (aside fijo a la izquierda + contenido a la derecha) */
@media (min-width: 900px) {
  .profile-card {
    max-width: 1120px;
    flex-direction: row;
    align-items: flex-start;
    gap: 56px;
    text-align: left;
  }
  .profile-aside {
    width: 300px; flex-shrink: 0;
    align-items: stretch; text-align: center;
    position: sticky; top: var(--space-lg);
  }
  .profile-main { margin-top: 0; flex: 1; min-width: 0; }
  .profile-main .profile-sections { margin-top: 0; gap: 56px; }
}
.profile-avatar {
  width: 116px; height: 116px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--c-accent);
  box-shadow: 0 0 26px rgba(97, 95, 255, 0.25);
  margin-bottom: var(--space-sm);
  margin-left: auto; margin-right: auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-bg-deep);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar--placeholder {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--c-accent);
}
.profile-name { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 0.3rem; }
.profile-bio { font-size: 0.95rem; opacity: 0.85; line-height: 1.6; margin-bottom: 0; max-width: 420px; }
.profile-sections { display: flex; flex-direction: column; gap: var(--space-md); width: 100%; margin-top: 0; }
/* Espaciado dentro del aside (perfil) */
.profile-aside .profile-social-row { margin-top: 0.75rem; }
.profile-aside .profile-links { margin-top: var(--space-md); }

/* Apóyame (PayPal / Patreon) */
.profile-apoyo {
  width: 100%; margin-top: var(--space-md);
  padding-top: var(--space-md); border-top: 1px solid var(--border-subtle);
}
.profile-apoyo__label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.4px;
  font-weight: 600; color: var(--c-muted); margin-bottom: 0.6rem; text-align: left;
}
.is-dark-bg .profile-apoyo__label { color: rgba(255,255,255,0.45); }
.profile-apoyo__btns { display: flex; flex-direction: column; gap: 0.6rem; }
.apoyo-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-radius: var(--lk-radius, 16px);
  border: 2px solid var(--lk-border, var(--lk-color, rgba(0,0,0,0.15)));
  background: var(--lk-color, rgba(0,0,0,0.08));
  color: var(--lk-hover-text, var(--c-cream));
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: opacity 200ms;
}
.apoyo-btn:hover { opacity: 0.88; }
.apoyo-btn__arrow { font-size: 1.1rem; opacity: 0.6; line-height: 1; }

/* Encabezado de libros (título + flechas) */
.books__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.books__heading { font-family: var(--font-display); font-size: 1.25rem; margin: 0; }
.is-dark-bg .books__heading { color: rgba(255,255,255,0.92); }
.profile-links {
  width: 100%; display: flex; flex-direction: column; gap: 0.7rem;
  /* Variables personalizables por el autor (con valores por defecto) */
  --lk-color: var(--c-accent);
  --lk-text: var(--c-cream);
  --lk-tint: rgba(97, 95, 255, 0.10);
  --lk-hover-text: var(--on-accent);
  --lk-radius: var(--radius-pill);
  --lk-border: var(--lk-color);   /* por defecto, el borde sigue al color del botón */
}
.profile-link {
  display: block;
  padding: 0.85rem 1rem;
  text-align: center;
  border-radius: var(--lk-radius);
  border: 2px solid var(--lk-border);
  background: var(--lk-color);
  color: var(--lk-hover-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: opacity 0.2s ease;
}
.profile-link:hover { opacity: 0.82; }
.profile-brand {
  display: block;
  width: 100%;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--c-cream);
  opacity: 0.7;
  text-decoration: none;
}
.profile-brand em { color: var(--c-accent); font-style: italic; margin-left: 0.25em; }
.profile-brand:hover { opacity: 1; }
.is-dark-bg .profile-brand { border-top-color: rgba(255,255,255,0.1); }

/* ---- Carrusel de libros (tarjetas) en el perfil público ---- */
.books {
  position: relative;
  width: 100%;
  /* El botón "Comprar" reutiliza la elección de botones de los enlaces */
  --lk-color: var(--c-accent);
  --lk-text: var(--c-cream);
  --lk-hover-text: var(--on-accent);
  --lk-radius: var(--radius-pill);
  --lk-border: var(--lk-color);
}
.is-dark-bg .books {
  --lk-color: rgba(255,255,255,0.25);
  --lk-text: rgba(255,255,255,0.88);
  --lk-hover-text: #fff;
}
.books__viewport {
  overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.books__viewport::-webkit-scrollbar { display: none; }
.books__track { display: flex; }
/* Cada libro: tarjeta con portada + título + descripción arriba, y un pie con
   precio y botón. La superficie se adapta al fondo (claro/oscuro) y el botón
   toma el color de acento del autor (--card-accent, se fija por JS). */
.book-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  padding: 1.25rem;
  background: var(--card-bg, var(--c-bg-deep));
  border: 1px solid var(--card-border, var(--border-subtle));
  border-radius: var(--card-radius, 22px);
  font-family: var(--font-body);
  text-align: left;
}
.book-card__top { display: flex; gap: 1.25rem; align-items: flex-start; }
.book-card__cover {
  flex-shrink: 0;
  width: 116px; height: 164px;
  object-fit: cover; border-radius: 14px;
  background: var(--c-bg);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.book-card__info { flex: 1; min-width: 0; }
.book-card__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.45rem; line-height: 1.15; color: var(--card-text, var(--c-cream));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card__desc {
  margin-top: 0.45rem; font-size: 0.92rem; line-height: 1.5;
  color: var(--card-muted, var(--c-muted));
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card__bottom {
  margin-top: 1.3rem; padding-top: 1.25rem;
  border-top: 1px solid var(--card-border, var(--border-subtle));
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.book-card__price {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  color: var(--card-text, var(--c-cream)); white-space: nowrap;
}
/* Mismo estilo que los botones de enlaces: contorno que se rellena al pasar
   el botón de compra usa el mismo color sólido que los botones de enlace (--lk-*). */
.book-card__buy {
  flex-shrink: 0; display: inline-block; text-align: center;
  padding: 0.7rem 1.7rem;
  border-radius: var(--lk-radius);
  border: 2px solid var(--lk-border);
  background: var(--lk-color);
  color: var(--lk-hover-text);
  font-weight: 700; font-size: 0.92rem; text-decoration: none;
  transition: opacity 0.2s ease;
}
.book-card__buy:hover { opacity: 0.82; }
.book-card__bottom--buy-only .book-card__buy { flex: 1; }
/* Controles de libros: junto al título "Mis libros" */
.books__controls { display: flex; align-items: center; gap: 0.4rem; }
.books__arrow {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--c-bg-deep);
  color: var(--c-cream);
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
  transition: background 200ms, opacity 200ms;
}
.books__arrow:hover:not(:disabled) { background: rgba(97,95,255,0.1); }
.books__arrow:disabled { opacity: 0.25; cursor: default; }

/* Peek del siguiente libro solo en pantallas muy pequeñas (< ancho del profile-card) */
@media (max-width: 479px) {
  .books__track { gap: 12px; }
  .book-card { flex: 0 0 85%; }
  .books--single .book-card { flex: 0 0 100%; }
  .books--single .books__track { justify-content: center; }
}
@media (max-width: 420px) {
  .book-card { padding: 1rem; border-radius: var(--card-radius, 18px); }
  .book-card__top { gap: 0.9rem; }
  .book-card__cover { width: 96px; height: 138px; }
  .book-card__title { font-size: 1.1rem; }
  .book-card__price { font-size: 1.2rem; }
  .book-card__buy { padding: 0.6rem 1.3rem; }
}
@media (max-width: 360px) {
  .book-card { padding: 0.85rem; }
  .book-card__cover { width: 78px; height: 112px; }
  .book-card__title { font-size: 1rem; }
  .book-card__price { font-size: 1.1rem; }
}
@media (max-width: 599px) {
  .books__controls { display: none; }
}

/* ---- Galería de arte (perfil público) ---- */
.gallery { width: 100%; }
.gallery__heading { font-family: var(--font-display); font-size: 1.25rem; text-align: center; margin-bottom: var(--space-sm); }
.gallery__viewport {
  overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.gallery__viewport::-webkit-scrollbar { display: none; }
.gallery__track { display: flex; gap: 0.6rem; }
/* Mobile: 43% = 2 items + ~14% del tercero como peek */
.gallery__item { flex: 0 0 calc(43% - 0.3rem); scroll-snap-align: start; cursor: zoom-in; position: relative; overflow: hidden; border-radius: var(--gallery-radius, 10px); }
@media (min-width: 560px) { .gallery__item { flex: 0 0 calc(33.333% - 0.4rem); } }
.gallery__item img {
  width: 100%; display: block; border-radius: var(--gallery-radius, 10px);
  aspect-ratio: 3/4; object-fit: cover;
  background: var(--c-bg-deep);
  transition: transform 200ms ease;
}
/* Forma de las imágenes de galería */
.gallery.gallery--rounded { --gallery-radius: 10px; }
.gallery.gallery--soft    { --gallery-radius: 4px; }
.gallery.gallery--square  { --gallery-radius: 0px; }
.gallery__item img:hover { transform: scale(1.03); }
.gallery__cap {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.5rem 0.6rem 0.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
  font-size: 0.78rem; color: #fff; text-align: center;
  border-radius: 0 0 var(--gallery-radius, 10px) var(--gallery-radius, 10px);
}
/* Imágenes marcadas +18: cubiertas con blur hasta que se revelan */
.gallery__item--nsfw img { filter: blur(22px) brightness(0.7); cursor: default; transform: none !important; }
.gallery__item--nsfw .gallery__cap { opacity: 0; pointer-events: none; }
.gallery__nsfw-reveal {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  width: 100%; height: 100%; border: 0; background: rgba(0,0,0,0.25);
  color: #fff; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
  cursor: pointer;
}
.gallery__nsfw-reveal:hover { background: rgba(0,0,0,0.4); }
/* Header de galería: título a la izquierda, flechas a la derecha */
.gallery__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.gallery__heading { margin-bottom: 0; }
.gallery__controls { display: flex; align-items: center; gap: 0.4rem; }
@media (max-width: 599px) { .gallery__controls { display: none; } }
.gallery__arrow {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--c-bg-deep);
  color: var(--c-cream);
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
  transition: background 200ms, opacity 200ms;
}
.gallery__arrow:hover:not(:disabled) { background: rgba(97,95,255,0.1); }
.gallery__arrow:disabled { opacity: 0.25; cursor: default; }

/* Lightbox: ver una obra en grande */
.lightbox {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(10, 8, 20, 0.9);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius-sm); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }

/* Botón flotante solo para el dueño: volver a su panel desde su perfil público */
.owner-return {
  position: fixed; top: 16px; left: 16px; z-index: 400;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.95rem; border-radius: var(--radius-pill);
  background: #fff; color: #1a1a1a; font-size: 0.85rem; font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.owner-return:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.26); }
.owner-return[hidden] { display: none; }

/* ---- Wizard de "Nueva publicación" (pasos) ---- */
.wizard-steps {
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  color: var(--c-muted);
  margin-bottom: var(--space-sm);
}
.wizard-steps__num {
  color: var(--c-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.word-count {
  text-align: right;
  font-size: 0.82rem;
  color: var(--c-muted);
  margin: 0.5rem 0 0.9rem;
}
.word-count.is-near { color: var(--c-accent); }
.word-count.is-over { color: #b3294e; font-weight: 600; }

/* ---- Editor de enlaces (en Mi cuenta) ---- */
.link-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.link-row input { flex: 1; min-width: 0; }
.link-row .link-label-input { flex: 0 0 140px; max-width: 140px; }
.link-row button {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--c-accent); color: var(--c-accent);
  border-radius: 6px; cursor: pointer; font-size: 1rem; line-height: 1;
  transition: background 150ms;
}
.link-row button:hover { background: rgba(97, 95, 255, 0.08); }
/* Manojo para arrastrar y reordenar (estilo Linktree) */
.link-row__handle {
  flex-shrink: 0; align-self: stretch; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; color: var(--c-muted); cursor: grab;
  border-radius: 6px; user-select: none; touch-action: none;
}
.link-row__handle:hover { color: var(--c-accent); background: rgba(97, 95, 255, 0.08); }
.link-row__handle:active { cursor: grabbing; }
.link-row.dragging { opacity: 0.55; background: rgba(97, 95, 255, 0.06); border-radius: var(--radius-sm); }
.link-row__icon {
  flex-shrink: 0; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--c-muted); line-height: 0;
}
.link-row__icon svg { width: 18px; height: 18px; }
.avatar-edit { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
/* Editor de bio: toolbar integrada sobre el textarea */
.bio-editor {
  border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden;
  transition: border-color 200ms, box-shadow 200ms;
}
.bio-editor:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(97,95,255,0.12); }
.bio-format-bar {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border-default);
  background: rgba(0,0,0,0.025);
}
.bio-editor textarea {
  display: block; width: 100%; min-height: 80px;
  border: none !important; border-radius: 0 !important;
  outline: none !important; box-shadow: none !important;
  resize: vertical; background: #fff; color: #000;
  font-family: var(--font-body); font-size: 0.9rem;
  padding: 0.6rem 0.75rem; line-height: 1.6;
}
.bio-fmt-btn {
  padding: 0.22rem 0.55rem; border-radius: 5px; border: 1px solid transparent;
  background: none; color: var(--c-muted); cursor: pointer; font-size: 0.9rem; line-height: 1;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.bio-fmt-btn:hover { background: rgba(97,95,255,0.1); color: var(--c-cream); }
.bio-fmt-btn.is-on { background: rgba(97,95,255,0.15); border-color: var(--c-accent); color: var(--c-cream); }
/* Grupo de botones de tipografía/tamaño (reemplaza los selects) */
.bio-fmt-group {
  display: flex; gap: 0;
  border: 1px solid var(--border-default); border-radius: 5px; overflow: hidden;
}
.bio-fmt-group .bio-fmt-btn { border-radius: 0; border: none; border-right: 1px solid var(--border-default); min-width: 26px; }
.bio-fmt-group .bio-fmt-btn:last-child { border-right: none; }
/* Selector de tipo de fondo (Color / Degradado / Imagen) */
.bg-type-selector { display: flex; gap: 1.3rem; margin-top: 0.65rem; margin-bottom: 0; }
.bg-type-opt {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 0.78rem; color: var(--c-muted); font-family: var(--font-body);
  transition: color 150ms;
}
.bg-type-opt.is-active { color: var(--c-head); font-weight: 600; }
.bg-type-circle {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--border-default); overflow: hidden;
  transition: border-color 150ms, box-shadow 150ms;
  background: var(--c-bg-deep);
}
.bg-type-opt.is-active .bg-type-circle {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(97, 95, 255, 0.18);
}
.bg-type-circle--img {
  display: flex; align-items: center; justify-content: center;
  color: var(--c-muted); background-size: cover; background-position: center;
}
.bg-type-panel { margin-top: 0.8rem; }

/* Preview de imagen de fondo */
.bg-img-preview {
  position: relative; width: 100%; height: 90px;
  border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.5rem;
  border: 1px solid var(--border-default);
}
.bg-img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-img-remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.65); color: #fff; border: none; border-radius: 6px;
  padding: 0.25rem 0.6rem; font-size: 0.78rem; cursor: pointer;
  transition: background 150ms;
}
.bg-img-remove:hover { background: rgba(0,0,0,0.85); }
.avatar-edit__preview {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border-default); background: var(--c-bg-deep);
  display: flex; align-items: center; justify-content: center; color: var(--c-accent); font-family: var(--font-display); font-size: 1.6rem;
}
.avatar-edit__preview img { width: 100%; height: 100%; object-fit: cover; }
.username-row { display: flex; align-items: center; gap: 0.3rem; }
.username-row .prefix { opacity: 0.6; font-size: 0.9rem; white-space: nowrap; }

/* ---- Editor de libros (en Mi cuenta) ---- */
.book-row {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.7rem; margin-bottom: 0.6rem;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: rgba(97, 95, 255, 0.03);
}
.book-row__cover {
  flex-shrink: 0; width: 64px; height: 92px; border-radius: 6px; overflow: hidden;
  border: 1px dashed var(--border-default); background: var(--c-bg-deep);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 0.68rem; color: var(--c-accent); text-align: center;
}
.book-row__cover img { width: 100%; height: 100%; object-fit: cover; }
.book-row__fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.book-row__fields input { width: 100%; }
.book-remove {
  flex-shrink: 0; background: none; border: 1px solid var(--c-accent); color: var(--c-accent);
  border-radius: 6px; padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.95rem; line-height: 1;
  transition: background 150ms;
}
.book-remove:hover { background: rgba(97, 95, 255, 0.08); }

/* ---- Editor de galería (en Mi cuenta) ---- */
.art-row {
  display: flex; gap: 0.7rem; align-items: center;
  padding: 0.7rem; margin-bottom: 0.6rem;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: rgba(97, 95, 255, 0.03);
}
.art-row__thumb {
  flex-shrink: 0; width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px dashed var(--border-default); background: var(--c-bg-deep);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 0.68rem; color: var(--c-accent); text-align: center;
}
.art-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-row .art-title { flex: 1; min-width: 0; }
.art-nsfw-toggle {
  flex-shrink: 0; display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 600; color: var(--c-muted);
  cursor: pointer; user-select: none;
}
.art-nsfw-toggle input { accent-color: var(--c-accent); cursor: pointer; }
.art-nsfw-toggle:has(input:checked) { color: var(--c-accent); }
.art-remove {
  flex-shrink: 0; background: none; border: 1px solid var(--c-accent); color: var(--c-accent);
  border-radius: 6px; padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.95rem; line-height: 1;
  transition: background 150ms;
}
.art-remove:hover { background: rgba(97, 95, 255, 0.08); }

/* ---- Botón de dictado por voz ---- */
.content-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 0.45rem;
}
.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-accent);
  background: rgba(97, 95, 255, 0.08);
  color: var(--c-accent);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms, color 180ms, border-color 180ms;
}
.voice-btn:hover { background: var(--c-accent); color: var(--on-accent); }
.voice-btn__icon { flex-shrink: 0; }
/* Estado grabando: rojo suave pulsante */
.voice-btn.is-recording {
  border-color: #c2415a;
  background: rgba(224, 96, 127, 0.16);
  color: #a3243f;
  animation: voice-pulse 1.4s ease-in-out infinite;
}
.voice-btn.is-recording:hover { background: rgba(224, 96, 127, 0.34); color: #7d1a30; }
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 96, 127, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(224, 96, 127, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .voice-btn.is-recording { animation: none; }
}

/* ---- Etiquetas: selector (editor) y visualización ---- */
.tag-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-pick {
  padding: 0.32rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--c-cream);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms, opacity 150ms;
}
.tag-pick:hover { border-color: var(--c-accent); }
.tag-pick.is-on {
  background: var(--c-accent);
  color: var(--on-accent);
  border-color: var(--c-accent);
}
.tag-pick:disabled { opacity: 0.35; cursor: not-allowed; }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.post-tag {
  font-size: 0.7rem; letter-spacing: 0.5px;
  padding: 0.14rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  color: var(--c-accent);
}
.post-tag--link {
  cursor: pointer; background: none; text-decoration: none;
  transition: background 150ms, border-color 150ms;
}
.post-tag--link:hover { background: var(--c-accent); color: var(--on-accent); border-color: var(--c-accent); }

/* Reseñas: badge con el autor del libro reseñado (si está inscrito) */
.post-reviewed-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-bottom: var(--space-sm);
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--c-cream);
  text-decoration: none;
  transition: border-color 150ms, background 150ms;
}
.post-reviewed-badge:hover { border-color: var(--c-accent); background: rgba(97, 95, 255, 0.08); }
.post-reviewed-badge strong { color: var(--c-accent); }

/* Tags fuera del <a> de la card */
.post-card__tags { padding: 0.5rem var(--space-sm) var(--space-sm); }

/* ---- Lectura de una publicación ---- */
.post-breadcrumb {
  display: flex; align-items: center; gap: 0.3rem;
  width: 100%; max-width: 720px;
  margin-bottom: var(--space-sm);
  font-size: 0.85rem; font-weight: 600; color: var(--c-accent);
  text-decoration: none;
}
.post-breadcrumb:hover { text-decoration: underline; }
.post-read { width: 100%; max-width: 720px; }
.post-read__type { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--c-accent); }
.post-read__title { font-family: var(--font-display); font-size: 2.2rem; line-height: 1.15; margin: 0.3rem 0 0.5rem; }
.post-read__cover { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius-md); margin-bottom: var(--space-md); }
/* ---- Subida de portada en el editor de publicaciones ---- */
.cover-preview-wrap { position: relative; width: 100%; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.5rem; }
.cover-preview-wrap img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.cover-remove-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.65); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 0.28rem 0.7rem;
  font-size: 0.8rem; cursor: pointer; font-family: var(--font-body);
  transition: background 150ms;
}
.cover-remove-btn:hover { background: rgba(0,0,0,0.88); }
.cover-upload-area {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 1.25rem; box-sizing: border-box;
  border: 1.5px dashed var(--border-default); border-radius: var(--radius-md);
  cursor: pointer; color: var(--c-muted); font-size: 0.9rem; font-family: var(--font-body);
  transition: border-color 150ms, color 150ms;
}
.cover-upload-area:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* Barra de autor + compartir */
.post-author-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: var(--space-md);
}
.post-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.post-share-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: none; border: 1px solid var(--border-default);
  cursor: pointer; color: var(--c-muted); line-height: 0;
  transition: border-color 150ms, color 150ms;
}
.post-share-icon:hover { border-color: var(--c-accent); color: var(--c-cream); }
.post-theme-btn { line-height: 0; }

/* Reacción ❤ al final de la publicación */
.post-reaccion { display: flex; justify-content: center; margin-top: var(--space-md); }
.like-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.2rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: var(--c-bg-deep);
  color: var(--c-cream); cursor: pointer;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  transition: border-color 150ms, transform 120ms;
}
.like-btn svg { color: #e0245e; transition: fill 150ms; fill: none; }
.like-btn:hover { border-color: #e0245e; }
.like-btn:active { transform: scale(0.94); }
.like-btn.is-liked svg { fill: #e0245e; stroke: #e0245e; }
.post-author {
  display: flex; align-items: center; gap: 0.65rem;
  text-decoration: none; color: inherit; flex: 1; min-width: 0;
}
.post-author:hover .post-author__name { text-decoration: underline; }
.post-author__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: var(--c-bg-deep);
  border: 1.5px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1rem; color: var(--c-accent);
}
.post-author__avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author__info { display: flex; flex-direction: column; line-height: 1.3; }
.post-author__name { font-weight: 600; font-size: 0.9rem; }
.post-author__date { font-size: 0.78rem; opacity: 0.65; }
/* Más publicaciones */
.more-posts { width: 100%; max-width: 720px; margin-top: var(--space-xl, 3rem); }
.more-posts__heading { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 1rem; }
.more-posts__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
@media (max-width: 560px) { .more-posts__grid { grid-template-columns: 1fr; } }
.more-post-card {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1rem; border-radius: 12px; text-decoration: none;
  background: var(--c-bg-deep); border: 1px solid var(--border-subtle);
  transition: border-color 200ms;
}
.more-post-card:hover { border-color: var(--c-accent); }
.more-post-card__title { font-family: var(--font-display); font-size: 0.95rem; color: var(--c-cream); line-height: 1.3; }
.more-post-card__meta { font-size: 0.78rem; color: var(--c-muted); margin-top: 0.2rem; }
/* Cuerpo de lectura en serif (Literata, cargada solo en leer.html):
   más cómoda para textos largos que la Montserrat de la interfaz. */
.post-body { font-family: 'Literata', Georgia, 'Times New Roman', serif; line-height: 1.85; font-size: 1.1rem; }
.post-body p, .post-body li { text-indent: 0 !important; margin-left: 0 !important; padding-left: 0 !important; }
/* ---- Página de obra (novela por capítulos) ---- */
.obra { width: 100%; max-width: 760px; }
.obra__head { display: flex; gap: 1.5rem; align-items: flex-start; }
.obra__cover {
  width: 140px; height: 200px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
  background: var(--c-bg-deep); border: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 3rem; color: var(--c-accent);
  box-shadow: 0 8px 24px rgba(20, 14, 30, 0.15);
}
.obra__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.obra__info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.obra__estado {
  font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700;
  padding: 0.2rem 0.7rem; border-radius: var(--radius-pill);
  background: rgba(97, 95, 255, 0.12); color: var(--c-accent);
}
.obra__estado--completa { background: rgba(16, 185, 129, 0.14); color: #0b8a5c; }
.obra__estado--clasico { background: rgba(191, 150, 46, 0.16); color: #8a6a1a; }
html.lectura-oscura .obra__estado--clasico { color: #dfc07a; }
.obra__title { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; color: var(--c-head); }
.obra__autor { font-size: 0.92rem; font-weight: 600; color: var(--c-cream); text-decoration: none; }
.obra__autor:hover { text-decoration: underline; }
.obra__stats { font-size: 0.82rem; color: var(--c-muted); }
.obra__cta { margin-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.obra__save-btn--saved { color: var(--c-accent); border-color: var(--c-accent); }
.obra__sinopsis { margin-top: var(--space-md); font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; }
.obra__toc { margin-top: var(--space-md); }
.obra__toc-heading { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.9rem; }
.obra__toc-empty { color: var(--c-muted); font-size: 0.9rem; }
.obra__toc-list { display: flex; flex-direction: column; gap: 0.45rem; }
.obra__toc-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.9rem; border-radius: 10px; text-decoration: none; color: inherit;
  background: var(--c-bg-deep); border: 1px solid var(--border-subtle);
  transition: border-color 150ms;
}
.obra__toc-item:hover { border-color: var(--c-accent); }
.obra__toc-num {
  flex-shrink: 0; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(97, 95, 255, 0.1); color: var(--c-accent);
  font-size: 0.82rem; font-weight: 700;
}
.obra__toc-title { flex: 1; min-width: 0; font-size: 0.92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obra__toc-title em { font-style: normal; font-weight: 400; color: var(--c-muted); }
.obra__toc-date { flex-shrink: 0; font-size: 0.78rem; color: var(--c-muted); }
@media (max-width: 560px) {
  .obra__head { gap: 1rem; }
  .obra__cover { width: 105px; height: 150px; font-size: 2.2rem; }
  .obra__toc-date { display: none; }
}

/* Navegación entre capítulos al pie del lector */
.chapter-nav {
  width: 100%; margin-top: var(--space-md);
  display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap;
}
.chapter-nav__btn {
  padding: 0.55rem 1.1rem; min-width: 0; font-size: 0.88rem;
  transition: filter 180ms, transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms;
}
.chapter-nav__btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(97, 95, 255, 0.18); }
.chapter-nav__btn:active { transform: translateY(0); transition-duration: 80ms; }

/* Tarjeta de novela en la Biblioteca: agrupa la obra completa */
.obra-card { position: relative; overflow: hidden; }
.obra-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-accent); z-index: 1;
  transform: scaleX(0); transform-origin: left;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}
.obra-card:hover::before { transform: scaleX(1); }
.obra-card .post-card__cover { transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1); }
.obra-card:hover .post-card__cover { transform: scale(1.04); }
.obra-card__chip {
  display: inline-flex; align-self: flex-start; align-items: center;
  padding: 0.18rem 0.6rem; border-radius: var(--radius-pill);
  background: var(--grad-accent); color: #fff !important;
  font-weight: 700;
}
/* Obras clásicas de dominio público (Biblioteca Clásica): chip dorado */
.obra-card__chip--clasico { background: linear-gradient(135deg, #8a6a1a, #bf962e); }
/* Las portadas clásicas son portadillas escaneadas: el título vive arriba */
.obra-card--clasico .post-card__cover { object-position: center top; }

/* "Mi biblioteca": progreso de lectura estilo Wattpad (la card lleva a donde quedaste) */
.obra-card--lib .post-card__meta { margin-top: 0.15rem; }
.obra-progress { margin-top: auto; display: flex; flex-direction: column; gap: 5px; }
.obra-progress__track {
  height: 5px; border-radius: 999px; overflow: hidden;
  background: rgba(0, 0, 0, 0.10);
}
.obra-progress__fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--grad-accent);
}
.obra-progress__label { font-size: 0.7rem; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Editor "Mis novelas" del panel: portada + estado editables al instante */
.obra-row {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border-subtle);
}
.obra-row:last-child { border-bottom: none; }
.obra-row__cover {
  position: relative; width: 56px; height: 78px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden; cursor: pointer;
  border: 1px dashed var(--border-default);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 180ms, box-shadow 220ms;
}
.obra-row__cover:hover { border-color: var(--c-accent); box-shadow: 0 4px 12px rgba(97, 95, 255, 0.18); }
.obra-row__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.obra-cover-ph { font-size: 0.62rem; color: var(--c-muted); text-align: center; line-height: 1.3; padding: 0 4px; }
.obra-row__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.obra-row__title { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obra-row__meta { font-size: 0.78rem; color: var(--c-muted); }
.obra-row__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.obra-row__btn { padding: 0.35rem 0.8rem; min-width: 0; font-size: 0.8rem; }
@media (max-width: 560px) {
  .obra-row { flex-wrap: wrap; }
  .obra-row__actions { width: 100%; justify-content: flex-start; }
}

/* Lista compacta de novelas en el perfil del autor.
   Igual que .book-card: la superficie sigue --card-bg (deriva del fondo
   del perfil) y el texto usa --card-text/--card-muted/--card-border,
   que .is-dark-bg redefine — así respeta el tema que eligió el autor. */
.obra-mini-list { display: flex; flex-direction: column; gap: 0.55rem; }
.obra-mini {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.6rem 0.8rem; border-radius: 12px; text-decoration: none;
  color: var(--card-text, var(--c-cream));
  background: var(--card-bg, var(--c-bg-deep));
  border: 1px solid var(--card-border, var(--border-subtle));
  transition: border-color 180ms, transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms;
}
.obra-mini:hover {
  border-color: var(--c-accent);
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(20, 14, 30, 0.10);
}
.obra-mini__cover {
  width: 44px; height: 62px; flex-shrink: 0; border-radius: 6px; overflow: hidden;
  box-shadow: 0 3px 8px rgba(20, 14, 30, 0.18);
}
.obra-mini__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.obra-mini__cover--ph {
  display: flex; align-items: center; justify-content: center;
  background: rgba(97, 95, 255, 0.12); color: var(--c-accent);
  font-family: var(--font-display); font-size: 1.3rem; font-style: italic;
}
.obra-mini__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.obra-mini__title {
  font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--card-text, var(--c-cream));
}
.obra-mini__meta { font-size: 0.78rem; color: var(--card-muted, var(--c-muted)); }
.obra-mini__arrow {
  flex-shrink: 0; font-size: 1.2rem; color: var(--card-muted, var(--c-muted));
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms;
}
.obra-mini:hover .obra-mini__arrow { transform: translateX(3px); color: var(--c-accent); }
/* Sobre fondo oscuro: superficie translúcida y texto claro (mismo patrón que .book-card) */
.is-dark-bg .obra-mini {
  --card-text: rgba(255, 255, 255, 0.95);
  --card-muted: rgba(255, 255, 255, 0.62);
  --card-border: rgba(255, 255, 255, 0.18);
}

/* ---- Top de la semana (ranking de votos, comunidad/novelas.html) ---- */
.ranking { width: 100%; max-width: 1000px; margin-bottom: var(--space-lg); }
.ranking__heading { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.9rem; }
.ranking__list { display: flex; flex-direction: column; gap: 0.5rem; }
.ranking-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.55rem 0.8rem; border-radius: 12px;
  background: var(--c-bg); border: 1px solid var(--c-border);
}
.ranking-item__pos {
  flex-shrink: 0; width: 1.6rem; text-align: center;
  font-family: var(--font-display); font-size: 1.05rem; color: var(--c-muted);
}
.ranking-item:nth-child(1) .ranking-item__pos,
.ranking-item:nth-child(2) .ranking-item__pos,
.ranking-item:nth-child(3) .ranking-item__pos { color: var(--c-accent); }
.ranking-item__cover {
  width: 40px; height: 56px; flex-shrink: 0; border-radius: 6px; overflow: hidden;
  box-shadow: 0 3px 8px rgba(20, 14, 30, 0.14);
}
.ranking-item__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ranking-item__cover--ph {
  display: flex; align-items: center; justify-content: center;
  background: rgba(97, 95, 255, 0.12); color: var(--c-accent);
  font-family: var(--font-display); font-size: 1.15rem; font-style: italic;
}
.ranking-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; text-decoration: none; }
.ranking-item__title {
  font-weight: 700; font-size: 0.92rem; color: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ranking-item__meta { font-size: 0.76rem; color: var(--c-muted); }
.ranking-item__vote {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  padding: 0.35rem 0.7rem; border-radius: var(--radius-pill);
  border: 1px solid var(--c-border); background: transparent; color: var(--c-muted);
  cursor: pointer; transition: border-color 150ms, color 150ms, background 150ms;
}
.ranking-item__vote:hover:not(:disabled) { border-color: var(--c-accent); color: var(--c-accent); }
.ranking-item__vote:disabled { opacity: 0.45; cursor: not-allowed; }
.ranking-item__vote.is-voted { border-color: var(--c-accent); color: var(--c-accent); background: rgba(97, 95, 255, 0.1); }
.ranking-item__vote-count { font-size: 0.78rem; font-weight: 600; }

/* Micro-interacciones de la tabla de contenidos: entrada escalonada +
   desplazamiento y número que se enciende al pasar el cursor */
@keyframes obraTocIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.obra__toc-item { animation: obraTocIn 380ms cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.obra__toc-item:nth-child(1)  { animation-delay: 30ms; }
.obra__toc-item:nth-child(2)  { animation-delay: 60ms; }
.obra__toc-item:nth-child(3)  { animation-delay: 90ms; }
.obra__toc-item:nth-child(4)  { animation-delay: 120ms; }
.obra__toc-item:nth-child(5)  { animation-delay: 150ms; }
.obra__toc-item:nth-child(6)  { animation-delay: 180ms; }
.obra__toc-item:nth-child(7)  { animation-delay: 210ms; }
.obra__toc-item:nth-child(8)  { animation-delay: 240ms; }
.obra__toc-item:nth-child(n+9) { animation-delay: 270ms; }
.obra__toc-item {
  transition: border-color 180ms, transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms;
}
.obra__toc-item:hover { transform: translateX(4px); box-shadow: 0 6px 18px rgba(20, 14, 30, 0.08); }
.obra__toc-num { transition: background 200ms, color 200ms, transform 260ms cubic-bezier(0.16, 1, 0.3, 1); }
.obra__toc-item:hover .obra__toc-num { background: var(--c-accent); color: #fff; transform: scale(1.08); }
.obra__cta .btn-cmn { transition: filter 180ms, transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms; }
.obra__cta .btn-cmn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(97, 95, 255, 0.28); }

@media (prefers-reduced-motion: reduce) {
  .obra__toc-item { animation: none; }
  .obra__toc-item:hover, .obra-mini:hover, .chapter-nav__btn:hover,
  .obra__cta .btn-cmn:hover, .obra-card:hover .post-card__cover,
  .obra__toc-item:hover .obra__toc-num, .obra-mini:hover .obra-mini__arrow { transform: none; }
}

/* Onboarding del panel: foco + tarjeta guiada (solo primera visita) */
.onb-overlay { position: fixed; inset: 0; z-index: 700; }
.onb-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(20, 14, 30, 0.62), 0 0 0 2px var(--c-accent);
  transition: left 250ms ease, top 250ms ease, width 250ms ease, height 250ms ease;
}
/* Sin foco (pasos de bienvenida/cierre): la propia tarjeta oscurece el fondo */
.onb-overlay:has(.onb-spot[hidden]) { background: rgba(20, 14, 30, 0.62); }
.onb-tip {
  position: fixed; z-index: 701;
  width: min(340px, calc(100vw - 32px));
  background: #fff; border-radius: 16px; padding: 1.1rem 1.2rem;
  border: 1px solid rgba(58, 0, 99, 0.12);
  box-shadow: 0 16px 48px rgba(20, 14, 30, 0.35);
}
.onb-tip__title { font-weight: 700; font-size: 1rem; color: var(--c-head); margin-bottom: 0.35rem; }
.onb-tip__text { font-size: 0.88rem; line-height: 1.55; color: #1a1a1a; }
.onb-tip__dots { display: flex; gap: 5px; margin: 0.8rem 0 0.6rem; }
.onb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(97, 95, 255, 0.25); transition: background 200ms, transform 200ms;
}
.onb-dot.is-active { background: var(--c-accent); transform: scale(1.25); }
.onb-tip__actions { display: flex; align-items: center; gap: 0.5rem; }
.onb-btn { padding: 0.45rem 0.95rem; min-width: 0; font-size: 0.85rem; }
.onb-skip {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--c-muted); font-family: var(--font-body); font-size: 0.82rem;
  text-decoration: underline;
}
.onb-skip:hover { color: #1a1a1a; }

/* Comentarios (en prueba: solo el admin puede publicar) */
.post-comments { width: 100%; max-width: 720px; margin-top: var(--space-lg); }
.post-comments__heading { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 1rem; }
.post-comments__empty { color: var(--c-muted); font-size: 0.9rem; }
.post-comments__list { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.2rem; }
.post-comments__more { display: flex; margin: 0 auto 1.2rem; padding: 0.5rem 1.1rem; min-width: 0; font-size: 0.85rem; }
.post-comment {
  padding: 0.9rem 1rem; border-radius: 12px;
  background: var(--c-bg-deep); border: 1px solid var(--border-subtle);
}
.post-comment__head { display: flex; align-items: center; flex-wrap: wrap; }
.post-comment__author { font-weight: 600; font-size: 0.88rem; color: inherit; text-decoration: none; }
a.post-comment__author:hover { text-decoration: underline; }
.post-comment__date { font-size: 0.78rem; color: var(--c-muted); margin-left: 0.5rem; }
.post-comment__body { margin-top: 0.35rem; font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; }
.post-comment__actions { display: flex; gap: 0.3rem; margin-left: auto; }
.post-comment__action {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: none; border: 1px solid var(--border-default);
  cursor: pointer; color: var(--c-muted); line-height: 0;
  transition: border-color 150ms, color 150ms;
}
.post-comment__action:hover { border-color: var(--c-accent); color: var(--c-cream); }
.post-comment-edit { margin-top: 0.35rem; display: flex; flex-direction: column; gap: 0.5rem; }
.post-comment-edit__input {
  width: 100%; min-height: 70px; padding: 0.6rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--border-default); background: var(--c-bg-deep); color: var(--c-cream);
  font-family: var(--font-body); font-size: 0.9rem; resize: vertical;
}
.post-comment-edit__actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.post-comment-edit__btn { padding: 0.4rem 0.9rem; min-width: 0; }
.post-comment-thread + .post-comment-thread { margin-top: 0.9rem; }
.post-comment__replies { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.7rem 0 0 1.6rem; }
.post-comment--reply { border-color: transparent; background: rgba(255,255,255,0.03); }
.post-comment__foot { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.55rem; }
.post-comment__like {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--c-muted); font-family: var(--font-body); font-size: 0.8rem;
  transition: color 150ms;
}
.post-comment__like svg { transition: fill 150ms; }
.post-comment__like:hover { color: var(--c-cream); }
.post-comment__like.is-liked { color: #e0245e; }
.post-comment__like.is-liked svg { fill: #e0245e; stroke: #e0245e; }
.post-comment__reply-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--c-muted); font-family: var(--font-body); font-size: 0.8rem; font-weight: 600;
  transition: color 150ms;
}
.post-comment__reply-toggle:hover { color: var(--c-accent); }
.post-comment-reply-form { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.post-comment-form { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.post-comment-form textarea {
  width: 100%; min-height: 90px; padding: 0.7rem 0.9rem; border-radius: 10px;
  border: 1px solid var(--border-default); background: var(--c-bg-deep); color: var(--c-cream);
  font-family: var(--font-body); font-size: 0.92rem; resize: vertical;
}

/* Botones de apoyo (PayPal / Patreon) en página de publicación */
.support-section { width: 100%; max-width: 720px; margin: var(--space-lg) 0 0; }
.support-section__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--c-muted); margin-bottom: 0.6rem; }
.support-section__btns { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.support-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1.1rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.9rem; text-decoration: none;
  font-family: var(--font-body); transition: opacity 200ms;
  border: 2px solid transparent; min-width: 170px;
}
.support-btn:hover { opacity: 0.85; }
.support-btn::after { content: '›'; font-size: 1.1rem; opacity: 0.65; line-height: 1; }
.support-btn--paypal  { background: #003087; color: #fff; border-color: #003087; }
.support-btn--patreon { background: #FF424D; color: #fff; border-color: #FF424D; }

/* Publicaciones en el perfil público del autor */
.profile-posts { width: 100%; }
.profile-posts__heading { font-family: var(--font-display); font-size: 1.25rem; text-align: left; margin-bottom: var(--space-sm); }
.profile-posts__list {
  display: flex; flex-direction: column; text-align: left;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.profile-post-item {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: nowrap;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none; color: inherit;
  transition: background 150ms;
}
.profile-post-item:last-child { border-bottom: none; }
.profile-post-item:hover { background: rgba(97,95,255,0.06); }
.profile-post-item__type {
  font-size: 0.65rem; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--post-type-color, var(--c-accent));
  border: 1px solid var(--post-type-color, var(--c-accent));
  border-radius: var(--radius-pill); padding: 0.2rem 0.55rem; line-height: 1;
  flex-shrink: 0; white-space: nowrap;
}
.profile-post-item__title { font-weight: 500; font-size: 0.9rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-cream); }
.profile-post-item__date { font-size: 0.78rem; color: var(--c-muted); flex-shrink: 0; white-space: nowrap; display: none; }
@media (min-width: 480px) { .profile-post-item__date { display: block; } }
.profile-post-item__arrow { font-size: 1.1rem; color: var(--c-muted); flex-shrink: 0; line-height: 1; }
.is-dark-bg .profile-post-item__arrow { color: rgba(255,255,255,0.4); }
/* Editor de redes sociales (panel) */
.social-editor-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.social-editor-row .social-row__url { flex: 1; min-width: 0; }

/* Fila de íconos sociales en el perfil público */
.profile-social-row { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; }
.profile-social-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--social-icon-bg, rgba(0,0,0,0.07));
  color: var(--social-icon-color, var(--c-cream));
  text-decoration: none; transition: transform 150ms, background 150ms;
  flex-shrink: 0;
}
.profile-social-icon-btn:hover { transform: scale(1.1); filter: brightness(1.15); }
.profile-social-icon-btn svg { width: 20px; height: 20px; display: block; }

.is-dark-bg .profile-posts__heading { color: rgba(255,255,255,0.92); }
.is-dark-bg .profile-posts__list { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); }
.is-dark-bg .profile-post-item__title { color: rgba(255,255,255,0.92); }
.is-dark-bg .profile-post-item { border-bottom-color: rgba(255,255,255,0.12); }
.is-dark-bg .profile-post-item__title { color: rgba(255,255,255,0.92); }
.is-dark-bg .profile-post-item__date { color: rgba(255,255,255,0.5); }
.post-body h1, .post-body h2, .post-body h3 { font-family: var(--font-display); margin: 1.4rem 0 0.6rem; }
.post-body p { margin-bottom: 1rem; }
.post-body p:empty { margin-bottom: 0; }
.post-body p:has(> br:only-child) { margin-bottom: 0; }
.post-body img { max-width: 100%; border-radius: var(--radius-sm); }
.post-body iframe { max-width: 100%; }
.post-body a { color: var(--c-accent); text-decoration: underline; }
.post-body blockquote { border-left: 3px solid var(--c-accent); padding-left: 1rem; opacity: 0.85; font-style: italic; }

/* ---- Modo lectura (pantalla completa, estilo Kindle) ---- */
.lectura-exit { display: none; }
html.modo-lectura .lectura-exit {
  position: fixed; top: 0.9rem; right: 0.9rem; z-index: 300;
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1rem; border: none; border-radius: var(--radius-pill);
  background: rgba(10, 8, 16, 0.72); color: #fff;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.3px;
  cursor: pointer; backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(8, 5, 14, 0.3);
  opacity: 0.85; transition: opacity 150ms;
}
html.modo-lectura .lectura-exit:hover { opacity: 1; }
/* Solo el texto: fuera todo el cromo alrededor de la lectura */
html.modo-lectura .cmn-topbar,
html.modo-lectura .post-breadcrumb,
html.modo-lectura #ownerBar,
html.modo-lectura .post-author-bar,
html.modo-lectura .post-tags,
html.modo-lectura .post-rights,
html.modo-lectura .post-reaccion,
html.modo-lectura .support-section,
html.modo-lectura .more-posts { display: none !important; }
html.modo-lectura .cmn-main { padding-top: 2.5rem; }
@media (max-width: 600px) {
  html.modo-lectura .lectura-exit span { display: none; } /* en móvil queda la ✕ redonda */
  html.modo-lectura .lectura-exit { padding: 0.55rem; }
}

/* ---- Comentarios por párrafo (capítulos) ---- */
.para-commentable { position: relative; }
/* Al pasar por el párrafo: resaltado suave (estilo WebNovel) */
.para-commentable:hover {
  background: rgba(97, 95, 255, 0.08);
  box-shadow: 0 0 0 5px rgba(97, 95, 255, 0.08);
  border-radius: 4px;
}
.para-comment-btn {
  position: absolute; top: 0.1rem; right: -2.6rem;
  display: flex; align-items: center; gap: 0.35rem;
  width: auto; min-width: 1.9rem; height: 1.9rem; padding: 0 0.4rem;
  border: none; border-radius: var(--radius-pill); background: transparent;
  color: var(--c-muted); cursor: pointer; opacity: 0; transition: opacity 150ms, background 150ms, color 150ms;
}
.para-commentable:hover .para-comment-btn,
.para-comment-btn.has-comments,
.para-comment-btn:focus-visible { opacity: 1; }
.para-comment-btn.has-comments { color: var(--c-accent); }
.para-comment-btn.has-comments:hover { background: rgba(97, 95, 255, 0.12); }
.para-comment-btn__count { font-size: 0.78rem; font-weight: 600; }
/* Sin comentarios aún: píldora "COMENTARIO" sobre el párrafo, bien visible */
.para-comment-btn__label { display: none; }
.para-comment-btn:not(.has-comments) {
  top: -1.25rem; right: 0.4rem;
  background: #262033; color: #fff;
  height: 1.8rem; padding: 0 0.8rem;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(8, 5, 14, 0.35);
}
.para-comment-btn:not(.has-comments) .para-comment-btn__label { display: inline; }
.para-comment-btn:not(.has-comments)::after {
  content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #262033; border-bottom: 0;
}
.para-comment-btn:not(.has-comments):hover { background: var(--c-accent); }
.para-comment-btn:not(.has-comments):hover::after { border-top-color: var(--c-accent); }
/* En fondo oscuro la píldora se invierte (clara) para destacar */
html.lectura-oscura .para-comment-btn:not(.has-comments) { background: #efe9f8; color: #241a32; }
html.lectura-oscura .para-comment-btn:not(.has-comments)::after { border-top-color: #efe9f8; }
html.lectura-oscura .para-comment-btn:not(.has-comments):hover { background: var(--c-accent); color: #fff; }
html.lectura-oscura .para-comment-btn:not(.has-comments):hover::after { border-top-color: var(--c-accent); }
/* El hilo del párrafo se muestra en el panel lateral (.read-panel) */
.para-comment-panel__list { display: flex; flex-direction: column; gap: 0.7rem; }
.para-comment-panel__list .post-comments__empty { font-size: 0.85rem; color: var(--c-muted); margin: 0; }
.para-comment-form { margin-top: 0.9rem; }
/* Sección de comentarios del capítulo dentro del panel lateral */
.read-panel__body .post-comments { margin-top: 0; max-width: none; }
.read-panel__body .post-comments__heading { display: none; }
.read-panel__body .post-comment-form textarea { width: 100%; }

@media (max-width: 900px) {
  .para-comment-btn { position: static; opacity: 1; display: inline-flex; margin-left: 0.35rem; vertical-align: middle; }
}

/* ---- Foro (hilos estilo Reddit) ---- */
.foro-new {
  width: 100%; max-width: 1000px; display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1rem; margin-bottom: var(--space-md);
  background: var(--c-bg); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
}
.foro-new input, .foro-new textarea {
  width: 100%; padding: 0.6rem 0.8rem; font-family: inherit; font-size: 0.95rem;
  background: #fff; color: var(--c-cream);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
}
.foro-new textarea { min-height: 110px; resize: vertical; }
.foro-new__actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.foro-new .btn-cmn { min-width: 0; }

.foro-list { width: 100%; max-width: 1000px; display: flex; flex-direction: column; gap: 0.55rem; }
.foro-item {
  display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0.9rem;
  background: var(--c-bg); border: 1px solid var(--c-border, var(--border-default)); border-radius: 12px;
  transition: border-color 150ms;
}
.foro-item:hover { border-color: var(--c-accent); }
.foro-item__main { flex: 1; min-width: 0; }
.foro-item__title {
  display: block; font-weight: 700; font-size: 1rem; color: inherit; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.foro-item__title:hover { color: var(--c-accent); }
.foro-item__meta { margin-top: 0.15rem; font-size: 0.78rem; color: var(--c-muted); }
.foro-item__meta a { color: inherit; }

.foro-vote { display: flex; flex-direction: column; align-items: center; gap: 0.05rem; flex-shrink: 0; min-width: 2rem; }
.foro-vote__btn {
  background: none; border: none; cursor: pointer; padding: 0.05rem 0.4rem;
  font-size: 0.8rem; line-height: 1; color: var(--c-muted); transition: color 120ms, transform 120ms;
}
.foro-vote__btn:hover:not(:disabled) { color: var(--c-accent); transform: scale(1.2); }
.foro-vote__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.foro-vote__up.is-active { color: var(--c-accent); }
.foro-vote__down.is-active { color: #e0245e; }
.foro-vote__score { font-size: 0.85rem; font-weight: 700; }
.foro-vote--compact .foro-vote__btn { font-size: 0.7rem; }
.foro-vote--compact .foro-vote__score { font-size: 0.75rem; }

.foro-hilo { width: 100%; max-width: 760px; }
.foro-hilo__head { display: flex; align-items: flex-start; gap: 1rem; }
.foro-hilo__main { flex: 1; min-width: 0; }
.foro-hilo__title { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; margin: 0 0 0.3rem; }
.foro-hilo__body { margin-top: var(--space-sm, 0.9rem); font-size: 0.98rem; line-height: 1.7; white-space: pre-wrap; }
.foro-replies { margin-top: var(--space-md); }
.foro-reply__row { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.55rem 0; }
.foro-reply__main { flex: 1; min-width: 0; }
.foro-reply__children {
  margin-left: 1rem; padding-left: 0.9rem;
  border-left: 2px solid var(--border-subtle);
}
.foro-reply .post-comment__reply-toggle { margin-top: 0.3rem; }

@media (max-width: 600px) {
  .foro-reply__children { margin-left: 0.4rem; padding-left: 0.55rem; }
}

/* ---- Derechos de autor ---- */
/* Form de publicar: <details> colapsado, no estorba el flujo */
.rights-field {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
}
.rights-field summary {
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer; list-style: none;
  font-size: 0.85rem; font-weight: 600; color: var(--c-muted);
  user-select: none;
}
.rights-field summary::-webkit-details-marker { display: none; }
.rights-field summary::after {
  content: '›'; margin-left: auto; font-size: 1.1rem;
  transition: transform 180ms; transform: rotate(90deg);
}
.rights-field[open] summary::after { transform: rotate(-90deg); }
.rights-field summary:hover { color: var(--c-cream); }
.rights-field summary svg { color: var(--c-accent); flex-shrink: 0; }
.rights-field__opt { font-weight: 400; opacity: 0.7; }
.rights-field__body { margin-top: 0.9rem; }

/* Sello público en la lectura: discreto, junto a las etiquetas */
.post-rights {
  display: inline-flex; align-items: center; gap: 0.5rem;
  align-self: flex-start;
  margin-bottom: var(--space-md);
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.78rem; color: var(--c-muted);
}
.post-rights svg { color: var(--c-accent); flex-shrink: 0; }
.post-rights strong { color: var(--c-cream); font-weight: 600; }
.post-rights a { color: var(--c-accent); text-decoration: none; }
.post-rights a:hover { text-decoration: underline; }

/* ---- Buscador global (comunidad/buscar.html) ---- */
.buscar-box { max-width: 720px; }
.buscar-hint { width: 100%; max-width: 720px; margin: 0.4rem 0 var(--space-md); font-size: 0.8rem; color: var(--c-muted); }
.buscar-results { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: var(--space-md); }
.buscar-grupo__titulo {
  font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 0.6rem;
  padding-bottom: 0.35rem; border-bottom: 1px solid var(--border-subtle);
}
.buscar-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem 0.7rem; border-radius: 10px; text-decoration: none; color: inherit;
  transition: background 140ms;
}
.buscar-item:hover { background: rgba(97, 95, 255, 0.07); }
.buscar-item:hover .obra-mini__arrow { transform: translateX(3px); color: var(--c-accent); }
.buscar-item__chip {
  flex-shrink: 0; padding: 0.15rem 0.55rem; border-radius: var(--radius-pill);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em;
  background: rgba(97, 95, 255, 0.12); color: var(--c-accent);
}
.buscar-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.buscar-item__titulo { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buscar-item__detalle { font-size: 0.78rem; color: var(--c-muted); }

/* ---- Modal de recorte de avatar ---- */
.crop-modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10, 8, 20, 0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.crop-modal__box {
  background: var(--c-bg-deep); border-radius: 20px; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 340px; width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.crop-modal__title { font-weight: 700; color: var(--c-head); font-size: 1rem; margin: 0; }
.crop-modal__hint { font-size: 0.78rem; color: var(--c-muted); margin: -4px 0; text-align: center; }
.crop-modal canvas { border-radius: 50%; cursor: grab; display: block; touch-action: none; }
.crop-modal canvas:active { cursor: grabbing; }
.crop-modal__zoom { display: flex; align-items: center; gap: 8px; width: 100%; }
.crop-modal__zoom input[type=range] { flex: 1; accent-color: var(--c-accent); }
.crop-modal__zoom span { font-size: 1rem; color: var(--c-muted); line-height: 1; user-select: none; }
.crop-modal__actions { display: flex; gap: 0.6rem; }

/* ---- Responsive (móvil) ---- */
@media (max-width: 640px) {
  .cmn-main { padding: 5.2rem var(--space-sm) var(--space-md); }
  .cmn-topbar { padding: 0.65rem var(--space-sm); }
  .cmn-topbar a.cmn-logo { font-size: 1.15rem; }
  .cmn-topbar nav { gap: 0.7rem; font-size: 0.85rem; }
  .cmn-head h1 { font-size: 1.45rem; }
  .auth-card { padding: var(--space-md) var(--space-sm) var(--space-sm); }
  .post-read__title { font-size: 1.6rem; }
  .feed-filters { gap: 0.4rem; }
  .feed-filters button { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
  .tag-pick { font-size: 0.75rem; padding: 0.28rem 0.65rem; }
  .adm-table { font-size: 0.78rem; }
  .adm-table th, .adm-table td { padding: 0.45rem; }
  /* Panel (perfil/admin) más compacto en móvil */
  .panel { gap: 16px; }
  #sections { gap: 16px; }
  .panel-banner { padding: 18px 16px; }
  .panel-banner__title { font-size: 1.25rem; }
  .panel-banner a.btn-cmn { width: 100% !important; text-align: center; }
  .panel-card { padding: 18px 16px; }
  .panel-card__title { font-size: 1.1rem; }
  /* Fila de enlaces: etiqueta arriba a ancho completo, URL + ✕ debajo */
  .link-row { flex-wrap: wrap; }
  /* El manojo y la etiqueta comparten la primera línea; URL + ✕ debajo */
  .link-row .link-label-input { flex: 1 1 calc(100% - 2rem); max-width: none; }
}

/* ─────────────────────────────────────────────────────────────────────
   Modo oscuro de lectura (leer.html). La clase se aplica en <html> antes
   del primer pintado; redefine los tokens del tema claro de esta hoja.
   ───────────────────────────────────────────────────────────────────── */
html.lectura-oscura {
  --c-bg: #17131f;
  --c-bg-deep: #211b2e;
  --c-cream: #ece7f4;
  --c-muted: rgba(236, 231, 244, 0.62);
  --c-accent: #9d9bff;
  --c-head: #d9c8ff;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.10);
  --border-accent-hover: rgba(157, 155, 255, 0.55);
}
html.lectura-oscura .cmn-topbar { background: rgba(23, 19, 31, 0.85); }
html.lectura-oscura .like-btn { background: var(--c-bg-deep); }

/* ── Modo oscuro por defecto en TODAS las secciones (2026-07-10) ──
   Los componentes de abajo tenían colores claros fijos (no tokens);
   aquí se re-mapean a los tokens oscuros. */
/* Sidebar del panel + barra móvil */
html.lectura-oscura .side-nav {
  background:
    linear-gradient(180deg, rgba(97,95,255,0.08) 0%, rgba(0,0,0,0) 50%, rgba(173,70,255,0.08) 100%),
    var(--c-bg-deep);
}
html.lectura-oscura .side-nav__brand-name,
html.lectura-oscura .snav-link,
html.lectura-oscura .snav-mobilebar__logo,
html.lectura-oscura .snav-bell__panel-head { color: var(--c-cream); }
html.lectura-oscura .side-nav__brand-name .accent,
html.lectura-oscura .snav-link.is-active .snav-ico,
html.lectura-oscura .snav-mobilebar__logo em,
html.lectura-oscura .snav-toggle,
html.lectura-oscura .snav-bell { color: var(--c-head); }
html.lectura-oscura .snav-logout:hover { color: var(--c-cream); }
html.lectura-oscura .snav-mobilebar { background: rgba(33, 27, 46, 0.92); }
/* Sidebar: subtítulo, label "Navegación", íconos y logout (negro-alfa → blanco-alfa) */
html.lectura-oscura .side-nav__brand-sub { color: rgba(255, 255, 255, 0.70); }
html.lectura-oscura .side-nav__label { color: rgba(255, 255, 255, 0.55); }
html.lectura-oscura .snav-ico { color: rgba(255, 255, 255, 0.65); }
html.lectura-oscura .snav-logout { color: rgba(255, 255, 255, 0.60); }
html.lectura-oscura .snav-logout .snav-ico { color: rgba(255, 255, 255, 0.55); }
/* Chips: el acento oscuro (#9d9bff) es claro → texto oscuro encima */
html.lectura-oscura .role-chip { color: #17131f; }
html.lectura-oscura .discord-chip { color: #A5B0FF; background: rgba(88, 101, 242, 0.22); }
/* Campana de notificaciones */
html.lectura-oscura .snav-bell--floating:not([hidden]) { background: var(--c-bg-deep); }
html.lectura-oscura .snav-bell__panel { background: var(--c-bg-deep); border-color: var(--border-default); }
html.lectura-oscura .snav-notif { border-top-color: var(--border-subtle); }
html.lectura-oscura .snav-notif__msg { color: var(--c-cream); }
html.lectura-oscura .obra-progress__track { background: rgba(255, 255, 255, 0.14); }
html.lectura-oscura .snav-notif__empty { color: rgba(255, 255, 255, 0.55); }
html.lectura-oscura .snav-notif__date { color: rgba(255, 255, 255, 0.50); }
/* Formularios (panel, publicar, editor de perfil) */
html.lectura-oscura .field input,
html.lectura-oscura .field textarea,
html.lectura-oscura .field select,
html.lectura-oscura .link-row input,
html.lectura-oscura .book-row__fields input,
html.lectura-oscura .book-row__fields textarea,
html.lectura-oscura .book-row__fields select,
html.lectura-oscura .art-row input[type=text],
html.lectura-oscura .social-editor-row input[type=url],
html.lectura-oscura #pfPaypal, html.lectura-oscura #pfPatreon {
  background: var(--c-bg); color: var(--c-cream);
}
html.lectura-oscura .field select option { background: var(--c-bg-deep); }
html.lectura-oscura .bio-editor textarea { background: var(--c-bg); color: var(--c-cream); }
html.lectura-oscura .btn-cmn--ghost { background: transparent; }
html.lectura-oscura .auth-provider-btn { background: var(--c-bg-deep); }
/* Popover compartir + volver al panel + tour de bienvenida */
html.lectura-oscura .share-profile__pop { background: var(--c-bg-deep); border-color: var(--border-default); }
html.lectura-oscura .owner-return { background: var(--c-bg-deep); color: var(--c-cream); border-color: var(--border-default); }
html.lectura-oscura .onb-tip { background: var(--c-bg-deep); border-color: var(--border-default); }
html.lectura-oscura .onb-tip__text { color: var(--c-cream); }
html.lectura-oscura .onb-skip:hover { color: var(--c-cream); }
/* Foro + admin */
html.lectura-oscura .foro-new input,
html.lectura-oscura .foro-new textarea { background: var(--c-bg); }
html.lectura-oscura .role-select { background: var(--c-bg-deep) !important; } /* pisa el style inline */
html.lectura-oscura .invite-code code,
html.lectura-oscura .adm-table code { background: rgba(255, 255, 255, 0.08); }

/* Fondo sepia de lectura (mismo mecanismo que el modo oscuro) */
html.lectura-sepia {
  --c-bg: #F0E4C9;
  --c-bg-deep: #E9D9B4;
  --c-cream: #3d3323;
  --c-muted: rgba(61, 51, 35, 0.62);
  --c-head: #4a3a1f;
  --border-subtle: rgba(61, 51, 35, 0.12);
  --border-default: rgba(61, 51, 35, 0.22);
  --border-strong: rgba(61, 51, 35, 0.16);
}
html.lectura-sepia .cmn-topbar { background: rgba(240, 228, 201, 0.85); }
html.lectura-sepia .like-btn { background: var(--c-bg-deep); }

/* Fuente alternativa del cuerpo de lectura */
html.lectura-sans .post-body { font-family: var(--font-body, 'Montserrat', sans-serif); }

/* Apagar los marcadores de comentarios por párrafo desde las opciones */
html.sin-para-com .para-comment-btn { display: none !important; }

/* ---- Riel lateral de lectura (leer.html, solo capítulos) ---- */
.read-rail {
  position: fixed; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 300;
  transition: right 200ms ease;
}
/* Con el panel abierto, el riel se corre a su izquierda para seguir accesible */
body.rail-panel-open .read-rail { right: calc(min(360px, 92vw) + 10px); z-index: 450; }
.read-rail__btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-bg-deep); color: var(--c-muted);
  border: 1px solid var(--border-default); cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 14, 30, 0.14);
  transition: color 150ms, border-color 150ms, transform 150ms;
}
.read-rail__btn:hover { color: var(--c-accent); border-color: var(--c-accent); transform: scale(1.06); }
.read-rail__btn.is-active { color: #fff; background: var(--c-accent); border-color: var(--c-accent); }
.read-panel {
  position: fixed; top: 0; right: 0; height: 100dvh; z-index: 400;
  width: min(360px, 92vw); display: flex; flex-direction: column;
  background: var(--c-bg); border-left: 1px solid var(--border-default);
  box-shadow: -12px 0 34px rgba(20, 14, 30, 0.18);
}
.read-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border-subtle);
}
.read-panel__title { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.read-panel__close {
  background: none; border: none; cursor: pointer; color: var(--c-muted);
  font-size: 1.5rem; line-height: 1; padding: 0.1rem 0.4rem;
}
.read-panel__close:hover { color: var(--c-cream); }
.read-panel__body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.read-panel__loading { color: var(--c-muted); font-size: 0.88rem; }
.read-toc-item {
  display: flex; align-items: baseline; gap: 0.7rem;
  padding: 0.55rem 0.3rem; text-decoration: none; color: var(--c-cream);
  border-bottom: 1px solid var(--border-subtle); font-size: 0.9rem;
}
.read-toc-item:hover .read-toc-item__title { color: var(--c-accent); }
.read-toc-item__num { flex-shrink: 0; min-width: 1.6rem; font-size: 0.8rem; color: var(--c-muted); }
.read-toc-item__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.read-toc-item.is-current .read-toc-item__title,
.read-toc-item.is-current .read-toc-item__num { color: var(--c-accent); font-weight: 600; }
.read-set__label { font-size: 0.78rem; color: var(--c-muted); margin: 1rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; }
.read-set__label:first-child { margin-top: 0; }
.read-set__row { display: flex; gap: 0.6rem; }
.read-theme-dot {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--border-default); transition: border-color 150ms, transform 150ms;
}
.read-theme-dot:hover { transform: scale(1.08); }
.read-theme-dot.is-active { border-color: var(--c-accent); box-shadow: 0 0 0 2px rgba(97, 95, 255, 0.25); }
.read-font-btn {
  flex: 1; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm);
  background: none; border: 1px solid var(--border-default); color: var(--c-cream);
  cursor: pointer; font-size: 0.88rem; transition: border-color 150ms, color 150ms;
}
.read-font-btn:hover { border-color: var(--c-accent); }
.read-font-btn.is-active { border-color: var(--c-accent); color: var(--c-accent); }
.read-size {
  display: flex; align-items: center; border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); overflow: hidden;
}
.read-size button {
  flex: 1; padding: 0.5rem 0; background: none; border: none; cursor: pointer;
  color: var(--c-cream); font-size: 0.9rem; transition: background 150ms;
}
.read-size button:hover { background: rgba(97, 95, 255, 0.1); color: var(--c-accent); }
.read-size span {
  flex: 1; text-align: center; font-size: 0.9rem; color: var(--c-muted);
  border-left: 1px solid var(--border-default); border-right: 1px solid var(--border-default);
  padding: 0.5rem 0;
}
.read-switch-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1.2rem; font-size: 0.9rem; cursor: pointer;
}
.read-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.read-switch input { opacity: 0; width: 0; height: 0; }
.read-switch i {
  position: absolute; inset: 0; border-radius: 11px; background: var(--border-default);
  transition: background 180ms;
}
.read-switch i::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform 180ms;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.read-switch input:checked + i { background: var(--c-accent); }
.read-switch input:checked + i::before { transform: translateX(18px); }

@media (max-width: 900px) {
  /* En móvil el riel baja a la esquina inferior derecha, en fila */
  .read-rail { top: auto; bottom: 14px; right: 12px; transform: none; flex-direction: row; }
  .read-rail__btn { width: 40px; height: 40px; }
}

/* ---- Stepper del panel (desktop; por ahora solo cuentas admin) ---- */
.pstepper-wrap { display: flex; align-items: flex-start; gap: 20px; }
.pstepper { display: flex; flex: 1; min-width: 0; }
.pstep {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0; background: none; border: 0; cursor: pointer;
  font-family: var(--font-body);
}
/* línea que conecta cada paso con el anterior */
.pstep::before {
  content: ''; position: absolute; top: 9px; right: 50%;
  width: 100%; height: 6px; border-radius: 3px;
  background: rgba(97, 95, 255, 0.14);
}
.pstep:first-child::before { display: none; }
.pstep__dot {
  position: relative; z-index: 1; box-sizing: border-box;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c-bg-deep); border: 6px solid rgba(97, 95, 255, 0.18);
  transition: border-color 150ms, background 150ms;
}
.pstep__label { font-size: 0.85rem; font-weight: 600; color: rgba(97, 95, 255, 0.5); line-height: 1.25; }
.pstep:hover .pstep__label { color: var(--c-accent); }
.pstep.is-done .pstep__dot { border-color: rgba(97, 95, 255, 0.55); background: rgba(97, 95, 255, 0.55); }
.pstep.is-active .pstep__dot { border-color: var(--c-accent); background: var(--c-bg-deep); }
.pstep.is-active .pstep__label { color: var(--c-accent); font-weight: 700; }
.pstepper-reorder { position: relative; flex-shrink: 0; }
.pstepper-reorder__btn { min-width: 0; display: inline-flex; align-items: center; gap: 8px; }
.reorder-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 240px; padding: 6px;
  background: var(--c-bg-deep); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); box-shadow: 0 10px 34px rgba(26, 8, 51, 0.16);
}
.reorder-pop__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 8px 10px; border-radius: 8px; font-size: 0.9rem;
}
.reorder-pop__row:hover { background: rgba(97, 95, 255, 0.06); }
.reorder-pop__btns { display: flex; gap: 6px; }
.reorder-pop__btns button {
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border-default); background: none; color: var(--c-accent);
  font-size: 0.9rem; line-height: 1;
}
.reorder-pop__btns button:disabled { opacity: 0.35; cursor: default; }
.reorder-pop__btns button:not(:disabled):hover { border-color: var(--c-accent); background: rgba(97, 95, 255, 0.08); }
.pstepper-nav { display: flex; justify-content: space-between; }
.pstepper-nav .btn-cmn { min-width: 0; }
body.stepper-on .panel-card__title { cursor: default; }

/* Stepper en pantallas angostas: puntos compactos, solo la etiqueta del
   paso activo (debajo de su punto) y el botón Reordenar en su propia fila */
@media (max-width: 899px) {
  .pstepper-wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .pstepper { padding-bottom: 26px; } /* reserva espacio para la etiqueta activa */
  .pstep { gap: 0; }
  .pstep__dot { width: 18px; height: 18px; border-width: 4px; }
  .pstep::before { top: 7px; height: 4px; }
  .pstep__label { display: none; }
  .pstep.is-active .pstep__label {
    display: block; position: absolute; top: 24px; left: 50%;
    transform: translateX(-50%); white-space: nowrap; font-size: 0.78rem;
  }
  .pstep.is-active:first-child .pstep__label { left: 0; transform: none; }
  .pstep.is-active:last-child .pstep__label { left: auto; right: 0; transform: none; }
  .pstepper-reorder { align-self: flex-end; }
  .reorder-pop { right: 0; }
}

/* Nota explicativa dentro del popover de Reordenar */
.reorder-pop__hint {
  margin: 4px 4px 8px; padding: 8px 10px;
  font-size: 0.78rem; line-height: 1.45; color: var(--c-muted);
  background: rgba(97, 95, 255, 0.06); border-radius: 8px;
  max-width: 260px;
}

/* ---- Perfil de miembro (comunidad/perfil.html) ---- */
.perfil { width: 100%; max-width: 860px; }
.perfil__head { display: flex; gap: 1.4rem; align-items: flex-start; }
.perfil__avatar {
  width: 108px; height: 108px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  border: 3px solid var(--c-accent);
  display: flex; align-items: center; justify-content: center;
}
.perfil__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.perfil__avatar--ph {
  background: rgba(97, 95, 255, 0.12); color: var(--c-accent);
  font-size: 2.6rem; font-weight: 700;
}
.perfil__info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.perfil__nombre { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; color: var(--c-head); margin: 0; }
.perfil__usuario { font-size: 0.9rem; font-weight: 600; color: var(--c-accent); }
.perfil__desde { font-size: 0.8rem; color: var(--c-muted); }
.perfil__bio { margin: 0.5rem 0 0; font-size: 0.92rem; line-height: 1.6; }
.perfil__acciones { display: flex; gap: 0.6rem; margin-top: 0.7rem; flex-wrap: wrap; align-items: center; }
.perfil__linkbio { align-self: flex-start; padding: 0.5rem 1.2rem; font-size: 0.85rem; }
.perfil__seguir { min-width: 0; padding: 0.5rem 1.5rem; font-size: 0.85rem; }
.perfil__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem;
  margin: 1.6rem 0;
}
.perfil__stat {
  background: var(--c-bg-deep); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 0.9rem 0.6rem; text-align: center;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.perfil__stat strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--c-head); }
.perfil__stat span { font-size: 0.72rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--c-muted); }
.perfil__seccion { margin-top: 1.8rem; }
.perfil__seccion-titulo { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.9rem; }
.perfil__escritos { display: flex; flex-direction: column; gap: 0.45rem; }
.perfil__escrito {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.7rem 0.9rem; border-radius: 10px; text-decoration: none; color: inherit;
  background: var(--c-bg-deep); border: 1px solid var(--border-subtle);
  transition: border-color 150ms;
}
.perfil__escrito:hover { border-color: var(--c-accent); }
.perfil__escrito-tipo {
  flex-shrink: 0; font-size: 0.66rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--c-accent);
  background: rgba(97, 95, 255, 0.1); border-radius: 4px; padding: 0.25rem 0.5rem;
  min-width: 5.4rem; text-align: center;
}
.perfil__escrito-cuerpo { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.perfil__escrito-titulo { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perfil__escrito-meta { font-size: 0.76rem; color: var(--c-muted); }
@media (max-width: 560px) {
  .perfil__head { gap: 1rem; }
  .perfil__avatar { width: 84px; height: 84px; }
  .perfil__escrito-tipo { min-width: 0; }
}

/* ---- Publicar: pantalla de selección de tipo (estilo Inkspired) ---- */
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-top: var(--space-sm);
}
.type-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.5rem; padding: 1.4rem 1rem;
  background: var(--c-bg-deep); border: 1px solid var(--border-subtle);
  border-radius: 14px; cursor: pointer; color: inherit;
  transition: border-color 180ms, transform 180ms, background 180ms;
}
.type-card:hover { border-color: var(--c-accent); transform: translateY(-3px); background: rgba(97, 95, 255, 0.06); }
.type-card__ico {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(97, 95, 255, 0.12); color: var(--c-accent);
}
.type-card__label { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--c-head, var(--c-cream)); }
.type-card__desc { font-size: 0.8rem; line-height: 1.4; color: var(--c-muted); }
@media (max-width: 720px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .type-grid { grid-template-columns: 1fr; } }

/* Tipo elegido (badge + cambiar) al frente del formulario */
.tipo-elegido { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.1rem; }
.tipo-elegido__badge {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.5px; color: #fff; background: var(--c-accent);
  border-radius: var(--radius-pill); padding: 0.35rem 0.95rem;
}
.tipo-elegido__cambiar {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 0.82rem; font-weight: 600; color: var(--c-accent); padding: 0;
}
.tipo-elegido__cambiar:hover { text-decoration: underline; }
/* Publicar: novela fija (capítulo desde Mis historias) — nombre no editable */
.obra-existing-name {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  color: var(--c-head); padding: 0.6rem 0.9rem;
  background: rgba(97, 95, 255, 0.08); border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

/* Fanfic: toggle + franquicia */
.fanfic-field {
  border: 1px solid var(--border-subtle); border-radius: 12px;
  padding: 0.9rem 1rem; background: var(--c-bg-deep);
}
.fanfic-toggle { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; margin: 0; font-size: 0.92rem; }
.fanfic-toggle input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--c-accent); cursor: pointer; }

/* ---- Página de notificaciones (lista completa; reusa .snav-notif) ---- */
.notif-page {
  background: var(--c-bg-deep); border: 1px solid var(--border-default);
  border-radius: 14px; overflow: hidden;
}
.notif-page:empty { display: none; }
.notif-page .snav-notif:first-child { border-top: none; }

/* ---- Mis historias (gestor estilo Wattpad) ---- */
.mh-obra {
  background: var(--c-bg-deep); border: 1px solid var(--border-default);
  border-radius: 14px; padding: 1rem; margin-bottom: 1.2rem;
}
.mh-obra__head { display: flex; gap: 1rem; align-items: flex-start; }
.mh-obra__cover { width: 74px; height: 106px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--c-bg); }
.mh-obra__cover--ph { display: flex; align-items: center; justify-content: center; font-size: 0.62rem; color: var(--c-muted); border: 1px dashed var(--border-default); text-align: center; }
.mh-obra__info { min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.mh-obra__title { font-family: var(--font-display); font-size: 1.1rem; color: var(--c-head); }
.mh-obra__meta { font-size: 0.8rem; color: var(--c-muted); }
.mh-obra__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.3rem; }
.mh-btn { min-width: 0; padding: 0.45rem 1rem; font-size: 0.82rem; }
.mh-sinopsis { margin-top: 0.9rem; }
/* Lista de capítulos plegada por defecto (compacto estilo Wattpad) */
.mh-toc-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  width: 100%; margin-top: 0.9rem; padding: 0.55rem 0.8rem;
  background: none; border: 1px solid var(--border-subtle); border-radius: 10px;
  color: inherit; font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: border-color 150ms;
}
.mh-toc-toggle:hover { border-color: var(--c-accent); }
.mh-toc-toggle__caret { transition: transform 200ms; }
.mh-toc-toggle.is-open .mh-toc-toggle__caret { transform: rotate(180deg); }
.mh-toc { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.mh-cap {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem; border-radius: 10px;
  background: rgba(97, 95, 255, 0.04); border: 1px solid var(--border-subtle);
}
.mh-cap__order { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.mh-cap__mv {
  width: 24px; height: 20px; line-height: 1; font-size: 0.8rem;
  background: none; border: 1px solid var(--border-default); border-radius: 6px;
  color: inherit; cursor: pointer;
}
.mh-cap__mv:hover { border-color: var(--c-accent); color: var(--c-accent); }
.mh-cap__mv:disabled { opacity: 0.4; cursor: default; }
.mh-cap__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.mh-cap__title { font-size: 0.92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-cap__type { font-style: normal; font-weight: 400; color: var(--c-muted); }
.mh-cap__meta { font-size: 0.74rem; color: var(--c-muted); }
.mh-ok { color: #3fb47f; font-weight: 600; }
.mh-warn { color: #d9a13c; font-weight: 600; }
.mh-cap__edit { min-width: 0; padding: 0.35rem 0.9rem; font-size: 0.8rem; flex-shrink: 0; }
@media (max-width: 560px) {
  .mh-obra__actions .mh-btn { flex: 1; text-align: center; }
}
