/* HMCDRS V4.9.7 — Fichas: paleta editorial coherente con Inicio.
   Se aplica SOLO a la ficha. No cambia su HTML, lector, galería ni funcionalidades.
   La ficha antigua tenía gradientes violeta/azul, portadas desenfocadas y
   superficies azul marino de la maqueta inicial. */

/* 1. Colores de base — idénticos a la familia editorial del sitio. */
body.hm-v3-ficha-page, body.hm-v3-ficha-page #appRoot {
  background: #f6f7fa !important;
}
html.site-dark body.hm-v3-ficha-page,
html.site-dark body.hm-v3-ficha-page #appRoot {
  background: #101114 !important;
}
body.hm-v3-ficha-page .hmc-ficha.hm-page-bg {
  --fi-bg: #f6f7fa;
  --fi-card: #ffffff;
  --fi-control: #eef0f5;
  --fi-soft: #f0edf8;
  --fi-border: #e1e4eb;
  --fi-text: #1d2230;
  --fi-heading: #1d2230;
  --fi-muted: #666e80;
  --fi-primary: #8060ce;
  --fi-pink: #d95699;
  background: #f6f7fa !important;
  background-image: none !important;
  color: #1d2230;
  color-scheme: light;
}
html.site-dark body.hm-v3-ficha-page .hmc-ficha.hm-page-bg {
  --fi-bg: #101114;
  --fi-card: #1a1c22;
  --fi-control: #22252d;
  --fi-soft: #282b34;
  --fi-border: #292c34;
  --fi-text: #f6f5f9;
  --fi-heading: #f6f5f9;
  --fi-muted: #a7a9b5;
  --fi-primary: #ad80f6;
  --fi-pink: #ed76bb;
  background: #101114 !important;
  background-image: none !important;
  color: #f6f5f9;
  color-scheme: dark;
}

/* 2. Cabecera: conserva portada y distribución, elimina el fondo difuminado. */
.hmc-ficha > section:first-of-type {
  background: var(--fi-bg) !important;
  background-image: none !important;
}
body.hm-v3-ficha-page .hmc-ficha > section:first-of-type > div:first-child,
body.hm-v3-ficha-page .hmc-ficha > section:first-of-type > div:nth-child(2) > div:last-child,
body.hm-v3-ficha-page .hmc-ficha #hero-backdrop-gradient,
body.hm-v3-ficha-page .hmc-ficha .fi-blur,
body.hm-v3-ficha-page .hmc-ficha .fi-hero-gradient,
html.site-dark body.hm-v3-ficha-page .hmc-ficha > section:first-of-type > div:first-child,
html.site-dark body.hm-v3-ficha-page .hmc-ficha > section:first-of-type > div:nth-child(2) > div:last-child,
html.site-dark body.hm-v3-ficha-page .hmc-ficha #hero-backdrop-gradient,
html.site-dark body.hm-v3-ficha-page .hmc-ficha .fi-blur,
html.site-dark body.hm-v3-ficha-page .hmc-ficha .fi-hero-gradient {
  background: transparent !important;
  background-image: none !important;
}
.hmc-ficha #hero-blur-img { display: none !important; }

/* 3. Pestañas y separación — misma base que el cuerpo de la web. */
body.hm-v3-ficha-page .hmc-ficha #tabs-anchor {
  background: rgba(246,247,250,.97) !important;
  background-image: none !important;
  border-bottom-color: #e1e4eb !important;
  box-shadow: none !important;
}
html.site-dark body.hm-v3-ficha-page .hmc-ficha #tabs-anchor {
  background: rgba(16,17,20,.97) !important;
  background-image: none !important;
  border-bottom-color: #292c34 !important;
}

/* 4. Tarjetas y capítulos: desaparece el azul oscuro heredado.
   Se respetan los iconos, estados, el progreso y las miniaturas. */
.hmc-ficha .fi-card { background: var(--fi-card); border-color: var(--fi-border); }
body.hm-v3-ficha-page .hmc-ficha #tab-content-container [class~="bg-white/95"],
body.hm-v3-ficha-page .hmc-ficha #tab-content-container [class~="bg-white/90"],
body.hm-v3-ficha-page .hmc-ficha #tab-content-container [class~="bg-white/70"] {
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: #e1e4eb !important;
}
html.site-dark #appRoot.public-screen .hmc-ficha #tab-content-container [class~="bg-white/95"],
html.site-dark #appRoot.public-screen .hmc-ficha #tab-content-container [class~="bg-white"],
html.site-dark #appRoot.public-screen .hmc-ficha #tab-content-container [class~="bg-white/90"],
html.site-dark #appRoot.public-screen .hmc-ficha #tab-content-container [class~="bg-white/70"] {
  background-color: #1a1c22 !important;
  background-image: none !important;
}
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkCard"],
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkCard/60"],
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkCard/80"],
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkCard/90"],
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkCard/95"] {
  background-color: #1a1c22 !important;
}
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkElevated"],
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkElevated/60"],
html.site-dark .hmc-ficha #tab-content-container [class~="dark:bg-hm-darkElevated/70"] {
  background-color: #22252d !important;
}
html.site-dark .hmc-ficha #tab-content-container [class~="dark:border-hm-darkBorder"] {
  border-color: #34363f !important;
}
html.site-dark .hmc-ficha #tab-content-container .divide-y > :not(:last-child) {
  border-color: #292c34 !important;
}

/* 5. Controles: carbón neutro, sin bloques azul marino. */
.hmc-ficha .fi-v2-meta button[data-fi-tag] {
  background: #ffffff !important;
  border-color: #e1e4eb !important;
  color: #50556a !important;
}
.hmc-ficha .fi-v2-meta button[data-fi-tag]:hover { border-color: #8060ce !important; color: #8060ce !important; }
html.site-dark .hmc-ficha .fi-v2-meta button[data-fi-tag] {
  background: #1a1c22 !important;
  border-color: #34363f !important;
  color: #d0ccdb !important;
}
html.site-dark .hmc-ficha .fi-v2-meta button[data-fi-tag]:hover { border-color: #ad80f6 !important; color: #d3b9ff !important; }

.hmc-ficha #chapter-search-input {
  background: #ffffff !important;
  color: #1d2230 !important;
  border-color: #e1e4eb !important;
}
html.site-dark #appRoot.public-screen .hmc-ficha #chapter-search-input {
  background: #22252d !important;
  color: #f6f5f9 !important;
  border-color: #393c46 !important;
}
html.site-dark #appRoot.public-screen .hmc-ficha #chapter-search-input:focus,
.hmc-ficha #chapter-search-input:focus { background: var(--fi-control) !important; border-color: var(--fi-primary) !important; }
html.site-dark #appRoot.public-screen .hmc-ficha #chapter-search-input::placeholder,
.hmc-ficha #chapter-search-input::placeholder { color: var(--fi-muted) !important; }

.hmc-ficha #hero-fav-btn[data-hmc-favorite="false"],
.hmc-ficha .hmc-ficha-status-control #hero-status-select,
.hmc-ficha .hmc-ficha-follow {
  background: #ffffff !important;
  border-color: #cfd4df !important;
  color: #343b4c !important;
}
html.site-dark .hmc-ficha #hero-fav-btn:not([data-hmc-favorite="true"]),
html.site-dark .hmc-ficha #hero-status-select,
html.site-dark .hmc-ficha .hmc-ficha-follow {
  background: #1a1c22 !important;
  border-color: #393c46 !important;
  color: #f6f5f9 !important;
}
html.site-dark .hmc-ficha #hero-fav-btn:not([data-hmc-favorite="true"]):hover,
html.site-dark .hmc-ficha .hmc-ficha-follow:hover { border-color: #ad80f6 !important; background: #22252d !important; }
.hmc-ficha .hmc-ficha-follow.is-following {
  background: #f3edff !important;
  border-color: #baadf5 !important;
  color: #684da8 !important;
}
html.site-dark .hmc-ficha .hmc-ficha-follow.is-following,
html.site-dark .hmc-ficha .hmc-ficha-status-control[data-hmc-status="selected"] #hero-status-select {
  background: #30273c !important;
  border-color: #665077 !important;
  color: #d9beff !important;
}
html.site-dark .hmc-ficha .hmc-ficha-follow.is-following:hover { background: #382d46 !important; border-color: #ad80f6 !important; }

/* 6. Galerías y recomendaciones que compartían el viejo azul marino. */
html.site-dark .hmc-ficha .fi-similar-cover { background: #1a1c22; border-color: #34363f; }
html.site-dark .hmc-ficha .fi-similar-tags span,
html.site-dark .hmc-ficha .fi-similar-info p span { background: #29232f; border-color: #40354d; }
html.site-dark .hmc-ficha .fi-similar-empty { background: #1a1c22; border-color: #34363f; }
html.site-dark .hmc-ficha .fi-viewer-panel,
html.site-dark .hmc-ficha .fi-viewer-details { background: #1a1c22; border-color: #393c46; }
html.site-dark .hmc-ficha .fi-viewer-header { background: #22252d; border-color: #393c46; }
html.site-dark .hmc-ficha .fi-viewer-artwork { background: #101114; background-image: none; }
html.site-dark .hmc-ficha .fi-viewer-close,
html.site-dark .hmc-ficha .fi-viewer-arrow { background: #22252d; border-color: #393c46; }
html.site-dark .hmc-ficha #lightbox-modal > div {
  background: #1a1c22 !important;
  border-color: #393c46 !important;
}

@media (prefers-reduced-motion: reduce) {
  .hmc-ficha .fi-card, .hmc-ficha .hmc-ficha-follow { transition: none; }
}


/* HMCDRS V4.9.11 — barras azules heredadas en fichas móviles.
   No elimina scroll horizontal: solo oculta su indicador visual. */
@media (max-width:767px) {
  .hmc-ficha #tabs-anchor [role="tablist"],
  .hmc-ficha .no-scrollbar {
    scrollbar-width:none !important;
    -ms-overflow-style:none;
    overscroll-behavior-x:contain;
  }
  .hmc-ficha #tabs-anchor [role="tablist"]::-webkit-scrollbar,
  .hmc-ficha .no-scrollbar::-webkit-scrollbar {
    display:none !important;
    width:0 !important;
    height:0 !important;
  }
  .hmc-ficha #tabs-anchor [role="tablist"]::-webkit-scrollbar-track,
  .hmc-ficha #tabs-anchor [role="tablist"]::-webkit-scrollbar-thumb,
  .hmc-ficha .no-scrollbar::-webkit-scrollbar-track,
  .hmc-ficha .no-scrollbar::-webkit-scrollbar-thumb {display:none !important;}
}
